コード例 #1
0
 /// <summary>
 /// Creates a new instance of the MultiSourceTreeView.
 /// </summary>
 public MultiSourceTreeView()
 {
     MoveNodesOnDragDrop = false;
     BeforeExpand       += MultiSourceTreeView_BeforeExpand;
     AfterSelect        += MultiSourceTreeView_AfterSelect;
     MouseDown          += MultiSourceTreeView_MouseDown;
     SortMode            = SortMode.NodeSource;
     Paint        += MultiSourceTreeView_Paint;
     SortMode      = SortMode.Alphabetical;
     DragOverNode += MultiSourceTreeView_DragOverNode;
     NodeDropped  += MultiSourceTreeView_NodeDropped;
     MouseEnter   += MultiSourceTreeView_MouseEnter;
     MouseLeave   += MultiSourceTreeView_MouseLeave;
     MouseMove    += new MouseEventHandler(MultiSourceTreeView_MouseMove);
     popupMenu     = new ButtonItem();
     popupMenu.AutoExpandOnClick = true;
     cmbPopupMenu      = new ContextMenuBar();
     cmbPopupMenu.Name = "PopupMenuBar";
     cmbPopupMenu.BeginInit();
     cmbPopupMenu.Items.Add(popupMenu);
     cmbPopupMenu.Style = eDotNetBarStyle.Office2007;
     Controls.Add(cmbPopupMenu);
     cmbPopupMenu.EndInit();
     mouseIdle.SynchronizingObject = this;
     mouseIdle.Elapsed            += new System.Timers.ElapsedEventHandler(mouseIdle_Elapsed);
     tooltip.CheckTooltipPosition  = false;
     AfterLabelEdit  += new NodeLabelEditEventHandler(MultiSourceTreeView_AfterLabelEdit);
     BeforeLabelEdit += new NodeLabelEditEventHandler(MultiSourceTreeView_BeforeLabelEdit);
     NodeMouseClick  += new TreeNodeMouseClickEventHandler(MultiSourceTreeView_NodeMouseClick);
     GotFocus        += new EventHandler(MultiSourceTreeView_GotFocus);
 }
コード例 #2
0
 private void Hierarchy_MouseDown(object sender, MouseEventArgs e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         ContextMenuBar.Show(sender as Control, e.X, e.Y);
     }
 }
コード例 #3
0
ファイル: ReportTreeWindow.cs プロジェクト: zixing131/LAEACC
 private void FTree_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         FTree.SelectedNode = FTree.GetNodeAt(e.Location);
         if (FTree.SelectedNode != null)
         {
             ContextMenuBar menu = (FTree.SelectedNode.Tag as Base).GetContextMenu();
             if (menu != null)
             {
                 PopupItem item = menu.Items[0] as PopupItem;
                 item.PopupMenu(FTree.PointToScreen(e.Location));
             }
         }
     }
 }
コード例 #4
0
ファイル: BandStructure.cs プロジェクト: zixing131/LAEACC
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            if (FPageDesigner.Locked)
            {
                return;
            }

            if (e.Button == MouseButtons.Right && Designer.SelectedObjects.Count > 0 &&
                Designer.SelectedObjects[0] is BandBase)
            {
                ContextMenuBar menu = Designer.SelectedObjects[0].GetContextMenu();
                if (menu != null)
                {
                    PopupItem item = menu.Items[0] as PopupItem;
                    item.PopupMenu(PointToScreen(e.Location));
                }
            }
        }
コード例 #5
0
ファイル: Language.cs プロジェクト: hklang/JJStart
        public void SetControlsText(Control ctrl)
        {
            SetControlText(ctrl);

            foreach (Control c in ctrl.Controls)
            {
                if (c is TextBoxDropDown)
                {
                    TextBoxDropDown tbdd = c as TextBoxDropDown;
                    foreach (BaseItem bi in tbdd.DropDownItems)
                    {
                        SetBaseItemText(bi);
                    }
                }
                else if (c is ContextMenuBar)
                {
                    ContextMenuBar cmb = c as ContextMenuBar;
                    foreach (BaseItem bi in cmb.Items)
                    {
                        SetBaseItemText(bi);
                    }
                }
                else if (c is MetroStatusBar)
                {
                    MetroStatusBar msb = c as MetroStatusBar;
                    foreach (BaseItem bi in msb.Items)
                    {
                        SetBaseItemText(bi);
                    }
                }
                else
                {
                    SetControlText(c);
                }

                if (c.HasChildren)
                {
                    SetControlsText(c);
                }
            }
        }
