[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms Control.cs,1.16
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms Control.cs,1.16,1.17 Form.cs,1.10,1.11 |
Date: |
Sun, 22 Jun 2003 00:07:55 -0400 |
Update of /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms
In directory subversions:/tmp/cvs-serv5798/System.Windows.Forms
Modified Files:
Control.cs Form.cs
Log Message:
Change the way that client area adjustments are performed.
Index: Control.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/Control.cs,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** Control.cs 22 Jun 2003 03:19:45 -0000 1.16
--- Control.cs 22 Jun 2003 04:07:52 -0000 1.17
***************
*** 414,432 ****
get
{
! //CreateControl();
! int leftAdjust = 0;
! int topAdjust = 0;
! int rightAdjust = 0;
! int bottomAdjust = 0;
! #if false // TODO: fix this so that it
doesn't need a window
! if(toolkitWindow != null)
! {
!
toolkitWindow.GetClientAreaAdjust
! (ref leftAdjust, ref
topAdjust,
! ref rightAdjust, ref
bottomAdjust);
! }
! #endif
! return new Size(width - leftAdjust -
rightAdjust,
! height
- topAdjust - bottomAdjust);
}
set
--- 414,418 ----
get
{
! return ClientToBounds(new Size(width,
height));
}
set
***************
*** 2248,2272 ****
}
! // Inner core of setting the client size.
protected virtual void SetClientSizeCore(int x, int y)
{
! //CreateControl();
! int leftAdjust = 0;
! int topAdjust = 0;
! int rightAdjust = 0;
! int bottomAdjust = 0;
! #if false // TODO: fix this so that it doesn't
need a window
! if(toolkitWindow != null)
! {
! toolkitWindow.GetClientAreaAdjust
! (ref leftAdjust, ref topAdjust,
! ref rightAdjust, ref
bottomAdjust);
! }
! #endif
! SetBoundsCore
! (left, top,
! x + leftAdjust + rightAdjust,
! y + topAdjust + bottomAdjust,
! BoundsSpecified.Size);
}
--- 2234,2243 ----
}
! // Inner core of setting the client size. In the default
! // implementation, this is identical to "SetBoundsCore".
! // Overridden by "Form" to add window border adjustments.
protected virtual void SetClientSizeCore(int x, int y)
{
! SetBoundsCore(left, top, x, y,
BoundsSpecified.Size);
}
***************
*** 4418,4421 ****
--- 4389,4399 ----
// TODO: background images
return new SolidBrush(BackColor);
+ }
+
+ // Convert a client size into a window bounds size.
+ internal virtual Size ClientToBounds(Size size)
+ {
+ // Overridden by "Form" to handle window
borders.
+ return size;
}
Index: Form.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/Form.cs,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** Form.cs 22 Jun 2003 03:19:45 -0000 1.10
--- Form.cs 22 Jun 2003 04:07:52 -0000 1.11
***************
*** 574,579 ****
}
! // Set the current state of the window decoration flags on a window.
! private void SetWindowFlags(IToolkitWindow window)
{
ToolkitWindowFlags flags = windowFlags;
--- 574,579 ----
}
! // Get the full set of window flags for this window.
! private ToolkitWindowFlags GetFullFlags()
{
ToolkitWindowFlags flags = windowFlags;
***************
*** 618,622 ****
break;
}
! window.SetWindowFlags(flags);
}
--- 618,628 ----
break;
}
! return flags;
! }
!
! // Set the current state of the window decoration flags on a window.
! private void SetWindowFlags(IToolkitWindow window)
! {
! window.SetWindowFlags(GetFullFlags());
}
***************
*** 1184,1188 ****
protected override void SetClientSizeCore(int x, int y)
{
! base.SetClientSizeCore(x, y);
}
--- 1190,1204 ----
protected override void SetClientSizeCore(int x, int y)
{
! // Get the border adjustment values from the
toolkit.
! int leftAdjust = 0;
! int topAdjust = 0;
! int rightAdjust = 0;
! int bottomAdjust = 0;
! ToolkitManager.Toolkit.GetWindowAdjust
! (out leftAdjust, out topAdjust,
! out rightAdjust, out bottomAdjust,
GetFullFlags());
! base.SetClientSizeCore
! (x + leftAdjust + rightAdjust,
! y + topAdjust + bottomAdjust);
}
***************
*** 1203,1206 ****
--- 1219,1236 ----
DestroyHandle();
}
+ }
+
+ // Convert a client size into a window bounds size.
+ internal override Size ClientToBounds(Size size)
+ {
+ int leftAdjust = 0;
+ int topAdjust = 0;
+ int rightAdjust = 0;
+ int bottomAdjust = 0;
+ ToolkitManager.Toolkit.GetWindowAdjust
+ (out leftAdjust, out topAdjust,
+ out rightAdjust, out bottomAdjust,
GetFullFlags());
+ return new Size(size.Width + leftAdjust +
rightAdjust,
+ size.Height +
topAdjust + bottomAdjust);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms Control.cs,1.16,1.17 Form.cs,1.10,1.11,
Rhys Weatherley <address@hidden> <=