C# Class Support.UI.QueryPanel

Exibir arquivo Open project: nhmkdev/cardmaker

Protected Properties

Property Type Description
X_LABEL_SIZE int
m_nButtonHeight int
m_zPanel System.Windows.Forms.Panel
m_zTabControl System.Windows.Forms.TabControl

Public Methods

Method Description
AddButton ( string sLabel, int nDesiredWidth, EventHandler eHandler, object zQueryKey ) : Button

Adds a button

AddCheckBox ( string sLabel, bool bCheckDefault, object zQueryKey ) : CheckBox

Adds a check box with an associated label.

AddComboBox ( string sLabel, string arrayEntries, int nDefaultIndex, object zQueryKey ) : ComboBox

Adds a ComboBox

AddDateTimePicker ( string sLabel, DateTimePickerFormat eFormat, System.DateTime dtValue, object zQueryKey ) : DateTimePicker

Adds a DateTime picker field

AddEnableControl ( object zQueryKey, object zQueryKeyEnable ) : bool

Adds the specified control to be enabled when the given control is enabled.

AddEnableControls ( object zQueryKey, object arrayQueryKeyEnable ) : bool

Adds the specified controls to be enabled when the given control is enabled.

AddFileBrowseBox ( string sLabel, string sDefault, string sFilter, object zQueryKey ) : TextBox

Adds a file browser component.

AddFolderBrowseBox ( string sLabel, string sDefault, object zQueryKey ) : TextBox

Adds a folder browser component

AddLabel ( string sLabel, int nHeight ) : Label

Adds a label

AddListBox ( string sLabel, string arrayEntries, int arraySelected, bool bMultiSelect, int nHeight, object zQueryKey ) : ListBox

Adds a ListBox with the specified items and selected items

AddMultiLineTextBox ( string sLabel, string sDefaultValue, int nHeight, object zQueryKey ) : TextBox

Adds a multiline TextBox

AddNumericBox ( string sLabel, decimal dDefault, decimal dMin, decimal dMax, decimal dIncrement, int nDecimalPlaces, object zQueryKey ) : NumericUpDown

Adds a NumericUpDown

AddNumericBox ( string sLabel, decimal dDefault, decimal dMin, decimal dMax, object zQueryKey ) : NumericUpDown

Adds a NumericUpDown

AddNumericBoxSlider ( string sLabel, bool bFloat, decimal dDefault, decimal dMin, decimal dMax, object zQueryKey ) : NumericUpDown

Adds a NumericUpDown with associated slider

AddPullDownBox ( string sLabel, string arrayEntries, int nDefaultIndex, object zQueryKey ) : ComboBox

Adds a ComboBox with the pulldownlist style.

AddTab ( string sTabName ) : TabPage

Creates a Tab

AddTextBox ( string sLabel, string sDefaultValue, bool bPassword, object zQueryKey ) : TextBox

Adds a TextBox

AddVerticalSpace ( int nHeight ) : void

Adds vertical spacing

ChangeToTab ( string sTabName ) : void

Changes to the tab specified and creates it if necessary

GetBool ( object zQueryKey ) : bool

Gets the state of the specified check box

GetControl ( object zQueryKey ) : Control

Gets the control associated with the query key

GetDateTime ( object zQueryKey ) : System.DateTime

Returns the DateTime of the specified control.

GetDecimal ( object zQueryKey ) : decimal

GetIndex ( object zQueryKey ) : int

Gets the index of the specified combo box

GetIndices ( object zQueryKey ) : int[]

Gets the selected indices of the given control

GetString ( object zQueryKey ) : string

Gets the string value of the specified control

GetStrings ( object zQueryKey ) : string[]

Gets the selected strings of the control

QueryPanel ( Panel zPanel, bool bTabbed ) : System

QueryPanel ( Panel zPanel, int nLabelWidth, bool bTabbed ) : System

SetupScrollState ( ScrollableControl scrollableControl ) : void
UpdateEnableStates ( ) : void

Protected Methods

Method Description
GetYPosition ( ) : int

Gets the current y position (based on the current layout control)

numeric_ValueChanged ( object sender, EventArgs e ) : void

Handles generic numeric change

Private Methods

Method Description
AddBrowseBox ( string sLabel, string sDefault, string sFilter, object zQueryKey ) : TextBox

Adds a browse component (button/textbox/label)

AddComboBox ( string sLabel, string arrayEntries, int nDefaultIndex, bool bPulldown, object zQueryKey ) : ComboBox

Adds a combo box with the items specified (based on the type specified)

AddTextBox ( string sLabel, string sDefaultValue, bool bMultiLine, bool bPassword, int nHeight, object zQueryKey ) : TextBox

Adds a TextBox

AddToYPosition ( int nYAmount ) : void

Sets the Y position for the current layout control (panel, tab etc.)

CreateLabel ( string sLabel ) : Label

Created a label based on the current y position

GetLabelWidth ( Label zLabel ) : int

This gets the width of the label + the control buffer (or 0 if the label is empty)

