Example #1
0
        private Button AddButton(string text, Bitmap image)
        {
            var btn   = new NoFocusButton();
            var sizeY = (int)(32 * Direct2DTheme.DialogScaling);

            btn.BackColor  = BackColor;
            btn.ForeColor  = ThemeBase.LightGreyFillColor2;
            btn.ImageAlign = ContentAlignment.MiddleLeft;
            btn.TextAlign  = ContentAlignment.MiddleLeft;
            btn.FlatStyle  = FlatStyle.Flat;
            btn.FlatAppearance.BorderSize         = 0;
            btn.FlatAppearance.MouseOverBackColor = ThemeBase.DarkGreyFillColor2;
            btn.FlatAppearance.MouseDownBackColor = ThemeBase.DarkGreyFillColor2;
            btn.Image             = image;
            btn.Top               = tabs.Count * sizeY;
            btn.Left              = 0;
            btn.Width             = panelTabs.Width;
            btn.Height            = sizeY;
            btn.Font              = tabs.Count == 0 ? fontBold : font;
            btn.Text              = text;
            btn.TextImageRelation = TextImageRelation.ImageBeforeText;
            btn.Click            += Btn_Click;

            panelTabs.Controls.Add(btn);

            return(btn);
        }
Example #2
0
        private Button CreateButton(ExportFormat format)
        {
            var btn = new NoFocusButton();

            btn.BackColor  = BackColor;
            btn.ForeColor  = Direct2DGraphics.ToDrawingColor4(Theme.LightGreyFillColor2);
            btn.ImageAlign = ContentAlignment.MiddleLeft;
            btn.TextAlign  = ContentAlignment.MiddleLeft;
            btn.FlatStyle  = FlatStyle.Flat;
            btn.FlatAppearance.BorderSize         = 0;
            btn.FlatAppearance.MouseOverBackColor = Direct2DGraphics.ToDrawingColor4(Theme.DarkGreyFillColor2);
            btn.FlatAppearance.MouseDownBackColor = Direct2DGraphics.ToDrawingColor4(Theme.DarkGreyFillColor2);
            btn.Image             = (Bitmap)Resources.ResourceManager.GetObject("Export" + format.ToString(), Resources.Culture);
            btn.Top               = ((int)format) * 32;
            btn.Left              = 0;
            btn.Width             = panelTabs.Width;
            btn.Height            = 32;
            btn.Font              = format == 0 ? fontBold : font;
            btn.Text              = format.ToString();
            btn.TextImageRelation = TextImageRelation.ImageBeforeText;
            btn.Click            += Btn_Click;

            panelTabs.Controls.Add(btn);

            return(btn);
        }
Example #3
0
        private void InitializeComponent()
        {
            propertyPage   = new PropertyPage();
            buttonYes      = new NoFocusButton();
            buttonNo       = new NoFocusButton();
            buttonAdvanced = new NoFocusButton();
            toolTip        = new ToolTip();

            propertyPage.AutoSizeMode        = AutoSizeMode.GrowAndShrink;
            propertyPage.BackColor           = Theme.DarkGreyFillColor1;
            propertyPage.Dock                = DockStyle.Top;
            propertyPage.Location            = new Point(0, 0);
            propertyPage.Padding             = new Padding(3);
            propertyPage.Size                = new Size(298, 200);
            propertyPage.PropertyWantsClose += new PropertyPage.PropertyWantsCloseDelegate(propertyPage_PropertyWantsClose);

            buttonYes.FlatAppearance.BorderSize = 0;
            buttonYes.FlatStyle = FlatStyle.Flat;
            buttonYes.Location  = new Point(224, 361);
            buttonYes.Size      = new Size(32, 32);
            buttonYes.UseVisualStyleBackColor = true;
            buttonYes.Click += new EventHandler(buttonYes_Click);

            buttonNo.FlatAppearance.BorderSize = 0;
            buttonNo.FlatStyle = FlatStyle.Flat;
            buttonNo.Location  = new Point(261, 361);
            buttonNo.Size      = new Size(32, 32);
            buttonNo.UseVisualStyleBackColor = true;
            buttonNo.Click += new EventHandler(buttonNo_Click);

            buttonAdvanced.FlatAppearance.BorderSize = 0;
            buttonAdvanced.FlatStyle = FlatStyle.Flat;
            buttonAdvanced.Location  = new Point(5, 361);
            buttonAdvanced.Size      = new Size(32, 32);
            buttonAdvanced.UseVisualStyleBackColor = true;
            buttonAdvanced.Visible = false;
            buttonAdvanced.Click  += new EventHandler(buttonAdvanced_Click);

            AutoScaleMode   = AutoScaleMode.None;
            BackColor       = Theme.DarkGreyFillColor1;
            ClientSize      = new Size(298, 398);
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            ControlBox      = false;
            KeyPreview      = true;
            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            SizeGripStyle   = SizeGripStyle.Hide;
            KeyDown        += new KeyEventHandler(PropertyDialog_KeyDown);

            SuspendLayout();
            Controls.Add(buttonAdvanced);
            Controls.Add(propertyPage);
            Controls.Add(buttonYes);
            Controls.Add(buttonNo);
            ResumeLayout(true);
        }
