Cleaner Code

This commit is contained in:
Cooldude2606
2019-09-22 17:08:43 +01:00
parent 1f204c6dac
commit ce88e0a296
114 changed files with 951 additions and 583 deletions

View File

@@ -7,11 +7,13 @@ local Gui = require 'expcore.gui.core'
--[[-- Similar to a flow but includes the ability to show and use scroll bars.
@element scroll
@tparam string horizontal_scroll the horizontal scroll policy for this scroll pane
@tparam string vertical_scroll the vertical scroll policy for this scroll pane
@usage-- Making a basic flow, contains a label with hello world
local basic_scroll =
Gui.clone_concept('scroll','basic_scroll')
Gui.new_concept('scroll')
:define_draw(function(properties,parent,element)
element.style.hieght = 50
for i = 1,10 do
@@ -21,11 +23,19 @@ Gui.clone_concept('scroll','basic_scroll')
}
end
end)
]]
Gui.new_concept('scroll')
Gui.new_concept()
:save_as('scroll')
-- Properties
:new_property('horizontal_scroll')
:new_property('vertical_scroll')
-- Draw
:define_draw(function(properties,parent,element)
-- Draw a scroll pane
element = parent.add{
name = properties.name,
type = 'scroll-pane',