Пример #1
0
        ///<summary>Change the button to a pressed state.</summary>
        protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseDown(e);
            if ((e.Button & MouseButtons.Left) != MouseButtons.Left)
            {
                return;
            }
            mouseIsDown = true;
            ODToolBarButton button = HitTest(e.X, e.Y);

            if (button == null)        //if there is no current hover button
            {
                return;                //don't set a hotButton
            }
            //if(!button.Enabled){
            //	return;//disabled buttons don't respond
            //}
            hotButton = button;
            if (button.Style == ODToolBarButtonStyle.DropDownButton &&
                HitTestDrop(button, e.X, e.Y))
            {
                button.State = ToolBarButtonState.DropPressed;
            }
            else
            {
                button.State = ToolBarButtonState.Pressed;
            }
            Invalidate(button.Bounds);
        }
Пример #2
0
        ///<summary></summary>
        protected void OnButtonClicked(ODToolBarButton myButton)
        {
            ODToolBarButtonClickEventArgs bArgs = new ODToolBarButtonClickEventArgs(myButton);

            if (ButtonClick != null)
            {
                ButtonClick(this, bArgs);
            }
        }
Пример #3
0
        private bool HitTestDrop(ODToolBarButton button, int x, int y)
        {
            Rectangle dropRect = new Rectangle(button.Bounds.X + button.Bounds.Width - 15, button.Bounds.Y
                                               , 15, button.Bounds.Height);

            if (dropRect.Contains(x, y))
            {
                return(true);
            }
            return(false);
        }
Пример #4
0
        ///<summary>Causes the toolbar to be laid out again.</summary>
        public void LayoutToolBar()
        {
            ToolBarMain.Buttons.Clear();
            ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this, "Print"), 0, "", "Print"));
            ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
            ToolBarMain.Buttons.Add(new ODToolBarButton("", 1, "Go Back One Page", "Back"));
            ODToolBarButton button = new ODToolBarButton("", -1, "", "PageNum");

            button.Style = ODToolBarButtonStyle.Label;
            ToolBarMain.Buttons.Add(button);
            ToolBarMain.Buttons.Add(new ODToolBarButton("", 2, "Go Forward One Page", "Fwd"));
            ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
            ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this, "Close"), -1, "Close This Window", "Close"));
        }
Пример #5
0
        ///<summary></summary>
        protected void OnButtonClicked(ODToolBarButton myButton)
        {
            if (myButton.DateTimeLastClicked.AddMilliseconds(SystemInformation.DoubleClickTime) > DateTime.Now)
            {
                return;
            }
            myButton.DateTimeLastClicked = DateTime.Now;
            ODToolBarButtonClickEventArgs bArgs = new ODToolBarButtonClickEventArgs(myButton);

            if (ButtonClick != null)
            {
                ButtonClick(this, bArgs);
            }
        }
Пример #6
0
 ///<summary>Causes the toolbar to be laid out again.</summary>
 public void LayoutToolBar()
 {
     ToolBarMain.Buttons.Clear();
     ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Print"),0,"","Print"));
     ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
     ToolBarMain.Buttons.Add(new ODToolBarButton("",1,"Go Back One Page","Back"));
     ODToolBarButton button=new ODToolBarButton("",-1,"","PageNum");
     button.Style=ODToolBarButtonStyle.Label;
     ToolBarMain.Buttons.Add(button);
     ToolBarMain.Buttons.Add(new ODToolBarButton("",2,"Go Forward One Page","Fwd"));
     ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
     ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Export"),3,"","Export"));
     ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Close"),-1,"Close This Window","Close"));
     //ToolBarMain.Invalidate();
 }
Пример #7
0
 ///<summary>This should only happen when mouse enters. Only causes a repaint if needed.</summary>
 protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if (mouseIsDown)
     {
         //regardless of whether a button is hot, nothing changes until the mouse is released.
         //a hot(pressed) button remains so, and no buttons are hot when hover
         //,so do nothing
     }
     else                                            //mouse is not down
     {
         ODToolBarButton button = HitTest(e.X, e.Y); //this is the button the mouse is over at the moment.
         //first handle the old hotbutton
         if (hotButton != null)                      //if there is a previous hotbutton
         {
             if (hotButton != button)                //if we have moved to hover over a new button, or to hover over nothing
             {
                 hotButton.State = ToolBarButtonState.Normal;
                 Invalidate(hotButton.Bounds);
             }
         }
         //then, the new button
         if (button != null)
         {
             if (hotButton != button)                  //if we have moved to hover over a new button
             {
                 toolTip1.SetToolTip(this, button.ToolTipText);
                 button.State = ToolBarButtonState.Hover;
                 Invalidate(button.Bounds);
             }
             else                     //Still hovering over the same button as before
                                      //do nothing.
             {
             }
         }
         else
         {
             toolTip1.SetToolTip(this, "");
         }
         hotButton = button;              //this might be null if hovering over nothing.
         //if there was no previous hotbutton, and there is not current hotbutton, then do nothing.
     }
 }
Пример #8
0
 ///<summary>Resets button appearance. This will also deactivate the button if it has been pressed but not released. A pressed button will still be hot, however, so that if the mouse enters again, it will behave properly.  Repaints only if necessary.</summary>
 protected override void OnMouseLeave(System.EventArgs e)
 {
     base.OnMouseLeave(e);
     if (mouseIsDown)            //mouse is down
     //if a button is hot, it will remain so, even if leave.  As long as mouse is down.
     //,so do nothing.
     //Also, if a button is not hot, nothing will happen when leave
     //,so do nothing.
     {
     }
     else                       //mouse is not down
     {
         if (hotButton != null) //if there was a previous hotButton
         {
             hotButton.State = ToolBarButtonState.Normal;
             Invalidate(hotButton.Bounds);
             hotButton = null;
         }
     }
 }
		///<summary></summary>
		public void Add(ODToolBarButton button){
			List.Add(button);
		}
 ///<summary></summary>
 public void Add(ODToolBarButton button)
 {
     List.Add(button);
 }
Пример #11
0
		///<summary></summary>
		public void LayoutToolBar() {
			ToolBarMain.Buttons.Clear();
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Setup"),-1,"","Setup"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Add TaskList"),0,"","AddList"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Add Task"),1,"","AddTask"));
			ODToolBarButton button=new ODToolBarButton();
			button.Style=ODToolBarButtonStyle.ToggleButton;
			button.Text=Lan.g(this,"BlockSubsc");
			button.ToolTipText=Lan.g(this,"Popups will be blocked for tasks sent to subscribed task lists.");
			button.Tag="BlockSubsc";
			button.Pushed=Security.CurUser.DefaultHidePopups;
			ToolBarMain.Buttons.Add(button);
			ODToolBarButton InboxButton=new ODToolBarButton();
			InboxButton.Style=ODToolBarButtonStyle.ToggleButton;
			InboxButton.Text=Lan.g(this,"BlockInbox");
			InboxButton.ToolTipText=Lan.g(this,"Popups will be blocked for tasks sent to user's personal inbox.");
			InboxButton.Tag="BlockInbox";
			InboxButton.Pushed=Security.CurUser.InboxHidePopups;
			ToolBarMain.Buttons.Add(InboxButton);
			ToolBarMain.Invalidate();
		}
		/*
		///<summary>The button is retrieved from List and explicitly cast to the button type.</summary>
		public ODToolBarButton Item(int index){
			return (ODToolBarButton)List[index];
		}*/

		///<summary></summary>
		public int IndexOf(ODToolBarButton value){
			return(List.IndexOf(value));
		}
Пример #13
0
		///<summary></summary>
		public void LayoutToolBars(){
			ToolBarMain.Buttons.Clear();
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Preview"),0,Lan.g(this,"Preview the Selected Claim"),"Preview"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Blank"),1,Lan.g(this,"Print a Blank Claim Form"),"Blank"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Print"),2,Lan.g(this,"Print Selected Claims"),"Print"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Labels"),6,Lan.g(this,"Print Single Labels"),"Labels"));
			/*ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			ODToolBarButton button=new ODToolBarButton(Lan.g(this,"Change Status"),-1,Lan.g(this,"Changes Status of Selected Claims"),"Status");
			button.Style=ODToolBarButtonStyle.DropDownButton;
			button.DropDownMenu=contextMenuStatus;
			ToolBarMain.Buttons.Add(button);*/
			ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			ODToolBarButton button=new ODToolBarButton(Lan.g(this,"Send E-Claims"),4,Lan.g(this,"Send claims Electronically"),"Eclaims");
			button.Style=ODToolBarButtonStyle.DropDownButton;
			button.DropDownMenu=contextMenuEclaims;
			ToolBarMain.Buttons.Add(button);
			if(CultureInfo.CurrentCulture.Name.EndsWith("CA")) {//Canadian. en-CA or fr-CA
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Outstanding"),-1,Lan.g(this,"Get Outstanding Transactions"),"Outstanding"));
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Payment Rec"),-1,Lan.g(this,"Get Payment Reconciliation Transactions"),"PayRec"));
				//ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Summary Rec"),-1,Lan.g(this,"Get Summary Reconciliation Transactions"),"SummaryRec"));
			}
			else {
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Get Reports"),5,Lan.g(this,"Get Reports from Other Clearinghouses"),"Reports"));
			}
			ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Close"),-1,"","Close"));
			/*ArrayList toolButItems=ToolButItems.GetForToolBar(ToolBarsAvail.ClaimsSend);
			for(int i=0;i<toolButItems.Count;i++){
				ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
				ToolBarMain.Buttons.Add(new ODToolBarButton(((ToolButItem)toolButItems[i]).ButtonText
					,-1,"",((ToolButItem)toolButItems[i]).ProgramNum));
			}*/
			ToolBarMain.Invalidate();
			ToolBarHistory.Buttons.Clear();
			ToolBarHistory.Buttons.Add(new ODToolBarButton(Lan.g(this,"Refresh"),-1,Lan.g(this,"Refresh this list."),"Refresh"));
			ToolBarHistory.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			ToolBarHistory.Buttons.Add(new ODToolBarButton(Lan.g(this,"Undo"),-1,
				Lan.g(this,"Change the status of claims back to 'Waiting'."),"Undo"));
			ToolBarHistory.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			ToolBarHistory.Buttons.Add(new ODToolBarButton(Lan.g(this,"Print List"),2,
				Lan.g(this,"Print history list."),"PrintList"));
			/*#if DEBUG
			ToolBarHistory.Buttons.Add(new ODToolBarButton(Lan.g(this,"Print Item"),2,
				Lan.g(this,"For debugging, this will simply display the first item in the list."),"PrintItem"));
			#else
			ToolBarHistory.Buttons.Add(new ODToolBarButton(Lan.g(this,"Print Item"),2,
				Lan.g(this,"Print one item from the list."),"PrintItem"));
			#endif*/
			ToolBarHistory.Invalidate();
		}
