59 lines
1.4 KiB
Python
Executable File
59 lines
1.4 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
from src.dariuino import *
|
|
|
|
|
|
class Argument:
|
|
INTEGER = 1
|
|
STRING = 2
|
|
|
|
def __init__(self, name, type):
|
|
self.name = name
|
|
self.type = type
|
|
|
|
|
|
class Statement:
|
|
def __init__(self, name):
|
|
self.arguments = []
|
|
|
|
def add_argument(self, argument):
|
|
self.arguments.append(argument)
|
|
|
|
|
|
def main():
|
|
ui = gui.UI('Dariuino IDE', gui.Dimensions(1920, 1080))
|
|
|
|
resources = gui.ResourceContainer.from_json_file('res/resources.json')
|
|
|
|
container = gui.Container(gui.Position(0, 0), gui.Dimensions(600, 600))
|
|
|
|
c = gui.Dragable(resources.get_image('icon-for-32'), gui.Position(100, 300))
|
|
c.on_click = lambda: print('Hello world')
|
|
|
|
a = gui.Dragable(resources.get_image('icon-while-32'), gui.Position(150, 350))
|
|
a.on_drag = lambda: a.set_transparency(0.5)
|
|
a.on_drop = lambda dropable: a.set_transparency(0.0)
|
|
a.on_fail = lambda drag : a.set_transparency(0.0)
|
|
|
|
d = gui.Dropable(gui.Position(0, 0), gui.Dimensions(50, 100))
|
|
d.background_color = gui.Color(255, 0, 0)
|
|
d.on_drop = lambda dragable: print(dragable)
|
|
|
|
container.add_dropable(d)
|
|
container.add_clickable(c)
|
|
container.add_clickable(a)
|
|
|
|
block = CodeBlock(BlockColor.VIOLET, resources.get_image('icon-for-32'))
|
|
block.add_text('Hallo liebe rosa Welt mit Regenbögen und Einhörnern.')
|
|
|
|
container.add_clickable(block)
|
|
|
|
ui.add_container(container)
|
|
ui.init()
|
|
ui.update()
|
|
ui.main()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|