2005-01-05 Geoff Norton <gnorton@customerdna.com>
authorGeoff Norton <grompf@sublimeintervention.com>
Wed, 5 Jan 2005 21:43:13 +0000 (21:43 -0000)
committerGeoff Norton <grompf@sublimeintervention.com>
Wed, 5 Jan 2005 21:43:13 +0000 (21:43 -0000)
        * XplatUIOSX.cs: Implement Activate/SetTopmost

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

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs

index a17595b8c2883a9a461119bbecdee801c594cf37..412258d46b246c552f691ec9b55909295f82eeb5 100644 (file)
@@ -1,3 +1,7 @@
+2005-01-05  Geoff Norton  <gnorton@customerdna.com>
+
+       * XplatUIOSX.cs: Implement Activate/SetTopmost
+
 2005-01-05  Geoff Norton  <gnorton@customerdna.com>
 
        * XplatUIOSX.cs: Implement SetZOrder, minor cleanup
index d9e21e04abd5358432bf013e268d680c9fce2503..b27515a2cf4fbeaf98d3e1be9540e2da6b2d01b8 100644 (file)
@@ -417,7 +417,7 @@ namespace System.Windows.Forms {
 
                [MonoTODO]
                internal override void Activate(IntPtr handle) {
-                       throw new NotImplementedException ();
+                       ActivateWindow (GetControlOwner (handle), true);
                }
 
                [MonoTODO]
@@ -889,9 +889,8 @@ namespace System.Windows.Forms {
                        return false;
                }
 
-               [MonoTODO]
                internal override bool SetTopmost(IntPtr hWnd, IntPtr hWndOwner, bool Enabled) {
-                       // FIXME
+                       HIViewSetZOrder (hWnd, 1, IntPtr.Zero);
                        return true;
                }
 
@@ -1266,6 +1265,8 @@ namespace System.Windows.Forms {
                [DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
                internal static extern int HIViewScrollRect (IntPtr vHnd, IntPtr rect, float x, float y);
                [DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+               internal static extern int HIViewSetZOrder (IntPtr hWnd, int cmd, IntPtr oHnd);
+               [DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
                internal static extern int HIViewSetBoundsOrigin (IntPtr vHnd, float x, float y);
                [DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
                internal static extern int HIViewConvertRect (ref HIRect r, IntPtr a, IntPtr b);
@@ -1282,6 +1283,8 @@ namespace System.Windows.Forms {
                [DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
                internal static extern IntPtr GetControlOwner (IntPtr aView);
                [DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
+               static extern int ActivateWindow (IntPtr windowHnd, bool inActivate);
+               [DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
                static extern bool IsWindowActive (IntPtr windowHnd);
                [DllImport ("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
                static extern int SetKeyboardFocus (IntPtr windowHdn, IntPtr cntrlHnd, ushort partcode);