Пример #14
0
		///<summary>Toolbar Layout for Amendments</summary>
		public void LayoutAmendmentToolBar() {
			ToolBarMain.Buttons.Clear();
			ToolBarPaint.Buttons.Clear();
			ODToolBarButton button;
			ToolBarMain.Buttons.Add(new ODToolBarButton("",1,Lan.g(this,"Print"),"Print"));
			ToolBarMain.Buttons.Add(new ODToolBarButton("",2,Lan.g(this,"Delete"),"Delete"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			button=new ODToolBarButton(Lan.g(this,"Scan:"),-1,"","");
			button.Style=ODToolBarButtonStyle.Label;
			ToolBarMain.Buttons.Add(button);
			ToolBarMain.Buttons.Add(new ODToolBarButton("",14,Lan.g(this,"Scan Document"),"ScanDoc"));
			ToolBarMain.Buttons.Add(new ODToolBarButton("",18,Lan.g(this,"Scan Multi-Page Document"),"ScanMultiDoc"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Import"),5,Lan.g(this,"Import From File"),"Import"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Export"),19,Lan.g(this,"Export To File"),"Export"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Copy"),17,Lan.g(this,"Copy displayed image to clipboard"),"Copy"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Paste"),6,Lan.g(this,"Paste From Clipboard"),"Paste"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Close"),-1,Lan.g(this,"Close window"),"Close"));
			ToolBarPaint.Buttons.Add(new ODToolBarButton("",8,Lan.g(this,"Zoom In"),"ZoomIn"));
			ToolBarPaint.Buttons.Add(new ODToolBarButton("",9,Lan.g(this,"Zoom Out"),"ZoomOut"));
			ToolBarPaint.Buttons.Add(new ODToolBarButton("100",-1,Lan.g(this,"Zoom 100"),"Zoom100"));
			ToolBarMain.Invalidate();
			ToolBarPaint.Invalidate();
		}
Пример #15
0
 ///<summary>This should only happen when mouse enters. Only causes a repaint if needed.</summary>
 protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
 {
     base.OnMouseMove(e);
     if(mouseIsDown){
         //regardless of whether a button is hot, nothing changes until the mouse is released.
         //a hot(pressed) button remains so, and no buttons are hot when hover
         //,so do nothing
     }
     else{//mouse is not down
         ODToolBarButton button=HitTest(e.X,e.Y);//this is the button the mouse is over at the moment.
         //first handle the old hotbutton
         if(hotButton!=null){//if there is a previous hotbutton
             if(hotButton!=button){//if we have moved to hover over a new button, or to hover over nothing
                 hotButton.State=ToolBarButtonState.Normal;
                 Invalidate(hotButton.Bounds);
             }
         }
         //then, the new button
         if(button!=null){
             if(hotButton!=button){//if we have moved to hover over a new button
                 toolTip1.SetToolTip(this,button.ToolTipText);
                 button.State=ToolBarButtonState.Hover;
                 Invalidate(button.Bounds);
             }
             else{//Still hovering over the same button as before
                 //do nothing.
             }
         }
         else{
             toolTip1.SetToolTip(this,"");
         }
         hotButton=button;//this might be null if hovering over nothing.
         //if there was no previous hotbutton, and there is not current hotbutton, then do nothing.
     }
 }
Пример #16
0
		private void DrawButton(Graphics g,ODToolBarButton button) {
			ODPaintTools paintToolboxCur=_paintToolboxDefault;
			if(button.IsRed) {
				paintToolboxCur=_paintToolboxError;
			}
			#region Separator
			if(button.Style==ODToolBarButtonStyle.Separator){
				//was 112,128,144
				//medium stripe
				g.DrawLine(new Pen(Color.FromArgb(190,200,210)),button.Bounds.Left,button.Bounds.Top+1,
					button.Bounds.Left,button.Bounds.Bottom-2);
				//dark stripe
				g.DrawLine(new Pen(Color.FromArgb(130,140,160)),button.Bounds.Left+1,button.Bounds.Top,
					button.Bounds.Left+1,button.Bounds.Bottom-1);
				//white stripe
				g.DrawLine(new Pen(Color.FromArgb(255,255,255)),button.Bounds.Left+2,button.Bounds.Top+1,
					button.Bounds.Left+2,button.Bounds.Bottom-2);
				return;
			}
			#endregion
			//draw background
			if(!button.Enabled){
				g.FillRectangle(paintToolboxCur.BrushMedium,button.Bounds);
			}
			else if(button.Style==ODToolBarButtonStyle.ToggleButton && button.Pushed){
				g.FillRectangle(paintToolboxCur.BrushPushed,button.Bounds);
			}
			else if(button.Style==ODToolBarButtonStyle.Label){
				g.FillRectangle(paintToolboxCur.BrushMedium,button.Bounds);
			}
			else switch(button.State){
				case ToolBarButtonState.Normal://Control is 224,223,227 (==Ryan. This is not always true. Control is 240,240,240 for me.)
					g.FillRectangle(paintToolboxCur.BrushMedium,button.Bounds);
					break;
				case ToolBarButtonState.Hover://this is lighter than control
					g.FillRectangle(paintToolboxCur.BrushHover,button.Bounds);
					break;
				case ToolBarButtonState.Pressed://slightly darker than control
					g.FillRectangle(paintToolboxCur.BrushDark,button.Bounds);
					break;
				case ToolBarButtonState.DropPressed:
					//left half looks like hover:
					g.FillRectangle(paintToolboxCur.BrushHover
						,new Rectangle(button.Bounds.X,button.Bounds.Y
						,button.Bounds.Width-15,button.Bounds.Height));
					//right section looks like Pressed:
					g.FillRectangle(paintToolboxCur.BrushDark
						,new Rectangle(button.Bounds.X+button.Bounds.Width-15,button.Bounds.Y
						,15,button.Bounds.Height));
					break;
			}
			//draw image and/or text
			//Color textColor=ForeColor;
			Rectangle textRect;
			int textWidth=button.Bounds.Width;
			if(button.Style==ODToolBarButtonStyle.DropDownButton){
				textWidth-=15;
			}
			//if(!button.Enabled){
			//	textColor=SystemColors.GrayText;
			//}
			if(imageList!=null && button.ImageIndex!=-1 && button.ImageIndex<imageList.Images.Count){//draw image and text
				if(!button.Enabled){
					System.Windows.Forms.ControlPaint.DrawImageDisabled(g,imageList.Images[button.ImageIndex]
						,button.Bounds.X+3,button.Bounds.Y+1,SystemColors.Control);
					textRect=new Rectangle(button.Bounds.X+imageList.ImageSize.Width+3
						,button.Bounds.Y,textWidth-imageList.ImageSize.Width-3,button.Bounds.Height);
				}
				else if(button.State==ToolBarButtonState.Pressed){//draw slightly down and right
					g.DrawImage(imageList.Images[button.ImageIndex],button.Bounds.X+4,button.Bounds.Y+2);
					textRect=new Rectangle(button.Bounds.X+1+imageList.ImageSize.Width+3
						,button.Bounds.Y+1,textWidth-imageList.ImageSize.Width-3,button.Bounds.Height);
				}
				else{
					g.DrawImage(imageList.Images[button.ImageIndex],button.Bounds.X+3,button.Bounds.Y+1);
					textRect=new Rectangle(button.Bounds.X+imageList.ImageSize.Width+3
						,button.Bounds.Y,textWidth-imageList.ImageSize.Width-3,button.Bounds.Height);
				}
			}
			else{//only draw text
				if(button.Style==ODToolBarButtonStyle.Label){
					textRect=new Rectangle(button.Bounds.X,button.Bounds.Y
						,textWidth,button.Bounds.Height);
				}
				else if(button.State==ToolBarButtonState.Pressed){//draw slightly down and right
					textRect=new Rectangle(button.Bounds.X+1,button.Bounds.Y+1
						,textWidth,button.Bounds.Height);
				}
				else{
					textRect=new Rectangle(button.Bounds.X,button.Bounds.Y
						,textWidth,button.Bounds.Height);
				}
			}
			StringFormat format;
			if(imageList!=null && button.ImageIndex!=-1){//if there is an image
				//draw text very close to image
				format=new StringFormat();
				format.Alignment=StringAlignment.Near;
				format.LineAlignment=StringAlignment.Center;
				if(button.Enabled) {
					g.DrawString(button.Text,Font,paintToolboxCur.BrushTextFore,textRect,format);
				}
				else {
					g.DrawString(button.Text,Font,paintToolboxCur.BrushTextDisabled,textRect,format);
				}
			}
			else{
				format=new StringFormat();
				format.Alignment=StringAlignment.Center;
				format.LineAlignment=StringAlignment.Center;
				if(button.Enabled) {
					g.DrawString(button.Text,Font,paintToolboxCur.BrushTextFore,textRect,format);
				}
				else {
					g.DrawString(button.Text,Font,paintToolboxCur.BrushTextDisabled,textRect,format);
				}
			}
			//draw outline
			//Pen penR=penMedium;//new Pen(Color.FromArgb(180,180,180));
			if(!button.Enabled){
				//no outline
				g.DrawLine(paintToolboxCur.PenDivider,button.Bounds.Right-1,button.Bounds.Top,button.Bounds.Right-1,button.Bounds.Bottom-1);//vertical line on the right side
			}
			else if(button.Style==ODToolBarButtonStyle.ToggleButton && button.Pushed){
				g.DrawRectangle(paintToolboxCur.PenOutline,new Rectangle(button.Bounds.X,button.Bounds.Y
					,button.Bounds.Width-1,button.Bounds.Height-1));
			}
			else if(button.Style==ODToolBarButtonStyle.Label){
				//no outline
				g.DrawLine(paintToolboxCur.PenDivider,button.Bounds.Right-1,button.Bounds.Top,button.Bounds.Right-1,button.Bounds.Bottom-1);//vertical line on the right side
			}
			else switch(button.State){
				case ToolBarButtonState.Normal:
					//no outline
						g.DrawLine(paintToolboxCur.PenDivider,button.Bounds.Right-1,button.Bounds.Top,button.Bounds.Right-1,button.Bounds.Bottom-1);
					break;
				case ToolBarButtonState.Hover:
					g.DrawRectangle(paintToolboxCur.PenOutline,new Rectangle(button.Bounds.X,button.Bounds.Y
						,button.Bounds.Width-1,button.Bounds.Height-1));
					break;
				case ToolBarButtonState.Pressed:
					g.DrawRectangle(paintToolboxCur.PenOutline,new Rectangle(button.Bounds.X,button.Bounds.Y
						,button.Bounds.Width-1,button.Bounds.Height-1));
					break;
				case ToolBarButtonState.DropPressed:
					g.DrawRectangle(paintToolboxCur.PenOutline,new Rectangle(button.Bounds.X,button.Bounds.Y
						,button.Bounds.Width-1,button.Bounds.Height-1));
					break;
			}
			if(button.Style==ODToolBarButtonStyle.DropDownButton){
				Point[] triangle=new Point[3];
				triangle[0]=new Point(button.Bounds.X+button.Bounds.Width-11
					,button.Bounds.Y+button.Bounds.Height/2-2);
				triangle[1]=new Point(button.Bounds.X+button.Bounds.Width-4
					,button.Bounds.Y+button.Bounds.Height/2-2);
				triangle[2]=new Point(button.Bounds.X+button.Bounds.Width-8
					,button.Bounds.Y+button.Bounds.Height/2+2);
				if(button.Enabled) {
					g.FillPolygon(paintToolboxCur.BrushTextFore,triangle);
				}
				else {
					g.FillPolygon(paintToolboxCur.BrushTextDisabled,triangle);
				}
				if(button.State!=ToolBarButtonState.Normal && button.Enabled){
					g.DrawLine(paintToolboxCur.PenOutline,button.Bounds.X+button.Bounds.Width-15,button.Bounds.Y
						,button.Bounds.X+button.Bounds.Width-15,button.Bounds.Y+button.Bounds.Height);
				}
			}
		}
Пример #17
0
        ///<summary>Change the button to a pressed state.</summary>
        protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseDown(e);
            if((e.Button & MouseButtons.Left)!=MouseButtons.Left){
                return;
            }
            mouseIsDown=true;
            ODToolBarButton button=HitTest(e.X,e.Y);
            if(button==null){//if there is no current hover button
                return;//don't set a hotButton
            }
            //if(!button.Enabled){
            //	return;//disabled buttons don't respond
            //}
            hotButton=button;
            if(button.Style==ODToolBarButtonStyle.DropDownButton
                && HitTestDrop(button,e.X,e.Y))
            {
                button.State=ToolBarButtonState.DropPressed;
            }
            else{
                button.State=ToolBarButtonState.Pressed;

            }
            Invalidate(button.Bounds);
        }
        /*
         * ///<summary>The button is retrieved from List and explicitly cast to the button type.</summary>
         * public ODToolBarButton Item(int index){
         *      return (ODToolBarButton)List[index];
         * }*/

        ///<summary></summary>
        public int IndexOf(ODToolBarButton value)
        {
            return(List.IndexOf(value));
        }
Пример #19
0
		///<summary>Causes the toolbars to be laid out again.</summary>
		public void LayoutToolBar(){
			ToolBarMain.Buttons.Clear();
			ODToolBarButton button;
			if(UsingEcwTightOrFull()) {
				if(!Environment.Is64BitOperatingSystem) {
					ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"New Rx"),1,"","Rx"));
				}
				//don't add eRx
			}
			else {
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"New Rx"),1,"","Rx"));
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"eRx"),1,"","eRx"));
			}
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"LabCase"),-1,"","LabCase"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Perio Chart"),2,"","Perio"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Ortho Chart"),-1,"","Ortho"));
			button=new ODToolBarButton(Lan.g(this,"Consent"),-1,"","Consent");
			button.Style=ODToolBarButtonStyle.DropDownButton;
			button.DropDownMenu=menuConsent;
			ToolBarMain.Buttons.Add(button);
			//if(PrefC.GetBool(PrefName.ToothChartMoveMenuToRight)) {
			//	ToolBarMain.Buttons.Add(new ODToolBarButton("                   .",-1,"",""));
			//}
			button=new ODToolBarButton(Lan.g(this,"Tooth Chart"),-1,"","ToothChart");
			button.Style=ODToolBarButtonStyle.DropDownButton;
			button.DropDownMenu=menuToothChart;
			ToolBarMain.Buttons.Add(button);
			button=new ODToolBarButton(Lan.g(this,"Exam Sheet"),-1,"","ExamSheet");
			button.Style=ODToolBarButtonStyle.PushButton;
			ToolBarMain.Buttons.Add(button);
			if(UsingEcwTight()) {//button will show in this toolbar instead of the usual one.
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Commlog"),4,Lan.g(this,"New Commlog Entry"),"Commlog"));
			}
			if(PrefC.GetBool(PrefName.ShowFeatureEhr)) {
				ToolBarMain.Buttons.Add(new ODToolBarButton("EHR",-1,"","EHR"));
			}
			if(HL7Defs.IsExistingHL7Enabled()) {
				ToolBarMain.Buttons.Add(new ODToolBarButton(HL7Defs.GetOneDeepEnabled().Description,-1,"","HL7"));
			}
			ArrayList toolButItems=ToolButItems.GetForToolBar(ToolBarsAvail.ChartModule);
			for(int i=0;i<toolButItems.Count;i++){
				ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
				ToolBarMain.Buttons.Add(new ODToolBarButton(((ToolButItem)toolButItems[i]).ButtonText
					,-1,"",((ToolButItem)toolButItems[i]).ProgramNum));
			}
			ToolBarMain.Invalidate();
			Plugins.HookAddCode(this,"ContrChart.LayoutToolBar_end",PatCur);
		}