コード例 #6
0
        private void CreateToolbarMenu()
        {
            mnuContext     = new ContextMenuBar();
            mnuContextRoot = new ButtonItem();
            mnuContext.Items.Add(mnuContextRoot);

            foreach (IDesignerPlugin plugin in Plugins)
            {
                if (plugin is ToolbarBase)
                {
                    ButtonItem menuItem = new ButtonItem();
                    menuItem.Text   = (plugin as ToolbarBase).Text;
                    menuItem.Tag    = plugin;
                    menuItem.Click += new EventHandler(toolbar_Click);
                    mnuContextRoot.SubItems.Add(menuItem);
                }
            }

            mnuContextRoot.PopupOpen += new DotNetBarManager.PopupOpenEventHandler(mnuContextRoot_PopupOpen);
            mnuContext.SetContextMenuEx(DotNetBarManager.ToolbarTopDockSite, mnuContextRoot);
        }
コード例 #7
0
        public StudentDescription()
        {
            InitializeComponent();

            #region InitializeComponent Manual
            this.StatusMenuBar = new DevComponents.DotNetBar.ContextMenuBar();
            this.Status1       = new DevComponents.DotNetBar.ButtonItem();
            this.Status2       = new DevComponents.DotNetBar.ButtonItem();
            this.Status3       = new DevComponents.DotNetBar.ButtonItem();
            this.Status4       = new DevComponents.DotNetBar.ButtonItem();
            this.Status5       = new DevComponents.DotNetBar.ButtonItem();
            this.Status6       = new DevComponents.DotNetBar.ButtonItem();
            this.StatusPanel   = new DevComponents.DotNetBar.PanelEx();
            ((System.ComponentModel.ISupportInitialize)(this.StatusMenuBar)).BeginInit();
            this.SuspendLayout();
            //
            // contextMenuBar1
            //
            this.StatusMenuBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
                this.Status1
            });
            this.StatusMenuBar.Location = new System.Drawing.Point(36, 12);
            this.StatusMenuBar.Size     = new System.Drawing.Size(123, 25);
            this.StatusMenuBar.Stretch  = true;
            this.StatusMenuBar.Style    = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
            this.StatusMenuBar.TabIndex = 184;
            this.StatusMenuBar.TabStop  = false;
            this.StatusMenuBar.Text     = "StatusMenuBar";
            //
            // buttonItem1
            //
            this.Status1.AutoExpandOnClick      = true;
            this.Status1.ImageListSizeSelection = DevComponents.DotNetBar.eButtonImageListSelection.NotSet;
            this.Status1.ImagePaddingHorizontal = 8;
            this.Status1.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] {
                this.Status2,
                this.Status3,
                this.Status4,
                this.Status5,
                this.Status6
            });
            this.Status1.Text = "statusMenu";
            //
            // buttonItem2
            //
            this.Status2.AutoCheckOnClick       = true;
            this.Status2.ImageListSizeSelection = DevComponents.DotNetBar.eButtonImageListSelection.NotSet;
            this.Status2.ImagePaddingHorizontal = 8;
            this.Status2.OptionGroup            = "status";
            this.Status2.Text            = "一般";
            this.Status2.CheckedChanged += new System.EventHandler(this.buttonItem2_CheckedChanged);
            //
            // buttonItem3
            //
            this.Status3.AutoCheckOnClick       = true;
            this.Status3.ImageListSizeSelection = DevComponents.DotNetBar.eButtonImageListSelection.NotSet;
            this.Status3.ImagePaddingHorizontal = 8;
            this.Status3.OptionGroup            = "status";
            this.Status3.Text            = "畢業或離校";
            this.Status3.CheckedChanged += new System.EventHandler(this.buttonItem2_CheckedChanged);
            //
            // buttonItem4
            //
            this.Status4.AutoCheckOnClick       = true;
            this.Status4.ImageListSizeSelection = DevComponents.DotNetBar.eButtonImageListSelection.NotSet;
            this.Status4.ImagePaddingHorizontal = 8;
            this.Status4.OptionGroup            = "status";
            this.Status4.Text            = "休學";
            this.Status4.CheckedChanged += new System.EventHandler(this.buttonItem2_CheckedChanged);
            //
            // buttonItem5
            //
            this.Status5.AutoCheckOnClick       = true;
            this.Status5.ImageListSizeSelection = DevComponents.DotNetBar.eButtonImageListSelection.NotSet;
            this.Status5.ImagePaddingHorizontal = 8;
            this.Status5.OptionGroup            = "status";
            this.Status5.Text            = "延修";
            this.Status5.Visible         = false;
            this.Status5.CheckedChanged += new System.EventHandler(this.buttonItem2_CheckedChanged);
            //
            // buttonItem6
            //
            this.Status6.AutoCheckOnClick       = true;
            this.Status6.ImageListSizeSelection = DevComponents.DotNetBar.eButtonImageListSelection.NotSet;
            this.Status6.ImagePaddingHorizontal = 8;
            this.Status6.OptionGroup            = "status";
            this.Status6.Text            = "輟學";
            this.Status6.CheckedChanged += new System.EventHandler(this.buttonItem2_CheckedChanged);



            //
            // panelEx1
            //
            this.StatusPanel.Anchor                            = System.Windows.Forms.AnchorStyles.Left;
            this.StatusPanel.CanvasColor                       = System.Drawing.SystemColors.Control;
            this.StatusPanel.ColorSchemeStyle                  = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;
            this.StatusPanel.Location                          = new System.Drawing.Point(66, 3);
            this.StatusPanel.Margin                            = new System.Windows.Forms.Padding(0);
            this.StatusPanel.Size                              = new System.Drawing.Size(95, 20);
            this.StatusPanel.Style.Alignment                   = System.Drawing.StringAlignment.Center;
            this.StatusPanel.Style.BackColor1.Color            = System.Drawing.Color.LightBlue;
            this.StatusPanel.Style.BackColor2.ColorSchemePart  = DevComponents.DotNetBar.eColorSchemePart.BarBackground2;
            this.StatusPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
            this.StatusPanel.Style.BorderSide                  = DevComponents.DotNetBar.eBorderSide.None;
            this.StatusPanel.Style.BorderWidth                 = 0;
            this.StatusPanel.Style.CornerType                  = DevComponents.DotNetBar.eCornerType.Rounded;
            this.StatusPanel.Style.ForeColor.ColorSchemePart   = DevComponents.DotNetBar.eColorSchemePart.ItemText;
            this.StatusPanel.Style.GradientAngle               = 90;
            this.StatusPanel.Style.TextTrimming                = System.Drawing.StringTrimming.Word;
            this.StatusPanel.TabIndex                          = 184;
            this.StatusPanel.Text                              = "一般";
            this.StatusPanel.Click                            += new System.EventHandler(this.StatusPanel_Click);
            //
            // DescriptionLabel
            //
            DescriptionLabel          = new LabelX();
            DescriptionLabel.Text     = string.Empty;
            DescriptionLabel.Dock     = DockStyle.Left;
            DescriptionLabel.AutoSize = true;
            DescriptionLabel.Font     = new Font(Font.FontFamily, 13);
            //
            // StudentDescription
            //
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
            this.AutoSize      = true;
            this.Controls.Add(this.StatusMenuBar);
            this.Name = "StudentDescription";
            this.Size = new System.Drawing.Size(375, 55);
            ((System.ComponentModel.ISupportInitialize)(this.StatusMenuBar)).EndInit();
            this.ResumeLayout(false);

            DescriptionPanel.Controls.Add(DescriptionLabel);
            DescriptionPanel.Controls.Add(StatusPanel);
            #endregion

            Student.Instance.ItemUpdated += delegate(object sender, ItemUpdatedEventArgs e)
            {
                if (e.PrimaryKeys.Contains(PrimaryKey))
                {
                    OnPrimaryKeyChanged(e);
                }
            };
        }
