changed eventHandler

- the event handler is now only listening to necessary events, which makes the overall event loop much smaller and makes other stuff also possible
- base frame is now auto. resizing
- setMoveable -> setMovable

Note: There may be some (ofc expected) bugs..
This commit is contained in:
Robert Jelic
2022-08-12 01:52:06 +02:00
parent 5f76a059cc
commit 6dcd4c2427
76 changed files with 1905 additions and 14981 deletions

View File

@@ -54,17 +54,17 @@ This is also possible with entire frames and its children objects. So keep that
## How To use XML
Here is a example on how to create a cool looking frame by using xml:
```xml
<frame width="50%" bg="gray" scrollable="true" importantScroll="true">
<button x="2" y="2" width="100%-2" bg="black" fg="lightGray" text="Example Button 1!"/>
<button x="2" y="6" width="100%-2" bg="black" fg="lightGray" text="Example Button 2!"/>
<button x="2" y="10" width="100%-2" bg="black" fg="lightGray" text="Example Button 3!"/>
<button x="2" y="14" width="100%-2" bg="black" fg="lightGray" text="Example Button 4!"/>
<button x="2" y="18" width="100%-2" bg="black" fg="lightGray" text="Example Button 5!"/>
<button x="2" y="22" width="100%-2" bg="black" fg="lightGray" text="Example Button 6!"/>
<button x="2" y="26" width="100%-2" bg="black" fg="lightGray" text="Example Button 7!"/>
<frame width="parent.w/2" bg="gray" scrollable="true" importantScroll="true">
<button x="2" y="2" width="parent.w-2" bg="black" fg="lightGray" text="Example Button 1!"/>
<button x="2" y="6" width="parent.w-2" bg="black" fg="lightGray" text="Example Button 2!"/>
<button x="2" y="10" width="parent.w-2" bg="black" fg="lightGray" text="Example Button 3!"/>
<button x="2" y="14" width="parent.w-2" bg="black" fg="lightGray" text="Example Button 4!"/>
<button x="2" y="18" width="parent.w-2" bg="black" fg="lightGray" text="Example Button 5!"/>
<button x="2" y="22" width="parent.w-2" bg="black" fg="lightGray" text="Example Button 6!"/>
<button x="2" y="26" width="parent.w-2" bg="black" fg="lightGray" text="Example Button 7!"/>
</frame>
<frame x="50%+1" width="50%+1" bg="black">
<textfield bg="gray" x="2" y="2" width="100%-2">
<frame x="parent.w/2+1" width="parent.w/2+1" bg="black">
<textfield bg="gray" x="2" y="2" width="parent.w-2">
<lines>
<line>This is line 1.</line>
<line>And this is line 2.</line>
@@ -79,4 +79,4 @@ local basalt = require("Basalt")
basalt.createFrame():addLayout("example.xml")
basalt.autoUpdate()
```
```