/// <summary> /// Creates new instance of the class. /// </summary> public VisualControlBase() { this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.Opaque, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(SystemOptions.DoubleBufferFlag, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.SetStyle(ControlStyles.Selectable, true); this.IsAccessible = true; _Colors = new InputControlColors(); _Colors.ColorChanged += new EventHandler(ColorsColorChanged); _ButtonCustom = new InputButtonSettings(this); _ButtonCustom2 = new InputButtonSettings(this); _RootVisual = CreateRootVisual(); _RootVisual.ArrangeInvalid += new EventHandler(VisualArrangeInvalid); _RootVisual.RenderInvalid += new EventHandler(VisualRenderInvalid); _BackgroundStyle.Class = ElementStyleClassKeys.DateTimeInputBackgroundKey; _BackgroundStyle.SetColorScheme(this.ColorScheme); _BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged); ApplyFieldNavigation(); }
/// <summary> /// Initializes a new instance of the IpAddressInput class. /// </summary> public IpAddressInput():base() { _ButtonClear = new InputButtonSettings(this); _ButtonDropDown = new InputButtonSettings(this); _ButtonFreeText = new InputButtonSettings(this); _IpGroup = this.RootVisualItem as IpAddressGroup; }
/// <summary> /// Initializes a new instance of the NumericInputBase class. /// </summary> public NumericInputBase() : base() { _ButtonClear = new InputButtonSettings(this); _ButtonDropDown = new InputButtonSettings(this); _ButtonFreeText = new InputButtonSettings(this); _ButtonCalculator = new InputButtonSettings(this); _InputGroup = this.RootVisualItem as VisualInputGroup; _InputGroup.AutoOverwrite = false; this.InputHorizontalAlignment = eHorizontalAlignment.Right; }
public TextBoxX() { #if FRAMEWORK20 _ButtonCustom = new InputButtonSettings(this); _ButtonCustom2 = new InputButtonSettings(this); CreateButtonGroup(); #endif m_BorderStyle = new ElementStyle(); m_BorderStyle.StyleChanged += new EventHandler(BorderStyle_StyleChanged); m_NCPainter = new NonClientPaintHandler(this, eScrollBarSkin.Optimized); base.BorderStyle = BorderStyle.None; this.AutoSize = false; StyleManager.Register(this); }
private void InitControl() { _BackgroundStyle.SetColorScheme(this.ColorScheme); _BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged); _ButtonCustom = new InputButtonSettings(this); _ButtonCustom2 = new InputButtonSettings(this); _ButtonClear = new InputButtonSettings(this); _ButtonDropDown = new InputButtonSettings(this); CreateButtonGroup(); _TextBox.BorderStyle = BorderStyle.None; _TextBox.TextChanged += new EventHandler(TextBoxTextChanged); _TextBox.TextAlignChanged += new EventHandler(TextBoxTextAlignChanged); _TextBox.SizeChanged += new EventHandler(TextBoxSizeChanged); _TextBox.ModifiedChanged += new EventHandler(TextBoxModifiedChanged); _TextBox.KeyPress += new KeyPressEventHandler(TextBoxKeyPress); _TextBox.KeyDown += new KeyEventHandler(TextBoxKeyDown); this.Controls.Add(_TextBox); }
protected override void OnInputButtonSettingsChanged(InputButtonSettings inputButtonSettings) { UpdateInputFieldAlignment(); base.OnInputButtonSettingsChanged(inputButtonSettings); }
protected override VisualItem CreateButton(InputButtonSettings buttonSettings) { VisualItem item = null; if (buttonSettings == _ButtonDropDown) { item = new VisualDropDownButton(); ApplyButtonSettings(buttonSettings, item as VisualButton); } else item = base.CreateButton(buttonSettings); VisualButton button = item as VisualButton; button.ClickAutoRepeat = false; if (buttonSettings == _ButtonClear) { if (buttonSettings.Image == null) button.Image = DevComponents.DotNetBar.BarFunctions.LoadBitmap("SystemImages.DateReset.png"); } else if (buttonSettings == _ButtonFreeText) { if (buttonSettings.Image == null) button.Image = DevComponents.DotNetBar.BarFunctions.LoadBitmap("SystemImages.FreeText.png"); button.Checked = buttonSettings.Checked; } else if (buttonSettings == _ButtonCalculator) { if (buttonSettings.Image == null) button.Image = DevComponents.DotNetBar.BarFunctions.LoadBitmap("SystemImages.Calculator.png"); button.Checked = buttonSettings.Checked; } return item; }
protected virtual void ApplyButtonSettings(InputButtonSettings buttonSettings, VisualButton button) { button.Text = buttonSettings.Text; button.Image = buttonSettings.Image; button.ItemType = eSystemItemType.SystemButton; button.Enabled = buttonSettings.Enabled; button.Shortcut = buttonSettings.Shortcut; }
protected virtual VisualItem CreateButton(InputButtonSettings buttonSettings) { VisualItem item = null; if (buttonSettings == _ButtonDropDown) { item = new VisualDropDownButton(); ApplyButtonSettings(buttonSettings, item as VisualButton); } else { item = new VisualCustomButton(); ApplyButtonSettings(buttonSettings, item as VisualButton); } VisualButton button = item as VisualButton; button.ClickAutoRepeat = false; if (buttonSettings == _ButtonClear) { if (buttonSettings.Image == null) button.Image = DevComponents.DotNetBar.BarFunctions.LoadBitmap("SystemImages.DateReset.png"); } return item; }
protected virtual void OnInputButtonSettingsChanged(InputButtonSettings inputButtonSettings) { UpdateButtons(); }
void IInputButtonControl.InputButtonSettingsChanged(InputButtonSettings inputButtonSettings) { OnInputButtonSettingsChanged(inputButtonSettings); }
private void InitControl() { _BackgroundStyle.SetColorScheme(this.ColorScheme); _BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged); _ButtonCustom = new InputButtonSettings(this); _ButtonCustom2 = new InputButtonSettings(this); _ButtonClear = new InputButtonSettings(this); _ButtonDropDown = new InputButtonSettings(this); CreateButtonGroup(); //_TextBox = new TextBoxX(); //_TextBox.BorderStyle = BorderStyle.None; //_TextBox.TextChanged += new EventHandler(TextBoxTextChanged); //_TextBox.TextAlignChanged += new EventHandler(TextBoxTextAlignChanged); //_TextBox.SizeChanged += new EventHandler(TextBoxSizeChanged); //_TextBox.Visible=false; ////_TextBox.ModifiedChanged += new EventHandler(TextBoxModifiedChanged); //this.Controls.Add(_TextBox); // Init popup tree _AdvTree = new DevComponents.AdvTree.AdvTree(); #if (!TRIAL) _AdvTree.LicenseKey = "F962CEC7-CD8F-4911-A9E9-CAB39962FC1F"; #endif _AdvTree.BackgroundStyle.Reset(); _AdvTree.BackgroundStyle.BackColor = SystemColors.Window; _AdvTree.BackgroundStyle.Border = eStyleBorderType.None; _AdvTree.ExpandButtonType = eExpandButtonType.Triangle; _AdvTree.DragDropEnabled = false; _AdvTree.HotTracking = true; _AdvTree.Indent = 6; _AdvTree.SelectionFocusAware = false; ElementStyle nodeStyle = new ElementStyle(); nodeStyle.Name = "nodeElementStyle"; nodeStyle.TextColor = System.Drawing.SystemColors.ControlText; _AdvTree.NodeStyle = nodeStyle; _AdvTree.PathSeparator = ";"; _AdvTree.Styles.Add(nodeStyle); _AdvTree.AfterNodeSelect += new AdvTreeNodeEventHandler(TreeAfterNodeSelect); _AdvTree.BeforeNodeSelect += new AdvTreeNodeCancelEventHandler(TreeBeforeNodeSelect); _AdvTree.NodeMouseDown += new TreeNodeMouseEventHandler(TreeNodeMouseDown); this.DropDownControl = _AdvTree; }
private int GetImageWidth(InputButtonSettings ibs) { if (ibs.Visible == true) return (ibs.Image != null ? ibs.Image.Width : 16); return (0); }
private void InitControl() { _BackgroundStyle.SetColorScheme(this.ColorScheme); _BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged); _ButtonCustom = new InputButtonSettings(this); _ButtonCustom2 = new InputButtonSettings(this); _ButtonClear = new InputButtonSettings(this); _ButtonDropDown = new InputButtonSettings(this); CreateButtonGroup(); _MaskedTextBox.BorderStyle = BorderStyle.None; _MaskedTextBox.TextChanged += new EventHandler(MaskedTextBoxTextChanged); _MaskedTextBox.IsOverwriteModeChanged += new EventHandler(MaskedTextBoxIsOverwriteModeChanged); _MaskedTextBox.MaskChanged += new EventHandler(MaskedTextBoxMaskChanged); _MaskedTextBox.MaskInputRejected += new MaskInputRejectedEventHandler(MaskedTextBoxMaskInputRejected); _MaskedTextBox.TextAlignChanged += new EventHandler(MaskedTextBoxTextAlignChanged); _MaskedTextBox.TypeValidationCompleted += new TypeValidationEventHandler(MaskedTextBoxTypeValidationCompleted); _MaskedTextBox.SizeChanged += new EventHandler(MaskedTextBoxSizeChanged); this.Controls.Add(_MaskedTextBox); }
/// <summary> /// Copies properties to new instance of the item. /// </summary> /// <param name="copy">New InputButtonSettings instance</param> internal void CopyToItem(InputButtonSettings copy) { copy.Visible = Visible; copy.Enabled = Enabled; copy.DisplayPosition = DisplayPosition; copy.Image = Image; copy.Text = Text; copy.Checked = Checked; copy.Shortcut = Shortcut; }
protected virtual VisualItem CreateButton(InputButtonSettings buttonSettings) { VisualCustomButton button = new VisualCustomButton(); ApplyButtonSettings(buttonSettings, button); return button; }