Пример #20
0
        private void DrawButton(Graphics g, ODToolBarButton button, Pen outlinePen, Pen dividerPen, SolidBrush textBrush, SolidBrush textBrushDisabled,
                                LinearGradientBrush brushTogglePushed, LinearGradientBrush brushHover, LinearGradientBrush brushMedium, LinearGradientBrush brushPushed)
        {
            const int dropDownWidth = 15;                                                                                                           //The width of the dropdown rectangle where the triangle shows.
            bool      isNotify      = (button.Style == ODToolBarButtonStyle.DropDownButton && !string.IsNullOrWhiteSpace(button.NotificationText)); //Notifies even when disabled.

            #region Separator
            if (button.Style == ODToolBarButtonStyle.Separator)
            {
                //was 112,128,144
                //medium stripe
                g.DrawLine(new Pen(Color.FromArgb(190, 200, 210)), button.Bounds.Left, button.Bounds.Top + 1, button.Bounds.Left, button.Bounds.Bottom - 2);
                //dark stripe
                g.DrawLine(new Pen(Color.FromArgb(130, 140, 160)), button.Bounds.Left + 1, button.Bounds.Top, button.Bounds.Left + 1, button.Bounds.Bottom - 1);
                //white stripe
                g.DrawLine(new Pen(Color.FromArgb(255, 255, 255)), button.Bounds.Left + 2, button.Bounds.Top + 1, button.Bounds.Left + 2, button.Bounds.Bottom - 2);
                return;
            }
            #endregion
            //draw background
            if (!button.Enabled)
            {
                g.FillRectangle(brushMedium, button.Bounds);
            }
            else if (button.Style == ODToolBarButtonStyle.ToggleButton && button.Pushed)
            {
                g.FillRectangle(brushTogglePushed, button.Bounds);
            }
            else if (button.Style == ODToolBarButtonStyle.Label || button.Style == ODToolBarButtonStyle.PageNav)
            {
                g.FillRectangle(brushMedium, button.Bounds);
            }
            else
            {
                switch (button.State)
                {
                case ToolBarButtonState.Normal:                //Control is 224,223,227 (==Ryan. This is not always true. Control is 240,240,240 for me.)
                    g.FillRectangle(brushMedium, button.Bounds);
                    break;

                case ToolBarButtonState.Hover:                //this is lighter than control
                    g.FillRectangle(brushHover, button.Bounds);
                    break;

                case ToolBarButtonState.Pressed:                //slightly darker than control
                    g.FillRectangle(brushPushed, button.Bounds);
                    break;

                case ToolBarButtonState.DropPressed:
                    //left half looks like hover:
                    g.FillRectangle(brushHover, new Rectangle(button.Bounds.X, button.Bounds.Y, button.Bounds.Width - 15, button.Bounds.Height));
                    //right section looks like Pressed:
                    g.FillRectangle(brushPushed, new Rectangle(button.Bounds.X + button.Bounds.Width - 15, button.Bounds.Y, 15, button.Bounds.Height));
                    break;
                }
            }
            if (isNotify)             //Override dropdown background to show notification color.
            {
                Rectangle rectDropDown = new Rectangle(button.Bounds.X + button.Bounds.Width - dropDownWidth, button.Bounds.Y, dropDownWidth, button.Bounds.Height);
                g.FillRectangle(_brushNotify, rectDropDown);               //Fill the dropdown background area with the notification color.
            }
            //draw image and/or text
            Rectangle textRect;
            int       textWidth = button.Bounds.Width;
            if (button.Style == ODToolBarButtonStyle.DropDownButton)
            {
                textWidth -= 15;
            }
            if (imageList != null && button.ImageIndex != -1 && button.ImageIndex < imageList.Images.Count)      //draw image and text
            {
                Image img = imageList.Images[button.ImageIndex];
                if (!button.Enabled)
                {
                    ControlPaint.DrawImageDisabled(g, ODColorTheme.InvertImageIfNeeded(img)
                                                   , button.Bounds.X + 3, button.Bounds.Y + 1, SystemColors.Control);
                    textRect = new Rectangle(button.Bounds.X + imageList.ImageSize.Width + 3
                                             , button.Bounds.Y, textWidth - imageList.ImageSize.Width - 3, button.Bounds.Height);
                }
                else if (button.State == ToolBarButtonState.Pressed)              //draw slightly down and right
                {
                    g.DrawImage(ODColorTheme.InvertImageIfNeeded(img), button.Bounds.X + 4, button.Bounds.Y + 2);
                    textRect = new Rectangle(button.Bounds.X + 1 + imageList.ImageSize.Width + 3
                                             , button.Bounds.Y + 1, textWidth - imageList.ImageSize.Width - 3, button.Bounds.Height);
                }
                else
                {
                    g.DrawImage(ODColorTheme.InvertImageIfNeeded(img), button.Bounds.X + 3, button.Bounds.Y + 1);
                    textRect = new Rectangle(button.Bounds.X + imageList.ImageSize.Width + 3
                                             , button.Bounds.Y, textWidth - imageList.ImageSize.Width - 3, button.Bounds.Height);
                }
            }
            else             //only draw text
            {
                if (button.Style == ODToolBarButtonStyle.Label || button.Style == ODToolBarButtonStyle.PageNav)
                {
                    textRect = new Rectangle(button.Bounds.X, button.Bounds.Y
                                             , textWidth, button.Bounds.Height);
                }
                else if (button.State == ToolBarButtonState.Pressed)              //draw slightly down and right
                {
                    textRect = new Rectangle(button.Bounds.X + 1, button.Bounds.Y + 1
                                             , textWidth, button.Bounds.Height);
                }
                else
                {
                    textRect = new Rectangle(button.Bounds.X, button.Bounds.Y
                                             , textWidth, button.Bounds.Height);
                }
            }
            StringFormat format;
            if (imageList != null && button.ImageIndex != -1)        //if there is an image
            //draw text very close to image
            {
                format               = new StringFormat();
                format.Alignment     = StringAlignment.Near;
                format.LineAlignment = StringAlignment.Center;
                if (button.Enabled)
                {
                    g.DrawString(button.Text, Font, textBrush, textRect, format);
                }
                else
                {
                    g.DrawString(button.Text, Font, textBrushDisabled, textRect, format);
                }
            }
            else
            {
                format               = new StringFormat();
                format.Alignment     = StringAlignment.Center;
                format.LineAlignment = StringAlignment.Center;
                if (button.Enabled)
                {
                    g.DrawString(button.Text, Font, textBrush, textRect, format);
                    //For page navigation buttons we ALWAYS show the text box so that users know they can type in the box to change pages.
                    if (button.Style == ODToolBarButtonStyle.PageNav)
                    {
                        //Because we do not display zeros to users (e.g. 001 / 135) and instead leave them off (e.g. 1 / 135) the width will be lopsided
                        //We need to draw each side of the page navigation (and pad a little) individually.
                        SizeF size = g.MeasureString("/", Font);
                        g.DrawString(button.PageValue.ToString(), Font, textBrush
                                     , new Rectangle(textRect.Location, new Size((textRect.Width / 2) - (int)(size.Width / 2) - 2, textRect.Height))
                                     , new StringFormat()
                        {
                            Alignment = StringAlignment.Far, LineAlignment = StringAlignment.Center
                        });
                        g.DrawString(button.PageMax.ToString(), Font, textBrush
                                     , new Rectangle(new Point(textRect.X + (textRect.Width / 2) + (int)(size.Width / 2) + 2, textRect.Y)
                                                     , new Size((textRect.Width / 2) - (int)(size.Width / 2), textRect.Height))
                                     , new StringFormat()
                        {
                            Alignment = StringAlignment.Near, LineAlignment = StringAlignment.Center
                        });
                        //Only add the text box for page navigation once.
                        //However, we need to add the text box here in the paint otherwise we don't know how large to make the text box.
                        if (textPageNav == null)
                        {
                            textPageNav             = new ValidNum();
                            textPageNav.Size        = new Size((button.Bounds.Width - 10) / 2, button.Bounds.Height);
                            textPageNav.KeyDown    += TextPageNav_KeyDown;
                            textPageNav.MinVal      = 1;                     //There is no such thing as 0 pages in a preview, always set min to 1.
                            textPageNav.RightToLeft = RightToLeft.Yes;
                            this.Controls.Add(textPageNav);
                        }
                        //Always recalculate the location of the button just in case someone changes the size of another button on the toolbar.
                        textPageNav.Location = new Point(button.Bounds.X + 1, button.Bounds.Y + 2);
                        //Nav text changes constantly so we need to update it when redrawing.
                        textPageNav.Text = button.PageValue.ToString();
                        if (button.PageMax != 0)
                        {
                            textPageNav.MaxVal = button.PageMax;
                        }
                    }
                }
                else
                {
                    g.DrawString(button.Text, Font, textBrushDisabled, textRect, format);
                }
            }
            //draw outline
            //Pen penR=penMedium;//new Pen(Color.FromArgb(180,180,180));
            if (!button.Enabled)
            {
                //no outline
                g.DrawLine(dividerPen, button.Bounds.Right - 1, button.Bounds.Top, button.Bounds.Right - 1, button.Bounds.Bottom - 1);      //vertical line on the right side
            }
            else if (button.Style == ODToolBarButtonStyle.ToggleButton && button.Pushed)
            {
                g.DrawRectangle(outlinePen, new Rectangle(button.Bounds.X, button.Bounds.Y
                                                          , button.Bounds.Width - 1, button.Bounds.Height - 1));
            }
            else if (button.Style == ODToolBarButtonStyle.Label || button.Style == ODToolBarButtonStyle.PageNav)
            {
                //no outline
                g.DrawLine(dividerPen, button.Bounds.Right - 1, button.Bounds.Top, button.Bounds.Right - 1, button.Bounds.Bottom - 1);      //vertical line on the right side
            }
            else
            {
                switch (button.State)
                {
                case ToolBarButtonState.Normal:
                    //no outline
                    g.DrawLine(dividerPen, button.Bounds.Right - 1, button.Bounds.Top, button.Bounds.Right - 1, button.Bounds.Bottom - 1);
                    break;

                case ToolBarButtonState.Hover:
                    g.DrawRectangle(outlinePen, new Rectangle(button.Bounds.X, button.Bounds.Y, button.Bounds.Width - 1, button.Bounds.Height - 1));
                    break;

                case ToolBarButtonState.Pressed:
                    g.DrawRectangle(outlinePen, new Rectangle(button.Bounds.X, button.Bounds.Y, button.Bounds.Width - 1, button.Bounds.Height - 1));
                    break;

                case ToolBarButtonState.DropPressed:
                    g.DrawRectangle(outlinePen, new Rectangle(button.Bounds.X, button.Bounds.Y, button.Bounds.Width - 1, button.Bounds.Height - 1));
                    break;
                }
            }
            if (button.Style == ODToolBarButtonStyle.DropDownButton)
            {
                int adjDown = 0;              //The distance to push the triangle down to show the notification text.
                if (isNotify)
                {
                    adjDown = 6;
                    //Draw the notification text.
                    Size sizeText = TextRenderer.MeasureText(button.NotificationText, Font);
                    g.DrawString(button.NotificationText, Font, (button.Enabled?textBrush:textBrushDisabled),
                                 button.Bounds.X + button.Bounds.Width + 1 - (dropDownWidth + sizeText.Width) / 2f, button.Bounds.Y + 2 + sizeText.Height / 2f, format);
                }
                Point[] triangle = new Point[3];
                triangle[0] = new Point(button.Bounds.X + button.Bounds.Width - 11
                                        , button.Bounds.Y + button.Bounds.Height / 2 - 2 + adjDown);
                triangle[1] = new Point(button.Bounds.X + button.Bounds.Width - 4
                                        , button.Bounds.Y + button.Bounds.Height / 2 - 2 + adjDown);
                triangle[2] = new Point(button.Bounds.X + button.Bounds.Width - 8
                                        , button.Bounds.Y + button.Bounds.Height / 2 + 2 + adjDown);
                if (button.Enabled)
                {
                    g.FillPolygon(textBrush, triangle);
                }
                else
                {
                    g.FillPolygon(textBrushDisabled, triangle);
                }
                if (button.State != ToolBarButtonState.Normal && button.Enabled)
                {
                    g.DrawLine(outlinePen, button.Bounds.X + button.Bounds.Width - 15, button.Bounds.Y
                               , button.Bounds.X + button.Bounds.Width - 15, button.Bounds.Y + button.Bounds.Height);
                }
            }
        }
