protected override void WndProc(ref Message m)
        {
            bool handled = false;

            if (m.MessageId == WindowMessages.WM_CREATE)
            {
                if (LayoutEngine == null)
                {
                    LayoutEngine = new DefaultLayoutEngine();
                }
                if (!m_LayoutEngineInitialized)
                {
                    LayoutEngine.Initialize(this);
                    m_LayoutEngineInitialized = true;
                }
            }
            else if (m.MessageId == WindowMessages.WM_SIZE)
            {
                LayoutEngine.DoLayout(this, ChildControls);
            }

            if (!handled)
            {
                base.WndProc(ref m);
            }
        }
Esempio n. 2
0
 public DUICaptionContainerAlpha(DUISkinFormAlpha owner)
 {
     this.owner             = owner;
     this.lastClientSize    = this.Size;
     this.dUIControlShare   = new DUIControlShare();
     synchronizationContext = SynchronizationContext.Current;
     #region 窗体事件
     this.owner.HandleCreated += (s, e) =>
     {
         this.DoHandleCreated(e);
         LayoutEngine.DoLayout(new DUILayoutEventArgs(this, "HandleCreated"));
     };
     this.owner.Resize += (s, e) => { this.DoResize(e); };
     this.owner.Layout += (s, e) =>
     {
         if (this.Width != 0 || this.Height != 0)
         {
             if (this.lastClientSize != this.Size)
             {
                 LayoutEngine.DoLayoutDock(new DUILayoutEventArgs(this, "Layout"), this.lastClientSize);
                 this.lastClientSize = this.Size;
             }
         }
         this.DoLayout(new DUILayoutEventArgs(this, "Layout"));
     };
     #endregion
     this.Owner.Load += (s, e) =>
     {
         //记录坐标和尺寸
         this.Owner.lastSysCommandLocation = this.owner.Location;
         this.Owner.lastSysCommandSize     = this.owner.Size;
     };
     this.Owner.ResizeEnd += (s, e) =>
     {
         if (this.Owner.WindowState == FormWindowState.Normal)
         {
             //记录坐标和尺寸
             this.Owner.lastSysCommandLocation = this.owner.Location;
             this.Owner.lastSysCommandSize     = this.owner.Size;
         }
     };
 }