Skip to content

Commit

Permalink
- Update example to deal with CueText Fixes and enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Smurf-IV committed Aug 18, 2021
1 parent 03eaef8 commit 94fe884
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 101 deletions.
Expand Up @@ -129,12 +129,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KryptonFontDialog Example 2
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KryptonColorDialog Example 2019", "KryptonColorDialog Example\KryptonColorDialog Example 2019.csproj", "{8A3E3D87-FD92-4CD4-9C22-1E61057BEBA8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KryptonFileDialog Example 2019", "KryptonFileDialog Example\KryptonFileDialog Example 2019.csproj", "{36981AB6-41A4-494B-AB7C-DF01030DC292}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KryptonFolderBrowserDialog Example 2019", "KryptonFolderBrowserDialog Example\KryptonFolderBrowserDialog Example 2019.csproj", "{2B590E4B-25D2-4AE9-B5A5-F198E5C6AACD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KryptonPageSetupDialog Example 2019", "KryptonPageSetupDialog Example\KryptonPageSetupDialog Example 2019.csproj", "{DE60E7E3-B86C-47CA-BA45-11386BC6FFC0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KryptonPrintDialog Example 2019", "KryptonPrintDialog Example\KryptonPrintDialog Example 2019.csproj", "{27C591CF-E471-4170-B65B-8C2E985ECACC}"
EndProject
Global
Expand Down Expand Up @@ -383,18 +377,6 @@ Global
{8A3E3D87-FD92-4CD4-9C22-1E61057BEBA8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A3E3D87-FD92-4CD4-9C22-1E61057BEBA8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A3E3D87-FD92-4CD4-9C22-1E61057BEBA8}.Release|Any CPU.Build.0 = Release|Any CPU
{36981AB6-41A4-494B-AB7C-DF01030DC292}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{36981AB6-41A4-494B-AB7C-DF01030DC292}.Debug|Any CPU.Build.0 = Debug|Any CPU
{36981AB6-41A4-494B-AB7C-DF01030DC292}.Release|Any CPU.ActiveCfg = Release|Any CPU
{36981AB6-41A4-494B-AB7C-DF01030DC292}.Release|Any CPU.Build.0 = Release|Any CPU
{2B590E4B-25D2-4AE9-B5A5-F198E5C6AACD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B590E4B-25D2-4AE9-B5A5-F198E5C6AACD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B590E4B-25D2-4AE9-B5A5-F198E5C6AACD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B590E4B-25D2-4AE9-B5A5-F198E5C6AACD}.Release|Any CPU.Build.0 = Release|Any CPU
{DE60E7E3-B86C-47CA-BA45-11386BC6FFC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE60E7E3-B86C-47CA-BA45-11386BC6FFC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE60E7E3-B86C-47CA-BA45-11386BC6FFC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE60E7E3-B86C-47CA-BA45-11386BC6FFC0}.Release|Any CPU.Build.0 = Release|Any CPU
{27C591CF-E471-4170-B65B-8C2E985ECACC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27C591CF-E471-4170-B65B-8C2E985ECACC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27C591CF-E471-4170-B65B-8C2E985ECACC}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Binary file not shown.
137 changes: 54 additions & 83 deletions Source/Krypton Toolkit Examples/KryptonTextBox Examples/Form1.cs
Expand Up @@ -11,41 +11,29 @@
#endregion

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;

using Krypton.Toolkit;

namespace KryptonTextBoxExamples
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public Form1() => InitializeComponent();

private void Form1_Load(object sender, EventArgs e)
{
private void Form1_Load(object sender, EventArgs e) =>
// Setup the property grid to edit this text box
propertyGrid.SelectedObject = new KryptonTextBoxProxy(kryptonTextBox1Blue);
}

private void kryptonTextBox1Blue_Enter(object sender, EventArgs e)
{
private void kryptonTextBox1Blue_Enter(object sender, EventArgs e) =>
// Setup the property grid to edit this text box
propertyGrid.SelectedObject = new KryptonTextBoxProxy(sender as KryptonTextBox);
}

private void buttonSpecAny1_Click(object sender, EventArgs e)
{
kryptonTextBox2Blue.Text = string.Empty;
}
private void buttonSpecAny1_Click(object sender, EventArgs e) => kryptonTextBox2Blue.Text = string.Empty;

private void buttonSpecAny3_Click(object sender, EventArgs e)
{
kryptonTextBox5System.Text = string.Empty;
}
private void buttonSpecAny3_Click(object sender, EventArgs e) => kryptonTextBox5System.Text = string.Empty;

private void fixedText1_Click(object sender, EventArgs e)
{
Expand All @@ -65,198 +53,181 @@ private void clear_Click(object sender, EventArgs e)
kryptonTextBox9Custom.TextBox.Focus();
}

private void buttonClose_Click(object sender, EventArgs e)
{
Close();
}
private void buttonClose_Click(object sender, EventArgs e) => Close();
}

public class KryptonTextBoxProxy
{
private KryptonTextBox _textBox;

public KryptonTextBoxProxy(KryptonTextBox textBox)
{
_textBox = textBox;
}
public KryptonTextBoxProxy(KryptonTextBox textBox) => _textBox = textBox;

[Category("Appearance")]
[Description("Text for display inside the control.")]
public string Text
{
get { return _textBox.Text; }
set { _textBox.Text = value; }
get => _textBox.Text;
set => _textBox.Text = value;
}

[Category("Visuals")]
[Description("Determines if the control is always active or only when the mouse is over the control or has focus.")]
public bool AlwaysActive
{
get { return _textBox.AlwaysActive; }
set { _textBox.AlwaysActive = value; }
get => _textBox.AlwaysActive;
set => _textBox.AlwaysActive = value;
}

[Category("Appearance")]
[Description("Indicates, for multiline edit controls, which scroll bars will be shown for this control.")]
public ScrollBars ScrollBars
{
get { return _textBox.ScrollBars; }
set { _textBox.ScrollBars = value; }
get => _textBox.ScrollBars;
set => _textBox.ScrollBars = value;
}

[Category("Appearance")]
[Description("Indicates how the text should be aligned for edit controls.")]
public HorizontalAlignment TextAlign
{
get { return _textBox.TextAlign; }
set { _textBox.TextAlign = value; }
get => _textBox.TextAlign;
set => _textBox.TextAlign = value;
}

[Category("Behavior")]
[Description("Indicates if lines are automatically word-wrapped for multiline edit controls.")]
public bool WordWrap
{
get { return _textBox.WordWrap; }
set { _textBox.WordWrap = value; }
get => _textBox.WordWrap;
set => _textBox.WordWrap = value;
}

[Category("Behavior")]
[Description("Control whether the text in the control can span more than one line.")]
public bool Multiline
{
get { return _textBox.Multiline; }
set { _textBox.Multiline = value; }
get => _textBox.Multiline;
set => _textBox.Multiline = value;
}

[Category("Behavior")]
[Description("Indicates if return characters are accepted as input for multiline edit controls.")]
public bool AcceptsReturn
{
get { return _textBox.AcceptsReturn; }
set { _textBox.AcceptsReturn = value; }
get => _textBox.AcceptsReturn;
set => _textBox.AcceptsReturn = value;
}

[Category("Behavior")]
[Description("Indicates if tab characters are accepted as input for multiline edit controls.")]
public bool AcceptsTab
{
get { return _textBox.AcceptsTab; }
set { _textBox.AcceptsTab = value; }
get => _textBox.AcceptsTab;
set => _textBox.AcceptsTab = value;
}

[Category("Behavior")]
[Description("Indicates if all the characters should be left alone or converted to uppercase or lowercase.")]
public CharacterCasing CharacterCasing
{
get { return _textBox.CharacterCasing; }
set { _textBox.CharacterCasing = value; }
get => _textBox.CharacterCasing;
set => _textBox.CharacterCasing = value;
}

[Category("Behavior")]
[Description("Indicates that the selection should be hidden when the edit control loses focus.")]
public bool HideSelection
{
get { return _textBox.HideSelection; }
set { _textBox.HideSelection = value; }
get => _textBox.HideSelection;
set => _textBox.HideSelection = value;
}

[Category("Behavior")]
[Description("Specifies the maximum number of characters that can be entered into the edit control.")]
public int MaxLength
{
get { return _textBox.MaxLength; }
set { _textBox.MaxLength = value; }
get => _textBox.MaxLength;
set => _textBox.MaxLength = value;
}

[Category("Behavior")]
[Description("Controls whether the text in the edit control can be changed or not.")]
public bool ReadOnly
{
get { return _textBox.ReadOnly; }
set { _textBox.ReadOnly = value; }
get => _textBox.ReadOnly;
set => _textBox.ReadOnly = value;
}

[Category("Behavior")]
[Description("Indicates the character to display for password input for single-line edit controls.")]
public char PasswordChar
{
get { return _textBox.PasswordChar; }
set { _textBox.PasswordChar = value; }
get => _textBox.PasswordChar;
set => _textBox.PasswordChar = value;
}

[Category("Behavior")]
[Description("Indicates if the text in the edit control should appear as the default password character.")]
public bool UseSystemPasswordChar
{
get { return _textBox.UseSystemPasswordChar; }
set { _textBox.UseSystemPasswordChar = value; }
get => _textBox.UseSystemPasswordChar;
set => _textBox.UseSystemPasswordChar = value;
}

[Category("Visuals")]
[Description("Input control style.")]
public InputControlStyle InputControlStyle
{
get { return _textBox.InputControlStyle; }
set { _textBox.InputControlStyle = value; }
get => _textBox.InputControlStyle;
set => _textBox.InputControlStyle = value;
}

[Category("Visuals")]
[Description("Should tooltips be displayed for button specs.")]
public bool AllowButtonSpecToolTips
{
get { return _textBox.AllowButtonSpecToolTips; }
set { _textBox.AllowButtonSpecToolTips = value; }
get => _textBox.AllowButtonSpecToolTips;
set => _textBox.AllowButtonSpecToolTips = value;
}

[Category("Visuals")]
[Description("Collection of button specifications.")]
public KryptonTextBox.TextBoxButtonSpecCollection ButtonSpecs
{
get { return _textBox.ButtonSpecs; }
}
public KryptonTextBox.TextBoxButtonSpecCollection ButtonSpecs => _textBox.ButtonSpecs;

[Category("Visuals")]
[Description("Initialize a new instance of the PaletteCueHintText class.")]
public PaletteCueHintText CueHintText => _textBox.CueHint;

[Category("Visuals")]
[Description("Overrides for defining common textbox appearance that other states can override.")]
public PaletteInputControlTripleRedirect StateCommon
{
get { return _textBox.StateCommon; }
}
public PaletteInputControlTripleRedirect StateCommon => _textBox.StateCommon;

[Category("Visuals")]
[Description("Overrides for defining disabled textbox appearance.")]
public PaletteInputControlTripleStates StateDisabled
{
get { return _textBox.StateDisabled; }
}
public PaletteInputControlTripleStates StateDisabled => _textBox.StateDisabled;

[Category("Visuals")]
[Description("Overrides for defining normal textbox appearance.")]
public PaletteInputControlTripleStates StateNormal
{
get { return _textBox.StateNormal; }
}
public PaletteInputControlTripleStates StateNormal => _textBox.StateNormal;

[Category("Visuals")]
[Description("Overrides for defining active textbox appearance.")]
public PaletteInputControlTripleStates StateActive
{
get { return _textBox.StateActive; }
}
public PaletteInputControlTripleStates StateActive => _textBox.StateActive;

[Category("Layout")]
[Description("The size of the control is pixels.")]
public Size Size
{
get { return _textBox.Size; }
set { _textBox.Size = value; }
get => _textBox.Size;
set => _textBox.Size = value;
}

[Category("Layout")]
[Description("The location of the control in pixels.")]
public Point Location
{
get { return _textBox.Location; }
set { _textBox.Location = value; }
get => _textBox.Location;
set => _textBox.Location = value;
}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 94fe884

Please sign in to comment.