Пример #21
0
		///<summary>Causes the toolbar to be laid out again.</summary>
		public void LayoutToolBar(){
			ToolBarMain.Buttons.Clear();
			ODToolBarButton button;
			//ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Recall"),1,"","Recall"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			button=new ODToolBarButton(Lan.g(this,"Family Members:"),-1,"","");
			button.Style=ODToolBarButtonStyle.Label;
			ToolBarMain.Buttons.Add(button);
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Add"),2,"Add Family Member","Add"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Delete"),3,Lan.g(this,"Delete Family Member"),"Delete"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Set Guarantor"),4,Lan.g(this,"Set as Guarantor"),"Guarantor"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Move"),5,Lan.g(this,"Move to Another Family"),"Move"));
			if(PrefC.GetBool(PrefName.ShowFeatureSuperfamilies)){
				ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
				button=new ODToolBarButton(Lan.g(this,"Super Family:"),-1,"","");
				button.Style=ODToolBarButtonStyle.Label;
				ToolBarMain.Buttons.Add(button);
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Add"),-1,"Add selected patient to a super family","AddSuper"));
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Remove"),-1,Lan.g(this,"Remove selected patient, and their family, from super family"),"RemoveSuper"));
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Disband"),-1,Lan.g(this,"Disband the current super family by removing all members of the super family."),"DisbandSuper"));
			}
			if(!PrefC.GetBool(PrefName.EasyHideInsurance)){
				ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
				button=new ODToolBarButton(Lan.g(this,"Add Insurance"),6,"","Ins");
				button.Style=ODToolBarButtonStyle.DropDownButton;
				button.DropDownMenu=menuInsurance;
				ToolBarMain.Buttons.Add(button);
			}
			ArrayList toolButItems=ToolButItems.GetForToolBar(ToolBarsAvail.FamilyModule);
			for(int i=0;i<toolButItems.Count;i++){
				ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
				ToolBarMain.Buttons.Add(new ODToolBarButton(((ToolButItem)toolButItems[i]).ButtonText
					,-1,"",((ToolButItem)toolButItems[i]).ProgramNum));
			}
			ToolBarMain.Invalidate();
			Plugins.HookAddCode(this,"ContrFamily.LayoutToolBar_end",PatCur);
		}
