Просмотр исходного кода

- Added method for enabling/disabling windows
- Added method for setting window modality
- Added method for setting topmost window

svn path=/trunk/mcs/; revision=35071

Peter Dennis Bartok 21 лет назад
Родитель
Сommit
a8a3d2136f

+ 18 - 1
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs

@@ -23,9 +23,14 @@
 //	Peter Bartok	[email protected]
 //
 //
-// $Revision: 1.24 $
+// $Revision: 1.25 $
 // $Modtime: $
 // $Log: XplatUI.cs,v $
+// Revision 1.25  2004/10/18 04:50:54  pbartok
+// - Added method for enabling/disabling windows
+// - Added method for setting window modality
+// - Added method for setting topmost window
+//
 // Revision 1.24  2004/10/02 19:07:36  pbartok
 // - Added ClientToScreen coordinate translation method
 //
@@ -294,6 +299,14 @@ namespace System.Windows.Forms {
 			driver.Activate(handle);
 		}
 
+		internal static void EnableWindow(IntPtr handle, bool Enable) {
+			driver.EnableWindow(handle, Enable);
+		}
+
+		internal static void SetModal(IntPtr handle, bool Modal) {
+			driver.SetModal(handle, Modal);
+		}
+
 		internal static IntPtr DefWndProc(ref Message msg) {
 			return driver.DefWndProc(ref msg);
 		}
@@ -338,6 +351,10 @@ namespace System.Windows.Forms {
 			return driver.SetZOrder(hWnd, AfterhWnd, Top, Bottom);
 		}
 
+		internal static bool SetTopmost(IntPtr hWnd, bool Enabled) {
+			return driver.SetTopmost(hWnd, Enabled);
+		}
+
 		internal static bool CalculateWindowRect(IntPtr hWnd, ref Rectangle ClientRect, int Style, bool HasMenu, out Rectangle WindowRect) {
 			return driver.CalculateWindowRect(hWnd, ref ClientRect, Style, HasMenu, out WindowRect);
 		}

+ 9 - 1
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs

@@ -23,9 +23,14 @@
 //	Peter Bartok	[email protected]
 //
 //
-// $Revision: 1.24 $
+// $Revision: 1.25 $
 // $Modtime: $
 // $Log: XplatUIDriver.cs,v $
+// Revision 1.25  2004/10/18 04:50:54  pbartok
+// - Added method for enabling/disabling windows
+// - Added method for setting window modality
+// - Added method for setting topmost window
+//
 // Revision 1.24  2004/10/02 19:07:36  pbartok
 // - Added ClientToScreen coordinate translation method
 //
@@ -191,6 +196,8 @@ namespace System.Windows.Forms {
 		internal abstract void SetWindowPos(IntPtr handle, int x, int y, int width, int height);
 		internal abstract void GetWindowPos(IntPtr handle, out int x, out int y, out int width, out int height, out int client_width, out int client_height);
 		internal abstract void Activate(IntPtr handle);
+		internal abstract void EnableWindow(IntPtr handle, bool Enable);
+		internal abstract void SetModal(IntPtr handle, bool Modal);
 		internal abstract void Invalidate(IntPtr handle, Rectangle rc, bool clear);
 		internal abstract IntPtr DefWndProc(ref Message msg);
 		internal abstract void HandleException(Exception e);
@@ -201,6 +208,7 @@ namespace System.Windows.Forms {
 		internal abstract bool DispatchMessage(ref MSG msg);
 
 		internal abstract bool SetZOrder(IntPtr hWnd, IntPtr AfterhWnd, bool Top, bool Bottom);
+		internal abstract bool SetTopmost(IntPtr hWnd, bool Enabled);
 
 		internal abstract bool CalculateWindowRect(IntPtr hWnd, ref Rectangle ClientRect, int Style, bool HasMenu, out Rectangle WindowRect);