mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-29 04:06:39 +09:00
Cleaner Code
This commit is contained in:
@@ -7,11 +7,13 @@ local Gui = require 'expcore.gui.core'
|
||||
|
||||
--[[-- Grey semi-transparent boxes that contain other elements. They have a caption, and, just like flows, they lay out children either horizontally or vertically.
|
||||
@element frame
|
||||
|
||||
@tparam ?string|Concepts.LocalisedString title the title that will show in the frame
|
||||
@tparam string direction the direction that children will be added
|
||||
|
||||
@usage-- Making a basic frame, contains a label with hello world
|
||||
local basic_frame =
|
||||
Gui.clone_concept('frame','basic_frame')
|
||||
Gui.new_concept('frame')
|
||||
:set_title('Basic Frame')
|
||||
:define_draw(function(properties,parent,element)
|
||||
element.add{
|
||||
@@ -19,11 +21,19 @@ Gui.clone_concept('frame','basic_frame')
|
||||
caption = 'Hello, World!'
|
||||
}
|
||||
end)
|
||||
|
||||
]]
|
||||
Gui.new_concept('frame')
|
||||
|
||||
Gui.new_concept()
|
||||
:save_as('frame')
|
||||
|
||||
-- Properties
|
||||
:new_property('title')
|
||||
:new_property('direction')
|
||||
|
||||
-- Draw
|
||||
:define_draw(function(properties,parent,element)
|
||||
-- Draw a frame
|
||||
element = parent.add{
|
||||
name = properties.name,
|
||||
type = 'frame',
|
||||
|
||||
Reference in New Issue
Block a user