Example #4
0
        private void InitializeComponent()
        {
            pictureBox1      = new PictureBox();
            label1           = new Label();
            checkBoxDontShow = new CheckBox();
            buttonLeft       = new NoFocusButton();
            buttonRight      = new NoFocusButton();
            toolTip          = new ToolTip();

            pictureBox1.Location = new Point(10, 88);
            pictureBox1.Size     = new Size(736, 414);
            pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
            pictureBox1.TabStop  = false;

            label1.Anchor   = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            label1.Location = new Point(10, 10);
            label1.Size     = new Size(736, 64);
            label1.Text     = "Welcome To FamiStudio!";

            checkBoxDontShow.Anchor   = AnchorStyles.Bottom | AnchorStyles.Left;
            checkBoxDontShow.AutoSize = true;
            checkBoxDontShow.Location = new Point(10, 513);
            checkBoxDontShow.Size     = new Size(115, 17);
            checkBoxDontShow.Text     = "Do not show again";
            checkBoxDontShow.UseVisualStyleBackColor = true;

            buttonLeft.FlatAppearance.BorderSize = 0;
            buttonLeft.FlatStyle = FlatStyle.Flat;
            buttonLeft.Location  = new Point(676, 504);
            buttonLeft.Size      = new Size(32, 32);
            buttonLeft.UseVisualStyleBackColor = true;
            buttonLeft.Click += new EventHandler(buttonLeft_Click);

            buttonRight.FlatAppearance.BorderSize = 0;
            buttonRight.FlatStyle = FlatStyle.Flat;
            buttonRight.Location  = new Point(714, 504);
            buttonRight.Size      = new Size(32, 32);
            buttonRight.UseVisualStyleBackColor = true;
            buttonRight.Click += new EventHandler(buttonRight_Click);

            AutoScaleMode   = AutoScaleMode.None;
            BackColor       = Theme.DarkGreyFillColor1;
            ClientSize      = new Size(754, 548);
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            ControlBox      = false;
            KeyPreview      = true;
            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowInTaskbar   = false;
            SizeGripStyle   = SizeGripStyle.Hide;
            StartPosition   = FormStartPosition.CenterParent;
            KeyDown        += new KeyEventHandler(TutorialDialog_KeyDown);

            SuspendLayout();
            Controls.Add(checkBoxDontShow);
            Controls.Add(label1);
            Controls.Add(pictureBox1);
            Controls.Add(buttonLeft);
            Controls.Add(buttonRight);
            ResumeLayout(true);
        }
        private void InitializeComponent()
        {
            buttonYes   = new NoFocusButton();
            buttonNo    = new NoFocusButton();
            tableLayout = new TableLayoutPanel();
            panelProps  = new Panel();
            panelTabs   = new Panel();
            toolTip     = new ToolTip();

            buttonYes.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
            buttonYes.FlatAppearance.BorderSize = 0;
            buttonYes.FlatStyle = FlatStyle.Flat;
            buttonYes.Location  = new Point(374, 337);
            buttonYes.Size      = new Size(32, 32);
            buttonYes.UseVisualStyleBackColor = true;
            buttonYes.Click += new EventHandler(buttonYes_Click);

            buttonNo.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
            buttonNo.FlatAppearance.BorderSize = 0;
            buttonNo.FlatStyle = FlatStyle.Flat;
            buttonNo.Location  = new Point(411, 337);
            buttonNo.Size      = new Size(32, 32);
            buttonNo.UseVisualStyleBackColor = true;
            buttonNo.Click += new EventHandler(buttonNo_Click);

            tableLayout.SuspendLayout();
            tableLayout.Anchor      = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
            tableLayout.ColumnCount = 2;
            tableLayout.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 150F));
            tableLayout.ColumnStyles.Add(new ColumnStyle());
            tableLayout.Location = new Point(5, 5);
            tableLayout.Margin   = new Padding(0);
            tableLayout.RowCount = 1;
            tableLayout.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
            tableLayout.Size = new Size(438, 327);
            tableLayout.Controls.Add(panelProps, 1, 0);
            tableLayout.Controls.Add(panelTabs, 0, 0);
            tableLayout.ResumeLayout(false);

            panelProps.Dock     = DockStyle.Fill;
            panelProps.Location = new Point(150, 0);
            panelProps.Margin   = new Padding(0);
            panelProps.Size     = new Size(307, 327);

            panelTabs.BackColor = Theme.DarkGreyFillColor1;
            panelTabs.Dock      = DockStyle.Fill;
            panelTabs.Location  = new Point(0, 0);
            panelTabs.Margin    = new Padding(0);
            panelTabs.Name      = "panelTabs";
            panelTabs.Size      = new Size(150, 327);
            panelTabs.TabIndex  = 21;

            AutoScaleMode   = AutoScaleMode.None;
            BackColor       = Theme.DarkGreyFillColor1;
            ClientSize      = new Size(448, 373);
            FormBorderStyle = FormBorderStyle.FixedToolWindow;
            ControlBox      = false;
            KeyPreview      = true;
            MaximizeBox     = false;
            MinimizeBox     = false;
            ShowIcon        = false;
            ShowInTaskbar   = false;
            StartPosition   = FormStartPosition.CenterParent;
            KeyDown        += new KeyEventHandler(MultiPropertyDialog_KeyDown);

            SuspendLayout();
            Controls.Add(tableLayout);
            Controls.Add(buttonYes);
            Controls.Add(buttonNo);
            ResumeLayout(true);
        }