GetQueryItem ( object zQueryKey ) : QueryItem

InitPanel ( Panel zPanel, bool bTabbed ) : void

SetupControl ( Control zControl, Label zLabel, ControlType eType, bool bApplySize, object zQueryKey ) : void

Support method to setup the control location/size. This method also adds the control to the form.

ThrowBadQueryException ( ) : void

Used to throw a general exception when the query key specified is wrong

ThrowWrongTypeException ( ) : void

Used to throw a general exception when the wrong type is queried

numericSlider_ValueChanged ( object sender, EventArgs e ) : void

Handles generic numeric slider change

zButton_Click ( object sender, EventArgs e ) : void

Generic button press (used for the browse file/folder box)

Method Details

AddButton() public method

Adds a button
public AddButton ( string sLabel, int nDesiredWidth, EventHandler eHandler, object zQueryKey ) : Button
sLabel string Text label of the button
nDesiredWidth int The desired width of the button
eHandler EventHandler The event handler to associated with the button
zQueryKey object The query key for requesting the value
return System.Windows.Forms.Button

AddCheckBox() public method

Adds a check box with an associated label.
public AddCheckBox ( string sLabel, bool bCheckDefault, object zQueryKey ) : CheckBox
sLabel string Label seting
bCheckDefault bool Default check box state
zQueryKey object The query key for requesting the value
return System.Windows.Forms.CheckBox

AddComboBox() public method

Adds a ComboBox
public AddComboBox ( string sLabel, string arrayEntries, int nDefaultIndex, object zQueryKey ) : ComboBox
sLabel string Label string
arrayEntries string Array of strings to be used in the combo box
nDefaultIndex int Default index of the combo box
zQueryKey object The query key for requesting the value
return System.Windows.Forms.ComboBox

AddDateTimePicker() public method

Adds a DateTime picker field
public AddDateTimePicker ( string sLabel, DateTimePickerFormat eFormat, System.DateTime dtValue, object zQueryKey ) : DateTimePicker
sLabel string Label string
eFormat DateTimePickerFormat DateTimePickerFormat to control the visual component
dtValue System.DateTime The default date time value
zQueryKey object The query key for requesting the value
return System.Windows.Forms.DateTimePicker

AddEnableControl() public method

Adds the specified control to be enabled when the given control is enabled.
public AddEnableControl ( object zQueryKey, object zQueryKeyEnable ) : bool
zQueryKey object The parent control to base the enable state on
zQueryKeyEnable object The control to enable/disable based on the parent control state
return bool

AddEnableControls() public method

Adds the specified controls to be enabled when the given control is enabled.
public AddEnableControls ( object zQueryKey, object arrayQueryKeyEnable ) : bool
zQueryKey object The parent control to base the enable state on
arrayQueryKeyEnable object string[] of controls to enable/disable based on the parent control state
return bool

AddFileBrowseBox() public method

Adds a file browser component.
public AddFileBrowseBox ( string sLabel, string sDefault, string sFilter, object zQueryKey ) : TextBox
sLabel string Label string
sDefault string Default string
sFilter string File filter (standard format for OpenFileDialog), string.empty for default *.*
zQueryKey object The query key for requesting the value
return System.Windows.Forms.TextBox

AddFolderBrowseBox() public method

Adds a folder browser component
public AddFolderBrowseBox ( string sLabel, string sDefault, object zQueryKey ) : TextBox
sLabel string Label string
sDefault string Default string
zQueryKey object The query key for requesting the value
return System.Windows.Forms.TextBox

AddLabel() public method

Adds a label
public AddLabel ( string sLabel, int nHeight ) : Label
sLabel string Label string
nHeight int Label height
return System.Windows.Forms.Label

AddListBox() public method

Adds a ListBox with the specified items and selected items
public AddListBox ( string sLabel, string arrayEntries, int arraySelected, bool bMultiSelect, int nHeight, object zQueryKey ) : ListBox
sLabel string Label string
arrayEntries string Array of strings as entries
arraySelected int Array of indicies to select
bMultiSelect bool Flag indicating whether multiple items can be selected
nHeight int The desired height of the ListBox
zQueryKey object The query key for requesting the value
return System.Windows.Forms.ListBox

AddMultiLineTextBox() public method

Adds a multiline TextBox
public AddMultiLineTextBox ( string sLabel, string sDefaultValue, int nHeight, object zQueryKey ) : TextBox
sLabel string Label string
sDefaultValue string Default text
nHeight int Height of the TextBox
zQueryKey object The query key for requesting the value
return System.Windows.Forms.TextBox

AddNumericBox() public method

Adds a NumericUpDown
public AddNumericBox ( string sLabel, decimal dDefault, decimal dMin, decimal dMax, decimal dIncrement, int nDecimalPlaces, object zQueryKey ) : NumericUpDown
sLabel string Label string
dDefault decimal Default value
dMin decimal Minimum value
dMax decimal Maximum value
dIncrement decimal Increment amout
nDecimalPlaces int decimal places
zQueryKey object The query key for requesting the value
return System.Windows.Forms.NumericUpDown

