/[dotgnu-pnet]/pnetlib/System.Windows.Forms/Control.cs
ViewVC logotype

Diff of /pnetlib/System.Windows.Forms/Control.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.92 by darkdust, Mon Aug 8 11:08:32 2005 UTC revision 1.93 by darkdust, Fri Aug 19 15:46:31 2005 UTC
# Line 5177  public class Control : IWin32Window, IDi Line 5177  public class Control : IWin32Window, IDi
5177  #endif  #endif
5178          protected virtual void OnParentVisibleChanged(EventArgs e)          protected virtual void OnParentVisibleChanged(EventArgs e)
5179                          {                          {
                                 bool parentVisible = parent.Visible;  
5180                                  OnVisibleChanged(e);                                  OnVisibleChanged(e);
5181                          }                          }
5182          internal virtual void OnPrimaryEnter(EventArgs e)          internal virtual void OnPrimaryEnter(EventArgs e)
# Line 5676  public class Control : IWin32Window, IDi Line 5675  public class Control : IWin32Window, IDi
5675                                                                  value.CreateControl();                                                                  value.CreateControl();
5676                                                                  owner.PerformLayout(value, "Parent");                                                                  owner.PerformLayout(value, "Parent");
5677                                                          }                                                          }
5678    
5679                                                            // If it's supposed to be visible then fire the
5680                                                            // OnVisibleChanged event.
5681                                                            if (value.visible)
5682                                                            {
5683                                                                    value.OnVisibleChanged(EventArgs.Empty);
5684                                                            }
5685                                                            
5686                                                          // Notify the owner that the control was added.                                                          // Notify the owner that the control was added.
5687                                                          owner.OnControlAdded                                                          owner.OnControlAdded
5688                                                                  (new ControlEventArgs(value));                                                                  (new ControlEventArgs(value));
# Line 5720  public class Control : IWin32Window, IDi Line 5727  public class Control : IWin32Window, IDi
5727                                  {                                  {
5728                                          if(value != null && value.Parent == owner)                                          if(value != null && value.Parent == owner)
5729                                          {                                          {
5730                                                    bool wasVisible = value.Visible;
5731    
5732                                                  // Update the parent.                                                  // Update the parent.
5733                                                  value.Parent = null;                                                  value.Parent = null;
5734    
5735                                                  // Perform layout on the owner.                                                  // Perform layout on the owner.
5736                                                  owner.PerformLayout(value, "Parent");                                                  owner.PerformLayout(value, "Parent");
5737    
5738                                                    // If it was visible, it now isn't and thus the
5739                                                    // visibility changed.
5740                                                    if (wasVisible)
5741                                                            value.OnVisibleChanged (EventArgs.Empty);
5742    
5743                                                  // Notify the owner that the control has been removed.                                                  // Notify the owner that the control has been removed.
5744                                                  owner.OnControlRemoved(new ControlEventArgs(value));                                                  owner.OnControlRemoved(new ControlEventArgs(value));
5745                                          }                                          }

Legend:
Removed from v.1.92  
changed lines
  Added in v.1.93

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26