コード例 #8
0
        private void CreateContextMenuBar()
        {
            if (_ContextMenuBar != null || this.DesignMode) return;
            _ContextMenuBar = new ContextMenuBar();
            _ContextMenuBar.Style = eDotNetBarStyle.StyleManagerControlled;
            this.Controls.Add(_ContextMenuBar);

            ButtonItem sysMenu = new ButtonItem(SysMenu);
            _ContextMenuBar.Items.Add(sysMenu);
            ButtonItem sysItem = new ButtonItem(SysMenuRestore, GetLocalizedString(LocalizationKeys.FormSystemMenuRestore));
            sysItem.Image = BarFunctions.LoadBitmap("SystemImages.WinRestore.png");
            sysItem.Click += new EventHandler(SysItemClick);
            sysMenu.SubItems.Add(sysItem);
            sysItem = new ButtonItem(SysMenuMove, GetLocalizedString(LocalizationKeys.FormSystemMenuMove));
            sysItem.Click += new EventHandler(SysItemClick);
            sysMenu.SubItems.Add(sysItem);
            sysItem = new ButtonItem(SysMenuSize, GetLocalizedString(LocalizationKeys.FormSystemMenuSize));
            sysItem.Click += new EventHandler(SysItemClick);
            sysMenu.SubItems.Add(sysItem);
            sysItem = new ButtonItem(SysMenuMinimize, GetLocalizedString(LocalizationKeys.FormSystemMenuMinimize));
            sysItem.Click += new EventHandler(SysItemClick);
            sysItem.Image = BarFunctions.LoadBitmap("SystemImages.WinMin.png");
            sysMenu.SubItems.Add(sysItem);
            sysItem = new ButtonItem(SysMenuMaximize, GetLocalizedString(LocalizationKeys.FormSystemMenuMaximize));
            sysItem.Click += new EventHandler(SysItemClick);
            sysItem.Image = BarFunctions.LoadBitmap("SystemImages.WinMax.png");
            sysMenu.SubItems.Add(sysItem);
            sysItem = new ButtonItem(SysMenuClose, GetLocalizedString(LocalizationKeys.FormSystemMenuClose));
            sysItem.Click += new EventHandler(SysItemClick);
            sysItem.Image = BarFunctions.LoadBitmap("SystemImages.WinClose.png");
            sysItem.BeginGroup = true;
            sysItem.FontBold = true;
            sysItem.HotFontBold = true;
            sysItem.Shortcuts.Add(eShortcut.CtrlF4);
            sysMenu.SubItems.Add(sysItem);
        }
