/// <summary>
            /// Initializes a new instance of the <see cref="CustomColorsPanel"/> class.
            /// </summary>
            /// <param name="serviceProvider">
            /// <para>Requires:</para>
            /// <para><see cref="INuGenButtonStateTracker"/></para>
            /// <para><see cref="INuGenControlStateTracker"/></para>
            /// <para><see cref="INuGenButtonRenderer"/></para>
            /// <para><see cref="INuGenPanelRenderer"/></para>
            /// <para><see cref="INuGenColorsProvider"/></para>
            /// </param>
            public CustomColorsPanel(INuGenServiceProvider serviceProvider)
            {
                if (serviceProvider == null)
                {
                    throw new ArgumentNullException("serviceProvider");
                }

                _serviceProvider = serviceProvider;

                this.Dock = DockStyle.Fill;

                _components       = new Container();
                _colorDialog      = new ColorDialog();
                _tableLayoutPanel = new TableLayoutPanel();
                _flowLayoutPanel  = new FlowLayoutPanel();
                _otherButton      = new NuGenButton(serviceProvider);

                this.InitializeColorDialog(_colorDialog);
                this.InitializeFlowLayoutPanel(_flowLayoutPanel);
                this.InitializeOtherButton(_otherButton);
                this.InitializeTableLayoutPanel(_tableLayoutPanel);

                _tableLayoutPanel.Controls.Add(_flowLayoutPanel, 0, 0);
                _tableLayoutPanel.Controls.Add(_otherButton, 0, 1);

                List <Color> colors = null;

                this.ColorsProvider.FillWithCustomColors(out colors);
                Debug.Assert(colors != null, "colors != null");

                foreach (Color color in colors)
                {
                    ColorPanel colorPanel = new ColorPanel(serviceProvider);
                    colorPanel.Click       += _colorPanel_Click;
                    colorPanel.DisplayColor = color;
                    colorPanel.Parent       = _flowLayoutPanel;
                }
            }
			/// <summary>
			/// Initializes a new instance of the <see cref="CustomColorsPanel"/> class.
			/// </summary>
			/// <param name="serviceProvider">
			/// <para>Requires:</para>
			/// <para><see cref="INuGenButtonStateTracker"/></para>
			/// <para><see cref="INuGenControlStateTracker"/></para>
			/// <para><see cref="INuGenButtonRenderer"/></para>
			/// <para><see cref="INuGenPanelRenderer"/></para>
			/// <para><see cref="INuGenColorsProvider"/></para>
			/// </param>
			public CustomColorsPanel(INuGenServiceProvider serviceProvider)
			{
				if (serviceProvider == null)
				{
					throw new ArgumentNullException("serviceProvider");
				}

				_serviceProvider = serviceProvider;

				this.Dock = DockStyle.Fill;

				_components = new Container();
				_colorDialog = new ColorDialog();
				_tableLayoutPanel = new TableLayoutPanel();
				_flowLayoutPanel = new FlowLayoutPanel();
				_otherButton = new NuGenButton(serviceProvider);

				this.InitializeColorDialog(_colorDialog);
				this.InitializeFlowLayoutPanel(_flowLayoutPanel);
				this.InitializeOtherButton(_otherButton);
				this.InitializeTableLayoutPanel(_tableLayoutPanel);

				_tableLayoutPanel.Controls.Add(_flowLayoutPanel, 0, 0);
				_tableLayoutPanel.Controls.Add(_otherButton, 0, 1);

				IList<Color> colors = null;
				this.ColorsProvider.FillWithCustomColors(out colors);
				Debug.Assert(colors != null, "colors != null");

				foreach (Color color in colors)
				{
					ColorPanel colorPanel = new ColorPanel(serviceProvider);
					colorPanel.Click += _colorPanel_Click;
					colorPanel.DisplayColor = color;
					colorPanel.Parent = _flowLayoutPanel;
				}
			}
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenHotKeyPopup"/> class.
		/// </summary>
		/// <param name="serviceProvider">Requires:<para/>
		/// <para><see cref="INuGenButtonStateTracker"/></para>
		/// <para><see cref="INuGenControlStateTracker"/></para>
		/// <para><see cref="INuGenButtonLayoutManager"/></para>
		/// <para><see cref="INuGenButtonRenderer"/></para>
		/// <para><see cref="INuGenCheckBoxLayoutManager"/></para>
		/// <para><see cref="INuGenCheckBoxRenderer"/></para>
		/// <para><see cref="INuGenComboBoxRenderer"/></para>
		/// <para><see cref="INuGenLabelLayoutManager"/></para>
		/// <para><see cref="INuGenLabelRenderer"/></para>
		/// <para><see cref="INuGenPanelRenderer"/></para>
		/// <para><see cref="INuGenControlImageManager"/></para>
		/// </param>
		/// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception>
		public NuGenHotKeyPopup(INuGenServiceProvider serviceProvider)
			: base(serviceProvider)
		{
			_modifiersLabel = new Label(serviceProvider);
			_modifiersLabel.Text = Resources.Text_HotKeysPopup_Modifiers;

			_keyLabel = new Label(serviceProvider);
			_keyLabel.Text = Resources.Text_HotKeysPopup_Key;

			_ctrlCheckBox = new NuGenCheckBox(serviceProvider);
			_ctrlCheckBox.Text = Resources.Text_HotKey_ctrlCheckBox;

			_shiftCheckBox = new NuGenCheckBox(serviceProvider);
			_shiftCheckBox.Text = Resources.Text_HotKey_shiftCheckBox;
			
			_altCheckBox = new NuGenCheckBox(serviceProvider);
			_altCheckBox.Text = Resources.Text_HotKey_altCheckBox;

			_modifiersLayoutPanel = new FlowLayoutPanel();
			_modifiersLayoutPanel.Dock = DockStyle.Fill;
			_modifiersLayoutPanel.Controls.AddRange(
				new Control[]
				{
					_ctrlCheckBox
					, _shiftCheckBox
					, _altCheckBox
				}
			);
			_modifiersLayoutPanel.Margin = _offsetMargin;

			_keyCombo = new KeyCombo(serviceProvider);
			_keyCombo.Width = 80;

			_resetButton = new NuGenButton(serviceProvider);
			_resetButton.Click += _resetButton_Click;
			_resetButton.Text = Resources.Text_HotKeysPopup_Reset;

			_keyLayoutPanel = new FlowLayoutPanel();
			_keyLayoutPanel.Dock = DockStyle.Fill;
			_keyLayoutPanel.Controls.AddRange(
				new Control[]
				{
					_keyCombo
					, _resetButton
				}
			);
			_keyLayoutPanel.Margin = _offsetMargin;

			_tableLayoutPanel = new TableLayoutPanel();
			_tableLayoutPanel.Dock = DockStyle.Fill;
			_tableLayoutPanel.Parent = this;
			_tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
			_tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 22));
			_tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 24));
			_tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 22));
			_tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 24));
			_tableLayoutPanel.Controls.Add(_modifiersLabel, 0, 0);
			_tableLayoutPanel.Controls.Add(_modifiersLayoutPanel, 0, 1);
			_tableLayoutPanel.Controls.Add(_keyLabel, 0, 2);
			_tableLayoutPanel.Controls.Add(_keyLayoutPanel, 0, 3);
		}
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NuGenHotKeyPopup"/> class.
        /// </summary>
        /// <param name="serviceProvider">Requires:<para/>
        /// <para><see cref="INuGenButtonStateTracker"/></para>
        /// <para><see cref="INuGenControlStateTracker"/></para>
        /// <para><see cref="INuGenButtonLayoutManager"/></para>
        /// <para><see cref="INuGenButtonRenderer"/></para>
        /// <para><see cref="INuGenCheckBoxLayoutManager"/></para>
        /// <para><see cref="INuGenCheckBoxRenderer"/></para>
        /// <para><see cref="INuGenComboBoxRenderer"/></para>
        /// <para><see cref="INuGenLabelLayoutManager"/></para>
        /// <para><see cref="INuGenLabelRenderer"/></para>
        /// <para><see cref="INuGenPanelRenderer"/></para>
        /// <para><see cref="INuGenControlImageManager"/></para>
        /// </param>
        /// <exception cref="ArgumentNullException"><paramref name="serviceProvider"/> is <see langword="null"/>.</exception>
        public NuGenHotKeyPopup(INuGenServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            _modifiersLabel      = new Label(serviceProvider);
            _modifiersLabel.Text = Resources.Text_HotKeysPopup_Modifiers;

            _keyLabel      = new Label(serviceProvider);
            _keyLabel.Text = Resources.Text_HotKeysPopup_Key;

            _ctrlCheckBox      = new NuGenCheckBox(serviceProvider);
            _ctrlCheckBox.Text = Resources.Text_HotKey_ctrlCheckBox;

            _shiftCheckBox      = new NuGenCheckBox(serviceProvider);
            _shiftCheckBox.Text = Resources.Text_HotKey_shiftCheckBox;

            _altCheckBox      = new NuGenCheckBox(serviceProvider);
            _altCheckBox.Text = Resources.Text_HotKey_altCheckBox;

            _modifiersLayoutPanel      = new FlowLayoutPanel();
            _modifiersLayoutPanel.Dock = DockStyle.Fill;
            _modifiersLayoutPanel.Controls.AddRange(
                new Control[]
            {
                _ctrlCheckBox
                , _shiftCheckBox
                , _altCheckBox
            }
                );
            _modifiersLayoutPanel.Margin = _offsetMargin;

            _keyCombo       = new KeyCombo(serviceProvider);
            _keyCombo.Width = 80;

            _resetButton        = new NuGenButton(serviceProvider);
            _resetButton.Click += _resetButton_Click;
            _resetButton.Text   = Resources.Text_HotKeysPopup_Reset;

            _keyLayoutPanel      = new FlowLayoutPanel();
            _keyLayoutPanel.Dock = DockStyle.Fill;
            _keyLayoutPanel.Controls.AddRange(
                new Control[]
            {
                _keyCombo
                , _resetButton
            }
                );
            _keyLayoutPanel.Margin = _offsetMargin;

            _tableLayoutPanel        = new TableLayoutPanel();
            _tableLayoutPanel.Dock   = DockStyle.Fill;
            _tableLayoutPanel.Parent = this;
            _tableLayoutPanel.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
            _tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 22));
            _tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 24));
            _tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 22));
            _tableLayoutPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 24));
            _tableLayoutPanel.Controls.Add(_modifiersLabel, 0, 0);
            _tableLayoutPanel.Controls.Add(_modifiersLayoutPanel, 0, 1);
            _tableLayoutPanel.Controls.Add(_keyLabel, 0, 2);
            _tableLayoutPanel.Controls.Add(_keyLayoutPanel, 0, 3);
        }