AddNumericBox() public method

Adds a NumericUpDown
public AddNumericBox ( string sLabel, decimal dDefault, decimal dMin, decimal dMax, object zQueryKey ) : NumericUpDown
sLabel string Label string
dDefault decimal Default value
dMin decimal Minimum value
dMax decimal Maximum value
zQueryKey object The query key for requesting the value
return System.Windows.Forms.NumericUpDown

AddNumericBoxSlider() public method

Adds a NumericUpDown with associated slider
public AddNumericBoxSlider ( string sLabel, bool bFloat, decimal dDefault, decimal dMin, decimal dMax, object zQueryKey ) : NumericUpDown
sLabel string Label string
bFloat bool Flag indicating whether the values associated are floating point
dDefault decimal Default value
dMin decimal Minimum value
dMax decimal Maximum value
zQueryKey object The query key for requesting the value
return System.Windows.Forms.NumericUpDown

AddPullDownBox() public method

Adds a ComboBox with the pulldownlist style.
public AddPullDownBox ( string sLabel, string arrayEntries, int nDefaultIndex, object zQueryKey ) : ComboBox
sLabel string Label string
arrayEntries string Array of strings to be used in the combo box
nDefaultIndex int Default index of the combo box
zQueryKey object The query key for requesting the value
return System.Windows.Forms.ComboBox

AddTab() public method

Creates a Tab
public AddTab ( string sTabName ) : TabPage
sTabName string Name of the tab to create
return System.Windows.Forms.TabPage

AddTextBox() public method

Adds a TextBox
public AddTextBox ( string sLabel, string sDefaultValue, bool bPassword, object zQueryKey ) : TextBox
sLabel string Label string
sDefaultValue string Default text
bPassword bool Flag indicating that this is a password textbox
zQueryKey object The query key for requesting the value
return System.Windows.Forms.TextBox

AddVerticalSpace() public method

Adds vertical spacing
public AddVerticalSpace ( int nHeight ) : void
nHeight int The amount of space to add.
return void

ChangeToTab() public method

Changes to the tab specified and creates it if necessary
public ChangeToTab ( string sTabName ) : void
sTabName string Name of the tab to change to
return void

GetBool() public method

Gets the state of the specified check box
public GetBool ( object zQueryKey ) : bool
zQueryKey object The query key for requesting the value
return bool

GetControl() public method

Gets the control associated with the query key
public GetControl ( object zQueryKey ) : Control
zQueryKey object The query key for requesting the value
return System.Windows.Forms.Control

GetDateTime() public method

Returns the DateTime of the specified control.
public GetDateTime ( object zQueryKey ) : System.DateTime
zQueryKey object The query key for requesting the value
return System.DateTime

GetDecimal() public method

public GetDecimal ( object zQueryKey ) : decimal
zQueryKey object The query key for requesting the value
return decimal

GetIndex() public method

Gets the index of the specified combo box
public GetIndex ( object zQueryKey ) : int
zQueryKey object The query key for requesting the value
return int

GetIndices() public method

Gets the selected indices of the given control
public GetIndices ( object zQueryKey ) : int[]
zQueryKey object The query key for requesting the value
return int[]

GetString() public method

Gets the string value of the specified control
public GetString ( object zQueryKey ) : string
zQueryKey object The query key for requesting the value
return string

GetStrings() public method

Gets the selected strings of the control
public GetStrings ( object zQueryKey ) : string[]
zQueryKey object The query key for requesting the value
return string[]

GetYPosition() protected method

Gets the current y position (based on the current layout control)
protected GetYPosition ( ) : int
return int

QueryPanel() public method

public QueryPanel ( Panel zPanel, bool bTabbed ) : System
zPanel System.Windows.Forms.Panel Empty Panel to add controls to
bTabbed bool Flag indicating whether to use a tab control
return System

QueryPanel() public method

public QueryPanel ( Panel zPanel, int nLabelWidth, bool bTabbed ) : System
zPanel System.Windows.Forms.Panel Empty Panel to add controls to
nLabelWidth int Desired with of labels
bTabbed bool Flag indicating whether to use a tab control
return System

SetupScrollState() public static method

public static SetupScrollState ( ScrollableControl scrollableControl ) : void
scrollableControl System.Windows.Forms.ScrollableControl
return void

UpdateEnableStates() public method

public UpdateEnableStates ( ) : void
return void

numeric_ValueChanged() protected method

Handles generic numeric change
protected numeric_ValueChanged ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

Property Details

X_LABEL_SIZE protected_oe property

protected int X_LABEL_SIZE
return int

m_nButtonHeight protected_oe property

protected int m_nButtonHeight
return int

m_zPanel protected_oe property

protected Panel,System.Windows.Forms m_zPanel
return System.Windows.Forms.Panel

m_zTabControl protected_oe property

protected TabControl,System.Windows.Forms m_zTabControl
return System.Windows.Forms.TabControl