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

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

[Dotgnu-pnet-commits] pnetlib/System.Drawing.Xsharp DrawingTopLevelWindo


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] pnetlib/System.Drawing.Xsharp DrawingTopLevelWindow.cs, 1.19, 1.20
Date: Wed, 03 Dec 2003 05:14:23 +0000

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Drawing.Xsharp
In directory subversions:/tmp/cvs-serv23812/System.Drawing.Xsharp

Modified Files:
        DrawingTopLevelWindow.cs 
Log Message:


Implement window maximize and restore; track dynamic changes to
the minimized and maximized window states.


Index: DrawingTopLevelWindow.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System.Drawing.Xsharp/DrawingTopLevelWindow.cs,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** DrawingTopLevelWindow.cs    2 Dec 2003 13:06:57 -0000       1.19
--- DrawingTopLevelWindow.cs    3 Dec 2003 05:14:20 -0000       1.20
***************
*** 224,228 ****
        void IToolkitTopLevelWindow.Maximize()
                        {
!                               // TODO
                        }
  
--- 224,232 ----
        void IToolkitTopLevelWindow.Maximize()
                        {
!                               Maximize();
!                               if(IsIconic)
!                               {
!                                       Deiconify();
!                               }
                        }
  
***************
*** 230,234 ****
        void IToolkitTopLevelWindow.Restore()
                        {
!                               // TODO
                        }
  
--- 234,245 ----
        void IToolkitTopLevelWindow.Restore()
                        {
!                               if(IsIconic)
!                               {
!                                       Deiconify();
!                               }
!                               if(IsMaximized)
!                               {
!                                       Restore();
!                               }
                        }
  
***************
*** 578,581 ****
--- 589,626 ----
                                        sink.ToolkitHelp();
                                }
+                       }
+ 
+       // Process a change in window state from Xsharp.
+       private void WindowStateChanged()
+                       {
+                               int state;
+                               if(IsIconic)
+                               {
+                                       state = 1;              // 
FormWindowState.Minimized.
+                               }
+                               else if(IsMaximized)
+                               {
+                                       state = 2;              // 
FormWindowState.Maximized.
+                               }
+                               else
+                               {
+                                       state = 0;              // 
FormWindowState.Normal.
+                               }
+                               if(sink != null)
+                               {
+                                       sink.ToolkitStateChanged(state);
+                               }
+                       }
+ 
+       // Override the "OnIconicStateChanged" event from Xsharp.
+       protected override void OnIconicStateChanged(bool value)
+                       {
+                               WindowStateChanged();
+                       }
+ 
+       // Override the "OnMaximizedStateChanged" event from Xsharp.
+       protected override void OnMaximizedStateChanged(bool value)
+                       {
+                               WindowStateChanged();
                        }
  





reply via email to

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