mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-28 20:05:22 +09:00
Cleaner Code
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user