Пример #22
0
		///<summary>Causes the toolbar to be laid out again.</summary>
		public void LayoutToolBar() {
			ToolBarMain.Buttons.Clear();
			ODToolBarButton button;
			button=new ODToolBarButton(Lan.g(this,"Select Patient"),0,"","Patient");
			button.Style=ODToolBarButtonStyle.DropDownButton;
			button.DropDownMenu=menuPatient;
			ToolBarMain.Buttons.Add(button);
			if(!Programs.UsingEcwTightMode()) {//eCW tight only gets Patient Select and Popups toolbar buttons
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Commlog"),1,Lan.g(this,"New Commlog Entry"),"Commlog"));
				button=new ODToolBarButton(Lan.g(this,"E-mail"),2,Lan.g(this,"Send E-mail"),"Email");
				button.Style=ODToolBarButtonStyle.DropDownButton;
				button.DropDownMenu=menuEmail;
				ToolBarMain.Buttons.Add(button);
				button=new ODToolBarButton(Lan.g(this,"WebMail"),2,Lan.g(this,"Secure WebMail"),"WebMail");
				button.Enabled=true;//Always enabled.  If the patient does not have an email address, then the user will be blocked from the FormWebMailMessageEdit window.
				ToolBarMain.Buttons.Add(button);
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Text"),5,Lan.g(this,"Send Text Message"),"Text"));
				button=new ODToolBarButton(Lan.g(this,"Letter"),-1,Lan.g(this,"Quick Letter"),"Letter");
				button.Style=ODToolBarButtonStyle.DropDownButton;
				button.DropDownMenu=menuLetter;
				ToolBarMain.Buttons.Add(button);
				button=new ODToolBarButton(Lan.g(this,"Forms"),-1,"","Form");
				//button.Style=ODToolBarButtonStyle.DropDownButton;
				//button.DropDownMenu=menuForm;
				ToolBarMain.Buttons.Add(button);
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"To Task List"),3,Lan.g(this,"Send to Task List"),"Tasklist"));
				button=new ODToolBarButton(Lan.g(this,"Label"),4,Lan.g(this,"Print Label"),"Label");
				button.Style=ODToolBarButtonStyle.DropDownButton;
				button.DropDownMenu=menuLabel;
				ToolBarMain.Buttons.Add(button);
			}
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Popups"),-1,Lan.g(this,"Edit popups for this patient"),"Popups"));
			ArrayList toolButItems=ToolButItems.GetForToolBar(ToolBarsAvail.AllModules);
			for(int i=0;i<toolButItems.Count;i++) {
			  //ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			  ToolBarMain.Buttons.Add(new ODToolBarButton(((ToolButItem)toolButItems[i]).ButtonText
			    ,-1,"",((ToolButItem)toolButItems[i]).ProgramNum));
			}
			Plugins.HookAddCode(this,"FormOpenDental.LayoutToolBar_end");
			ToolBarMain.Invalidate();
		}
Пример #23
0
 private void DrawButton(Graphics g,ODToolBarButton button)
 {
     if(button.Style==ODToolBarButtonStyle.Separator){
         //was 112,128,144
         g.DrawLine(new Pen(Color.FromArgb(190,200,210)),button.Bounds.Left,button.Bounds.Top+1,
             button.Bounds.Left,button.Bounds.Bottom-2);
         g.DrawLine(new Pen(Color.FromArgb(130,140,160)),button.Bounds.Left+1,button.Bounds.Top+1,
             button.Bounds.Left+1,button.Bounds.Bottom-2);
         return;
     }
     //draw background
     if(!button.Enabled){
         g.FillRectangle(new SolidBrush(SystemColors.Control),button.Bounds);
     }
     else if(button.Style==ODToolBarButtonStyle.ToggleButton && button.Pushed){
         g.FillRectangle(new SolidBrush(Color.FromArgb(248,248,248)),button.Bounds);
     }
     else if(button.Style==ODToolBarButtonStyle.Label){
         g.FillRectangle(new SolidBrush(SystemColors.Control),button.Bounds);
     }
     else switch(button.State){
         case ToolBarButtonState.Normal://Control is 224,223,227
             g.FillRectangle(new SolidBrush(SystemColors.Control),button.Bounds);
             break;
         case ToolBarButtonState.Hover://this is lighter than control
             g.FillRectangle(new SolidBrush(Color.FromArgb(240,240,240)),button.Bounds);
             break;
         case ToolBarButtonState.Pressed://slightly darker than control
             g.FillRectangle(new SolidBrush(Color.FromArgb(210,210,210)),button.Bounds);
             break;
         case ToolBarButtonState.DropPressed:
             //left half looks like hover:
             g.FillRectangle(new SolidBrush(Color.FromArgb(240,240,240))
                 ,new Rectangle(button.Bounds.X,button.Bounds.Y
                 ,button.Bounds.Width-15,button.Bounds.Height));
             //right section looks like Pressed:
             g.FillRectangle(new SolidBrush(Color.FromArgb(210,210,210))
                 ,new Rectangle(button.Bounds.X+button.Bounds.Width-15,button.Bounds.Y
                 ,15,button.Bounds.Height));
             break;
     }
     //draw image and/or text
     Color textColor=ForeColor;
     Rectangle textRect;
     int textWidth=button.Bounds.Width;
     if(button.Style==ODToolBarButtonStyle.DropDownButton){
         textWidth-=15;
     }
     if(!button.Enabled){
         textColor=SystemColors.GrayText;
     }
     if(imageList!=null && button.ImageIndex!=-1){//draw image and text
         if(!button.Enabled){
             System.Windows.Forms.ControlPaint.DrawImageDisabled(g,imageList.Images[button.ImageIndex]
                 ,button.Bounds.X+3,button.Bounds.Y+1,SystemColors.Control);
             textRect=new Rectangle(button.Bounds.X+imageList.ImageSize.Width+3
                 ,button.Bounds.Y,textWidth-imageList.ImageSize.Width-3,button.Bounds.Height);
         }
         else if(button.State==ToolBarButtonState.Pressed){//draw slightly down and right
             g.DrawImage(imageList.Images[button.ImageIndex],button.Bounds.X+4,button.Bounds.Y+2);
             textRect=new Rectangle(button.Bounds.X+1+imageList.ImageSize.Width+3
                 ,button.Bounds.Y+1,textWidth-imageList.ImageSize.Width-3,button.Bounds.Height);
         }
         else{
             g.DrawImage(imageList.Images[button.ImageIndex],button.Bounds.X+3,button.Bounds.Y+1);
             textRect=new Rectangle(button.Bounds.X+imageList.ImageSize.Width+3
                 ,button.Bounds.Y,textWidth-imageList.ImageSize.Width-3,button.Bounds.Height);
         }
     }
     else{//only draw text
         if(button.Style==ODToolBarButtonStyle.Label){
             textRect=new Rectangle(button.Bounds.X,button.Bounds.Y
                 ,textWidth,button.Bounds.Height);
         }
         else if(button.State==ToolBarButtonState.Pressed){//draw slightly down and right
             textRect=new Rectangle(button.Bounds.X+1,button.Bounds.Y+1
                 ,textWidth,button.Bounds.Height);
         }
         else{
             textRect=new Rectangle(button.Bounds.X,button.Bounds.Y
                 ,textWidth,button.Bounds.Height);
         }
     }
     StringFormat format;
     if(imageList!=null && button.ImageIndex!=-1){//if there is an image
         //draw text very close to image
         format=new StringFormat();
         format.Alignment=StringAlignment.Near;
         format.LineAlignment=StringAlignment.Center;
         g.DrawString(button.Text,Font,new SolidBrush(textColor),textRect,format);
     }
     else{
         format=new StringFormat();
         format.Alignment=StringAlignment.Center;
         format.LineAlignment=StringAlignment.Center;
         g.DrawString(button.Text,Font,new SolidBrush(textColor),textRect,format);
     }
     //draw outline
     Pen penR=new Pen(Color.FromArgb(180,180,180));
     if(!button.Enabled){
         //no outline
         g.DrawLine(penR,button.Bounds.Right-1,button.Bounds.Top,button.Bounds.Right-1,button.Bounds.Bottom-1);
     }
     else if(button.Style==ODToolBarButtonStyle.ToggleButton && button.Pushed){
         g.DrawRectangle(Pens.SlateGray,new Rectangle(button.Bounds.X,button.Bounds.Y
             ,button.Bounds.Width-1,button.Bounds.Height-1));
     }
     else if(button.Style==ODToolBarButtonStyle.Label){
         //no outline
         g.DrawLine(penR,button.Bounds.Right-1,button.Bounds.Top,button.Bounds.Right-1,button.Bounds.Bottom-1);
     }
     else switch(button.State){
         case ToolBarButtonState.Normal:
             //no outline
             g.DrawLine(penR,button.Bounds.Right-1,button.Bounds.Top,button.Bounds.Right-1,button.Bounds.Bottom-1);
             break;
         case ToolBarButtonState.Hover:
             g.DrawRectangle(Pens.SlateGray,new Rectangle(button.Bounds.X,button.Bounds.Y
                 ,button.Bounds.Width-1,button.Bounds.Height-1));
             break;
         case ToolBarButtonState.Pressed:
             g.DrawRectangle(Pens.SlateGray,new Rectangle(button.Bounds.X,button.Bounds.Y
                 ,button.Bounds.Width-1,button.Bounds.Height-1));
             break;
         case ToolBarButtonState.DropPressed:
             g.DrawRectangle(Pens.SlateGray,new Rectangle(button.Bounds.X,button.Bounds.Y
                 ,button.Bounds.Width-1,button.Bounds.Height-1));
             break;
     }
     if(button.Style==ODToolBarButtonStyle.DropDownButton){
         Point[] triangle=new Point[3];
         triangle[0]=new Point(button.Bounds.X+button.Bounds.Width-11
             ,button.Bounds.Y+button.Bounds.Height/2-2);
         triangle[1]=new Point(button.Bounds.X+button.Bounds.Width-4
             ,button.Bounds.Y+button.Bounds.Height/2-2);
         triangle[2]=new Point(button.Bounds.X+button.Bounds.Width-8
             ,button.Bounds.Y+button.Bounds.Height/2+2);
         g.FillPolygon(new SolidBrush(textColor),triangle);
         if(button.State!=ToolBarButtonState.Normal && button.Enabled){
             g.DrawLine(Pens.SlateGray,button.Bounds.X+button.Bounds.Width-15,button.Bounds.Y
                 ,button.Bounds.X+button.Bounds.Width-15,button.Bounds.Y+button.Bounds.Height);
         }
     }
 }
