Пример #1
0
		private void InitControls()
		{
			palettePanel = new PalettePanel();
			LayoutHelper.Below(toolStrip).Left(this).Bottom(this).Width(palettePanel.Width).Apply(palettePanel);
			palettePanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;

			palettePanel.SettingChanged += new EventHandler(PalettePanel_OnSettingChanged);
			palettePanel.SizeChanged += new EventHandler(PalettePanel_OnSizeChanged);

			this.Controls.Add(palettePanel);

			if(collection != null)
			{
				if(collection.ColorPalette != null)
					palettePanel.Set(collection.ColorPalette);
				else if(collection.Config.PaletteFileName != null)
					palettePanel.Set(collection.Config.PaletteFileName);
			}

			flowPanel = new FlowLayoutPanel();
			flowPanel.AutoScroll = true;
			flowPanel.BorderStyle = BorderStyle.FixedSingle;
			LayoutHelper.RightOf(palettePanel).Right(this).MatchTop(palettePanel).Bottom(this).Apply(flowPanel);
			flowPanel.Anchor = LayoutHelper.AnchorAll;
			this.Controls.Add(flowPanel);
		}
Пример #2
0
        private void InitPalette()
        {
            palettePanel = new PalettePanel(Setting_SwatchesPerRow);
            LayoutHelper.Below(toolStrip).Left(this).Bottom(this).Width(palettePanel.Width).Apply(palettePanel);
            palettePanel.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left;

            palettePanel.SettingChanged += new EventHandler(PalettePanel_OnSettingChanged);
            palettePanel.SizeChanged    += new EventHandler(PalettePanel_OnSizeChanged);

            this.Controls.Add(palettePanel);

            palettePanel.Set(Default_PaletteFileName);
        }
Пример #3
0
        private void InitControls()
        {
            int margin       = 10;
            int radioHeight  = 20;
            int buttonHeight = 20;
            int buttonWidth  = 50;

            RadioButton radio1 = new RadioButton();

            radio1.Text = "Do not save any palette information with the project.";
            paletteOptionRadioButtons[PPConfig.PaletteOptions.SaveNothing] = radio1;

            RadioButton radio2 = new RadioButton();

            radio2.Text = "Save filename of the palette with the project.";
            paletteOptionRadioButtons[PPConfig.PaletteOptions.SaveFileName] = radio2;

            RadioButton radio3 = new RadioButton();

            radio3.Text = "Save entire palette file with the project.";
            paletteOptionRadioButtons[PPConfig.PaletteOptions.SaveFile] = radio3;

            LayoutHelper.Top(this, margin).Left(this, margin).Right(this, margin).Height(radioHeight).Apply(radio1);
            this.Controls.Add(radio1);

            LayoutHelper.Below(radio1).MatchLeft(radio1).MatchRight(radio1).Height(radioHeight).Apply(radio2);
            this.Controls.Add(radio2);

            LayoutHelper.Below(radio2).MatchLeft(radio1).MatchRight(radio1).Height(radioHeight).Apply(radio3);
            this.Controls.Add(radio3);

            paletteOptionRadioButtons[paletteOption].Checked = true;

            Button okButton = new Button();

            okButton.Text = "Ok";
            LayoutHelper.Below(radio3, margin).Left(this, margin).Width(buttonWidth).Height(buttonHeight).Apply(okButton);
            okButton.Click += new EventHandler(OkButton_OnClick);
            this.Controls.Add(okButton);

            Button cancelButton = new Button();

            cancelButton.Text = "Cancel";
            LayoutHelper.MatchTop(okButton).Right(this, margin).Width(buttonWidth).Height(buttonHeight).Apply(cancelButton);
            cancelButton.Click += new EventHandler(CancelButton_OnClick);
            this.Controls.Add(cancelButton);
        }
Пример #4
0
        private void InitImage()
        {
            scrollPanel            = new Panel();
            scrollPanel.AutoScroll = true;
            LayoutHelper.Below(toolStrip).RightOf(palettePanel).Right(this).Above(statusPanel).Apply(scrollPanel);
            scrollPanel.Anchor      = LayoutHelper.AnchorAll;
            scrollPanel.BorderStyle = BorderStyle.Fixed3D;

            pictureBox          = new PixelPictureBox();
            pictureBox.Dock     = DockStyle.Fill;
            pictureBox.SizeMode = PictureBoxSizeMode.Zoom;
            pictureBox.Cursor   = ADD_COLOR_CURSOR;
            pictureBox.Click   += new EventHandler(Image_OnClick);

            scrollPanel.Controls.Add(pictureBox);
            this.Controls.Add(scrollPanel);
        }