コード例 #9
0
ファイル: DictionaryWindow.cs プロジェクト: zixing131/LAEACC
        /// <summary>
        /// Initializes a new instance of the <see cref="DictionaryWindow"/> class with default settings.
        /// </summary>
        /// <param name="designer">The report designer.</param>
        public DictionaryWindow(Designer designer) : base(designer)
        {
            Name  = "DictionaryWindow";
            Image = Res.GetImage(72);

            FToolbar              = new Bar();
            FToolbar.Dock         = DockStyle.Top;
            FToolbar.Font         = DrawUtils.DefaultFont;
            FToolbar.RoundCorners = false;

            btnActions = new ButtonItem();
            btnActions.AutoExpandOnClick = true;
            btnEdit   = AddButton(Res.GetImage(68), miEdit_Click);
            btnDelete = AddButton(Res.GetImage(51), miDelete_Click);
            btnView   = AddButton(Res.GetImage(54), miView_Click);
            FToolbar.Items.AddRange(new ButtonItem[] { btnActions, btnEdit, btnDelete, btnView });

            miNew                   = AddButton(Res.GetImage(0), miNew_Click);
            miOpen                  = AddButton(Res.GetImage(1), miOpen_Click);
            miMerge                 = AddButton(null, miMerge_Click);
            miSave                  = AddButton(Res.GetImage(2), miSave_Click);
            miChooseData            = AddButton(null, Designer.cmdChooseData.Invoke);
            miChooseData.BeginGroup = true;

            miNewDataSource            = AddButton(Res.GetImage(137), Designer.cmdAddData.Invoke);
            miNewDataSource.BeginGroup = true;
            miNewRelation         = AddButton(Res.GetImage(139), miNewRelation_Click);
            miNewCalculatedColumn = AddButton(Res.GetImage(55), miNewCalculatedColumn_Click);
            miNewParameter        = AddButton(Res.GetImage(56), miNewParameter_Click);
            miNewTotal            = AddButton(Res.GetImage(65), miNewTotal_Click);
            btnActions.SubItems.AddRange(new ButtonItem[] {
                miNew, miOpen, miMerge, miSave, miChooseData,
                miNewDataSource, miNewRelation, miNewCalculatedColumn, miNewParameter, miNewTotal
            });
            btnActions.PopupOpen += btnActions_PopupOpen;


            mnuContext     = new ContextMenuBar();
            mnuContextRoot = new ButtonItem();
            mnuContext.Items.Add(mnuContextRoot);
            miRename = AddButton(null, miRename_Click);
            miRename.Shortcuts.Add(eShortcut.F2);
            miEdit        = AddButton(Res.GetImage(68), miEdit_Click);
            miDelete      = AddButton(Res.GetImage(51), miDelete_Click);
            miDeleteAlias = AddButton(null, miDeleteAlias_Click);
            miView        = AddButton(Res.GetImage(54), miView_Click);
            mnuContextRoot.SubItems.AddRange(new ButtonItem[] {
                miRename, miEdit, miDelete, miDeleteAlias, miView
            });
            mnuContextRoot.PopupOpen += mnuContextRoot_PopupOpen;

            FTree                  = new TreeView();
            FTree.Dock             = DockStyle.Fill;
            FTree.BorderStyle      = BorderStyle.None;
            FTree.ImageList        = Res.GetImages();
            FTree.LabelEdit        = true;
            FTree.HideSelection    = false;
            FTree.AllowDrop        = true;
            FTree.MouseDown       += FTree_MouseDown;
            FTree.BeforeLabelEdit += FTree_BeforeLabelEdit;
            FTree.AfterLabelEdit  += FTree_AfterLabelEdit;
            FTree.KeyDown         += FTree_KeyDown;
            FTree.AfterSelect     += FTree_AfterSelect;
            FTree.DoubleClick     += miEdit_Click;
            FTree.ItemDrag        += FTree_ItemDrag;
            FTree.DragOver        += FTree_DragOver;
            FTree.DragDrop        += FTree_DragDrop;
            mnuContext.SetContextMenuEx(FTree, mnuContextRoot);

            FSplitter         = new Splitter();
            FSplitter.Dock    = DockStyle.Bottom;
            FSplitter.Visible = false;

            lblDescription         = new DescriptionControl();
            lblDescription.Dock    = DockStyle.Bottom;
            lblDescription.Height  = 70;
            lblDescription.Visible = false;

            ParentControl.Controls.AddRange(new Control[] { FTree, FSplitter, lblDescription, FToolbar });
            FExpandedNodes = new List <string>();
            Localize();
        }
