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.Windows.Forms Control.cs,1.18


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/System.Windows.Forms Control.cs,1.18,1.19 Form.cs,1.12,1.13
Date: Mon, 23 Jun 2003 01:35:22 -0400

Update of /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms
In directory subversions:/tmp/cvs-serv11338/System.Windows.Forms

Modified Files:
        Control.cs Form.cs 
Log Message:


Detect when top-level forms are activated or deactivated and dispatch
the appropriate events.


Index: Control.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/Control.cs,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** Control.cs  23 Jun 2003 01:04:21 -0000      1.18
--- Control.cs  23 Jun 2003 05:35:20 -0000      1.19
***************
*** 3728,3731 ****
--- 3728,3739 ----
                                }
                        }
+       internal virtual void OnPrimaryEnter(EventArgs e)
+                       {
+                               // Nothing to do here: overridden in "Form".
+                       }
+       internal virtual void OnPrimaryLeave(EventArgs e)
+                       {
+                               // Nothing to do here: overridden in "Form".
+                       }
  #if !CONFIG_COMPACT_FORMS
        protected virtual void OnQueryAccessibilityHelp
***************
*** 4367,4370 ****
--- 4375,4392 ----
                        {
                                OnLeave(EventArgs.Empty);
+                       }
+ 
+       // Event that is emitted when the primary focus enters this window.
+       // This is only called on top-level windows.
+       void IToolkitEventSink.ToolkitPrimaryFocusEnter()
+                       {
+                               OnPrimaryEnter(EventArgs.Empty);
+                       }
+ 
+       // Event that is emitted when the primary focus leaves this window.
+       // This is only called on top-level windows.
+       void IToolkitEventSink.ToolkitPrimaryFocusLeave()
+                       {
+                               OnPrimaryLeave(EventArgs.Empty);
                        }
  

Index: Form.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System.Windows.Forms/Form.cs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** Form.cs     23 Jun 2003 01:04:21 -0000      1.12
--- Form.cs     23 Jun 2003 05:35:20 -0000      1.13
***************
*** 648,655 ****
  
        // Activate the form and give it focus.
-       [TODO]
        public void Activate()
                        {
!                               // TODO
                        }
  
--- 648,654 ----
  
        // Activate the form and give it focus.
        public void Activate()
                        {
!                               BringToFront();
                        }
  
***************
*** 671,675 ****
        // Get the auto scale base size for a particular font.
        [TODO]
!       public static SizeF GetAutoScalSize(Font font)
                        {
                                // TODO
--- 670,674 ----
        // Get the auto scale base size for a particular font.
        [TODO]
!       public static SizeF GetAutoScaleSize(Font font)
                        {
                                // TODO
***************
*** 925,928 ****
--- 924,931 ----
        protected virtual void OnActivated(EventArgs e)
                        {
+                               // This form is currently the active one.
+                               activeForm = this;
+ 
+                               // Dispatch the event to everyone who is 
listening.
                                EventHandler handler;
                                handler = 
(EventHandler)(GetHandler(EventId.Activated));
***************
*** 965,968 ****
--- 968,975 ----
        protected virtual void OnDeactivate(EventArgs e)
                        {
+                               // None of the application's forms are 
currently active.
+                               activeForm = null;
+ 
+                               // Dispatch the event to everyone who is 
listening.
                                EventHandler handler;
                                handler = 
(EventHandler)(GetHandler(EventId.Deactivate));
***************
*** 1101,1104 ****
--- 1108,1123 ----
                        {
                                base.OnPaint(e);
+                       }
+ 
+       // Override the "PrimaryEnter" event.
+       internal override void OnPrimaryEnter(EventArgs e)
+                       {
+                               OnActivated(e);
+                       }
+ 
+       // Override the "PrimaryLeave" event.
+       internal override void OnPrimaryLeave(EventArgs e)
+                       {
+                               OnDeactivate(e);
                        }
  





reply via email to

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