diff --git a/docs/dev/controls/_template.md b/docs/dev/controls/_template.md index 8fb2c19..ba49314 100644 --- a/docs/dev/controls/_template.md +++ b/docs/dev/controls/_template.md @@ -31,6 +31,14 @@ If there are variations of the control available feel free to expand this sectio --- +## Parent Controls + +Reference all inheritances here. + +- Control + +--- + ## Available Parameters and Arguments Describe here what parameters are available for this `Control`. diff --git a/docs/dev/controls/container.md b/docs/dev/controls/container.md new file mode 100644 index 0000000..a383226 --- /dev/null +++ b/docs/dev/controls/container.md @@ -0,0 +1,72 @@ +--- +id: control-container +title: Container +--- + +The `Container` control is the base for other controls. + +*This documentation is a WIP and probably not exhaustive.* + +--- + +## Usage Example + +`Container` is an abstract class which provides base functionality for other controls. + +--- + +## Parent Controls + +- Control + +--- + +## Available Parameters and Arguments + +**WidthSizingMode** +Type: *SizingMode* +Determines how the width of this container should be handled. +*(optional)* + +**HeightSizingMode** +Type: *SizingMode* +Determines how the height of this container should be handled. +*(optional)* + +**AutoSizePadding** +Type: *Point* +If `HeightSizingMode` or `WidthSizingMode` is set to `SizingMode.AutoSize`, +then `AutoSizePadding` is added to the size. +*(optional)* + +--- + +## Available Methods + +A list of `Methods` and `EventHandlers` to hook onto. + +### Methods + +**AddChild** +Adds a child to the control. + +**RemoveChild** +Removes a child from the control. + +**ClearChildren** +Removes all children from the control. + +### EventHandler + +**ChildAdded** + +**ChildRemoved** + +**ContentResized** + +--- + +## Remarks + +*This documentation is a WIP and probably not exhaustive.* + diff --git a/docs/dev/controls/control.md b/docs/dev/controls/control.md new file mode 100644 index 0000000..d79ac90 --- /dev/null +++ b/docs/dev/controls/control.md @@ -0,0 +1,117 @@ +--- +id: control-control +title: Control +--- + +The `Control` control is the base for all other controls. + +*This documentation is a WIP and probably not exhaustive.* + +--- + +## Usage Example + +`Control` is an abstract class which provides base functionality for all other controls. + +--- + +## Available Parameters and Arguments + +**Size** +Type: *Point* +The size of the control. Both the X and Y component must be greater than 0. +*(optional)* + +**Location** +Type: *Point* +The position of the control within its `Parent`. + +**Parent** +Type: *Panel* +Parent control + +**ContextMenuStrip** +Type: *ContextMenuStrip* +If provided, the menu will display when the control is right-clicked on. +*(optional)* + +**Tooltip** +Type: *Tooltip* +If provided, the Tooltip will display when the mouse is over the control. +Do not use this if you are already using `BasicTooltipText`. +*(optional)* + +**BasicTooltipText** +Type: *String* +If provided, a tooltip will be shown with the provided text when the mouse is over the control. +Do not use this if you are already using `Tooltip`. +*(optional)* + +**Opacity** +Type: *Float* +Set an opacity level for the control. +*(optional)* + +**Visible** +Type: *Bool* +Toggle visibility of the control. +*(optional)* + +**Enabled** +Type: *Bool* +Toggle control. +*(optional)* + +**Padding** +Type: *Thickness* +Set the control padding. +*(optional)* + +**BackgroundColor** +Type: *Color* +Set the background color of the control. +*(optional)* + +--- + +## Available Methods + +A list of `Methods` and `EventHandlers` to hook onto. + +### EventHandler + +**Click** +Alias for `LeftMouseButtonReleased` with the difference that it only fires if `Enabled` is true. + +**LeftMouseButtonPressed** + +**LeftMouseButtonReleased** + +**MouseMoved** + +**RightMouseButtonPressed** + +**RightMouseButtonReleased** + +**MouseWheelScrolled** + +**MouseEntered** + +**MouseLeft** + +**Shown** + +**Hidden** + +**Resized** + +**Moved** + +**Disposed** + +--- + +## Remarks + +*This documentation is a WIP and probably not exhaustive.* + diff --git a/docs/dev/controls/image.md b/docs/dev/controls/image.md index cbaf523..53bd390 100644 --- a/docs/dev/controls/image.md +++ b/docs/dev/controls/image.md @@ -14,7 +14,7 @@ The `Image` control adds a image asset to your layout. This example shows how to use the `Image` control. ```cs -var exampleImage = new Image(Texture2D Icon) +var exampleImage = new Image(Texture2D Texture) { Size = new Point(40, 40), Location = new Point(0, 0), @@ -24,27 +24,26 @@ var exampleImage = new Image(Texture2D Icon) --- -## Available Parameters and Arguments +## Parent Controls + +- Control + +--- -**Size** -Type: *Point* -Size of the control *(optional)* +## Available Parameters and Arguments -**Location** -Type: *Point* -Position of the control within parent Panel +**Texture** +Type: *AsyncTexture2D* +Texture the control will show -**Parent** -Type: *Panel* -Parent Panel +**SpriteEffects** +Type: *SpriteEffects* +*(optional)* **Tint** Type: *Color* -Tint the control *(optional)* - -**BasicTooltipText** -Type: *String* -Display a tooltip text on mouse hover *(optional)* +Apply a tint the control +*(optional)* --- @@ -52,8 +51,7 @@ Display a tooltip text on mouse hover *(optional)* A list of `Methods` and `EventHandlers` to hook onto. -**Click** -Call a method when clicking. +see parent controls --- diff --git a/docs/dev/controls/label.md b/docs/dev/controls/label.md index 023aded..ffb8aed 100644 --- a/docs/dev/controls/label.md +++ b/docs/dev/controls/label.md @@ -27,55 +27,74 @@ var exampleLabel = new Label() --- -## Available Parameters and Arguments +## Parent Controls -**Size** -Type: *Point* -Size of the control *(optional)* +- Control +- LabelBase -**Location** -Type: *Point* -Position within parent panel +--- -**Parent** -Type: *Panel* -Parent Panel +## Available Parameters and Arguments **Text** Type: *String* -The text this control will show +The text this control should show. **Font** Type: *BitmapFont* -The used font *(optional)* +The font the `Text` will be rendered in. +*(optional)* **TextColor** Type: *Color* -Color of the font *(optional)* +The color of the `Text` +*(optional)* + +**HorizontalAlignment** +Type: *HorizontalAlignment* +The horizontal alignment of the text within the control. +Default: `Left` + +**VerticalAlignment** +Type: *VerticalAlignment* +The vertical alignment of the text within the control. +Default: `Top` **WrapText** Type: *Bool* -Should text be wrapped when reaching the end of the control *(optional)* +Should text be wrapped when reaching the end of the control +Default: `true` **ShowShadow** Type: *Bool* -1px offset shadow will be applied behind the rendered text *(optional)* - -**ShadowColor** -Type: *Color* -Color of the font *(optional)* +If enabled, a 1px offset shadow will be applied behind the rendered text. +Default: `true` **StrokeText** Type: *Bool* -A stroke effect will be applied to the text to make it more visible +If enabled, a stroke effect will be applied to the text to make it more visible. +`ShadowColor` will set the color of the stroke. + +**ShadowColor** +Type: *Color* +If either `ShowShadow` or `StrokeText` is enabled, they will be drawn in this color. +*(optional)* **AutoSizeWidth** Type: *Bool* -Match the width of the text +If enabled, the `Control.Width` of this control will change to match the width of the text. **AutoSizeHeight** Type: *Bool* -Match the height of the text +If enabled, the `Control.Height` of this control will change to match the height of the text. + +--- + +## Available Methods + +A list of `Methods` and `EventHandlers` to hook onto. + +see parent controls --- diff --git a/docs/dev/controls/labelbase.md b/docs/dev/controls/labelbase.md new file mode 100644 index 0000000..8a5ac34 --- /dev/null +++ b/docs/dev/controls/labelbase.md @@ -0,0 +1,41 @@ +--- +id: control-labelbase +title: LabelBase +--- + +The `LabelBase` control is the base for other controls. + +*This documentation is a WIP and probably not exhaustive.* + +--- + +## Usage Example + +`LabelBase` is an abstract class which provides base functionality for other controls. + +--- + +## Parent Controls + +- Control + +--- + +## Available Parameters and Arguments + +see parent controls + +--- + +## Available Methods + +A list of `Methods` and `EventHandlers` to hook onto. + +see parent controls + +--- + +## Remarks + +*This documentation is a WIP and probably not exhaustive.* + diff --git a/docs/dev/controls/panel.md b/docs/dev/controls/panel.md index b5a26d7..16b00f8 100644 --- a/docs/dev/controls/panel.md +++ b/docs/dev/controls/panel.md @@ -28,19 +28,14 @@ var examplePanel = new Panel() --- -## Available Parameters and Arguments +## Parent Controls -**Size** -Type: *Point* -Size of the control *(optional)* +- Control +- Container -**Location** -Type: *Point* -Position of the control within parent control +--- -**Parent** -Type: *Panel* -Parent control +## Available Parameters and Arguments **Title** Type: *String* @@ -50,14 +45,40 @@ The text this control will show on the title bar by default *(optional)* Type: *Bool* Toggle a visible border and title area *(optional)* +**CanScroll** +Type: *Bool* +Enable a scrollbar if content is overflowing. + +**BackgroundTexture** +Type: *AsyncTexture2D* +Set a background texture. + +**ShowTint** +Type: *Bool* +Apply tint to the control. + +**CanCollapse** +Type: *Bool* +Make the control collapsible. + +**Collapsed** +Type: *Bool* +If `CanCollapse` is set, this will set the initial state of the control. + --- ## Available Methods A list of `Methods` and `EventHandlers` to hook onto. -**Click** -Call a method when the user clicked on the button. +**Expand** +If `CanCollapse` is set, this will expand the control. + +**Collapse** +If `CanCollapse` is set, this will collapse the control. + +**ToggleAccordionState** +If `CanCollapse` is set, this will toggle between collapsed and expanded state. --- diff --git a/docs/dev/controls/standardbutton.md b/docs/dev/controls/standardbutton.md index 7d80fdb..92e0365 100644 --- a/docs/dev/controls/standardbutton.md +++ b/docs/dev/controls/standardbutton.md @@ -27,19 +27,14 @@ var exampleButton = new StandardButton() --- -## Available Parameters and Arguments +## Parent Controls -**Size** -Type: *Point* -Size of the control *(optional)* +- Control +- LabelBase -**Location** -Type: *Point* -Position of the control within parent Panel +--- -**Parent** -Type: *Panel* -Parent panel +## Available Parameters and Arguments **Text** Type: *String* @@ -47,7 +42,11 @@ The text shown on the control. **Icon** Type: *Texture2D* -An icon to show on the control. For best results, the Icon should be 16x16. *(optional)* +An icon to show on the control. For best results, the `Icon` should be 16x16. *(optional)* + +**ResizeIcon** +Type: *Bool* +If true, the `Icon` texture will be resized to 16x16. --- @@ -55,8 +54,7 @@ An icon to show on the control. For best results, the Icon should be 16x16. *(o A list of `Methods` and `EventHandlers` to hook onto. -**Click** -Call a method on click. +see parent controls --- diff --git a/docs/dev/controls/textbox.md b/docs/dev/controls/textbox.md index b24c090..94e60bb 100644 --- a/docs/dev/controls/textbox.md +++ b/docs/dev/controls/textbox.md @@ -28,51 +28,16 @@ var exampleTextBox = new Textbox() --- -## Available Parameters and Arguments - -**Size** -Type: *Point* -Size of the control *(optional)* - -**Location** -Type: *Point* -Position of the control within parent panel - -**Parent** -Type: *Panel* -Parent Panel - -**Text** -Type: *String* -The text this control will show by default *(optional)* - -**PlaceholderText** -Type: *String* -A placeholder text when control is empty *(optional)* +## Parent Controls -**Font** -Type: *BitmapFont* -The used font *(optional)* +- Control +- TextInputBase -**ForeColor** -Type: *Color* -Color of the font *(optional)* - -**Focused** -Type: *Bool* -If the control should be focused by default *(optional)* - -**SelectionStart** -Type: *Int* -Start position if preselected text *(optional)* +--- -**SelectionEnd** -Type: *Int* -End position if preselected text *(optional)* +## Available Parameters and Arguments -**CursorIndex** -Type: *Int* -Position of the cursor *(optional)* +see parent controls --- @@ -80,14 +45,7 @@ Position of the cursor *(optional)* A list of `Methods` and `EventHandlers` to hook onto. -**TextChanged** -Call a method when the user typed text. - -**InputFocusChanged** -Call a method when the user changes focus to the control. - -**CursorIndexChanged** -Call a method when the user changes the position of the cursor. +### EventHandler **EnterPressed** Call a method when the `Enter` key is pressed by the user. diff --git a/docs/dev/controls/textinputbase.md b/docs/dev/controls/textinputbase.md new file mode 100644 index 0000000..ba90264 --- /dev/null +++ b/docs/dev/controls/textinputbase.md @@ -0,0 +1,98 @@ +--- +id: control-textinputbase +title: TextInputBase +--- + +The base of controls such as the `TextBox` or `MultilineTextBox` which accept text input from the user. + +*This documentation is a WIP and probably not exhaustive.* + +--- + +## Usage Example + +`LabelBase` is an abstract class which provides base functionality for other controls. + +--- + +## Parent Controls + +- Control + +--- + +## Available Parameters and Arguments + +**Text** +Type: *String* +The text this control will show by default +*(optional)* + +**MaxLength** +Type: *String* +The text this control will show by default +*(optional)* + +**MaxLength** +Type: *Int* +The maximum string length this control will accept +*(optional)* + +**PlaceholderText** +Type: *String* +A placeholder text when control is empty +*(optional)* + +**ForeColor** +Type: *Color* +Color of the font +*(optional)* + +**Font** +Type: *BitmapFont* +The used font +*(optional)* + +**Focused** +Type: *Bool* +If the control should be focused by default +*(optional)* + +**SelectionStart** +Type: *Int* +Start position if preselected text +*(optional)* + +**SelectionEnd** +Type: *Int* +End position if preselected text +*(optional)* + +**CursorIndex** +Type: *Int* +Position of the cursor +*(optional)* + +--- + +## Available Methods + +A list of `Methods` and `EventHandlers` to hook onto. + +### EventHandler + +**TextChanged** +Call a method when the user typed text. + +**CursorIndexChanged** +Call a method when the user changes focus to the control. + +**InputFocusChanged** +Call a method when the user changes the position of the cursor. + +--- + +## Remarks + +*This documentation is a WIP and probably not exhaustive.* +