dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms ToolBar.cs,1.2,1


From: Richard Baumann <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms ToolBar.cs,1.2,1.3
Date: Sat, 05 Jul 2003 01:31:12 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms
In directory subversions:/tmp/cvs-serv24009/System.Windows.Forms

Modified Files:
        ToolBar.cs 
Log Message:
Add support, to winforms toolbar, for drop down menus.


Index: ToolBar.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/ToolBar.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ToolBar.cs  4 Jul 2003 17:31:32 -0000       1.2
--- ToolBar.cs  5 Jul 2003 05:31:10 -0000       1.3
***************
*** 1102,1111 ****
                handler = ((ToolBarButtonClickEventHandler)
                           (GetHandler(EventId.ButtonClick)));
!               if(handler != null)
                {
                        handler(this, e);
                }
        }
-       [TODO]
        protected virtual void OnButtonDropDown(ToolBarButtonClickEventArgs e)
        {
--- 1102,1110 ----
                handler = ((ToolBarButtonClickEventHandler)
                           (GetHandler(EventId.ButtonClick)));
!               if (handler != null)
                {
                        handler(this, e);
                }
        }
        protected virtual void OnButtonDropDown(ToolBarButtonClickEventArgs e)
        {
***************
*** 1113,1121 ****
                handler = ((ToolBarButtonClickEventHandler)
                           (GetHandler(EventId.ButtonDropDown)));
!               if(handler != null)
                {
                        handler(this, e);
                }
!               // TODO - show drop down menu
        }
        protected override void OnFontChanged(EventArgs e)
--- 1112,1136 ----
                handler = ((ToolBarButtonClickEventHandler)
                           (GetHandler(EventId.ButtonDropDown)));
!               if (handler != null)
                {
                        handler(this, e);
                }
!               ToolBarButton b = e.Button;
!               ContextMenu menu = (b.DropDownMenu as ContextMenu);
!               if (menu != null)
!               {
!                       Rectangle rect;
!                       if (dropDownArrows)
!                       {
!                               rect = b.dropRectangle;
!                       }
!                       else
!                       {
!                               rect = b.viewRectangle;
!                       }
!                       int x = rect.X; // left
!                       int y = rect.Y+rect.Height; // bottom
!                       menu.Show(this,new Point(x,y));
!               }
        }
        protected override void OnFontChanged(EventArgs e)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]