Пример #24
0
 ///<summary>Resets button appearance. This will also deactivate the button if it has been pressed but not released. A pressed button will still be hot, however, so that if the mouse enters again, it will behave properly.  Repaints only if necessary.</summary>
 protected override void OnMouseLeave(System.EventArgs e)
 {
     base.OnMouseLeave(e);
     if(mouseIsDown){//mouse is down
         //if a button is hot, it will remain so, even if leave.  As long as mouse is down.
         //,so do nothing.
         //Also, if a button is not hot, nothing will happen when leave
         //,so do nothing.
     }
     else{//mouse is not down
         if(hotButton!=null){//if there was a previous hotButton
             hotButton.State=ToolBarButtonState.Normal;
             Invalidate(hotButton.Bounds);
             hotButton=null;
         }
     }
 }
Пример #25
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="myButton"></param>
 public ODToolBarButtonClickEventArgs(ODToolBarButton myButton)
 {
     button=myButton;
 }
Пример #26
0
 ///<summary>Change button to hover state and repaint if needed.</summary>
 protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
 {
     base.OnMouseUp(e);
       if((e.Button & MouseButtons.Left)!=MouseButtons.Left){
         return;
     }
     mouseIsDown=false;
     ODToolBarButton button=HitTest(e.X,e.Y);
     if(hotButton==null){//if there was not a previous hotButton
         //do nothing
     }
     else{//there was a hotButton
         hotButton.State=ToolBarButtonState.Normal;
         //but can't set it null yet, because still need it for testing
         Invalidate(hotButton.Bounds);//invalidate the old button
         //CLICK:
         if(hotButton==button){//if mouse was released over the same button as it was depressed
             if(!button.Enabled){
                 //disabled buttons don't respond at all
             }
             else if(button.Style==ODToolBarButtonStyle.DropDownButton//if current button is dropdown
                 && HitTestDrop(button,e.X,e.Y)//and we are in the dropdown area on the right
                 && button.DropDownMenu!=null)//and there is a dropdown menu to display
             {
                 hotButton=null;
                 button.State=ToolBarButtonState.Normal;
                 Invalidate(button.Bounds);
                 button.DropDownMenu.GetContextMenu().Show(this
                     ,new Point(button.Bounds.X,button.Bounds.Y+button.Bounds.Height));
             }
             else if(button.Style==ODToolBarButtonStyle.ToggleButton){//if current button is a toggle button
                 if(button.Pushed)
                     button.Pushed=false;
                 else
                     button.Pushed=true;
                 OnButtonClicked(button);
             }
             else if(button.Style==ODToolBarButtonStyle.Label){
                 //lables do not respond with click
             }
             else{
                 OnButtonClicked(button);
             }
             return;//the button will not revert back to hover
         }//end of click section
         else{//there was a hot button, but it did not turn into a click
             hotButton=null;
         }
     }
     if(button!=null){//no click, and now there is a hover button, not the same as original button.
         //this section could easily be deleted, since all the user has to do is move the mouse slightly.
         button.State=ToolBarButtonState.Hover;
         hotButton=button;//set the current hover button to be the new hotbutton
         Invalidate(button.Bounds);
     }
 }
Пример #27
0
		///<summary>Causes the toolbar to be laid out again.</summary>
		public void LayoutToolBar() {
			ToolBarMain.Buttons.Clear();
			ODToolBarButton button;
			button=new ODToolBarButton(Lan.g(this,"Payment"),1,"","Payment");
			//button.Style=ODToolBarButtonStyle.DropDownButton;
			//button.DropDownMenu=contextMenuPayment;
			ToolBarMain.Buttons.Add(button);
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Adjustment"),2,"","Adjustment"));
			button=new ODToolBarButton(Lan.g(this,"New Claim"),3,"","Insurance");
			button.Style=ODToolBarButtonStyle.DropDownButton;
			button.DropDownMenu=contextMenuIns;
			ToolBarMain.Buttons.Add(button);
			ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Payment Plan"),-1,"","PayPlan"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Installment Plan"),-1,"","InstallPlan"));
			if(!PrefC.GetBool(PrefName.EasyHideRepeatCharges)) {
				button=new ODToolBarButton(Lan.g(this,"Repeating Charge"),-1,"","RepeatCharge");
				button.Style=ODToolBarButtonStyle.DropDownButton;
				button.DropDownMenu=contextMenuRepeat;
				ToolBarMain.Buttons.Add(button);
			}
			ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			button=new ODToolBarButton(Lan.g(this,"Statement"),4,"","Statement");
			button.Style=ODToolBarButtonStyle.DropDownButton;
			button.DropDownMenu=contextMenuStatement;
			ToolBarMain.Buttons.Add(button);
			ArrayList toolButItems=ToolButItems.GetForToolBar(ToolBarsAvail.AccountModule);
			for(int i=0;i<toolButItems.Count;i++) {
				ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
				ToolBarMain.Buttons.Add(new ODToolBarButton(((ToolButItem)toolButItems[i]).ButtonText
					,-1,"",((ToolButItem)toolButItems[i]).ProgramNum));
			}
			ToolBarMain.Invalidate();
			Plugins.HookAddCode(this,"ContrAccount.LayoutToolBar_end",PatCur);
		}
Пример #28
0
 private bool HitTestDrop(ODToolBarButton button,int x,int y)
 {
     Rectangle dropRect=new Rectangle(button.Bounds.X+button.Bounds.Width-15,button.Bounds.Y
         ,15,button.Bounds.Height);
     if(dropRect.Contains(x,y)){
         return true;
     }
     return false;
 }
