Exemplo n.º 1
0
        public FormColor(MaterialForm form)
        {
            materialSkinManager = MaterialSkinManager.Instance;
            materialSkinManager.AddFormToManage(form);
            materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;

            switch (Esquema())
            {
                case 1:
                    materialSkinManager.ColorScheme = new ColorScheme(Primary.Blue700, Primary.Blue900, Primary.Blue500, Accent.Green400, TextShade.WHITE);
                    MetroColor = MetroColorStyle.Blue;
                    break;
                case 2:
                    materialSkinManager.ColorScheme = new ColorScheme(Primary.Orange700, Primary.Orange900, Primary.Orange500, Accent.Red700, TextShade.WHITE);
                    MetroColor = MetroColorStyle.Orange;
                    break;
                case 3:
                    materialSkinManager.ColorScheme = new ColorScheme(Primary.Indigo700, Primary.Indigo900, Primary.Indigo500, Accent.Pink400, TextShade.WHITE);
                    MetroColor = MetroColorStyle.Magenta;
                    break;
                default:
                    materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);
                    MetroColor = MetroColorStyle.Teal;
                    break;
            }
        }
Exemplo n.º 2
0
 public void AddMaterialPanelTab(MaterialForm form, bool focus = false)
 {
     TabPage newTab = new TabPage(form.Text);
     form.Dock = DockStyle.Fill;
     form.Parent = newTab;
     newTab.Controls.Add(form);
     tabControl.TabPages.Add(newTab);
     if (focus)
         tabControl.SelectedTab = newTab;
 }
Exemplo n.º 3
0
        public System.Windows.Forms.DialogResult ShowDialog(MaterialForm parentForm, bool DrawActionBar)
        {
            Control TopParentObject = parentForm;
            while(TopParentObject != null && !(TopParentObject is IWin32Window) && TopParentObject.Parent != null)
            {
                TopParentObject = TopParentObject.Parent;
            };

            this.Visible = false;
            this.TopLevel = true;
            this.DrawBorderLine = true;
            this.DrawStatusBar = true;
            this.STATUS_BAR_HEIGHT = STATUS_BAR_HEIGHT;

            if (DrawActionBar)
            {
                this.DrawActionBar = true;
                this.ACTION_BAR_HEIGHT = ACTION_BAR_HEIGHT;
                this.TitleLocation = LocationType.ActionBar;
            }
            else
            {
                this.TitleLocation = LocationType.StatusBar;
            }
            this.Sizable = true;
            this.DrawBorderLine = true;

            this.Moveable = true;

            this.ControlBox = true;
            this.MaximizeBox = true;
            this.MinimizeBox = true;

            this.TitleImage = null;

            this.Width -= 1;
            this.Width += 1;

            if (this.Controls.Count == 1 && this.Controls[0] is System.Windows.Forms.TableLayoutPanel)
            {
                this.Controls[0].Dock = System.Windows.Forms.DockStyle.None;
                System.Drawing.Rectangle bounds = this.Controls[0].Bounds;
                bounds.Y += (DrawActionBar ? this.ACTION_BAR_HEIGHT : 0) + this.STATUS_BAR_HEIGHT;
                bounds.X += this.DefaultMargin.Left;
                bounds.Height -= (DrawActionBar ? this.ACTION_BAR_HEIGHT : 0) + this.STATUS_BAR_HEIGHT + this.DefaultMargin.Top + this.DefaultMargin.Bottom;
                bounds.Width -= (this.DefaultMargin.Left + this.DefaultMargin.Right + 2);
                this.Controls[0].Bounds = bounds;
                this.Controls[0].Anchor = System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom;
            }

            if (TopParentObject != null && TopParentObject is IWin32Window)
                return ShowDialog(TopParentObject);
            else
                return ShowDialog();
        }
Exemplo n.º 4
0
 public void RemoveFormToManage(MaterialForm materialForm)
 {
     formsToManage.Remove(materialForm);
 }
Exemplo n.º 5
0
 public void AddFormToManage(MaterialForm materialForm)
 {
     formsToManage.Add(materialForm);
     UpdateBackgrounds();
 }
Exemplo n.º 6
0
 public bool RemoveMaterialPanelTab(MaterialForm form)
 {
     return RemoveMaterialPanelTab(form.Text);
 }