scrollbar, options and widgets changes

* complete scrollbar skin
* implement scrollbar functionality (scrolling with mouse)
* fix onMouseClick issues
* add tabs in options (graphics and general tab)
* add new option for limiting frame rate using scrollbar
* add new widget property "clipping" that will be used on scrollable areas
This commit is contained in:
Eduardo Bart
2012-03-25 11:10:15 -03:00
parent de0008caf1
commit 179e53bb77
23 changed files with 420 additions and 98 deletions

View File

@@ -4,7 +4,10 @@ importStyle = g_ui.importStyle
importFont = g_fonts.importFont
setDefaultFont = g_fonts.setDefaultFont
loadUI = g_ui.loadUI
function loadUI(otui, parent)
local otuiFilePath = resolvepath(otui, 2)
return g_ui.loadUI(otuiFilePath, parent)
end
function displayUI(otui, parent)
parent = parent or rootWidget
@@ -17,7 +20,6 @@ function createWidget(stylename, parent)
parent = rootWidget:recursiveGetChildById(parent)
end
local widget = g_ui.createWidgetFromStyle(stylename, parent)
--widget:setStyle(stylename)
return widget
end
@@ -36,6 +38,26 @@ function addEvent(callback, front)
return event
end
function periodicalEvent(eventFunc, conditionFunc, delay, autoRepeatDelay)
delay = delay or 30
autoRepeatDelay = autoRepeatDelay or delay
local func
func = function()
if conditionFunc and not conditionFunc() then
func = nil
return
end
eventFunc()
scheduleEvent(func, delay)
end
scheduleEvent(function()
func()
end, autoRepeatDelay)
end
function removeEvent(event)
if event then
event:cancel()