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

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

[Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing.Xsharp DrawingToolkit


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing.Xsharp DrawingToolkit.cs,1.11,1.12
Date: Tue, 24 Jun 2003 07:10:06 -0400

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

Modified Files:
        DrawingToolkit.cs 
Log Message:


Add some support code for converting between screen and client co-ordinates.


Index: DrawingToolkit.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing.Xsharp/DrawingToolkit.cs,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** DrawingToolkit.cs   24 Jun 2003 07:52:49 -0000      1.11
--- DrawingToolkit.cs   24 Jun 2003 11:10:02 -0000      1.12
***************
*** 522,525 ****
--- 522,557 ----
                        }
  
+       // Convert a client point for a window into a screen point.
+       public System.Drawing.Point ClientToScreen
+                               (IToolkitWindow window, System.Drawing.Point 
point)
+                       {
+                               Widget widget = (window as Widget);
+                               if(widget != null)
+                               {
+                                       Xsharp.Point pt = 
widget.WidgetToScreen(point.X, point.Y);
+                                       return new System.Drawing.Point(pt.x, 
pt.y);
+                               }
+                               else
+                               {
+                                       return point;
+                               }
+                       }
+ 
+       // Convert a screen point for a window into a client point.
+       public System.Drawing.Point ScreenToClient
+                               (IToolkitWindow window, System.Drawing.Point 
point)
+                       {
+                               Widget widget = (window as Widget);
+                               if(widget != null)
+                               {
+                                       Xsharp.Point pt = 
widget.ScreenToWidget(point.X, point.Y);
+                                       return new System.Drawing.Point(pt.x, 
pt.y);
+                               }
+                               else
+                               {
+                                       return point;
+                               }
+                       }
+ 
  }; // class DrawingToolkit
  





reply via email to

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