diff --git a/docs/references/elements/BarChart.md b/docs/references/elements/BarChart.md index 275e0a8..638ddf0 100644 --- a/docs/references/elements/BarChart.md +++ b/docs/references/elements/BarChart.md @@ -1,11 +1,6 @@ # BarChart : Graph This is the bar chart class. It is based on the graph element. It draws bar based points. -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions diff --git a/docs/references/elements/BaseElement.md b/docs/references/elements/BaseElement.md index 068a618..a04b66a 100644 --- a/docs/references/elements/BaseElement.md +++ b/docs/references/elements/BaseElement.md @@ -14,16 +14,16 @@ The base class for all UI elements in Basalt. This class provides basic properti |Method|Returns|Description| |---|---|---| -|[BaseElement.defineEvent](#BaseElement.defineEvent)|-| -|[BaseElement.registerEventCallback](#BaseElement.registerEventCallback)|-| +|[BaseElement.defineEvent](#BaseElement.defineEvent)|-|Registers a new event listener for the element (on class level) +|[BaseElement.registerEventCallback](#BaseElement.registerEventCallback)|-|Registers a new event callback for the element (on class level) |[BaseElement:destroy](#BaseElement:destroy)|-|Destroys the element and cleans up all references |[BaseElement:fireEvent](#BaseElement:fireEvent)|table|Triggers an event and calls all registered callbacks -|[BaseElement:getBaseFrame](#BaseElement:getBaseFrame)|table|Returns the base frame of the element +|[BaseElement:getBaseFrame](#BaseElement:getBaseFrame)|BaseFrame|Returns the base frame of the element |[BaseElement:isType](#BaseElement:isType)|boolean|Checks if the element is a specific type |[BaseElement:listenEvent](#BaseElement:listenEvent)|table|Enables or disables event listening for a specific event |[BaseElement:onChange](#BaseElement:onChange)|table|Observes a property and calls a callback when it changes |[BaseElement:registerCallback](#BaseElement:registerCallback)|table|Registers a callback function -|[BaseElement:updateRender](#BaseElement:updateRender)|-|Requests a render update for this element +|[BaseElement:updateRender](#BaseElement:updateRender)|table|Requests a render update for this element ## Protected Functions @@ -35,20 +35,25 @@ The base class for all UI elements in Basalt. This class provides basic properti |[BaseElement:init](#BaseElement:init)|table|Initializes the BaseElement instance |[BaseElement:postInit](#BaseElement:postInit)|table|Post initialization -## BaseElement.defineEvent() +## BaseElement.defineEvent(class, eventName, requiredEvent?) Registers a new event listener for the element (on class level) -## BaseElement.registerEventCallback() +### Parameters +* `class` `table` The class to register +* `eventName` `string` The name of the event to register +* `requiredEvent` *(optional)* `string` The name of the required event (optional) + +## BaseElement.registerEventCallback(class, callbackName, ...) Registers a new event callback for the element (on class level) +### Parameters +* `class` `table` The class to register +* `callbackName` `string` The name of the callback to register +* `...` `string` The names of the events to register the callback for + ## BaseElement:destroy() Destroys the element and cleans up all references -### Usage - ```lua -element:destroy() -``` - ## BaseElement:fireEvent(event, ...) Triggers an event and calls all registered callbacks @@ -59,16 +64,11 @@ Triggers an event and calls all registered callbacks ### Returns * `table` `self` The BaseElement instance -### Usage - ```lua -element:fireEvent("mouse_click", 1, 2) -``` - ## BaseElement:getBaseFrame() Returns the base frame of the element ### Returns -* `table` `BaseFrame` The base frame of the element +* `BaseFrame` `BaseFrame` The base frame of the element ## BaseElement:isType(type) Checks if the element is a specific type @@ -77,7 +77,7 @@ Checks if the element is a specific type * `type` `string` The type to check for ### Returns -* `boolean` `Whether` the element is of the specified type +* `boolean` `isType` Whether the element is of the specified type ## BaseElement:listenEvent(eventName, enable?) Enables or disables event listening for a specific event @@ -89,11 +89,6 @@ Enables or disables event listening for a specific event ### Returns * `table` `self` The BaseElement instance -### Usage - ```lua -element:listenEvent("mouse_click", true) -``` - ## BaseElement:onChange(property, callback) Observes a property and calls a callback when it changes @@ -114,17 +109,10 @@ Registers a callback function for an event ### Returns * `table` `self` The BaseElement instance -### Usage - ```lua -element:registerCallback("mouse_click", function(self, ...) end) -``` - ## BaseElement:updateRender() Requests a render update for this element -### Usage - ```lua -element:updateRender() -``` +### Returns +* `table` `self` The BaseElement instance diff --git a/docs/references/elements/BigFont.md b/docs/references/elements/BigFont.md index 3efaee2..128e9a9 100644 --- a/docs/references/elements/BigFont.md +++ b/docs/references/elements/BigFont.md @@ -8,11 +8,6 @@ The BigFont element is a text element that displays large text. |text|string|BigFont|BigFont text |fontSize|number|1|The font size of the BigFont -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions diff --git a/docs/references/elements/BigFont_BigFontText.md b/docs/references/elements/BigFont_BigFontText.md index 20511d2..871423e 100644 --- a/docs/references/elements/BigFont_BigFontText.md +++ b/docs/references/elements/BigFont_BigFontText.md @@ -2,10 +2,5 @@ Basalt - Nyorie: Please don't copy paste this code to your projects, this code is slightly changed (to fit the way basalt draws stuff), if you want the original code, checkout this: http://www.computercraft.info/forums2/index.php?/topic/25367-bigfont-api-write-bigger-letters-v10/ -## Functions - -|Method|Returns|Description| -|---|---|---| - diff --git a/docs/references/elements/Button.md b/docs/references/elements/Button.md index 6358e61..8ddbb16 100644 --- a/docs/references/elements/Button.md +++ b/docs/references/elements/Button.md @@ -7,11 +7,6 @@ The Button is a standard button element with click handling and state management |---|---|---|---| |text|string|Button|Button text -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions diff --git a/docs/references/elements/Checkbox.md b/docs/references/elements/Checkbox.md index 848cee8..2b76501 100644 --- a/docs/references/elements/Checkbox.md +++ b/docs/references/elements/Checkbox.md @@ -10,11 +10,6 @@ The Checkbox is a visual element that can be checked. |checkedText|string|Text|when checked |autoSize|boolean|true|Whether to automatically size the checkbox -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions diff --git a/docs/references/elements/Dropdown.md b/docs/references/elements/Dropdown.md index 9096da9..9ee5990 100644 --- a/docs/references/elements/Dropdown.md +++ b/docs/references/elements/Dropdown.md @@ -10,11 +10,6 @@ This is the dropdown class. It is a visual element that can show a list of selec |selectedText|string|""|The text to show when no item is selected |dropSymbol|string|"\31"|The symbol to show for dropdown indication -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions diff --git a/docs/references/elements/Frame.md b/docs/references/elements/Frame.md index 746731b..4150ffa 100644 --- a/docs/references/elements/Frame.md +++ b/docs/references/elements/Frame.md @@ -8,11 +8,6 @@ This is the frame class. It serves as a grouping container for other elements. |draggable|boolean|false|Whether the frame is draggable |draggingMap|table|{}|The map of dragging positions -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions diff --git a/docs/references/elements/LineChart.md b/docs/references/elements/LineChart.md index 86e5bfe..a670c65 100644 --- a/docs/references/elements/LineChart.md +++ b/docs/references/elements/LineChart.md @@ -1,11 +1,6 @@ # LineChart : Graph This is the line chart class. It is based on the graph element. It draws lines between points. -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions diff --git a/docs/references/elements/ProgressBar.md b/docs/references/elements/ProgressBar.md index 286b674..b7eddb0 100644 --- a/docs/references/elements/ProgressBar.md +++ b/docs/references/elements/ProgressBar.md @@ -10,11 +10,6 @@ with optional percentage display and customizable colors. |showPercentage|boolean|false|Whether to show the percentage text in the center |progressColor|color|lime|The color used for the filled portion of the progress bar -## Functions - -|Method|Returns|Description| -|---|---|---| - ## Protected Functions diff --git a/docs/references/plugins/reactive.md b/docs/references/plugins/reactive.md index e46a0d2..30ba8b9 100644 --- a/docs/references/plugins/reactive.md +++ b/docs/references/plugins/reactive.md @@ -2,10 +2,5 @@ This module provides reactive functionality for elements, it adds no new functionality for elements. It is used to evaluate expressions in property values and update the element when the expression changes. -## Functions - -|Method|Returns|Description| -|---|---|---| -