* implement draw clipping using opengl stencil buffers * allow to create Widgets by style name with g_ui.createWidgetByStyle * styles can now have children widgets * make proper use of the isNotPathable in pathfinding * add scrollbar skinmaster
parent
efa9811342
commit
de0008caf1
@ -0,0 +1,30 @@
|
||||
UIScrollBar = extends(UIWidget)
|
||||
|
||||
function UIScrollBar.create()
|
||||
local scrollbar = UIScrollBar.internalCreate()
|
||||
scrollbar:setFocusable(false)
|
||||
return scrollbar
|
||||
end
|
||||
|
||||
function UIScrollBar:onSetup()
|
||||
--self.getChildById('upButton').onClick = function() self.navigateUp() end
|
||||
--self.getChildById('upButton').onClick = function() self.navigateDown() end
|
||||
end
|
||||
|
||||
function UIScrollBar:attachWidget(widget)
|
||||
self.attachedWidget = widget
|
||||
end
|
||||
|
||||
function UIScrollBar:onStyleApply(styleName, styleNode)
|
||||
if styleNode['attached-to'] then
|
||||
local id = styleNode['attached-to']
|
||||
local parent = self:getParent()
|
||||
local widget
|
||||
if id == 'parent' then
|
||||
widget = parent
|
||||
elseif parent then
|
||||
widget = parent:getChildById(id)
|
||||
end
|
||||
self:attachWidget(widget)
|
||||
end
|
||||
end
|
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 197 B |
After Width: | Height: | Size: 350 B |
@ -0,0 +1,30 @@
|
||||
VerticalScrollBar < UIScrollBar
|
||||
width: 13
|
||||
image-source: images/vscrollbar.png
|
||||
image-clip: 0 39 13 32
|
||||
image-border: 1
|
||||
|
||||
UIButton
|
||||
id: upButton
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
image-source: images/vscrollbar.png
|
||||
image-clip: 0 0 13 13
|
||||
size: 13 13
|
||||
|
||||
UIButton
|
||||
id: downButton
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
size: 13 13
|
||||
image-source: images/vscrollbar.png
|
||||
image-clip: 0 13 13 13
|
||||
|
||||
//UIButton
|
||||
//id: middleButton
|
||||
//anchors.top: parent.top
|
||||
//anchors.right: parent.right
|
||||
//size: 13 13
|
||||
//margin-top: 30
|
||||
//image-source: images/vscrollbar.png
|
||||
//image-clip: 0 26 13 13
|
Loading…
Reference in new issue