Beispiel #1
0
        private void toolbarToolStripMenuItem_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            string    name      = e.ClickedItem.Text;
            FieldInfo fieldInfo = this.GetType().GetField(name.ToLower() + "Strip", BindingFlags.NonPublic | BindingFlags.Instance);

            if (fieldInfo == null)
            {
                return;
            }
            ToolStrip         toolStrip = fieldInfo.GetValue(this) as ToolStrip;
            ToolStripMenuItem item      = e.ClickedItem as ToolStripMenuItem;

            if (item == null)
            {
                return;
            }
            if (item.Checked)
            {
                toolStrip.Hide();
            }
            else
            {
                toolStrip.Show();
            }
        }
Beispiel #2
0
 public void SetUser(User user)
 {
     CurrentUser = user;
     this.Text   = $"{user.Login} участвует в Викторине";
     if (user.IsAdmin)
     {
         toolStrip1.Show();
         this.mEditFiles.Click += EditTest;
     }
     else
     {
         toolStrip1.Hide();
         this.mEditFiles.Click -= EditTest;
     }
 }
        public ModelDiagramForm(WbContext context, String id)
        {
            InitializeComponent();

            wbContext = context;

            CreateCanvas(id); // Sets formBE.

            canvasViewer.CanvasPanel.MouseMove        += new MouseEventHandler(CanvasPanel_MouseMove);
            canvasViewer.CanvasPanel.MouseDown        += new MouseEventHandler(CanvasPanel_MouseDown);
            canvasViewer.CanvasPanel.MouseUp          += new MouseEventHandler(CanvasPanel_MouseUp);
            canvasViewer.CanvasPanel.MouseDoubleClick += new MouseEventHandler(CanvasPanel_MouseDoubleClick);
            canvasViewer.CanvasPanel.KeyDown          += new KeyEventHandler(CanvasPanel_KeyDown);
            canvasViewer.CanvasPanel.KeyUp            += new KeyEventHandler(CanvasPanel_KeyUp);
            canvasViewer.CanvasPanel.MouseLeave       += new EventHandler(CanvasPanel_MouseLeave);

            // Sidebar windows.
            modelNavigator             = new ModelNavigatorForm(this);
            userDatatypesForm          = new UserDatatypesForm(wbContext);
            modelLayerForm             = new ModelLayerForm(this);
            modelCatalogForm           = new ModelCatalogForm(formBE);
            historyForm                = new UndoHistoryForm(wbContext);
            modelPropertiesForm        = new ModelPropertiesForm(wbContext);
            modelObjectDescriptionForm = new ModelObjectDescriptionForm(wbContext);

            SetupSideBars();

            toolsToolStrip      = formBE.get_tools_toolbar();
            toolsToolStrip.Dock = DockStyle.Left;
            diagramPanel.Controls.Add(toolsToolStrip);

            optionsToolStrip          = formBE.get_options_toolbar();
            optionsToolStrip.Padding  = new Padding(2);
            optionsToolStrip.Dock     = DockStyle.None;
            optionsToolStrip.AutoSize = false;
            diagramPanel.Controls.Add(optionsToolStrip);
            diagramPanel.Controls.SetChildIndex(optionsToolStrip, 0);
            optionsToolStrip.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
            optionsToolStrip.Hide();

            UpdateColors();

            ManagedNotificationCenter.AddObserver(this, "GNFormTitleDidChange");
        }
Beispiel #4
0
 private void CreateSubToolStrip()
 {
     if (toolStrip == null)
     {
         toolStrip             = new ToolStrip();
         toolStrip.LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow;
         toolStrip.Dock        = DockStyle.Left;
         toolStrip.GripStyle   = ToolStripGripStyle.Hidden;
         toolStrip.AutoSize    = false;
         toolStrip.Size        = new System.Drawing.Size(121, 1024);
         //toolStrip.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(198)))), ((int)(((byte)(218)))), ((int)(((byte)(248)))));
         toolStrip.BackgroundImage       = WinFormUI.Properties.Resources.secondmenu;
         toolStrip.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
         toolStrip.Hide();
         this.Controls.Add(toolStrip);
         toolStrip.BringToFront();
         toolStrip.Show();
     }
 }
