Example #1
0
        /// <summary>
        /// Initializes the abort retry ignore buttons.
        /// </summary>
        private void InitAbortRetryIgnoreButtons()
        {
            MaterialFlatButton btnAbort = new MaterialFlatButton();

            btnAbort.Text   = "Abbrechen";
            btnAbort.Accent = true;
            btnAbort.Tag    = "Abort";
            btnAbort.Click += ButtonClick;

            MaterialFlatButton btnRetry = new MaterialFlatButton();

            btnRetry.Text      = "Erneut versuchen";
            btnRetry.ForeColor = Color.DarkGray;
            btnRetry.Tag       = "Retry";
            btnRetry.Click    += ButtonClick;

            MaterialFlatButton btnIgnore = new MaterialFlatButton();

            btnIgnore.Text      = "Ignorieren";
            btnIgnore.Tag       = "Ignore";
            btnIgnore.ForeColor = Color.DarkGray;
            btnIgnore.Click    += ButtonClick;

            this._buttonCollection.Add(btnIgnore);
            this._buttonCollection.Add(btnAbort);
            this._buttonCollection.Add(btnRetry);
        }
Example #2
0
        /// <summary>
        /// Initializes the yes no cancel buttons.
        /// </summary>
        private void InitYesNoCancelButtons()
        {
            MaterialFlatButton btnYes = new MaterialFlatButton();

            btnYes.Text = "Ja";

            btnYes.Tag    = "Yes";
            btnYes.Accent = true;
            btnYes.Click += ButtonClick;

            MaterialFlatButton btnNo = new MaterialFlatButton();

            btnNo.Text = "Nein";

            btnNo.Tag       = "No";
            btnNo.ForeColor = Color.DarkGray;
            btnNo.Click    += ButtonClick;

            MaterialFlatButton btnCancel = new MaterialFlatButton();

            btnCancel.Text = "Abbrechen";

            btnCancel.Tag       = "Cancel";
            btnCancel.ForeColor = Color.DarkGray;
            btnCancel.Click    += ButtonClick;

            this._buttonCollection.Add(btnYes);
            this._buttonCollection.Add(btnNo);
            this._buttonCollection.Add(btnCancel);
        }
        /// <summary>
        /// Drawers the item clicked.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        private void DrawerItemClicked(object sender, EventArgs e)
        {
            String strText;
            Object objTag;

            if (sender.GetType() == typeof(MaterialDrawerItem))
            {
                MaterialDrawerItem t = (MaterialDrawerItem)sender;
                if (t.Selected)
                {
                    return;
                }
            }
            else
            {
                MaterialFlatButton t = (MaterialFlatButton)sender;
                if (t.Selected)
                {
                    return;
                }
            }

            foreach (Control objSideControl in Controls)
            {
                if (objSideControl.GetType() == typeof(MaterialFlatButton))
                {
                    MaterialFlatButton objItem = (MaterialFlatButton)objSideControl;
                    objItem.Selected = false;
                    objItem.Invalidate();
                }
                else if (objSideControl.GetType() == typeof(MaterialDrawerItem))
                {
                    MaterialDrawerItem t = (MaterialDrawerItem)objSideControl;
                    t.Selected = false;
                    t.Invalidate();
                }
            }

            if (sender.GetType() == typeof(MaterialDrawerItem))
            {
                MaterialDrawerItem t = (MaterialDrawerItem)sender;
                t.Selected = true && SelectOnClick;
                strText    = t.Text;
                objTag     = t.Tag;
            }
            else
            {
                MaterialFlatButton t = (MaterialFlatButton)sender;
                t.Selected = true && SelectOnClick;
                strText    = t.Text;
                objTag     = t.Tag;
            }


            if (onSideDrawerItemClicked != null)
            {
                onSideDrawerItemClicked(sender, new SideDrawerEventArgs(strText, objTag));
            }
        }
Example #4
0
        /// <summary>
        /// Initializes the ok button.
        /// </summary>
        private void InitOKButton()
        {
            MaterialFlatButton btnOK = new MaterialFlatButton();

            btnOK.Text   = "OK";
            btnOK.Tag    = "Ok";
            btnOK.Accent = true;
            btnOK.Click += ButtonClick;

            this._buttonCollection.Add(btnOK);
        }
Example #5
0
        /// <summary>
        /// Initializes the retry cancel buttons.
        /// </summary>
        private void InitRetryCancelButtons()
        {
            MaterialFlatButton btnRetry = new MaterialFlatButton();

            btnRetry.Text   = "Erneut versuchen";
            btnRetry.Tag    = "Retry";
            btnRetry.Accent = true;
            btnRetry.Click += ButtonClick;

            MaterialFlatButton btnCancel = new MaterialFlatButton();

            btnCancel.Text      = "Abbrechen";
            btnCancel.Tag       = "Cancel";
            btnCancel.ForeColor = Color.DarkGray;
            btnCancel.Click    += ButtonClick;

            this._buttonCollection.Add(btnRetry);
            this._buttonCollection.Add(btnCancel);
        }
