/// <summary>
        /// Initialise a new instance of the KryptonRibbonGroupNumericUpDown class.
        /// </summary>
        public KryptonRibbonGroupNumericUpDown()
        {
            // Default fields
            _visible = true;
            _enabled = true;
            _itemSizeCurrent = GroupItemSize.Medium;
            _shortcutKeys = Keys.None;
            _keyTip = "X";

            // Create the actual numeric up-down control and set initial settings
            _numericUpDown = new KryptonNumericUpDown();
            _numericUpDown.InputControlStyle = InputControlStyle.Ribbon;
            _numericUpDown.AlwaysActive = false;
            _numericUpDown.MinimumSize = new Size(121, 0);
            _numericUpDown.MaximumSize = new Size(121, 0);
            _numericUpDown.TabStop = false;

            // Hook into events to expose via this container
            _numericUpDown.ValueChanged += new EventHandler(OnNumericUpDownValueChanged);
            _numericUpDown.GotFocus += new EventHandler(OnNumericUpDownGotFocus);
            _numericUpDown.LostFocus += new EventHandler(OnNumericUpDownLostFocus);
            _numericUpDown.KeyDown += new KeyEventHandler(OnNumericUpDownKeyDown);
            _numericUpDown.KeyUp += new KeyEventHandler(OnNumericUpDownKeyUp);
            _numericUpDown.KeyPress += new KeyPressEventHandler(OnNumericUpDownKeyPress);
            _numericUpDown.PreviewKeyDown += new PreviewKeyDownEventHandler(OnNumericUpDownPreviewKeyDown);

            // Ensure we can track mouse events on the numeric up-down
            MonitorControl(_numericUpDown);
        }
        /// <summary>
        /// Initialise a new instance of the KryptonRibbonGroupTrackBar class.
        /// </summary>
        public KryptonRibbonGroupTrackBar()
        {
            // Default fields
            _visible = true;
            _enabled = true;
            _itemSizeCurrent = GroupItemSize.Medium;
            _keyTip = "T";
            _minimumLength = 55;
            _maximumLength = 55;

            // Create the actual track barcontrol and set initial settings
            _trackBar = new KryptonTrackBar();
            _trackBar.DrawBackground = false;
            _trackBar.TickStyle = TickStyle.None;
            _trackBar.MinimumSize = new Size(_minimumLength, 0);
            _trackBar.MaximumSize = new Size(_maximumLength, 0);
            _trackBar.TabStop = false;

            // Hook into events to expose via this container
            _trackBar.GotFocus += new EventHandler(OnTrackBarGotFocus);
            _trackBar.LostFocus += new EventHandler(OnTrackBarLostFocus);
            _trackBar.ValueChanged += new EventHandler(OnTrackBarValueChanged);

            // Ensure we can track mouse events on the track bar
            MonitorControl(_trackBar);
        }
        public KryptonRibbonGroupDateTimePicker()
        {
            // Default fields
            _visible = true;
            _itemSizeCurrent = GroupItemSize.Medium;
            _shortcutKeys = Keys.None;
            _keyTip = "X";

            // Create the actual date time picker control and set initial settings
            _dateTimePicker = new KryptonDateTimePicker();
            _dateTimePicker.InputControlStyle = InputControlStyle.Ribbon;
            _dateTimePicker.AlwaysActive = false;
            _dateTimePicker.MinimumSize = new Size(180, 0);
            _dateTimePicker.MaximumSize = new Size(180, 0);
            _dateTimePicker.TabStop = false;

            // Hook into events to expose via this container
            _dateTimePicker.ValueChanged += new EventHandler(OnDateTimePickerValueChanged);
            _dateTimePicker.ValueNullableChanged += new EventHandler(OnDateTimePickerValueNullableChanged);
            _dateTimePicker.DropDown += new EventHandler<DateTimePickerDropArgs>(OnDateTimePickerDropDown);
            _dateTimePicker.CloseUp += new EventHandler<DateTimePickerCloseArgs>(OnDateTimePickerCloseUp);
            _dateTimePicker.CheckedChanged += new EventHandler(OnDateTimePickerCheckedChanged);
            _dateTimePicker.FormatChanged += new EventHandler(OnDateTimePickerFormatChanged);
            _dateTimePicker.GotFocus += new EventHandler(OnDateTimePickerGotFocus);
            _dateTimePicker.LostFocus += new EventHandler(OnDateTimePickerLostFocus);
            _dateTimePicker.KeyDown += new KeyEventHandler(OnDateTimePickerKeyDown);
            _dateTimePicker.KeyUp += new KeyEventHandler(OnDateTimePickerKeyUp);
            _dateTimePicker.KeyPress += new KeyPressEventHandler(OnDateTimePickerKeyPress);
            _dateTimePicker.PreviewKeyDown += new PreviewKeyDownEventHandler(OnDateTimePickerKeyDown);

            // Ensure we can track mouse events on the date time picker
            MonitorControl(_dateTimePicker);
        }
        /// <summary>
        /// Initialize a new instance of the ViewDrawRibbonGroupColorButton class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="ribbonColorButton">Reference to source color button definition.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public ViewDrawRibbonGroupColorButton(KryptonRibbon ribbon,
                                              KryptonRibbonGroupColorButton ribbonColorButton,
                                              NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(ribbonColorButton != null);
            Debug.Assert(needPaint != null);

            // Remember incoming references
            _ribbon = ribbon;
            _ribbonColorButton = ribbonColorButton;
            _needPaint = needPaint;
            _currentSize = _ribbonColorButton.ItemSizeCurrent;

            // Associate this view with the source component (required for design time selection)
            Component = _ribbonColorButton;

            // Create the different views for different sizes of the button
            CreateLargeButtonView();
            CreateMediumSmallButtonView();

            // Update all views to reflect current button state
            UpdateEnabledState();
            UpdateCheckedState();
            UpdateDropDownState();
            UpdateItemSizeState();

            // Hook into changes in the ribbon button definition
            _ribbonColorButton.PropertyChanged += new PropertyChangedEventHandler(OnButtonPropertyChanged);
        }
        /// <summary>
        /// Initialize a new instance of the ViewDrawRibbonGroupCheckBox class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="ribbonCheckBox">Reference to source check box definition.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public ViewDrawRibbonGroupCheckBox(KryptonRibbon ribbon,
                                           KryptonRibbonGroupCheckBox ribbonCheckBox,
                                           NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(ribbonCheckBox != null);
            Debug.Assert(needPaint != null);

            // Remember incoming references
            _ribbon = ribbon;
            _ribbonCheckBox = ribbonCheckBox;
            _needPaint = needPaint;
            _currentSize = _ribbonCheckBox.ItemSizeCurrent;

            // Create delegate used to process end of click action
            _finishDelegateLarge = new EventHandler(ActionFinishedLarge);
            _finishDelegateMediumSmall = new EventHandler(ActionFinishedMediumSmall);

            // Associate this view with the source component (required for design time selection)
            Component = _ribbonCheckBox;

            // Create the different views for different sizes of the check box
            CreateLargeCheckBoxView();
            CreateMediumSmallCheckBoxView();

            // Update all views to reflect current check box state
            UpdateEnabledState();
            UpdateCheckState();
            UpdateItemSizeState();

            // Hook into changes in the ribbon check box definition
            _ribbonCheckBox.PropertyChanged += new PropertyChangedEventHandler(OnCheckBoxPropertyChanged);
        }
        public KryptonRibbonGroupTextBox()
        {
            // Default fields
            _visible = true;
            _enabled = true;
            _itemSizeCurrent = GroupItemSize.Medium;
            _shortcutKeys = Keys.None;
            _keyTip = "X";

            // Create the actual text box control and set initial settings
            _textBox = new KryptonTextBox();
            _textBox.InputControlStyle = InputControlStyle.Ribbon;
            _textBox.AlwaysActive = false;
            _textBox.MinimumSize = new Size(121, 0);
            _textBox.MaximumSize = new Size(121, 0);
            _textBox.TabStop = false;

            // Hook into events to expose via this container
            _textBox.AcceptsTabChanged += new EventHandler(OnTextBoxAcceptsTabChanged);
            _textBox.TextAlignChanged += new EventHandler(OnTextBoxTextAlignChanged);
            _textBox.TextChanged += new EventHandler(OnTextBoxTextChanged);
            _textBox.HideSelectionChanged += new EventHandler(OnTextBoxHideSelectionChanged);
            _textBox.ModifiedChanged += new EventHandler(OnTextBoxModifiedChanged);
            _textBox.MultilineChanged += new EventHandler(OnTextBoxMultilineChanged);
            _textBox.ReadOnlyChanged += new EventHandler(OnTextBoxReadOnlyChanged);
            _textBox.GotFocus += new EventHandler(OnTextBoxGotFocus);
            _textBox.LostFocus += new EventHandler(OnTextBoxLostFocus);
            _textBox.KeyDown += new KeyEventHandler(OnTextBoxKeyDown);
            _textBox.KeyUp += new KeyEventHandler(OnTextBoxKeyUp);
            _textBox.KeyPress += new KeyPressEventHandler(OnTextBoxKeyPress);
            _textBox.PreviewKeyDown += new PreviewKeyDownEventHandler(OnTextBoxPreviewKeyDown);

            // Ensure we can track mouse events on the text box
            MonitorControl(_textBox);
        }
 /// <summary>
 /// Initialise a new instance of the KryptonRibbonGroupCustom class.
 /// </summary>
 public KryptonRibbonGroupCustomControl()
 {
     // Default fields
     _visible = true;
     _enabled = true;
     _itemSizeCurrent = GroupItemSize.Medium;
     _customControl = null;
     _shortcutKeys = Keys.None;
     _keyTip = "X";
 }
        /// <summary>
        /// Initialize a new instance of the ViewDrawRibbonDesignGroupTriple class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="ribbonTriple">Associated ribbon group triple.</param>
        /// <param name="currentSize">Size the view should use.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public ViewDrawRibbonDesignGroupTriple(KryptonRibbon ribbon,
                                               KryptonRibbonGroupTriple ribbonTriple,
                                               GroupItemSize currentSize,
                                               NeedPaintHandler needPaint)
            : base(ribbon, needPaint)
        {
            Debug.Assert(ribbonTriple != null);

            _ribbonTriple = ribbonTriple;
            _currentSize = currentSize;
        }
        /// <summary>
        /// Initialize a new instance of the ViewDrawRibbonDesignGroupLines class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="ribbonLines">Associated ribbon group lines.</param>
        /// <param name="currentSize">Size the view should use.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public ViewDrawRibbonDesignGroupLines(KryptonRibbon ribbon,
                                              KryptonRibbonGroupLines ribbonLines,
                                              GroupItemSize currentSize,
                                              NeedPaintHandler needPaint)
            : base(ribbon, needPaint)
        {
            Debug.Assert(ribbonLines != null);

            _ribbonLines = ribbonLines;
            _currentSize = currentSize;
        }
        /// <summary>
        /// Initialize a new instance of the ViewDrawRibbonGroupGallery class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="ribbonGallery">Reference to source gallery.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public ViewDrawRibbonGroupGallery(KryptonRibbon ribbon,
                                          KryptonRibbonGroupGallery ribbonGallery,
                                          NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(ribbonGallery != null);
            Debug.Assert(needPaint != null);

            // Remember incoming references
            _ribbon = ribbon;
            _ribbonGallery = ribbonGallery;
            _needPaint = needPaint;
            _currentSize = _ribbonGallery.ItemSizeCurrent;

            // Create the button view used in small setting
            CreateLargeButtonView();

            // Hook into the gallery events
            _ribbonGallery.MouseEnterControl += new EventHandler(OnMouseEnterControl);
            _ribbonGallery.MouseLeaveControl += new EventHandler(OnMouseLeaveControl);

            // Associate this view with the source component (required for design time selection)
            Component = _ribbonGallery;

            if (_ribbon.InDesignMode)
            {
                // At design time we need to know when the user right clicks the gallery
                ContextClickController controller = new ContextClickController();
                controller.ContextClick += new MouseEventHandler(OnContextClick);
                MouseController = controller;
            }

            // Create controller needed for handling focus and key tip actions
            _controller = new GalleryController(_ribbon, _ribbonGallery, this);
            SourceController = _controller;
            KeyController = _controller;

            // We need to rest visibility of the gallery for each layout cycle
            _ribbon.ViewRibbonManager.LayoutBefore += new EventHandler(OnLayoutAction);
            _ribbon.ViewRibbonManager.LayoutAfter += new EventHandler(OnLayoutAction);

            // Define back reference to view for the gallery definition
            _ribbonGallery.GalleryView = this;

            // Give paint delegate to gallery so its palette changes are redrawn
            _ribbonGallery.ViewPaintDelegate = needPaint;

            // Hook into changes in the ribbon custom definition
            _ribbonGallery.PropertyChanged += new PropertyChangedEventHandler(OnGalleryPropertyChanged);
        }
        /// <summary>
        /// Initialise a new instance of the KryptonRibbonGroupLines class.
        /// </summary>
        public KryptonRibbonGroupLines()
        {
            // Default fields
            _visible = true;
            _itemSizeMax = GroupItemSize.Large;
            _itemSizeMin = GroupItemSize.Small;
            _itemSizeCurrent = GroupItemSize.Large;

            // Create collection for holding triple items
            _ribbonLineItems = new KryptonRibbonGroupLinesCollection();
            _ribbonLineItems.Clearing += new EventHandler(OnRibbonGroupLineClearing);
            _ribbonLineItems.Cleared += new EventHandler(OnRibbonGroupLineCleared);
            _ribbonLineItems.Inserted += new TypedHandler<KryptonRibbonGroupItem>(OnRibbonGroupLineInserted);
            _ribbonLineItems.Removed += new TypedHandler<KryptonRibbonGroupItem>(OnRibbonGroupLineRemoved);
        }
        /// <summary>
        /// Initialise a new instance of the KryptonRibbonGroupCluster class.
        /// </summary>
        public KryptonRibbonGroupCluster()
        {
            // Default fields
            _itemSizeMax = GroupItemSize.Medium;
            _itemSizeMin = GroupItemSize.Small;
            _itemSizeCurrent = GroupItemSize.Medium;
            _visible = true;

            // Create collection for holding triple items
            _ribbonClusterItems = new KryptonRibbonGroupClusterCollection();
            _ribbonClusterItems.Clearing += new EventHandler(OnRibbonGroupClusterClearing);
            _ribbonClusterItems.Cleared += new EventHandler(OnRibbonGroupClusterCleared);
            _ribbonClusterItems.Inserted += new TypedHandler<KryptonRibbonGroupItem>(OnRibbonGroupClusterInserted);
            _ribbonClusterItems.Removed += new TypedHandler<KryptonRibbonGroupItem>(OnRibbonGroupClusterRemoved);
        }
        /// <summary>
        /// Initialize a new instance of the ViewDrawRibbonGroupCustom class.
        /// </summary>
        /// <param name="ribbon">Reference to owning ribbon control.</param>
        /// <param name="ribbonCustom">Reference to source custom definition.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public ViewDrawRibbonGroupCustomControl(KryptonRibbon ribbon,
                                                KryptonRibbonGroupCustomControl ribbonCustom,
                                                NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(ribbonCustom != null);
            Debug.Assert(needPaint != null);

            // Remember incoming references
            _ribbon = ribbon;
            _ribbonCustomControl = ribbonCustom;
            _needPaint = needPaint;
            _currentSize = _ribbonCustomControl.ItemSizeCurrent;

            // Hook into the custom control events
            _ribbonCustomControl.MouseEnterControl += new EventHandler(OnMouseEnterControl);
            _ribbonCustomControl.MouseLeaveControl += new EventHandler(OnMouseLeaveControl);

            // Associate this view with the source component (required for design time selection)
            Component = _ribbonCustomControl;

            if (_ribbon.InDesignMode)
            {
                // At design time we need to know when the user right clicks the label
                ContextClickController controller = new ContextClickController();
                controller.ContextClick += new MouseEventHandler(OnContextClick);
                MouseController = controller;
            }

            // Create controller needed for handling focus and key tip actions
            _controller = new CustomControlController(_ribbon, _ribbonCustomControl, this);
            SourceController = _controller;
            KeyController = _controller;

            // We need to rest visibility of the custom control for each layout cycle
            _ribbon.ViewRibbonManager.LayoutBefore += new EventHandler(OnLayoutAction);
            _ribbon.ViewRibbonManager.LayoutAfter += new EventHandler(OnLayoutAction);

            // Provide back reference to the custom control definition
            _ribbonCustomControl.CustomControlView = this;

            // Give paint delegate to label so its palette changes are redrawn
            _ribbonCustomControl.ViewPaintDelegate = needPaint;

            // Hook into changes in the ribbon custom definition
            _ribbonCustomControl.PropertyChanged += new PropertyChangedEventHandler(OnCustomPropertyChanged);
        }
 /// <summary>
 /// Initialise a new instance of the KryptonRibbonGroupRadioButton class.
 /// </summary>
 public KryptonRibbonGroupRadioButton()
 {
     // Default fields
     _enabled = true;
     _visible = true;
     _checked = false;
     _autoCheck = true;
     _shortcutKeys = Keys.None;
     _textLine1 = "RadioButton";
     _textLine2 = string.Empty;
     _keyTip = "R";
     _itemSizeMax = GroupItemSize.Large;
     _itemSizeMin = GroupItemSize.Small;
     _itemSizeCurrent = GroupItemSize.Large;
     _toolTipImageTransparentColor = Color.Empty;
     _toolTipTitle = string.Empty;
     _toolTipBody = string.Empty;
     _toolTipStyle = LabelStyle.SuperTip;
 }
        /// <summary>
        /// Initialise a new instance of the KryptonRibbonGroupComboBox class.
        /// </summary>
        public KryptonRibbonGroupComboBox()
        {
            // Default fields
            _visible = true;
            _enabled = true;
            _itemSizeCurrent = GroupItemSize.Medium;
            _shortcutKeys = Keys.None;
            _keyTip = "X";

            // Create the actual combo box control and set initial settings
            _comboBox = new KryptonComboBox();
            _comboBox.InputControlStyle = InputControlStyle.Ribbon;
            _comboBox.AlwaysActive = false;
            _comboBox.MinimumSize = new Size(121, 0);
            _comboBox.MaximumSize = new Size(121, 0);
            _comboBox.TabStop = false;

            // Hook into the events that are then exposed via ourself
            _comboBox.DropDown += new EventHandler(OnComboBoxDropDown);
            _comboBox.DropDownClosed += new EventHandler(OnComboBoxDropDownClosed);
            _comboBox.DropDownStyleChanged += new EventHandler(OnComboBoxDropDownStyleChanged);
            _comboBox.SelectedIndexChanged += new EventHandler(OnComboBoxSelectedIndexChanged);
            _comboBox.SelectionChangeCommitted += new EventHandler(OnComboBoxSelectionChangeCommitted);
            _comboBox.TextUpdate += new EventHandler(OnComboBoxTextUpdate);
            _comboBox.GotFocus += new EventHandler(OnComboBoxGotFocus);
            _comboBox.LostFocus += new EventHandler(OnComboBoxLostFocus);
            _comboBox.KeyDown += new KeyEventHandler(OnComboBoxKeyDown);
            _comboBox.KeyUp += new KeyEventHandler(OnComboBoxKeyUp);
            _comboBox.KeyPress += new KeyPressEventHandler(OnComboBoxKeyPress);
            _comboBox.PreviewKeyDown += new PreviewKeyDownEventHandler(OnComboBoxPreviewKeyDown);
            _comboBox.DataSourceChanged += new EventHandler(OnComboBoxDataSourceChanged);
            _comboBox.DisplayMemberChanged += new EventHandler(OnComboBoxDisplayMemberChanged);
            _comboBox.Format += new ListControlConvertEventHandler(OnComboBoxFormat);
            _comboBox.FormatInfoChanged += new EventHandler(OnComboBoxFormatInfoChanged);
            _comboBox.FormatStringChanged += new EventHandler(OnComboBoxFormatStringChanged);
            _comboBox.FormattingEnabledChanged += new EventHandler(OnComboBoxFormattingEnabledChanged);
            _comboBox.SelectedValueChanged += new EventHandler(OnComboBoxSelectedValueChanged);
            _comboBox.ValueMemberChanged += new EventHandler(OnComboBoxValueMemberChanged);

            // Ensure we can track mouse events on the text box
            MonitorControl(_comboBox);
        }
 /// <summary>
 /// Initialise a new instance of the KryptonRibbonGroupClusterButton class.
 /// </summary>
 public KryptonRibbonGroupClusterButton()
 {
     // Default fields
     _enabled = true;
     _visible = true;
     _checked = false;
     _textLine = string.Empty;
     _keyTip = "B";
     _shortcutKeys = Keys.None;
     _itemSizeMax = GroupItemSize.Medium;
     _itemSizeMin = GroupItemSize.Small;
     _itemSizeCurrent = GroupItemSize.Medium;
     _imageSmall = _defaultButtonImageSmall;
     _buttonType = GroupButtonType.Push;
     _contextMenuStrip = null;
     _kryptonContextMenu = null;
     _toolTipImageTransparentColor = Color.Empty;
     _toolTipTitle = string.Empty;
     _toolTipBody = string.Empty;
     _toolTipStyle = LabelStyle.SuperTip;
 }