Пример #29
0
        ///<summary>Change button to hover state and repaint if needed.</summary>
        protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseUp(e);
            if ((e.Button & MouseButtons.Left) != MouseButtons.Left)
            {
                return;
            }
            mouseIsDown = false;
            ODToolBarButton button = HitTest(e.X, e.Y);

            if (hotButton == null)          //if there was not a previous hotButton
            //do nothing
            {
            }
            else             //there was a hotButton
            {
                hotButton.State = ToolBarButtonState.Normal;
                //but can't set it null yet, because still need it for testing
                Invalidate(hotButton.Bounds);         //invalidate the old button
                //CLICK:
                if (hotButton == button)              //if mouse was released over the same button as it was depressed
                {
                    if (!button.Enabled)
                    {
                        //disabled buttons don't respond at all
                    }
                    else if (button.Style == ODToolBarButtonStyle.DropDownButton &&              //if current button is dropdown
                             HitTestDrop(button, e.X, e.Y) &&                 //and we are in the dropdown area on the right
                             button.DropDownMenu != null)                    //and there is a dropdown menu to display
                    {
                        hotButton    = null;
                        button.State = ToolBarButtonState.Normal;
                        Invalidate(button.Bounds);
                        button.DropDownMenu.GetContextMenu().Show(this
                                                                  , new Point(button.Bounds.X, button.Bounds.Y + button.Bounds.Height));
                    }
                    else if (button.Style == ODToolBarButtonStyle.ToggleButton)                  //if current button is a toggle button
                    {
                        if (button.Pushed)
                        {
                            button.Pushed = false;
                        }
                        else
                        {
                            button.Pushed = true;
                        }
                        OnButtonClicked(button);
                    }
                    else if (button.Style == ODToolBarButtonStyle.Label)
                    {
                        //lables do not respond with click
                    }
                    else
                    {
                        OnButtonClicked(button);
                    }
                    return;      //the button will not revert back to hover
                }                //end of click section
                else             //there was a hot button, but it did not turn into a click
                {
                    hotButton = null;
                }
            }
            if (button != null)          //no click, and now there is a hover button, not the same as original button.
            //this section could easily be deleted, since all the user has to do is move the mouse slightly.
            {
                button.State = ToolBarButtonState.Hover;
                hotButton    = button;           //set the current hover button to be the new hotbutton
                Invalidate(button.Bounds);
            }
        }
Пример #30
0
 ///<summary></summary>
 protected void OnButtonClicked(ODToolBarButton myButton)
 {
     ODToolBarButtonClickEventArgs bArgs=new ODToolBarButtonClickEventArgs(myButton);
     if(ButtonClick!=null)
         ButtonClick(this,bArgs);
 }
Пример #31
0
        private void DrawButton(Graphics g, ODToolBarButton button)
        {
            if (button.Style == ODToolBarButtonStyle.Separator)
            {
                //was 112,128,144
                g.DrawLine(new Pen(Color.FromArgb(190, 200, 210)), button.Bounds.Left, button.Bounds.Top + 1,
                           button.Bounds.Left, button.Bounds.Bottom - 2);
                g.DrawLine(new Pen(Color.FromArgb(130, 140, 160)), button.Bounds.Left + 1, button.Bounds.Top + 1,
                           button.Bounds.Left + 1, button.Bounds.Bottom - 2);
                return;
            }
            //draw background
            if (!button.Enabled)
            {
                g.FillRectangle(new SolidBrush(SystemColors.Control), button.Bounds);
            }
            else if (button.Style == ODToolBarButtonStyle.ToggleButton && button.Pushed)
            {
                g.FillRectangle(new SolidBrush(Color.FromArgb(248, 248, 248)), button.Bounds);
            }
            else if (button.Style == ODToolBarButtonStyle.Label)
            {
                g.FillRectangle(new SolidBrush(SystemColors.Control), button.Bounds);
            }
            else
            {
                switch (button.State)
                {
                case ToolBarButtonState.Normal:                //Control is 224,223,227
                    g.FillRectangle(new SolidBrush(SystemColors.Control), button.Bounds);
                    break;

                case ToolBarButtonState.Hover:                //this is lighter than control
                    g.FillRectangle(new SolidBrush(Color.FromArgb(240, 240, 240)), button.Bounds);
                    break;

                case ToolBarButtonState.Pressed:                //slightly darker than control
                    g.FillRectangle(new SolidBrush(Color.FromArgb(210, 210, 210)), button.Bounds);
                    break;

                case ToolBarButtonState.DropPressed:
                    //left half looks like hover:
                    g.FillRectangle(new SolidBrush(Color.FromArgb(240, 240, 240))
                                    , new Rectangle(button.Bounds.X, button.Bounds.Y
                                                    , button.Bounds.Width - 15, button.Bounds.Height));
                    //right section looks like Pressed:
                    g.FillRectangle(new SolidBrush(Color.FromArgb(210, 210, 210))
                                    , new Rectangle(button.Bounds.X + button.Bounds.Width - 15, button.Bounds.Y
                                                    , 15, button.Bounds.Height));
                    break;
                }
            }
            //draw image and/or text
            Color     textColor = ForeColor;
            Rectangle textRect;
            int       textWidth = button.Bounds.Width;

            if (button.Style == ODToolBarButtonStyle.DropDownButton)
            {
                textWidth -= 15;
            }
            if (!button.Enabled)
            {
                textColor = SystemColors.GrayText;
            }
            if (imageList != null && button.ImageIndex != -1)        //draw image and text
            {
                if (!button.Enabled)
                {
                    System.Windows.Forms.ControlPaint.DrawImageDisabled(g, imageList.Images[button.ImageIndex]
                                                                        , button.Bounds.X + 3, button.Bounds.Y + 1, SystemColors.Control);
                    textRect = new Rectangle(button.Bounds.X + imageList.ImageSize.Width + 3
                                             , button.Bounds.Y, textWidth - imageList.ImageSize.Width - 3, button.Bounds.Height);
                }
                else if (button.State == ToolBarButtonState.Pressed)              //draw slightly down and right
                {
                    g.DrawImage(imageList.Images[button.ImageIndex], button.Bounds.X + 4, button.Bounds.Y + 2);
                    textRect = new Rectangle(button.Bounds.X + 1 + imageList.ImageSize.Width + 3
                                             , button.Bounds.Y + 1, textWidth - imageList.ImageSize.Width - 3, button.Bounds.Height);
                }
                else
                {
                    g.DrawImage(imageList.Images[button.ImageIndex], button.Bounds.X + 3, button.Bounds.Y + 1);
                    textRect = new Rectangle(button.Bounds.X + imageList.ImageSize.Width + 3
                                             , button.Bounds.Y, textWidth - imageList.ImageSize.Width - 3, button.Bounds.Height);
                }
            }
            else             //only draw text
            {
                if (button.Style == ODToolBarButtonStyle.Label)
                {
                    textRect = new Rectangle(button.Bounds.X, button.Bounds.Y
                                             , textWidth, button.Bounds.Height);
                }
                else if (button.State == ToolBarButtonState.Pressed)              //draw slightly down and right
                {
                    textRect = new Rectangle(button.Bounds.X + 1, button.Bounds.Y + 1
                                             , textWidth, button.Bounds.Height);
                }
                else
                {
                    textRect = new Rectangle(button.Bounds.X, button.Bounds.Y
                                             , textWidth, button.Bounds.Height);
                }
            }
            StringFormat format;

            if (imageList != null && button.ImageIndex != -1)        //if there is an image
            //draw text very close to image
            {
                format               = new StringFormat();
                format.Alignment     = StringAlignment.Near;
                format.LineAlignment = StringAlignment.Center;
                g.DrawString(button.Text, Font, new SolidBrush(textColor), textRect, format);
            }
            else
            {
                format               = new StringFormat();
                format.Alignment     = StringAlignment.Center;
                format.LineAlignment = StringAlignment.Center;
                g.DrawString(button.Text, Font, new SolidBrush(textColor), textRect, format);
            }
            //draw outline
            Pen penR = new Pen(Color.FromArgb(180, 180, 180));

            if (!button.Enabled)
            {
                //no outline
                g.DrawLine(penR, button.Bounds.Right - 1, button.Bounds.Top, button.Bounds.Right - 1, button.Bounds.Bottom - 1);
            }
            else if (button.Style == ODToolBarButtonStyle.ToggleButton && button.Pushed)
            {
                g.DrawRectangle(Pens.SlateGray, new Rectangle(button.Bounds.X, button.Bounds.Y
                                                              , button.Bounds.Width - 1, button.Bounds.Height - 1));
            }
            else if (button.Style == ODToolBarButtonStyle.Label)
            {
                //no outline
                g.DrawLine(penR, button.Bounds.Right - 1, button.Bounds.Top, button.Bounds.Right - 1, button.Bounds.Bottom - 1);
            }
            else
            {
                switch (button.State)
                {
                case ToolBarButtonState.Normal:
                    //no outline
                    g.DrawLine(penR, button.Bounds.Right - 1, button.Bounds.Top, button.Bounds.Right - 1, button.Bounds.Bottom - 1);
                    break;

                case ToolBarButtonState.Hover:
                    g.DrawRectangle(Pens.SlateGray, new Rectangle(button.Bounds.X, button.Bounds.Y
                                                                  , button.Bounds.Width - 1, button.Bounds.Height - 1));
                    break;

                case ToolBarButtonState.Pressed:
                    g.DrawRectangle(Pens.SlateGray, new Rectangle(button.Bounds.X, button.Bounds.Y
                                                                  , button.Bounds.Width - 1, button.Bounds.Height - 1));
                    break;

                case ToolBarButtonState.DropPressed:
                    g.DrawRectangle(Pens.SlateGray, new Rectangle(button.Bounds.X, button.Bounds.Y
                                                                  , button.Bounds.Width - 1, button.Bounds.Height - 1));
                    break;
                }
            }
            if (button.Style == ODToolBarButtonStyle.DropDownButton)
            {
                Point[] triangle = new Point[3];
                triangle[0] = new Point(button.Bounds.X + button.Bounds.Width - 11
                                        , button.Bounds.Y + button.Bounds.Height / 2 - 2);
                triangle[1] = new Point(button.Bounds.X + button.Bounds.Width - 4
                                        , button.Bounds.Y + button.Bounds.Height / 2 - 2);
                triangle[2] = new Point(button.Bounds.X + button.Bounds.Width - 8
                                        , button.Bounds.Y + button.Bounds.Height / 2 + 2);
                g.FillPolygon(new SolidBrush(textColor), triangle);
                if (button.State != ToolBarButtonState.Normal && button.Enabled)
                {
                    g.DrawLine(Pens.SlateGray, button.Bounds.X + button.Bounds.Width - 15, button.Bounds.Y
                               , button.Bounds.X + button.Bounds.Width - 15, button.Bounds.Y + button.Bounds.Height);
                }
            }
        }
