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 DrawingTopLeve


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Drawing.Xsharp DrawingTopLevelWindow.cs,1.6,1.7 DrawingWindow.cs,1.5,1.6
Date: Sun, 22 Jun 2003 21:04:23 -0400

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

Modified Files:
        DrawingTopLevelWindow.cs DrawingWindow.cs 
Log Message:


Implement key event dispatching.


Index: DrawingTopLevelWindow.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/System.Drawing.Xsharp/DrawingTopLevelWindow.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** DrawingTopLevelWindow.cs    22 Jun 2003 04:07:52 -0000      1.6
--- DrawingTopLevelWindow.cs    23 Jun 2003 01:04:21 -0000      1.7
***************
*** 327,330 ****
--- 327,331 ----
                                                                           
ModifierMask modifiers, String str)
                        {
+                               bool processed = false;
                                if(sink != null)
                                {
***************
*** 333,337 ****
                                        if(keyData != ToolkitKeys.None)
                                        {
!                                               sink.ToolkitKeyDown(keyData);
                                        }
  
--- 334,341 ----
                                        if(keyData != ToolkitKeys.None)
                                        {
!                                               if(sink.ToolkitKeyDown(keyData))
!                                               {
!                                                       processed = true;
!                                               }
                                        }
  
***************
*** 341,351 ****
                                                foreach(char ch in str)
                                                {
!                                                       sink.ToolkitKeyChar(ch);
                                                }
                                        }
                                }
  
!                               // The key has been processed.
!                               return true;
                        }
  
--- 345,371 ----
                                                foreach(char ch in str)
                                                {
!                                                       
if(sink.ToolkitKeyChar(ch))
!                                                       {
!                                                               processed = 
true;
!                                                       }
                                                }
                                        }
                                }
+                               return processed;
+                       }
  
!       // Override the key release event from Xsharp.
!       protected override bool OnKeyRelease(KeyName key, ModifierMask 
modifiers)
!                       {
!                               if(sink != null)
!                               {
!                                       // Emit the "KeyUp" event.
!                                       ToolkitKeys keyData = 
DrawingWindow.MapKey(key, modifiers);
!                                       if(keyData != ToolkitKeys.None)
!                                       {
!                                               return 
sink.ToolkitKeyUp(keyData);
!                                       }
!                               }
!                               return false;
                        }
  

Index: DrawingWindow.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Drawing.Xsharp/DrawingWindow.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** DrawingWindow.cs    22 Jun 2003 04:07:52 -0000      1.5
--- DrawingWindow.cs    23 Jun 2003 01:04:21 -0000      1.6
***************
*** 296,299 ****
--- 296,300 ----
                                                                           
ModifierMask modifiers, String str)
                        {
+                               bool processed = false;
                                if(sink != null)
                                {
***************
*** 302,306 ****
                                        if(keyData != ToolkitKeys.None)
                                        {
!                                               sink.ToolkitKeyDown(keyData);
                                        }
  
--- 303,310 ----
                                        if(keyData != ToolkitKeys.None)
                                        {
!                                               if(sink.ToolkitKeyDown(keyData))
!                                               {
!                                                       processed = true;
!                                               }
                                        }
  
***************
*** 310,320 ****
                                                foreach(char ch in str)
                                                {
!                                                       sink.ToolkitKeyChar(ch);
                                                }
                                        }
                                }
  
!                               // The key has been processed.
!                               return true;
                        }
  
--- 314,340 ----
                                                foreach(char ch in str)
                                                {
!                                                       
if(sink.ToolkitKeyChar(ch))
!                                                       {
!                                                               processed = 
true;
!                                                       }
                                                }
                                        }
                                }
+                               return processed;
+                       }
  
!       // Override the key release event from Xsharp.
!       protected override bool OnKeyRelease(KeyName key, ModifierMask 
modifiers)
!                       {
!                               if(sink != null)
!                               {
!                                       // Emit the "KeyUp" event.
!                                       ToolkitKeys keyData = MapKey(key, 
modifiers);
!                                       if(keyData != ToolkitKeys.None)
!                                       {
!                                               return 
sink.ToolkitKeyUp(keyData);
!                                       }
!                               }
!                               return false;
                        }
  





reply via email to

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