Ejemplo n.º 1
0
        public ColorPresetControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
            AccessibleName = Res.Get(StringId.ColorPickerColor);

            System.Diagnostics.Debug.Assert(colors.Length == 12, "Unexpected number of buttons.  If you change the number of buttons, then you'll need to ensure that the navigation code is updated as well.");

            int i = 0;

            foreach (ColorButton button in colors)
            {
                button.ColorSelected += colorSelected;
                button.Navigate      += new GridNavigateEventHandler(ColorPresetControl_Navigate);
                button.TabIndex       = i;
                button.Margin         = new System.Windows.Forms.Padding(0);
                tableLayout.Controls.Add(button);
                tableLayout.SetCellPosition(button, new TableLayoutPanelCellPosition(i % (NUM_ROWS + 1), i / (NUM_COLUMNS)));
                i++;
            }

            foreach (RowStyle style in tableLayout.RowStyles)
            {
                style.SizeType = SizeType.Percent;
                style.Height   = 1 / (float)tableLayout.RowCount;
            }
            foreach (ColumnStyle style in tableLayout.ColumnStyles)
            {
                style.SizeType = SizeType.Percent;
                style.Width    = 1 / (float)tableLayout.ColumnCount;
            }

            this.Controls.Add(tableLayout);
        }
 public ColorDefaultColorControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate)
 {
     // This call is required by the Windows.Forms Form Designer.
     InitializeComponent();
     this.Text = Res.Get(StringId.ColorPickerDefaultColor);
     Color     = Color.Empty;
 }
 public ColorDefaultColorControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate)
 {
     // This call is required by the Windows.Forms Form Designer.
     InitializeComponent();
     this.Text = Res.Get(StringId.ColorPickerDefaultColor);
     Color = Color.Empty;
 }
 public ColorDialogLauncherControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate)
 {
     // This call is required by the Windows.Forms Form Designer.
     InitializeComponent();
     this.Text = Res.Get(StringId.ColorPickerMoreColors);
 }
Ejemplo n.º 5
0
 public IColorPickerSubControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate)
 {
     _ColorSelected += colorSelected;
     _Navigate       = navigate;
 }
Ejemplo n.º 6
0
 public IColorPickerSubControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate)
 {
     _ColorSelected += colorSelected;
     _Navigate = navigate;
 }
Ejemplo n.º 7
0
 public ColorDialogLauncherControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate)
 {
     // This call is required by the Windows.Forms Form Designer.
     InitializeComponent();
     this.Text = Res.Get(StringId.ColorPickerMoreColors);
 }
        public ColorPresetControl(ColorSelectedEventHandler colorSelected, NavigateEventHandler navigate) : base(colorSelected, navigate)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
            AccessibleName = Res.Get(StringId.ColorPickerColor);

            System.Diagnostics.Debug.Assert(colors.Length == 12, "Unexpected number of buttons.  If you change the number of buttons, then you'll need to ensure that the navigation code is updated as well.");

            int i = 0;
            foreach (ColorButton button in colors)
            {
                button.ColorSelected += colorSelected;
                button.Navigate += new GridNavigateEventHandler(ColorPresetControl_Navigate);
                button.TabIndex = i;
                button.Margin = new System.Windows.Forms.Padding(0);
                tableLayout.Controls.Add(button);
                tableLayout.SetCellPosition(button, new TableLayoutPanelCellPosition(i % (NUM_ROWS + 1), i / (NUM_COLUMNS)));
                i++;
            }

            foreach (RowStyle style in tableLayout.RowStyles)
            {
                style.SizeType = SizeType.Percent;
                style.Height = 1 / (float)tableLayout.RowCount;
            }
            foreach (ColumnStyle style in tableLayout.ColumnStyles)
            {
                style.SizeType = SizeType.Percent;
                style.Width = 1 / (float)tableLayout.ColumnCount;
            }

            this.Controls.Add(tableLayout);
        }