示例#1
0
        private void OnAssociatedForm_StyleChanged(object sender, EventArgs e)
        {
            Form parentForm = RadTitleBar.FindParentForm((Control)this);

            if (parentForm == null)
            {
                return;
            }
            if (parentForm.MaximizeBox)
            {
                int num1 = (int)this.titleBarElement.MaximizeButton.SetDefaultValueOverride(RadElement.VisibilityProperty, (object)ElementVisibility.Visible);
            }
            else
            {
                int num2 = (int)this.titleBarElement.MaximizeButton.SetDefaultValueOverride(RadElement.VisibilityProperty, (object)ElementVisibility.Collapsed);
            }
            if (parentForm.MinimizeBox)
            {
                int num3 = (int)this.titleBarElement.MinimizeButton.SetDefaultValueOverride(RadElement.VisibilityProperty, (object)ElementVisibility.Visible);
            }
            else
            {
                int num4 = (int)this.titleBarElement.MinimizeButton.SetDefaultValueOverride(RadElement.VisibilityProperty, (object)ElementVisibility.Collapsed);
            }
            if (!parentForm.MinimizeBox && !parentForm.MaximizeBox && parentForm.HelpButton)
            {
                int num5 = (int)this.titleBarElement.HelpButton.SetDefaultValueOverride(RadElement.VisibilityProperty, (object)ElementVisibility.Visible);
            }
            else
            {
                int num6 = (int)this.titleBarElement.HelpButton.SetDefaultValueOverride(RadElement.VisibilityProperty, (object)ElementVisibility.Collapsed);
            }
        }
示例#2
0
        protected virtual void OnMaximizeRestore(object sender, EventArgs args)
        {
            Form parentForm = RadTitleBar.FindParentForm((Control)this);

            if (parentForm != null && !parentForm.MaximizeBox)
            {
                return;
            }
            if (this.MaximizeRestore != null)
            {
                this.MaximizeRestore(sender, args);
            }
            if (parentForm == null)
            {
                return;
            }
            if (parentForm.WindowState == FormWindowState.Maximized)
            {
                parentForm.WindowState = FormWindowState.Normal;
            }
            else
            {
                parentForm.WindowState = FormWindowState.Maximized;
            }
        }
示例#3
0
 protected virtual void OnClose(object sender, EventArgs args)
 {
     if (this.Close != null)
     {
         this.Close(sender, args);
     }
     RadTitleBar.FindParentForm((Control)this)?.Close();
 }
示例#4
0
 public virtual void HandleDoubleClickClick()
 {
     if (this.ElementTree != null)
     {
         Form form = RadTitleBar.FindParentForm(this.ElementTree.Control);
         if (form != null && form.MaximizeBox)
         {
             OnMaximizeRestore(this, EventArgs.Empty);
         }
     }
 }
示例#5
0
        protected virtual void OnHelpButtonClicked(object sender, EventArgs args)
        {
            Form parentForm = RadTitleBar.FindParentForm((Control)this);

            if (parentForm == null || !parentForm.IsHandleCreated)
            {
                return;
            }
            int num = 61824;

            Telerik.WinControls.NativeMethods.PostMessage(new HandleRef((object)this, parentForm.Handle), 274, new IntPtr(num), IntPtr.Zero);
        }
示例#6
0
        public virtual void HandleDoubleClickClick()
        {
            if (this.ElementTree == null)
            {
                return;
            }
            Form parentForm = RadTitleBar.FindParentForm(this.ElementTree.Control);

            if (parentForm == null || !parentForm.MaximizeBox)
            {
                return;
            }
            this.OnMaximizeRestore((object)this, EventArgs.Empty);
        }
示例#7
0
        private void menu_Popup(object sender, EventArgs e)
        {
            Form parentForm = RadTitleBar.FindParentForm((Control)this);

            if (parentForm == null)
            {
                return;
            }
            bool flag = parentForm.WindowState == FormWindowState.Maximized;

            this.menu.MenuItems[0].Enabled = flag;
            this.menu.MenuItems[1].Enabled = !flag;
            this.menu.MenuItems[2].Enabled = !flag;
            this.menu.MenuItems[4].Enabled = !flag;
        }
示例#8
0
        protected void OnClose(object sender, EventArgs args)
        {
            if (!this.canManageOwnerForm)
            {
                return;
            }
            if (Close != null)
            {
                Close(sender, args);
            }
            RadTitleBar titleBar = this.ElementTree.Control as RadTitleBar;

            if (titleBar != null)
            {
                titleBar.CallOnClose(sender, args);
            }
        }
示例#9
0
 protected override void OnParentChanged(EventArgs e)
 {
     if (this.associatedForm != null)
     {
         this.associatedForm.TextChanged  -= new EventHandler(this.OnParentForm_TextChanged);
         this.associatedForm.StyleChanged -= new EventHandler(this.OnAssociatedForm_StyleChanged);
     }
     base.OnParentChanged(e);
     this.associatedForm = RadTitleBar.FindParentForm((Control)this);
     if (this.associatedForm == null)
     {
         return;
     }
     this.associatedForm.TextChanged  += new EventHandler(this.OnParentForm_TextChanged);
     this.associatedForm.StyleChanged += new EventHandler(this.OnAssociatedForm_StyleChanged);
     this.titleBarElement.Text         = this.associatedForm.Text;
 }
示例#10
0
        public override ControlStyleBuilderInfoList GetThemeDesignedControls(Control previewSurface)
        {
            RadTitleBar titleBarPreview = new RadTitleBar();

            titleBarPreview.Text   = "RadTitleBar";
            titleBarPreview.Bounds = new Rectangle(30, 30, 300, 26);

            RadTitleBar titleBarStructure = new RadTitleBar();

            titleBarStructure.Text = "RadTitleBar";

            ControlStyleBuilderInfo     designed = new ControlStyleBuilderInfo(titleBarPreview, titleBarStructure.RootElement);
            ControlStyleBuilderInfoList res      = new ControlStyleBuilderInfoList();

            res.Add(designed);

            return(res);
        }
示例#11
0
        protected virtual void OnMinimize(object sender, EventArgs args)
        {
            Form parentForm = RadTitleBar.FindParentForm((Control)this);

            if (parentForm != null && !parentForm.MinimizeBox)
            {
                return;
            }
            if (this.Minimize != null)
            {
                this.Minimize(sender, args);
            }
            if (parentForm == null)
            {
                return;
            }
            parentForm.WindowState = FormWindowState.Minimized;
        }
示例#12
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (this.IsDesignMode || this.DesignMode)
            {
                return;
            }
            Form form = (Form)null;

            if (this.ElementTree != null)
            {
                form = RadTitleBar.FindParentForm(this.ElementTree.Control);
            }
            if (form == null)
            {
                return;
            }
            this.HandleMouseMove(e, form);
        }
 public RadTitleBarAccessibleObject(RadTitleBar owner)
     : base((Control)owner)
 {
     this.owner = owner;
 }