Beispiel #1
0
        /// <summary>
        /// 关闭窗体时,修改网格为不可编辑状态
        /// </summary>
        /// <param name="sender">触发事件的控件</param>
        /// <param name="e">事件所需参数</param>
        private void FrmUpdateBed_VisibleChanged(object sender, EventArgs e)
        {
            btnAdd.Dispose();
            btnDel.Dispose();
            btnAdd = new ButtonItem();
            btnDel = new ButtonItem();
            // 新增费用
            btnAdd.Name   = "btnAdd";
            btnAdd.Text   = "新增费用(&N)";
            btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
            // 删除费用
            btnDel.Name   = "btnDel";
            btnDel.Text   = "删除费用(&D)";
            btnDel.Click += new System.EventHandler(this.btnDel_Click);

            if (bar1.Items.Count > 0)
            {
                bar1.Items.Clear();
            }

            bar1.Items.AddRange(new BaseItem[]
            {
                btnAdd,
                btnDel
            });

            if (mIsAddBed)
            {
                txtWardNo.Focus();
            }
            else
            {
                btnAdd.Focus();
            }

            grdBedFreeList.EndEdit();
        }
Beispiel #2
0
        private void DeleteOwnMenuItems()
        {
            if (!(Designer is DesignerControl))
            {
                return;
            }

            DesignerMenu menu = (Designer as DesignerControl).MainMenu;

            menu.miView.PopupOpen   -= new DotNetBarManager.PopupOpenEventHandler(miView_PopupOpen);
            menu.miReport.PopupOpen -= new DotNetBarManager.PopupOpenEventHandler(miReport_PopupOpen);

            if (miViewGrid != null)
            {
                menu.miView.SubItems.Remove(miViewGrid);
                menu.miView.SubItems.Remove(miViewGuides);
                menu.miView.SubItems.Remove(miViewAutoGuides);
                menu.miView.SubItems.Remove(miViewDeleteHGuides);
                menu.miView.SubItems.Remove(miViewDeleteVGuides);
                menu.miView.SubItems.Remove(miViewUnits);

                miViewGrid.Dispose();
                miViewGuides.Dispose();
                miViewAutoGuides.Dispose();
                miViewDeleteHGuides.Dispose();
                miViewDeleteVGuides.Dispose();
                miViewUnits.Dispose();

                menu.miReport.SubItems.Remove(miReportBands);
                menu.miReport.SubItems.Remove(miReportStyles);
                menu.miReport.SubItems.Remove(miReportGroupExpert);
                menu.miReport.SubItems.Remove(miReportTitle);
                menu.miReport.SubItems.Remove(miPageHeader);
                menu.miReport.SubItems.Remove(miColumnHeader);
                menu.miReport.SubItems.Remove(miColumnFooter);
                menu.miReport.SubItems.Remove(miReportSummary);
                menu.miReport.SubItems.Remove(miPageFooter);
                menu.miReport.SubItems.Remove(miOverlay);

                miReportBands.Dispose();
                miReportStyles.Dispose();
                miReportGroupExpert.Dispose();
                miReportTitle.Dispose();
                miPageHeader.Dispose();
                miColumnHeader.Dispose();
                miColumnFooter.Dispose();
                miReportSummary.Dispose();
                miPageFooter.Dispose();
                miOverlay.Dispose();
            }

            miViewGrid          = null;
            miViewGuides        = null;
            miViewAutoGuides    = null;
            miViewDeleteHGuides = null;
            miViewDeleteVGuides = null;
            miViewUnits         = null;

            miReportBands       = null;
            miReportStyles      = null;
            miReportGroupExpert = null;
            miReportTitle       = null;
            miPageHeader        = null;
            miColumnHeader      = null;
            miColumnFooter      = null;
            miReportSummary     = null;
            miPageFooter        = null;
            miOverlay           = null;
        }
Beispiel #3
0
        /// <summary>
        /// Displays popup customize context menu for given customization object.
        /// </summary>
        /// <param name="o">Object that should be customized, usually an instance of BaseItem.</param>
        /// <param name="isTabStrip">Indicates whether customize menu is displayed over metro tab strip</param>
        internal virtual void ShowCustomizeContextMenu(object o, bool isTabStrip)
        {
            if (o == null || !_UseCustomizeDialog)
                return;

            _TabStrip.ClosePopup(SYS_CUSTOMIZE_POPUP_MENU);

            ButtonItem cont = new ButtonItem(SYS_CUSTOMIZE_POPUP_MENU);
            cont.Style = eDotNetBarStyle.StyleManagerControlled;
            cont.SetOwner(_TabStrip);

            if ((CanCustomizeItem(o as BaseItem)) && !_UseExternalCustomization)
            {
                if (o is BaseItem && this.QuickToolbarItems.Contains((BaseItem)o))
                {

                    ButtonItem b = new ButtonItem(SysQatRemoveFromItemName);
                    b.Text = this.SystemText.QatRemoveItemText;
                    b.Click += new System.EventHandler(CustomizeRemoveFromQuickAccessToolbar);
                    b.Tag = o;
                    cont.SubItems.Add(b);
                }
                else
                {
                    BaseItem itemToCustomize = o as BaseItem;

                    ButtonItem b = new ButtonItem(SysQatAddToItemName);
                    b.Text = this.SystemText.QatAddItemText;
                    b.Click += new System.EventHandler(CustomizeAddToQuickAccessToolbar);
                    b.Tag = o;
                    cont.SubItems.Add(b);

                    if (itemToCustomize != null && this.QuickToolbarItems.Contains(itemToCustomize.Name))
                        b.Enabled = false;

                    if (itemToCustomize != null && BaseItem.IsOnPopup(itemToCustomize) && itemToCustomize.Parent != null)
                    {
                        Control c = itemToCustomize.ContainerControl as Control;
                        if (c != null) c.VisibleChanged += new EventHandler(CustomizePopupItemParentVisibleChange);
                    }
                }
            }

            if (_UseCustomizeDialog)
            {
                ButtonItem b = new ButtonItem(SysQatCustomizeItemName);
                b.Text = this.SystemText.QatCustomizeText;
                b.BeginGroup = true;
                b.Click += new EventHandler(CustomizeQuickAccessToolbarDialog);
                cont.SubItems.Add(b);
            }

            RibbonCustomizeEventArgs e = new RibbonCustomizeEventArgs(o, cont);
            OnBeforeCustomizeMenuPopup(e);
            if (e.Cancel)
            {
                cont.Dispose();
                return;
            }

            ((IOwnerMenuSupport)_TabStrip).RegisterPopup(cont);
            cont.Popup(Control.MousePosition);
        }