Пример #17
0
        /// <summary>
        /// Initialise a new instance of the KryptonRibbonGroupLabel class.
        /// </summary>
        public KryptonRibbonGroupLabel()
        {
            // Default fields
            _visible = true;
            _enabled = true;
            _imageSmall = null;
            _imageLarge = null;
            _textLine1 = "Label";
            _textLine2 = string.Empty;
            _itemSizeCurrent = GroupItemSize.Medium;
            _toolTipImageTransparentColor = Color.Empty;
            _toolTipTitle = string.Empty;
            _toolTipBody = string.Empty;
            _toolTipStyle = LabelStyle.SuperTip;

            // Create delegate fired by a change to one of the state palettes
            _needPaintDelegate = new NeedPaintHandler(OnPaletteNeedPaint);

            // Create palette entries for customizing the label text color
            _stateNormal = new PaletteRibbonText(_needPaintDelegate);
            _stateDisabled = new PaletteRibbonText(_needPaintDelegate);
        }
        /// <summary>
        /// Initialise a new instance of the KryptonRibbonGroupGallery class.
        /// </summary>
        public KryptonRibbonGroupGallery()
        {
            // Default fields
            _visible = true;
            _enabled = true;
            _keyTip = "X";
            _itemSizeMax = GroupItemSize.Large;
            _itemSizeMin = GroupItemSize.Small;
            _itemSizeCurrent = GroupItemSize.Large;
            _largeItemCount = 9;
            _mediumItemCount = 3;
            _dropButtonItemWidth = 9;
            _imageLarge = _defaultButtonImageLarge;
            _textLine1 = "Gallery";
            _textLine2 = string.Empty;
            _toolTipImageTransparentColor = Color.Empty;
            _toolTipTitle = string.Empty;
            _toolTipBody = string.Empty;
            _toolTipStyle = LabelStyle.SuperTip;

            // Create the actual text box control and set initial settings
            _gallery = new KryptonGallery();
            _gallery.AlwaysActive = false;
            _gallery.TabStop = false;
            _gallery.InternalPreferredItemSize = new Size(_largeItemCount, 1);

            // Hook into events to expose via this container
            _gallery.SelectedIndexChanged += new EventHandler(OnGallerySelectedIndexChanged);
            _gallery.ImageListChanged += new EventHandler(OnGalleryImageListChanged);
            _gallery.TrackingImage += new EventHandler<ImageSelectEventArgs>(OnGalleryTrackingImage);
            _gallery.GalleryDropMenu += new EventHandler<GalleryDropMenuEventArgs>(OnGalleryGalleryDropMenu);
            _gallery.GotFocus += new EventHandler(OnGalleryGotFocus);
            _gallery.LostFocus += new EventHandler(OnGalleryLostFocus);

            // Ensure we can track mouse events on the gallery
            MonitorControl(_gallery);
        }
        public KryptonRibbonGroupMaskedTextBox()
        {
            // Default fields
            _visible = true;
            _enabled = true;
            _itemSizeCurrent = GroupItemSize.Medium;
            _shortcutKeys = Keys.None;
            _keyTip = "X";

            // Create the actual masked text box control and set initial settings
            _maskedTextBox = new KryptonMaskedTextBox();
            _maskedTextBox.InputControlStyle = InputControlStyle.Ribbon;
            _maskedTextBox.AlwaysActive = false;
            _maskedTextBox.MinimumSize = new Size(121, 0);
            _maskedTextBox.MaximumSize = new Size(121, 0);
            _maskedTextBox.TabStop = false;

            // Hook into events to expose via our container
            _maskedTextBox.TextAlignChanged += new EventHandler(OnMaskedTextBoxTextAlignChanged);
            _maskedTextBox.TextChanged += new EventHandler(OnMaskedTextBoxTextChanged);
            _maskedTextBox.HideSelectionChanged += new EventHandler(OnMaskedTextBoxHideSelectionChanged);
            _maskedTextBox.ModifiedChanged += new EventHandler(OnMaskedTextBoxModifiedChanged);
            _maskedTextBox.ReadOnlyChanged += new EventHandler(OnMaskedTextBoxReadOnlyChanged);
            _maskedTextBox.MaskChanged += new EventHandler(OnMaskedMaskChanged);
            _maskedTextBox.IsOverwriteModeChanged += new EventHandler(OnMaskedIsOverwriteModeChanged);
            _maskedTextBox.MaskInputRejected += new MaskInputRejectedEventHandler(OnMaskedMaskInputRejected);
            _maskedTextBox.TypeValidationCompleted += new TypeValidationEventHandler(OnMaskedTypeValidationCompleted);
            _maskedTextBox.GotFocus += new EventHandler(OnMaskedTextBoxGotFocus);
            _maskedTextBox.LostFocus += new EventHandler(OnMaskedTextBoxLostFocus);
            _maskedTextBox.KeyDown += new KeyEventHandler(OnMaskedTextBoxKeyDown);
            _maskedTextBox.KeyUp += new KeyEventHandler(OnMaskedTextBoxKeyUp);
            _maskedTextBox.KeyPress += new KeyPressEventHandler(OnMaskedTextBoxKeyPress);
            _maskedTextBox.PreviewKeyDown += new PreviewKeyDownEventHandler(OnMaskedTextBoxPreviewKeyDown);

            // Ensure we can track mouse events on the masked text box
            MonitorControl(_maskedTextBox);
        }
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = _ribbonDateTimePicker.ItemSizeCurrent;
 }