コード例 #10
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            Control tabControl = this.GetType().BaseType.GetField("tabControl",
                                                                  BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic | BindingFlags.ExactBinding)
                                 .GetValue(this) as Control;

            barMain    = new ContextMenuBar();
            itemRoot   = new ButtonItem("Root");
            item1      = new ComboBoxItem("item1");
            item1.Text = "显示比例";
            ButtonItem btn1 = new ButtonItem("b1", "标准");
            ButtonItem btn2 = new ButtonItem("b2", "适应");
            ButtonItem btn3 = new ButtonItem("b3", "页面宽度");

            item1.Items.AddRange(new BaseItem[] { btn1, btn2, btn3 });
            item1.ComboWidth    = 80;
            item1.DropDownStyle = ComboBoxStyle.DropDownList;
            item1.SelectedIndex = 0;
            item1.Click        += (obj, args) =>
            {
                switch (item1.SelectedIndex)
                {
                case 0: this.Zoom = 1f; break;

                case 1: this.ZoomWholePage(); break;

                case 2: this.ZoomPageWidth(); break;

                default: break;
                }
            };
            item2      = new ComboBoxItem("item2");
            item2.Text = "页面位置";
            ButtonItem btn4 = new ButtonItem("b4", "前一页");
            ButtonItem btn5 = new ButtonItem("b5", "后一页");
            ButtonItem btn6 = new ButtonItem("b7", "首页");
            ButtonItem btn7 = new ButtonItem("b8", "尾页");

            item2.Items.AddRange(new BaseItem[] { btn4, btn5, btn6, btn7 });
            item2.ComboWidth    = 80;
            item2.DropDownStyle = ComboBoxStyle.DropDownList;
            item2.SelectedIndex = 0;
            item2.Click        += (obj, args) =>
            {
                switch (item2.SelectedIndex)
                {
                case 0: this.Prior(); break;

                case 1: this.Next(); break;

                case 2: this.First(); break;

                case 3: this.Last(); break;

                default: break;
                }
            };
            item3            = new ButtonItem("item3");
            item3.BeginGroup = true;
            item3.Text       = "打印";
            item3.Image      = Res.GetImage(195);
            item3.Click     += (obj, args) =>
            {
                this.Print();
            };
            item4        = new ButtonItem("item4");
            item4.Text   = "打印当前页";
            item4.Click += (obj, args) =>
            {
                this.Report.PrintSettings.PageNumbers = this.PageNo.ToString();
                this.Report.PrintSettings.PageRange   = FastReport.PageRange.PageNumbers;
                this.Report.Print();
                this.Report.PrintSettings.PageNumbers = "";
                this.Report.PrintSettings.PageRange   = FastReport.PageRange.All;
            };
            item5        = new TextBoxItem("item5");
            item5.Text   = "页码范围";
            item5.Click += (obj, args) =>
            {
                try
                {
                    this.Report.PrintSettings.PageNumbers = item5.ControlText;
                    this.Report.PrintSettings.PageRange   = FastReport.PageRange.PageNumbers;
                    this.Report.Print();
                    this.Report.PrintSettings.PageNumbers = "";
                    this.Report.PrintSettings.PageRange   = FastReport.PageRange.All;
                }
                catch
                {
                    MessageBoxEx.Show("输入的页码范围无效,请核对后重试", "提示");
                }
            };
            itemRoot.SubItems.AddRange(new BaseItem[] { item1, item2, item3, item4, item5 });
            barMain.SetContextMenuEx(tabControl, itemRoot);
            this.Controls.Add(barMain);
            tabControl.Controls[0].MouseDown += (obj, args) =>
            {
                itemRoot.ClosePopup();
            };
            //tabControl.Controls[0].LostFocus += (obj, args) =>
            //{
            //    itemRoot.ClosePopup();
            //};
        }
