This commit is contained in:
NoryiE
2025-03-17 18:09:43 +00:00
parent a90df39304
commit b931f24dee
11 changed files with 20 additions and 82 deletions

View File

@@ -1,11 +1,6 @@
# BarChart : Graph # BarChart : Graph
This is the bar chart class. It is based on the graph element. It draws bar based points. This is the bar chart class. It is based on the graph element. It draws bar based points.
## Functions
|Method|Returns|Description|
|---|---|---|
## Protected Functions ## Protected Functions

View File

@@ -14,16 +14,16 @@ The base class for all UI elements in Basalt. This class provides basic properti
|Method|Returns|Description| |Method|Returns|Description|
|---|---|---| |---|---|---|
|[BaseElement.defineEvent](#BaseElement.defineEvent)|-| |[BaseElement.defineEvent](#BaseElement.defineEvent)|-|Registers a new event listener for the element (on class level)
|[BaseElement.registerEventCallback](#BaseElement.registerEventCallback)|-| |[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: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: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: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: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:onChange](#BaseElement:onChange)|table|Observes a property and calls a callback when it changes
|[BaseElement:registerCallback](#BaseElement:registerCallback)|table|Registers a callback function |[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 ## 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:init](#BaseElement:init)|table|Initializes the BaseElement instance
|[BaseElement:postInit](#BaseElement:postInit)|table|Post initialization |[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) 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) 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() ## BaseElement:destroy()
Destroys the element and cleans up all references Destroys the element and cleans up all references
### Usage
```lua
element:destroy()
```
## BaseElement:fireEvent(event, ...) ## BaseElement:fireEvent(event, ...)
Triggers an event and calls all registered callbacks Triggers an event and calls all registered callbacks
@@ -59,16 +64,11 @@ Triggers an event and calls all registered callbacks
### Returns ### Returns
* `table` `self` The BaseElement instance * `table` `self` The BaseElement instance
### Usage
```lua
element:fireEvent("mouse_click", 1, 2)
```
## BaseElement:getBaseFrame() ## BaseElement:getBaseFrame()
Returns the base frame of the element Returns the base frame of the element
### Returns ### Returns
* `table` `BaseFrame` The base frame of the element * `BaseFrame` `BaseFrame` The base frame of the element
## BaseElement:isType(type) ## BaseElement:isType(type)
Checks if the element is a specific 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 * `type` `string` The type to check for
### Returns ### Returns
* `boolean` `Whether` the element is of the specified type * `boolean` `isType` Whether the element is of the specified type
## BaseElement:listenEvent(eventName, enable?) ## BaseElement:listenEvent(eventName, enable?)
Enables or disables event listening for a specific event Enables or disables event listening for a specific event
@@ -89,11 +89,6 @@ Enables or disables event listening for a specific event
### Returns ### Returns
* `table` `self` The BaseElement instance * `table` `self` The BaseElement instance
### Usage
```lua
element:listenEvent("mouse_click", true)
```
## BaseElement:onChange(property, callback) ## BaseElement:onChange(property, callback)
Observes a property and calls a callback when it changes Observes a property and calls a callback when it changes
@@ -114,17 +109,10 @@ Registers a callback function for an event
### Returns ### Returns
* `table` `self` The BaseElement instance * `table` `self` The BaseElement instance
### Usage
```lua
element:registerCallback("mouse_click", function(self, ...) end)
```
## BaseElement:updateRender() ## BaseElement:updateRender()
Requests a render update for this element Requests a render update for this element
### Usage ### Returns
```lua * `table` `self` The BaseElement instance
element:updateRender()
```

View File

@@ -8,11 +8,6 @@ The BigFont element is a text element that displays large text.
|text|string|BigFont|BigFont text |text|string|BigFont|BigFont text
|fontSize|number|1|The font size of the BigFont |fontSize|number|1|The font size of the BigFont
## Functions
|Method|Returns|Description|
|---|---|---|
## Protected Functions ## Protected Functions

View File

@@ -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: 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/ http://www.computercraft.info/forums2/index.php?/topic/25367-bigfont-api-write-bigger-letters-v10/
## Functions
|Method|Returns|Description|
|---|---|---|

View File

@@ -7,11 +7,6 @@ The Button is a standard button element with click handling and state management
|---|---|---|---| |---|---|---|---|
|text|string|Button|Button text |text|string|Button|Button text
## Functions
|Method|Returns|Description|
|---|---|---|
## Protected Functions ## Protected Functions

View File

@@ -10,11 +10,6 @@ The Checkbox is a visual element that can be checked.
|checkedText|string|Text|when checked |checkedText|string|Text|when checked
|autoSize|boolean|true|Whether to automatically size the checkbox |autoSize|boolean|true|Whether to automatically size the checkbox
## Functions
|Method|Returns|Description|
|---|---|---|
## Protected Functions ## Protected Functions

View File

@@ -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 |selectedText|string|""|The text to show when no item is selected
|dropSymbol|string|"\31"|The symbol to show for dropdown indication |dropSymbol|string|"\31"|The symbol to show for dropdown indication
## Functions
|Method|Returns|Description|
|---|---|---|
## Protected Functions ## Protected Functions

View File

@@ -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 |draggable|boolean|false|Whether the frame is draggable
|draggingMap|table|{}|The map of dragging positions |draggingMap|table|{}|The map of dragging positions
## Functions
|Method|Returns|Description|
|---|---|---|
## Protected Functions ## Protected Functions

View File

@@ -1,11 +1,6 @@
# LineChart : Graph # LineChart : Graph
This is the line chart class. It is based on the graph element. It draws lines between points. This is the line chart class. It is based on the graph element. It draws lines between points.
## Functions
|Method|Returns|Description|
|---|---|---|
## Protected Functions ## Protected Functions

View File

@@ -10,11 +10,6 @@ with optional percentage display and customizable colors.
|showPercentage|boolean|false|Whether to show the percentage text in the center |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 |progressColor|color|lime|The color used for the filled portion of the progress bar
## Functions
|Method|Returns|Description|
|---|---|---|
## Protected Functions ## Protected Functions

View File

@@ -2,10 +2,5 @@
This module provides reactive functionality for elements, it adds no new functionality for elements. 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. It is used to evaluate expressions in property values and update the element when the expression changes.
## Functions
|Method|Returns|Description|
|---|---|---|