Пример #21
0
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = GroupDomainUpDown.ItemSizeCurrent;
 }
 private void UpdateItemSizeState(GroupItemSize size)
 {
     _currentSize = size;
     _viewMediumSmallCenter.CurrentSize = size;
     _viewMediumSmallText1.Visible = (size != GroupItemSize.Small);
 }
Пример #23
0
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = GroupTrackBar.ItemSizeCurrent;
 }
        /// <summary>
        /// Gets an array of the allowed possible sizes of the container.
        /// </summary>
        /// <param name="context">Context used to calculate the sizes.</param>
        /// <returns>Array of size values.</returns>
        public ItemSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
        {
            // Ensure the control has the correct parent
            UpdateParent(context.Control);

            if (LastGallery != null)
            {
                Size originalItemSize = LastGallery.PreferredItemSize;
                GroupItemSize originalSize = _currentSize;

                // Create a list of results
                List<ItemSizeWidth> results = new List<ItemSizeWidth>();

                // Are we allowed to be in the large size?
                if (_ribbonGallery.ItemSizeMaximum == GroupItemSize.Large)
                {
                    // Allow a maximum of 39 steps between the large and medium values (with a minimum of 1)
                    int step = Math.Max(1, (_ribbonGallery.LargeItemCount - _ribbonGallery.MediumItemCount) / 20);

                    // Process each step from large to medium
                    int itemCount = _ribbonGallery.LargeItemCount;
                    while (itemCount > _ribbonGallery.MediumItemCount)
                    {
                        LastGallery.InternalPreferredItemSize = new Size(itemCount, 1);
                        results.Add(new ItemSizeWidth(GroupItemSize.Large, GetPreferredSize(context).Width, itemCount));
                        itemCount -= step;
                    }
                }

                // Are we allowed to be in the medium size?
                if (((int)_ribbonGallery.ItemSizeMaximum >= (int)GroupItemSize.Medium) &&
                    ((int)_ribbonGallery.ItemSizeMinimum <= (int)GroupItemSize.Medium))
                {
                    LastGallery.InternalPreferredItemSize = new Size(_ribbonGallery.MediumItemCount, 1);
                    ItemSizeWidth mediumWidth = new ItemSizeWidth(GroupItemSize.Medium, GetPreferredSize(context).Width);

                    if (_ribbon.InDesignHelperMode)
                    {
                        // Only add if we are the first calculation, as in design mode we
                        // always provide a single possible size which is the largest item
                        if (results.Count == 0)
                            results.Add(mediumWidth);
                    }
                    else
                    {
                        // Only add the medium size if there is no other entry or we are
                        // smaller than the existing size and so represent a useful shrinkage
                        if ((results.Count == 0) || (results[results.Count - 1].Width > mediumWidth.Width))
                            results.Add(mediumWidth);
                    }
                }

                // Are we allowed to be in the small size?
                if ((int)_ribbonGallery.ItemSizeMinimum == (int)GroupItemSize.Small)
                {
                    // Temporary set the item size to be size
                    _viewLarge.Visible = true;
                    _currentSize = GroupItemSize.Small;

                    // Get the width of the large button view
                    ItemSizeWidth smallWidth = new ItemSizeWidth(GroupItemSize.Small, GetPreferredSize(context).Width);

                    if (_ribbon.InDesignHelperMode)
                    {
                        // Only add if we are the first calculation, as in design mode we
                        // always provide a single possible size which is the largest item
                        if (results.Count == 0)
                            results.Add(smallWidth);
                    }
                    else
                    {
                        // Only add the medium size if there is no other entry or we are
                        // smaller than the existing size and so represent a useful shrinkage
                        if ((results.Count == 0) || (results[results.Count - 1].Width > smallWidth.Width))
                            results.Add(smallWidth);
                    }
                }

                // Ensure original value is put back
                LastGallery.InternalPreferredItemSize = originalItemSize;
                _currentSize = originalSize;

                return results.ToArray();
            }
            else
                return new ItemSizeWidth[] { new ItemSizeWidth(GroupItemSize.Large, NULL_CONTROL_WIDTH) };
        }
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = _ribbonMaskedTextBox.ItemSizeCurrent;
 }
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = GroupDateTimePicker.ItemSizeCurrent;
 }
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = _ribbonDomainUpDown.ItemSizeCurrent;
 }
