This commit is contained in:
NoryiE
2025-02-24 22:13:57 +00:00
parent 5513bf4072
commit c3f9dfa735
38 changed files with 42 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ and then applies the plugins to the elements. It also provides a way to get elem
|[ElementManager.getElementList](#ElementManager.getElementList)|table|
|[ElementManager.loadElement](#ElementManager.loadElement)|-|
## ElementManager.getAPI(name)
Gets an Plugin API by name

View File

@@ -29,6 +29,7 @@ The base class for all UI elements in Basalt. This class provides basic properti
|[BaseElement:registerCallback](#BaseElement:registerCallback)|table|Registers a callback function
|[BaseElement:updateRender](#BaseElement:updateRender)|-|Requests a render update for this element
## BaseElement.defineEvent()
## BaseElement.new(props, basalt)

View File

@@ -27,6 +27,7 @@ This is the base frame class. It is the root element of all elements and the onl
|[BaseFrame:textBg](#BaseFrame:textBg)|-|Renders a text with a background color to the render Object
|[BaseFrame:textFg](#BaseFrame:textFg)|-|Renders a text with a foreground color to the render Object
## BaseFrame.new()
Creates a new Frame instance

View File

@@ -21,6 +21,7 @@ The Button is a standard button element with click handling and state management
|[Button:init](#Button:init)|-|Initializes the Button instance
|[Button:render](#Button:render)|-|Renders the Button
## Button.new()
Creates a new Button instance

View File

@@ -19,6 +19,7 @@ The Checkbox is a visual element that can be checked.
|[Checkbox:mouse_click](#Checkbox:mouse_click)|boolean|Handles mouse click events
|[Checkbox:render](#Checkbox:render)|-|Renders the Checkbox
## Checkbox.new()
Creates a new Checkbox instance

View File

@@ -52,6 +52,7 @@ like Frames, BaseFrames, and more.
|[Container:textFg](#Container:textFg)|Container|Draws a line of text and fg as color
|[Container:unregisterChildEvent](#Container:unregisterChildEvent)|Container|Unregisters the children events of the container
## Container.new()
Creates a new Container instance

View File

@@ -19,6 +19,7 @@ This is the dropdown class. It is a visual element that can show a list of selec
|[Dropdown:mouse_click](#Dropdown:mouse_click)|boolean|Handles mouse click events
|[Dropdown:render](#Dropdown:render)|-|Renders the Dropdown
## Dropdown.new()
Creates a new Dropdown instance

View File

@@ -22,6 +22,7 @@ This is the Flexbox class. It is a container that arranges its children in a fle
|[Flexbox:removeChild](#Flexbox:removeChild)|Flexbox|Removes a child element from the flexbox
|[Flexbox:render](#Flexbox:render)|Flexbox|Renders the flexbox and its children
## Flexbox.new()
Creates a new Flexbox instance

View File

@@ -8,6 +8,7 @@ This is the frame class. It serves as a grouping container for other elements.
|[Frame.new](#Frame.new)|Frame|Creates a new Frame instance
|[Frame:init](#Frame:init)|Frame|Initializes the Frame instance
## Frame.new()
Creates a new Frame instance

View File

@@ -26,6 +26,7 @@ See: https://github.com/SkyTheCodeMaster/bimg
|[Image:setFg](#Image:setFg)|-|
|[Image:setPixel](#Image:setPixel)|-|
## Image.new()
## Image:getPixelData(x, y)

View File

@@ -30,6 +30,7 @@ cursor movement, text manipulation, placeholder text, and input validation.
|[Input:render](#Input:render)|-|Renders the input element
|[Input:updateViewport](#Input:updateViewport)|-|Updates the input's viewport
## Input.new()
Creates a new Input instance

View File

@@ -18,6 +18,7 @@ resizes its width based on the text content.
|[Label:init](#Label:init)|Label|Initializes the Label instance
|[Label:render](#Label:render)|-|Renders the Label by drawing its text content
## Label.new()
Creates a new Label instance

View File

@@ -36,6 +36,7 @@ custom item rendering, separators, and selection handling.
|[List:scrollToBottom](#List:scrollToBottom)|List|Scrolls the list to the bottom
|[List:scrollToTop](#List:scrollToTop)|List|Scrolls the list to the top
## List.new()
Creates a new List instance

View File

@@ -18,6 +18,7 @@ Menu items are displayed in a single row and can have custom colors and callback
|[Menu:render](#Menu:render)|-|Renders the menu horizontally with proper spacing and colors
|[Menu:setItems](#Menu:setItems)|Menu|Sets the menu items and calculates total width
## Menu.new()
Creates a new Menu instance

View File

@@ -20,6 +20,7 @@ This is the program class. It provides a program that runs in a window.
|[Program:init](#Program:init)|Program|Initializes the Program instance
|[Program:render](#Program:render)|-|Renders the program
## Program.new()
Creates a new Program instance

View File

@@ -18,6 +18,7 @@ with optional percentage display and customizable colors.
|[ProgressBar:init](#ProgressBar:init)|ProgressBar|Initializes the ProgressBar instance
|[ProgressBar:render](#ProgressBar:render)|-|Renders the progress bar with filled portion and optional percentage text
## ProgressBar.new()
Creates a new ProgressBar instance

View File

@@ -34,6 +34,7 @@ A scrollbar element that can be attached to other elements to control their scro
|[Scrollbar:render](#Scrollbar:render)|-|Renders the scrollbar
|[Scrollbar:updateAttachedElement](#Scrollbar:updateAttachedElement)|Scrollbar|Updates the attached element's property based on the scrollbar value
## Scrollbar.new()
Creates a new Scrollbar instance

View File

@@ -29,6 +29,7 @@ with customizable colors and value ranges.
|[Slider:mouse_scroll](#Slider:mouse_scroll)|boolean|Handles mouse release events
|[Slider:render](#Slider:render)|-|Renders the slider with track and handle
## Slider.new()
Creates a new Slider instance

View File

@@ -27,6 +27,7 @@ row selection, and scrolling capabilities.
|[Table:render](#Table:render)|-|Renders the table with headers, data and scrollbar
|[Table:sortData](#Table:sortData)|Table|Sorts the table data by the specified column
## Table.new()
Creates a new Table instance

View File

@@ -30,6 +30,7 @@ A multi-line text editor component with cursor support and text manipulation fea
|[TextBox:setText](#TextBox:setText)|TextBox|Sets the text of the TextBox
|[TextBox:updateViewport](#TextBox:updateViewport)|TextBox|Updates the viewport to keep the cursor in view
## TextBox.new()
Creates a new TextBox instance

View File

@@ -29,6 +29,7 @@ with support for selection and scrolling.
|[Tree:render](#Tree:render)|-|Renders the tree with nodes, selection and scrolling
|[Tree:toggleNode](#Tree:toggleNode)|Tree|Toggles between expanded and collapsed state
## Tree.new()
Creates a new Tree instance

View File

@@ -70,6 +70,7 @@ and provides core functionality for positioning, sizing, colors, and rendering.
|[VisualElement:textBg](#VisualElement:textBg)|-|Draws text with background color
|[VisualElement:textFg](#VisualElement:textFg)|-|Draws text with foreground color
## VisualElement.new(props, basalt)
Creates a new VisualElement instance

View File

@@ -14,6 +14,7 @@ This is Basalt's error handler. All the errors are handled by this module.
|---|---|---|
|[errorHandler.error](#errorHandler.error)|-|
## errorHandler.error(errMsg)
Handles an error

View File

@@ -22,6 +22,7 @@ Logger module for Basalt. Logs messages to the console and optionally to a file.
|[Log.setLogToFile](#Log.setLogToFile)|-|Sets if the logger should log to a file
|[Log.warn](#Log.warn)|-|Sends a warning message
## Log.debug(...)
Sends a debug message to the logger.

View File

@@ -37,6 +37,7 @@ What this code does is it loads basalt into the project, and you can access it b
|[basalt.stop](#basalt.stop)|-|Stops the Basalt runtime
|[basalt.update](#basalt.update)|-|Runs basalt once
## basalt.create(type, properties?)
Creates and returns a new UI element of the specified type.

View File

@@ -17,6 +17,7 @@ with support for sequences, easing functions, and multiple animation types.
|[Animation:sequence](#Animation:sequence)|Animation|Creates a new sequence
|[Animation:start](#Animation:start)|Animation|Starts the animation
## Animation.new(element)
Creates a new Animation

View File

@@ -23,6 +23,7 @@ This is the AnimationInstance class. It represents a single animation instance
|[AnimationInstance:start](#AnimationInstance:start)|AnimationInstance|Starts the animation
|[AnimationInstance:update](#AnimationInstance:update)|boolean|Updates the animation
## AnimationInstance.new(element, animType, args, duration, easing)
Creates a new AnimationInstance

View File

@@ -7,6 +7,7 @@ Adds additional methods for VisualElement when adding animation plugin
|---|---|---|
|[VisualElement:animate](#VisualElement:animate)|Animation|Creates a new animation
## VisualElement:animate()
Creates a new Animation Object

View File

@@ -11,6 +11,7 @@ Benchmark API methods
|[API.start](#API.start)|-|Starts timing a custom operation
|[API.stop](#API.stop)|-|Stops timing and logs results
## API.clear(name)
Clears a specific benchmark

View File

@@ -14,6 +14,7 @@ The following methods are available for BaseElement
|[BaseElement:startProfile](#BaseElement:startProfile)|BaseElement|Starts timing a method call
|[BaseElement:stopBenchmark](#BaseElement:stopBenchmark)|BaseElement|Disables performance measurement for a method
## BaseElement:benchmark(methodName)
Enables benchmarking for a method

View File

@@ -9,6 +9,7 @@ Container benchmarking methods
|[Container:logContainerBenchmarks](#Container:logContainerBenchmarks)|Container|Recursively logs benchmark statistics
|[Container:stopContainerBenchmark](#Container:stopContainerBenchmark)|Container|Recursively stops benchmarking
## Container:benchmarkContainer(methodName)
Enables benchmarking for a container and all its children

View File

@@ -8,6 +8,7 @@ No Description
|[BaseElement.debug](#BaseElement.debug)|-|Enables debugging for this element
|[BaseElement.dumpDebug](#BaseElement.dumpDebug)|-|Dumps debug information
## BaseElement.debug(self, level)
Enables debugging for this element
@@ -35,6 +36,7 @@ Dumps debug information for this element
|[BaseFrame.showDebugLog](#BaseFrame.showDebugLog)|-|Shows the debug log frame
|[BaseFrame.toggleDebugLog](#BaseFrame.toggleDebugLog)|-|Toggles the debug log frame
## BaseFrame.hideDebugLog(self)
Hides the debug log frame
@@ -65,6 +67,7 @@ Toggles the debug log frame
|---|---|---|
|[Container.debugChildren](#Container.debugChildren)|-|Debug container and children
## Container.debugChildren(self, level)
Enables debugging for this container and all its children

View File

@@ -8,3 +8,4 @@ It is used to evaluate expressions in property values and update the element whe
|---|---|---|

View File

@@ -13,6 +13,7 @@ persistent states, computed states, and state sharing between elements.
|[BaseElement:setState](#BaseElement:setState)|BaseElement|Sets a state value
|[BaseElement:shareState](#BaseElement:shareState)|BaseElement|Shares state between elements
## BaseElement:computed(self, key, computeFn)
Creates a computed state that derives its value from other states

View File

@@ -9,6 +9,7 @@ with support for inheritance, named styles, and dynamic theme switching.
|[BaseElement:applyTheme](#BaseElement:applyTheme)|BaseElement|Applies theme styles to the element
|[BaseElement:getTheme](#BaseElement:getTheme)|table|Gets theme properties for the element
## BaseElement:applyTheme(self)
Applies the current theme to this element
@@ -42,6 +43,7 @@ The Theme API provides methods for managing themes globally
|[themeAPI.loadTheme](#themeAPI.loadTheme)|-|Loads theme from JSON file
|[themeAPI.setTheme](#themeAPI.setTheme)|-|Sets a new theme
## themeAPI.getTheme()
Gets the current theme configuration

View File

@@ -7,6 +7,7 @@ The XML plugin provides XML parsing and UI creation from XML markup
|---|---|---|
|[BaseElement:fromXML](#BaseElement:fromXML)|BaseElement|Creates element from XML node
## BaseElement:fromXML(self, node)
Creates an element from an XML node
@@ -29,6 +30,7 @@ Creates an element from an XML node
|---|---|---|
|[Container:loadXML](#Container:loadXML)|Container|Loads UI from XML string
## Container:loadXML(self, content, scope?)
Loads and creates UI elements from XML content
local xml = [[

View File

@@ -30,6 +30,7 @@ It also allows for properties to have custom getters and setters. This is the ba
|[PropertySystem:removeObserver](#PropertySystem:removeObserver)|table|
|[PropertySystem:removeProperty](#PropertySystem:removeProperty)|table|Removes a property from the PropertySystem
## PropertySystem.addSetterHook(hook)
Adds a setter hook to the PropertySystem. Setter hooks are functions that are called before a property is set.

View File

@@ -36,6 +36,7 @@ functionality. It also has a buffer system to reduce the number of calls
|[Render:textBg](#Render:textBg)|Render|
|[Render:textFg](#Render:textFg)|Render|
## Render.new(terminal)
Creates a new Render object