Пример #32
0
		///<summary>Causes the toolbar to be laid out again.</summary>
		public void LayoutToolBar() {
			ToolBarMain.Buttons.Clear();
			ToolBarPaint.Buttons.Clear();
			ODToolBarButton button;
			ToolBarMain.Buttons.Add(new ODToolBarButton("",1,Lan.g(this,"Print"),"Print"));
			ToolBarMain.Buttons.Add(new ODToolBarButton("",2,Lan.g(this,"Delete"),"Delete"));
			if(ClaimPaymentNum==0) {
				ToolBarMain.Buttons.Add(new ODToolBarButton("",3,Lan.g(this,"Item Info"),"Info"));
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Sign"),-1,Lan.g(this,"Sign this document"),"Sign"));
			}
			ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			button=new ODToolBarButton(Lan.g(this,"Scan:"),-1,"","");
			button.Style=ODToolBarButtonStyle.Label;
			ToolBarMain.Buttons.Add(button);
			ToolBarMain.Buttons.Add(new ODToolBarButton("",14,Lan.g(this,"Scan Document"),"ScanDoc"));
			ToolBarMain.Buttons.Add(new ODToolBarButton("",18,Lan.g(this,"Scan Multi-Page Document"),"ScanMultiDoc"));
			if(ClaimPaymentNum==0) {
				ToolBarMain.Buttons.Add(new ODToolBarButton("",16,Lan.g(this,"Scan Radiograph"),"ScanXRay"));
				ToolBarMain.Buttons.Add(new ODToolBarButton("",15,Lan.g(this,"Scan Photo"),"ScanPhoto"));
			}
			ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Import"),5,Lan.g(this,"Import From File"),"Import"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Export"),19,Lan.g(this,"Export To File"),"Export"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Copy"),17,Lan.g(this,"Copy displayed image to clipboard"),"Copy"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Paste"),6,Lan.g(this,"Paste From Clipboard"),"Paste"));
			if(ClaimPaymentNum==0) {
				button=new ODToolBarButton(Lan.g(this,"Templates"),-1,"","Forms");
				button.Style=ODToolBarButtonStyle.DropDownButton;
				menuForms=new ContextMenu();
				string formDir=ODFileUtils.CombinePaths(ImageStore.GetPreferredAtoZpath(),"Forms");
				if(Directory.Exists(formDir)) {
					DirectoryInfo dirInfo=new DirectoryInfo(formDir);
					FileInfo[] fileInfos=dirInfo.GetFiles();
					for(int i=0;i<fileInfos.Length;i++) {
						if(Documents.IsAcceptableFileName(fileInfos[i].FullName)) {
							menuForms.MenuItems.Add(fileInfos[i].Name,new System.EventHandler(menuForms_Click));
						}
					}
				}
				button.DropDownMenu=menuForms;
				ToolBarMain.Buttons.Add(button);
				button=new ODToolBarButton(Lan.g(this,"Capture"),-1,"Capture Image From Device","Capture");
				button.Style=ODToolBarButtonStyle.ToggleButton;
				ToolBarMain.Buttons.Add(button);
				//Program links:
				ArrayList toolButItems=ToolButItems.GetForToolBar(ToolBarsAvail.ImagesModule);
				for(int i=0;i<toolButItems.Count;i++) {
					ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
					ToolBarMain.Buttons.Add(new ODToolBarButton(((ToolButItem)toolButItems[i]).ButtonText
						,-1,"",((ToolButItem)toolButItems[i]).ProgramNum));
				}
			}
			else {//claimpayment
				ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
				ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Close"),-1,Lan.g(this,"Close window"),"Close"));
			}
			if(ClaimPaymentNum==0) {
				button=new ODToolBarButton("",7,Lan.g(this,"Crop Tool"),"Crop");
				button.Style=ODToolBarButtonStyle.ToggleButton;
				button.Pushed=IsCropMode;
				ToolBarPaint.Buttons.Add(button);
				button=new ODToolBarButton("",10,Lan.g(this,"Hand Tool"),"Hand");
				button.Style=ODToolBarButtonStyle.ToggleButton;
				button.Pushed=!IsCropMode;
				ToolBarPaint.Buttons.Add(button);
				ToolBarPaint.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
			}
			ToolBarPaint.Buttons.Add(new ODToolBarButton("",8,Lan.g(this,"Zoom In"),"ZoomIn"));
			ToolBarPaint.Buttons.Add(new ODToolBarButton("",9,Lan.g(this,"Zoom Out"),"ZoomOut"));
			ToolBarPaint.Buttons.Add(new ODToolBarButton("100",-1,Lan.g(this,"Zoom 100"),"Zoom100"));
			if(ClaimPaymentNum==0) {
				ToolBarPaint.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
				button=new ODToolBarButton(Lan.g(this,"Rotate:"),-1,"","");
				button.Style=ODToolBarButtonStyle.Label;
				ToolBarPaint.Buttons.Add(button);
				ToolBarPaint.Buttons.Add(new ODToolBarButton("",11,Lan.g(this,"Flip"),"Flip"));
				ToolBarPaint.Buttons.Add(new ODToolBarButton("",12,Lan.g(this,"Rotate Left"),"RotateL"));
				ToolBarPaint.Buttons.Add(new ODToolBarButton("",13,Lan.g(this,"Rotate Right"),"RotateR"));
			}
			ToolBarMain.Invalidate();
			ToolBarPaint.Invalidate();
			Plugins.HookAddCode(this,"ContrDocs.LayoutToolBar_end",PatCur);
		}
Пример #33
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="myButton"></param>
 public ODToolBarButtonClickEventArgs(ODToolBarButton myButton)
 {
     button = myButton;
 }
Пример #34
0
 ///<summary>Causes the toolbar to be laid out again.</summary>
 public void LayoutToolBar()
 {
     ToolBarMain.Buttons.Clear();
     ODToolBarButton button;
     button=new ODToolBarButton(Lan.g(this,"Select Patient"),0,"","Patient");
     button.Style=ODToolBarButtonStyle.DropDownButton;
     button.DropDownMenu=menuPatient;
     ToolBarMain.Buttons.Add(button);
     if(!Programs.UsingEcwTight()) {//eCW only gets Patient Select and Popups toolbar buttons
         ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Commlog"),1,Lan.g(this,"New Commlog Entry"),"Commlog"));
         button=new ODToolBarButton(Lan.g(this,"E-mail"),2,Lan.g(this,"Send E-mail"),"Email");
         ToolBarMain.Buttons.Add(button);
         button=new ODToolBarButton("",-1,"","EmailDropdown");
         button.Style=ODToolBarButtonStyle.DropDownButton;
         button.DropDownMenu=menuEmail;
         ToolBarMain.Buttons.Add(button);
         button=new ODToolBarButton(Lan.g(this,"Letter"),-1,Lan.g(this,"Quick Letter"),"Letter");
         button.Style=ODToolBarButtonStyle.DropDownButton;
         button.DropDownMenu=menuLetter;
         ToolBarMain.Buttons.Add(button);
         button=new ODToolBarButton(Lan.g(this,"Forms"),-1,"","Form");
         //button.Style=ODToolBarButtonStyle.DropDownButton;
         //button.DropDownMenu=menuForm;
         ToolBarMain.Buttons.Add(button);
         ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"To Task List"),3,Lan.g(this,"Send to Task List"),"Tasklist"));
         button=new ODToolBarButton(Lan.g(this,"Label"),4,Lan.g(this,"Print Label"),"Label");
         button.Style=ODToolBarButtonStyle.DropDownButton;
         button.DropDownMenu=menuLabel;
         ToolBarMain.Buttons.Add(button);
     }
     ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Popups"),-1,Lan.g(this,"Edit popups for this patient"),"Popups"));
     ArrayList toolButItems=ToolButItems.GetForToolBar(ToolBarsAvail.AllModules);
     for(int i=0;i<toolButItems.Count;i++) {
       //ToolBarMain.Buttons.Add(new ODToolBarButton(ODToolBarButtonStyle.Separator));
       ToolBarMain.Buttons.Add(new ODToolBarButton(((ToolButItem)toolButItems[i]).ButtonText
         ,-1,"",((ToolButItem)toolButItems[i]).ProgramNum));
     }
     Plugins.HookAddCode(this,"FormOpenDental.LayoutToolBar_end");
     ToolBarMain.Invalidate();
 }
Пример #35
0
		///<summary></summary>
		public void LayoutToolBar() {
			ToolBarMain.Buttons.Clear();
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Setup"),-1,"","Setup"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Add TaskList"),0,"","AddList"));
			ToolBarMain.Buttons.Add(new ODToolBarButton(Lan.g(this,"Add Task"),1,"","AddTask"));
			ODToolBarButton button=new ODToolBarButton();
			button.Style=ODToolBarButtonStyle.ToggleButton;
			button.Text=Lan.g(this,"BlockPopups");
			button.ToolTipText=Lan.g(this,"Sounds will still play, but popups will be blocked.");
			button.Tag="Block";
			button.Pushed=Security.CurUser.DefaultHidePopups;
			ToolBarMain.Buttons.Add(button);
			ToolBarMain.Invalidate();
		}