Example #6
0
        /// <summary>
        /// Initializes the ok cancel buttons.
        /// </summary>
        private void InitOKCancelButtons()
        {
            MaterialFlatButton btnOK = new MaterialFlatButton();

            btnOK.Text   = "OK";
            btnOK.Tag    = "Ok";
            btnOK.Accent = true;
            btnOK.Click += ButtonClick;

            MaterialFlatButton btnCancel = new MaterialFlatButton();

            btnCancel.Text      = "Abbrechen";
            btnCancel.Tag       = "Cancel";
            btnCancel.ForeColor = Color.DarkGray;
            btnCancel.Click    += ButtonClick;

            this._buttonCollection.Add(btnOK);
            this._buttonCollection.Add(btnCancel);
        }
        /// <summary>
        /// Initializes the side drawer.
        /// </summary>
        private void initSideDrawer()
        {
            bool LastControlWasDivider = false;

            if (_SideDrawer != null)
            {
                Controls.Clear();

                foreach (ToolStripItem objMenuItem in _SideDrawer.Items)
                {
                    if (objMenuItem.GetType() == typeof(ToolStripSeparator))
                    {
                        MaterialDivider objDivider = new MaterialDivider();
                        objDivider.Size = new Size(MaximumSize.Width - Margin.Left - Margin.Right - SystemInformation.VerticalScrollBarWidth, 2);
                        Controls.Add(objDivider);
                        LastControlWasDivider = true;
                    }
                    else
                    {
                        bool Verarbeitet = false;

                        if (objMenuItem.GetType() == typeof(MaterialToolStripMenuItem))
                        {
                            MaterialToolStripMenuItem t = (MaterialToolStripMenuItem)objMenuItem;
                            if (t.DropDownItems.Count > 0)
                            {
                                Verarbeitet = true;
                                if (Controls.Count > 0 && !LastControlWasDivider)
                                {
                                    MaterialDivider objTopDivider = new MaterialDivider();
                                    objTopDivider.Size = new Size(MaximumSize.Width - Margin.Left - Margin.Right - SystemInformation.VerticalScrollBarWidth, 2);
                                    Controls.Add(objTopDivider);
                                    LastControlWasDivider = true;
                                }
                                MaterialLabel objLabel = new MaterialLabel();
                                objLabel.Text         = objMenuItem.Text;
                                objLabel.Tag          = objMenuItem.Tag;
                                objLabel.Margin       = new Padding(0);
                                objLabel.Font         = SkinManager.ROBOTO_MEDIUM_10;
                                LastControlWasDivider = false;
                                Controls.Add(objLabel);

                                foreach (ToolStripItem objSubMenuItem in t.DropDownItems)
                                {
                                    MaterialDrawerItem objSubItem = new MaterialDrawerItem();
                                    objSubItem.Text     = objSubMenuItem.Text;
                                    objSubItem.Tag      = objSubMenuItem.Tag;
                                    objSubItem.Enabled  = objSubMenuItem.Enabled;
                                    objSubItem.AutoSize = false;
                                    objSubItem.Margin   = new Padding(10, 0, 0, 0);
                                    if (objSubMenuItem.GetType() == typeof(MaterialToolStripMenuItem))
                                    {
                                        objSubItem.IconImage = ((MaterialToolStripMenuItem)objSubMenuItem).Image;
                                    }
                                    objSubItem.MouseClick += new MouseEventHandler(DrawerItemClicked);
                                    objSubItem.Size        = new Size(MaximumSize.Width - Margin.Left - Margin.Right - SystemInformation.VerticalScrollBarWidth - 10, 40);
                                    objSubItem.MouseClick -= new MouseEventHandler(DrawerItemClicked);
                                    objSubItem.MouseClick += new MouseEventHandler(DrawerItemClicked);

                                    Controls.Add(objSubItem);
                                    LastControlWasDivider = false;
                                    objSubItem.Location   = new Point(10, objSubItem.Location.Y);
                                }

                                MaterialDivider objBottomDivider = new MaterialDivider();
                                objBottomDivider.Size = new Size(MaximumSize.Width - Margin.Left - Margin.Right - SystemInformation.VerticalScrollBarWidth, 2);
                                Controls.Add(objBottomDivider);
                                LastControlWasDivider = true;
                            }
                        }
                        if (!Verarbeitet)
                        {
                            MaterialFlatButton objItem = new MaterialFlatButton();
                            objItem.Text          = objMenuItem.Text;
                            objItem.Tag           = objMenuItem.Tag;
                            objItem.Enabled       = objMenuItem.Enabled;
                            objItem.AutoSize      = false;
                            objItem.Margin        = new Padding(0, 0, 0, 0);
                            objItem.Size          = new Size(MaximumSize.Width - Margin.Left - Margin.Right - SystemInformation.VerticalScrollBarWidth, 40);
                            objItem.MouseClick   -= new MouseEventHandler(DrawerItemClicked);
                            objItem.MouseClick   += new MouseEventHandler(DrawerItemClicked);
                            LastControlWasDivider = false;
                            Controls.Add(objItem);
                        }
                    }
                }
            }
        }