Ejemplo n.º 1
0
        private void itmEditButton_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (_editButton != null)
            {
                HotButtonSettingForm frmHotButton = null;

                try
                {
                    frmHotButton          = new HotButtonSettingForm();
                    frmHotButton.SignList = SignList;
                    frmHotButton.Load(_editButton);

                    if (frmHotButton.ShowDialog() == DialogResult.OK)
                    {
                        hotButtonPanelControl.UpdateHotButtonData(_editButton, frmHotButton.HotKeyButton, frmHotButton.LiveSigns);
                    }
                }
                finally
                {
                    if (frmHotButton != null)
                    {
                        frmHotButton.Dispose();
                    }
                    ClosePoputMenu();
                }
            }
        }
Ejemplo n.º 2
0
        private void itmAddButton_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            HotButtonSettingForm frmHotButton = null;

            try
            {
                frmHotButton          = new HotButtonSettingForm();
                frmHotButton.SignList = SignList;

                if (frmHotButton.ShowDialog() == DialogResult.OK)
                {
                    Control hotkey = frmHotButton.HotKeyButton;
                    hotkey.Dock = DockStyle.Fill;

                    if (typeof(SmallButtonControl) == hotkey.GetType())
                    {
                        SmallButtonControl btn = hotkey as SmallButtonControl;
                        btn.Sign = frmHotButton.LiveSigns;

                        PanelControl panel = hotButtonPanelControl.NewButtonContainer(HotButtonPanelControl.ButtonContainerType.Small);
                        panel.Controls.Add(btn);
                        hotButtonPanelControl.AddButtonContainer(panel);
                    }
                    else if (typeof(LargeButtonControl) == hotkey.GetType())
                    {
                        LargeButtonControl btn = hotkey as LargeButtonControl;
                        btn.Sign = frmHotButton.LiveSigns;

                        PanelControl panel = hotButtonPanelControl.NewButtonContainer(HotButtonPanelControl.ButtonContainerType.Large);
                        panel.Controls.Add(hotkey);
                        hotButtonPanelControl.AddButtonContainer(panel);
                    }
                }
            }
            finally
            {
                if (frmHotButton != null)
                {
                    frmHotButton.Dispose();
                }
                ClosePoputMenu();
            }
        }