Пример #28
0
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = _ribbonComboBox.ItemSizeCurrent;
 }
Пример #29
0
 private void UpdateItemSizeState(GroupItemSize size)
 {
     _currentSize = size;
     _viewMediumSmallCenter.CurrentSize = size;
     _viewMediumSmallText1.Visible      = (size != GroupItemSize.Small);
 }
        /// <summary>
        /// Gets an array of the allowed possible sizes of the container.
        /// </summary>
        /// <param name="context">Context used to calculate the sizes.</param>
        /// <returns>Array of size values.</returns>
        public ItemSizeWidth[] GetPossibleSizes(ViewLayoutContext context)
        {
            // Ensure the control has the correct parent
            UpdateParent(context.Control);

            if (LastGallery != null)
            {
                Size          originalItemSize = LastGallery.PreferredItemSize;
                GroupItemSize originalSize     = _currentSize;

                // Create a list of results
                List <ItemSizeWidth> results = new List <ItemSizeWidth>();

                // Are we allowed to be in the large size?
                if (GroupGallery.ItemSizeMaximum == GroupItemSize.Large)
                {
                    // Allow a maximum of 39 steps between the large and medium values (with a minimum of 1)
                    int step = Math.Max(1, (GroupGallery.LargeItemCount - GroupGallery.MediumItemCount) / 20);

                    // Process each step from large to medium
                    int itemCount = GroupGallery.LargeItemCount;
                    while (itemCount > GroupGallery.MediumItemCount)
                    {
                        LastGallery.InternalPreferredItemSize = new Size(itemCount, 1);
                        results.Add(new ItemSizeWidth(GroupItemSize.Large, GetPreferredSize(context).Width, itemCount));
                        itemCount -= step;
                    }
                }

                // Are we allowed to be in the medium size?
                if (((int)GroupGallery.ItemSizeMaximum >= (int)GroupItemSize.Medium) &&
                    ((int)GroupGallery.ItemSizeMinimum <= (int)GroupItemSize.Medium))
                {
                    LastGallery.InternalPreferredItemSize = new Size(GroupGallery.MediumItemCount, 1);
                    ItemSizeWidth mediumWidth = new ItemSizeWidth(GroupItemSize.Medium, GetPreferredSize(context).Width);

                    if (_ribbon.InDesignHelperMode)
                    {
                        // Only add if we are the first calculation, as in design mode we
                        // always provide a single possible size which is the largest item
                        if (results.Count == 0)
                        {
                            results.Add(mediumWidth);
                        }
                    }
                    else
                    {
                        // Only add the medium size if there is no other entry or we are
                        // smaller than the existing size and so represent a useful shrinkage
                        if ((results.Count == 0) || (results[results.Count - 1].Width > mediumWidth.Width))
                        {
                            results.Add(mediumWidth);
                        }
                    }
                }

                // Are we allowed to be in the small size?
                if ((int)GroupGallery.ItemSizeMinimum == (int)GroupItemSize.Small)
                {
                    // Temporary set the item size to be size
                    _viewLarge.Visible = true;
                    _currentSize       = GroupItemSize.Small;

                    // Get the width of the large button view
                    ItemSizeWidth smallWidth = new ItemSizeWidth(GroupItemSize.Small, GetPreferredSize(context).Width);

                    if (_ribbon.InDesignHelperMode)
                    {
                        // Only add if we are the first calculation, as in design mode we
                        // always provide a single possible size which is the largest item
                        if (results.Count == 0)
                        {
                            results.Add(smallWidth);
                        }
                    }
                    else
                    {
                        // Only add the medium size if there is no other entry or we are
                        // smaller than the existing size and so represent a useful shrinkage
                        if ((results.Count == 0) || (results[results.Count - 1].Width > smallWidth.Width))
                        {
                            results.Add(smallWidth);
                        }
                    }
                }

                // Ensure original value is put back
                LastGallery.InternalPreferredItemSize = originalItemSize;
                _currentSize = originalSize;

                return(results.ToArray());
            }
            else
            {
                return(new ItemSizeWidth[] { new ItemSizeWidth(GroupItemSize.Large, NULL_CONTROL_WIDTH) });
            }
        }
 /// <summary>
 /// Override the group item size if possible.
 /// </summary>
 /// <param name="size">New size to use.</param>
 public void SetGroupItemSize(GroupItemSize size)
 {
     UpdateItemSizeState(size);
 }