コード例 #11
0
        private const string StatusPermission = "Student.Status0001"; //變更學生狀態。

        public StudentChangeStatusStudentBar()
        {
            InitializeComponent();

            #region InitializeComponent Manual
            this.StatusMenuBar = new DevComponents.DotNetBar.ContextMenuBar();

            StatusList = new List <ButtonItem>();

            //依據設定動態建立功能表。
            foreach (StatusItem each in  Tagging.Program.StatusList)
            {
                ButtonItem item = new ButtonItem();

                item.AutoCheckOnClick       = true;
                item.ImageListSizeSelection = DevComponents.DotNetBar.eButtonImageListSelection.NotSet;
                item.ImagePaddingHorizontal = 8;
                item.OptionGroup            = "status";
                item.Text = each.Text;
                item.Tag  = each;
                if (Permissions.變更學生狀態權限)
                {
                    item.CheckedChanged += new System.EventHandler(this.StatusMenu_CheckedChanged);
                    item.Enabled         = true;
                }
                else
                {
                    item.Enabled = false;
                }

                StatusList.Add(item);
            }

            this.StatusContainer = new DevComponents.DotNetBar.ButtonItem();
            this.StatusPanel     = new DevComponents.DotNetBar.PanelEx();
            ((System.ComponentModel.ISupportInitialize)(this.StatusMenuBar)).BeginInit();
            this.SuspendLayout();
            //
            // contextMenuBar1
            //
            this.StatusMenuBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
                this.StatusContainer
            });
            this.StatusMenuBar.Location = new System.Drawing.Point(36, 12);
            this.StatusMenuBar.Size     = new System.Drawing.Size(123, 25);
            this.StatusMenuBar.Stretch  = true;
            this.StatusMenuBar.TabIndex = 184;
            this.StatusMenuBar.TabStop  = false;
            this.StatusMenuBar.Text     = "StatusMenuBar";
            //
            // buttonItem1
            //
            this.StatusContainer.AutoExpandOnClick      = true;
            this.StatusContainer.ImageListSizeSelection = DevComponents.DotNetBar.eButtonImageListSelection.NotSet;
            this.StatusContainer.ImagePaddingHorizontal = 8;
            this.StatusContainer.SubItems.AddRange(StatusList.ToArray());
            this.StatusContainer.Text       = "statusMenu";
            this.StatusContainer.PopupOpen += new DotNetBarManager.PopupOpenEventHandler(StatusContainer_PopupOpen);
            //
            // panelEx1
            //
            this.StatusPanel.Anchor                            = System.Windows.Forms.AnchorStyles.Left;
            this.StatusPanel.CanvasColor                       = System.Drawing.SystemColors.Control;
            this.StatusPanel.Location                          = new System.Drawing.Point(66, 3);
            this.StatusPanel.Margin                            = new System.Windows.Forms.Padding(0);
            this.StatusPanel.Size                              = new System.Drawing.Size(95, 20);
            this.StatusPanel.Style.Alignment                   = System.Drawing.StringAlignment.Center;
            this.StatusPanel.Style.BackColor1.Color            = System.Drawing.Color.LightBlue;
            this.StatusPanel.Style.BackColor2.ColorSchemePart  = DevComponents.DotNetBar.eColorSchemePart.BarBackground2;
            this.StatusPanel.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;
            this.StatusPanel.Style.BorderSide                  = DevComponents.DotNetBar.eBorderSide.None;
            this.StatusPanel.Style.BorderWidth                 = 0;
            this.StatusPanel.Style.CornerType                  = DevComponents.DotNetBar.eCornerType.Rounded;
            this.StatusPanel.Style.ForeColor.ColorSchemePart   = DevComponents.DotNetBar.eColorSchemePart.ItemText;
            this.StatusPanel.Style.GradientAngle               = 90;
            this.StatusPanel.Style.TextTrimming                = System.Drawing.StringTrimming.Word;
            this.StatusPanel.TabIndex                          = 184;
            this.StatusPanel.Text                              = "一般";
            this.StatusPanel.Click                            += new System.EventHandler(this.StatusPanel_Click);
            //
            // DescriptionLabel
            //
            DescriptionLabel          = new LabelX();
            DescriptionLabel.Text     = string.Empty;
            DescriptionLabel.Dock     = DockStyle.Left;
            DescriptionLabel.AutoSize = true;
            DescriptionLabel.Font     = new Font(Font.FontFamily, 13);
            //
            // StudentDescription
            //
            //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
            //this.AutoSize = true;
            this.Controls.Add(this.StatusMenuBar);
            this.Name = "StudentDescription";

            ((System.ComponentModel.ISupportInitialize)(this.StatusMenuBar)).EndInit();
            this.ResumeLayout(false);

            DescriptionPanel.Controls.Add(DescriptionLabel);
            DescriptionPanel.Controls.Add(StatusPanel);
            #endregion

            TaggingWorker.DoWork             += (TaggingWorker_DoWork);
            TaggingWorker.RunWorkerCompleted += (TaggingWorker_RunWorkerCompleted);

            TagConfig.AfterInsert        += TagRecordChangedEventHandler;
            TagConfig.AfterUpdate        += TagRecordChangedEventHandler;
            TagConfig.AfterDelete        += TagRecordChangedEventHandler;
            K12.Data.Student.AfterUpdate += Student_AfterUpdate;

            StudentTag.AfterInsert += TagRecordChangedEventHandler;
            StudentTag.AfterUpdate += TagRecordChangedEventHandler;
            StudentTag.AfterDelete += TagRecordChangedEventHandler;

            Disposed += delegate
            {
                StudentTag.AfterInsert       -= TagRecordChangedEventHandler;
                StudentTag.AfterUpdate       -= TagRecordChangedEventHandler;
                StudentTag.AfterDelete       -= TagRecordChangedEventHandler;
                TagConfig.AfterInsert        -= TagRecordChangedEventHandler;
                TagConfig.AfterUpdate        -= TagRecordChangedEventHandler;
                TagConfig.AfterDelete        -= TagRecordChangedEventHandler;
                K12.Data.Student.AfterUpdate -= Student_AfterUpdate;
            };

            FISCA.Features.TryRegister("學生.Tag.Reload", args =>
            {
                OnPrimaryKeyChanged(EventArgs.Empty);
            });
        }
