What does is it (currently) do?:
(Make an empty table, which will later contain your items (buttons, textboxes, etc) to use the API)
- Create buttons (which get inserted in the specified table)
- Create textboxes (which get inserted in the specified table)
- Create ScrollBoxes (yes, they can scroll and you can select things)
- Create Labels (they are the same as textboxes, but aren't editable)
- Create Toggles (click on them to toggle them, obviously)
- Add a context (right-click) menu for specific ScrollBoxes
- Draw every item of a specified table (warning: screen gets cleared)
- Update (redraw) a specified item (useful for editing text of a textbox)
- Handle events for the items of the given table
- Once you click on a button, the API queues an event "button_press", which contains the type of the item and the key of the item (e.g. myTable[clickedButton] ) for you to do something with that information It also blinks blue :P/>/>
- Once you click on a textbox, it starts reading input and when you press enter, it saves your entered text and queues an event with the type of the item and key as value (e.g. myTable[editedTextBox] ) for you to do something with that information
- Once you click on something inside a ScrollBox, it marks that line blue and queues an event "scrollBox_select", which returns "scrollBox", the indexkey (name) of the ScrollBox, the indexkey (index number) of the selected text (items.myScrollBox.childs[key])
- Once you add a context menu and right click on something inside a ScrollBox, it marks that line blue and shows the context menu, if you click on something inside the context menu it gets marked blue, the context menu gets invisible shortly after that and then it queues an event "context_select", which returns the indexkey (name) of the ScrollBox, the indexkey (index number) of the selected text of the scrollBox, the selected text inside the context menu (–> NOT the key, but the actual text that was written on the context menu) If you click outside the context menu it gets invisible and you can continue clicking on other things
- More items to be added~~
Pastebin
Small docu:
fsEAPI.addButton(TABLE, NAME, TEXT, LENGTH, XPOS, YPOS)
--add a button to the given table with the given name, which will be the key (TABLE[NAME] = {data} )
fsEAPI.addTextBox(TABLE, NAME, TEXT, LENGTH, XPOS, YPOS)
--add a textbox, the same as above
fsEAPI.addLabel(TABLE, NAME, TEXT, LENGTH, XPOS, YPOS)
--add a label, the same same as a textbox but they aren't editable
fsEAPI.update(DATATABLEOFITEM)
--update/redraw the given item , e.g. fsEAPI.update( TABLE[NAME] )
fsEAPI.updateAll(TABLE, BACKGROUNDCOLOR)
--clear the screen and draw every item of that given table
fsEAPI.run(TABLE)
--goes into a loop and returns interactions with items of the given table as events:
event, typeOfItem, nameOfItem
fsEAPI.addScrollBox(TABLE, NAME, LENGTHx, LENGTHy, XPOS, YPOS)
--add a scrollbox, with the given name and length in both dimension. an event gets queued when selecting an item inside the box returning:
event (scrollBox_select), typeOfItem (scrollBox), nameOfItem (name of the scrollbox), numberOfChild
fsEAPI.addChild(SCROLLBOXITEM, STRING)
--add a child (text) to the scrollbox
fsEAPI.addContextMenu(SCROLLBOXITEM, TABLEOFCHILDS)
--add a context menu to the scrollbox, enabling the right-click. when clicking on the context menu it returns:
event (context_select), nameOfScrollBox, numberOfSelectedChildInScrollBox, nameOfSelectedChildInContext
fsEAPI.removeChild(SCROLLBOXITEM, KEYNUMBER)
--remove a child from a scrollbox by it's key(index number)
fsEAPI.addToggle(TABLE, NAME, XPOS, YPOS)
--add a toggle, if you want to get the state, just look at TABLE[NAME].toggled (which is true or false)
it returns: event (toggle), typeOfItem (toggle), nameOfToggle, nil
NOTE:
When adding or removing things, they won't get drawn or automatically removed, you need to call update(ITEM) on that specific thing or just updateAll(ÍTEMLIST, BACKGROUNDCOLOR) to redraw these things.
Ok where is the download?:
Pastebin
pastebin get 8JRrW0Va fsEAPI
Pics?:
Btw this was actually meant to be used in my second version of fsExpose buuut I thought I'd upload this so..yeah..