Beispiel #5
0
        private void InitializeComponent()
        {
            StartPosition = FormStartPosition.CenterScreen;

            var currentSize = Font.SizeInPoints;

            currentSize       += 3;
            BackColor          = Color.Aqua;
            Font               = new Font(Font.Name, currentSize, Font.Style);
            CheckedListBoxTest = new CheckedListBox();
            this.toolStrip1    = new System.Windows.Forms.ToolStrip();
            mCreatFiles        = new System.Windows.Forms.ToolStripButton();
            mEditFiles         = new System.Windows.Forms.ToolStripButton();
            mDeleteFiles       = new System.Windows.Forms.ToolStripButton();
            this.toolStrip1.SuspendLayout();
            this.SuspendLayout();
            //
            //CheckedListBoxTest
            //
            CheckedListBoxTest.Dock = System.Windows.Forms.DockStyle.Fill;
            CheckedListBoxTest.FormattingEnabled = false;
            CheckedListBoxTest.Location          = new System.Drawing.Point(50, 50);
            CheckedListBoxTest.Name     = "mListBox";
            CheckedListBoxTest.Size     = new System.Drawing.Size(230, 200);
            CheckedListBoxTest.TabIndex = 0;
            //
            StartBtn = new Button
            {
                Location = new Point(25, 205),
                Text     = "Старт"
            };
            StartBtn.Click += Start_Click;
            // StartBtn.Click += Check_User_Click;

            Controls.Add(StartBtn);

            ShowRezultBtn = new Button
            {
                Location = new Point(105, 205),
                Text     = "Результаты"
            };
            ShowRezultBtn.Click += ShowRezultBtn_Click;
            Controls.Add(ShowRezultBtn);
            Top20Btn = new Button
            {
                Location = new Point(185, 205),
                Text     = "Top 20"
            };
            Top20Btn.Click += Top20Btn_Click;
            Controls.Add(Top20Btn);
            int h = Height, w = Width;

            ChangeUserBtn = new Button
            {
                Location = new Point(2, h - 60),
                Text     = "Сменить пользователя",
                Width    = w - 100
            };
            ChangeUserBtn.Click += ChangeUserBtn_Click;
            Controls.Add(ChangeUserBtn);
            SettingBtn = new Button
            {
                Location = new Point(w - 100, h - 60),
                Text     = "Настройки",
                Width    = 83
            };
            SettingBtn.Click += SettingBtn_Click;
            Controls.Add(SettingBtn);
            //
            // toolStrip1
            //
            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                mEditFiles, mCreatFiles, mDeleteFiles
            });
            this.toolStrip1.Location = new System.Drawing.Point(0, 0);
            this.toolStrip1.Name     = "toolStrip1";
            this.toolStrip1.Size     = new System.Drawing.Size(284, 25);
            this.toolStrip1.TabIndex = 1;
            this.toolStrip1.Text     = "toolStrip1";
            //


            //mEditFiles
            this.mEditFiles.ImageTransparentColor =
                System.Drawing.Color.Azure;
            this.mEditFiles.Name   = "Edit";
            this.mEditFiles.Size   = new System.Drawing.Size(148, 22);
            mEditFiles.Text        = "Редактировать";
            this.mEditFiles.Click += Check_User_Click;

            //mCreatFiles
            this.mCreatFiles.ImageTransparentColor =
                System.Drawing.Color.Azure;
            this.mCreatFiles.Name   = "Edit";
            this.mCreatFiles.Size   = new System.Drawing.Size(148, 22);
            mCreatFiles.Text        = "Добавить новый";
            this.mCreatFiles.Click += CreateTest;


            mDeleteFiles.ImageTransparentColor =
                System.Drawing.Color.Azure;
            mDeleteFiles.Name   = "Delete";
            mDeleteFiles.Size   = new System.Drawing.Size(148, 22);
            mDeleteFiles.Text   = "Удалить";
            mDeleteFiles.Click += DeleteTest;

            //////
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(284, 264);
            this.Controls.Add(CheckedListBoxTest);
            this.Controls.Add(this.toolStrip1);
            toolStrip1.Hide();
            this.Name = "Quiz";

            this.toolStrip1.ResumeLayout(false);
            this.toolStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }
Beispiel #6
0
 private void ModifyToolStrip(ToolStrip strip)
 {
     strip.Hide();
 }
Beispiel #7
0
 private void ModifyToolStrip(ToolStrip tStrip)
 {
     tStrip.Hide();
 }