コード例 #12
0
        protected override void OnMouseUp(MouseEventArgs e)
        {
            base.OnMouseUp(e);
            if (Locked)
            {
                return;
            }

            ObjectCollection selectedObjects = new ObjectCollection();

            Designer.SelectedObjects.CopyTo(selectedObjects);
            HideToolTip();

            FEventArgs.X       = e.X - Offset.X;
            FEventArgs.Y       = e.Y - Offset.Y;
            FEventArgs.Button  = e.Button;
            FEventArgs.Mode    = FMode2;
            FEventArgs.Handled = false;

            if (FMode2 == WorkspaceMode2.Move || FMode2 == WorkspaceMode2.Size)
            {
                // serve all objects
                for (int i = 0; i < Designer.Objects.Count; i++)
                {
                    ComponentBase c = Designer.Objects[i] as ComponentBase;
                    if (c != null)
                    {
                        c.HandleMouseUp(FEventArgs);
                    }
                }
                // remove objects with zero size
                if (FMode1 == WorkspaceMode1.Insert)
                {
                    int i = 0;
                    while (i < Designer.SelectedObjects.Count)
                    {
                        ComponentBase c = Designer.SelectedObjects[i] as ComponentBase;
                        if (c != null && c.Width == 0 && c.Height == 0)
                        {
                            Designer.Objects.Remove(c);
                            Designer.SelectedObjects.Remove(c);
                            c.Dispose();
                            i--;
                        }
                        i++;
                    }
                }
                if (FMode1 != WorkspaceMode1.Select)
                {
                    // during OnInsert call current context may be changed
                    WorkspaceMode1 saveMode = FMode1;
                    FMode1 = WorkspaceMode1.Select;
                    ObjectCollection insertedObjects = new ObjectCollection();
                    Designer.SelectedObjects.CopyTo(insertedObjects);
                    foreach (Base c in insertedObjects)
                    {
                        c.OnAfterInsert(FInsertionSource);
                    }
                    FMode1 = saveMode;
                }

                // check if we actually move a mouse after we clicked it
                if (FMouseMoved || FMode1 == WorkspaceMode1.Insert)
                {
                    Designer.SetModified(FPageDesigner,
                                         FMode1 == WorkspaceMode1.Insert ? "Insert" : FMode2 == WorkspaceMode2.Move ? "Move" : "Size");
                }
            }
            else if (FMode2 == WorkspaceMode2.SelectionRect)
            {
                FEventArgs.SelectionRect = NormalizeSelectionRect();
                if (FEventArgs.ActiveObject != null)
                {
                    FEventArgs.ActiveObject.HandleMouseUp(FEventArgs);
                }
            }
            else if (FMode2 == WorkspaceMode2.Custom)
            {
                if (FEventArgs.ActiveObject != null)
                {
                    FEventArgs.ActiveObject.HandleMouseUp(FEventArgs);
                }
            }

            bool needReset = FMode1 == WorkspaceMode1.Insert;

            if (!selectedObjects.Equals(Designer.SelectedObjects) || needReset)
            {
                Designer.SelectionChanged(FPageDesigner);
            }

            FMouseDown = false;
            FMode1     = WorkspaceMode1.Select;
            FMode2     = WorkspaceMode2.None;
            FGuides.ClearVirtualGuides();
            Refresh();
            if (needReset)
            {
                Designer.ResetObjectsToolbar(false);
            }

            if (e.Button == MouseButtons.Right && Designer.SelectedObjects.Count > 0)
            {
                ContextMenuBar menu = Designer.SelectedObjects[0].GetContextMenu();
                if (menu != null)
                {
                    PopupItem item = menu.Items[0] as PopupItem;
                    item.PopupMenu(PointToScreen(e.Location));
                }
            }
        }