Пример #32
0
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = _ribbonRichTextBox.ItemSizeCurrent;
 }
Пример #33
0
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = GroupCustomControl.ItemSizeCurrent;
 }
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = GroupComboBox.ItemSizeCurrent;
 }
Пример #35
0
 /// <summary>
 /// Override the group item size if possible.
 /// </summary>
 /// <param name="size">New size to use.</param>
 public void SetGroupItemSize(GroupItemSize size)
 {
     _currentSize = size;
 }
 /// <summary>
 /// Override the group item size if possible.
 /// </summary>
 /// <param name="size">New size to use.</param>
 public void SetGroupItemSize(GroupItemSize size)
 {
     _currentSize = size;
 }
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = GroupMaskedTextBox.ItemSizeCurrent;
 }
        /// <summary>
        /// Initialise a new instance of the KryptonRibbonGroupColorButton class.
        /// </summary>
        public KryptonRibbonGroupColorButton()
        {
            // Default fields
            _enabled = true;
            _visible = true;
            _checked = false;
            _visibleThemes = true;
            _visibleStandard = true;
            _visibleRecent = true;
            _visibleNoColor = true;
            _visibleMoreColors = true;
            _autoRecentColors = true;
            _shortcutKeys = Keys.None;
            _imageSmall = _defaultButtonImageSmall;
            _imageLarge = _defaultButtonImageLarge;
            _textLine1 = "Color";
            _textLine2 = string.Empty;
            _keyTip = "B";
            _selectedColor = Color.Red;
            _emptyBorderColor = Color.DarkGray;
            _selectedRectSmall = new Rectangle(0, 12, 16, 4);
            _selectedRectLarge = new Rectangle(2, 26, 28, 4);
            _schemeThemes = ColorScheme.OfficeThemes;
            _schemeStandard = ColorScheme.OfficeStandard;
            _buttonType = GroupButtonType.Split;
            _itemSizeMax = GroupItemSize.Large;
            _itemSizeMin = GroupItemSize.Small;
            _itemSizeCurrent = GroupItemSize.Large;
            _toolTipImageTransparentColor = Color.Empty;
            _toolTipTitle = string.Empty;
            _toolTipBody = string.Empty;
            _toolTipStyle = LabelStyle.SuperTip;
            _maxRecentColors = 10;
            _recentColors = new List<Color>();

            // Create the context menu items
            _kryptonContextMenu = new KryptonContextMenu();
            _separatorTheme = new KryptonContextMenuSeparator();
            _headingTheme = new KryptonContextMenuHeading("Theme Colors");
            _colorsTheme = new KryptonContextMenuColorColumns(ColorScheme.OfficeThemes);
            _separatorStandard = new KryptonContextMenuSeparator();
            _headingStandard = new KryptonContextMenuHeading("Standard Colors");
            _colorsStandard = new KryptonContextMenuColorColumns(ColorScheme.OfficeStandard);
            _separatorRecent = new KryptonContextMenuSeparator();
            _headingRecent = new KryptonContextMenuHeading("Recent Colors");
            _colorsRecent = new KryptonContextMenuColorColumns(ColorScheme.None);
            _separatorNoColor = new KryptonContextMenuSeparator();
            _itemNoColor = new KryptonContextMenuItem("&No Color", Properties.Resources.ButtonNoColor, new EventHandler(OnClickNoColor));
            _itemsNoColor = new KryptonContextMenuItems();
            _itemsNoColor.Items.Add(_itemNoColor);
            _separatorMoreColors = new KryptonContextMenuSeparator();
            _itemMoreColors = new KryptonContextMenuItem("&More Colors...", new EventHandler(OnClickMoreColors));
            _itemsMoreColors = new KryptonContextMenuItems();
            _itemsMoreColors.Items.Add(_itemMoreColors);
            _kryptonContextMenu.Items.AddRange(new KryptonContextMenuItemBase[] { _separatorTheme, _headingTheme, _colorsTheme,
                                                                                  _separatorStandard, _headingStandard, _colorsStandard,
                                                                                  _separatorRecent, _headingRecent, _colorsRecent,
                                                                                  _separatorNoColor, _itemsNoColor,
                                                                                  _separatorMoreColors, _itemsMoreColors});
        }
