[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms ToolBar.cs,1.1,1
From: |
Richard Baumann <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms ToolBar.cs,1.1,1.2 ToolBarButton.cs,1.2,1.3 |
Date: |
Fri, 04 Jul 2003 13:31:34 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms
In directory subversions:/tmp/cvs-serv30708/System.Windows.Forms
Modified Files:
ToolBar.cs ToolBarButton.cs
Log Message:
Fix some layout and button drawing bugs.
Index: ToolBar.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/ToolBar.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** ToolBar.cs 4 Jul 2003 05:50:00 -0000 1.1
--- ToolBar.cs 4 Jul 2003 17:31:32 -0000 1.2
***************
*** 53,56 ****
--- 53,58 ----
private int mouseHoverClick = -1;
private int mouseHoverDrop = -1;
+ private int limitWidth = -1;
+ private int limitHeight = -1;
// used in calculating button and toolbar sizes
***************
*** 344,370 ****
if (!preferredSize.IsEmpty) { return preferredSize; }
DockStyle dock = Dock;
! int parentWidth = Parent.Width;
! int parentHeight = Parent.Height;
if (dock == DockStyle.Left || dock == DockStyle.Right)
{
! preferredSize = CalculateSizeV(parentHeight);
! if (preferredSize.Height < parentHeight)
{
! preferredSize.Height = parentHeight;
}
}
else if (dock == DockStyle.Top || dock ==
DockStyle.Bottom)
{
! preferredSize = CalculateSizeH(parentWidth);
! if (preferredSize.Width < parentWidth)
{
! preferredSize.Width = parentWidth;
}
}
else // dock == DockStyle.None
{
! preferredSize = CalculateSizeH(parentWidth);
}
return preferredSize;
--- 346,378 ----
if (!preferredSize.IsEmpty) { return preferredSize; }
DockStyle dock = Dock;
! if (limitWidth == -1)
! {
! limitWidth = Parent.Width;
! }
! if (limitHeight == -1)
! {
! limitHeight = Parent.Height;
! }
if (dock == DockStyle.Left || dock == DockStyle.Right)
{
! preferredSize = CalculateSizeV(limitHeight);
! if (preferredSize.Height < limitHeight)
{
! preferredSize.Height = limitHeight;
}
}
else if (dock == DockStyle.Top || dock ==
DockStyle.Bottom)
{
! preferredSize = CalculateSizeH(limitWidth);
! if (preferredSize.Width < limitWidth)
{
! preferredSize.Width = limitWidth;
}
}
else // dock == DockStyle.None
{
! preferredSize = CalculateSizeH(limitWidth);
}
return preferredSize;
***************
*** 849,852 ****
--- 857,866 ----
partial &= b.PartialPush;
+ // if the button is a drop down button, but the drop down is
+ // triggered from the viewRectangle, instead of the
+ // dropRectangle, set viewClick to true for proper drawing
+ viewClick |= (dropClick && !drops);
+
+
ButtonState state =
CalculateButtonState(flat,viewClick,viewHover,
partial,pushed);
***************
*** 1391,1396 ****
--- 1405,1419 ----
{
Size oldSize = Size;
+ if ((specified & BoundsSpecified.Width) != 0)
+ {
+ limitWidth = width;
+ }
+ if ((specified & BoundsSpecified.Height) != 0)
+ {
+ limitHeight = height;
+ }
if (autoSize)
{
+ preferredSize = Size.Empty;
Size size = PreferredSize;
width = size.Width;
Index: ToolBarButton.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/ToolBarButton.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ToolBarButton.cs 4 Jul 2003 05:50:00 -0000 1.2
--- ToolBarButton.cs 4 Jul 2003 17:31:32 -0000 1.3
***************
*** 296,300 ****
}
}
! return 0;
}
internal void Reset()
--- 296,307 ----
}
}
! else if (viewRectangle.Contains(x,y))
! {
! return 1;
! }
! else
! {
! return 0;
! }
}
internal void Reset()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms ToolBar.cs,1.1,1.2 ToolBarButton.cs,1.2,1.3,
Richard Baumann <address@hidden> <=