Пример #39
0
 /// <summary>
 /// Override the group item size if possible.
 /// </summary>
 /// <param name="size">New size to use.</param>
 public void SetGroupItemSize(GroupItemSize size)
 {
     UpdateItemSizeState(size);
 }
        private void UpdateItemSizeState(GroupItemSize size)
        {
            _currentSize = size;

            switch (size)
            {
                case GroupItemSize.Small:
                case GroupItemSize.Medium:
                    bool show = (size == GroupItemSize.Medium);
                    _viewMediumSmallCenter.CurrentSize = size;
                    _viewMediumSmallText1.Visible = show;
                    _viewMediumSmallText2.Visible = show;
                    DefineRootView(_viewMediumSmall);
                    break;
                case GroupItemSize.Large:
                    _viewLargeCenter.CurrentSize = size;
                    DefineRootView(_viewLarge);
                    break;
            }
        }
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = GroupNumericUpDown.ItemSizeCurrent;
 }
 /// <summary>
 /// Reset the group item size to the item definition.
 /// </summary>
 public void ResetGroupItemSize()
 {
     _currentSize = _ribbonNumericUpDown.ItemSizeCurrent;
 }
Пример #43
0
 /// <summary>
 /// Initialize a new instance of the ItemSizeWidth class.
 /// </summary>
 /// <param name="itemSize">Group item size.</param>
 /// <param name="width">Width associated with the item size.</param>
 public ItemSizeWidth(GroupItemSize itemSize, int width)
     : this(itemSize, width, -1)
 {
 }