implement API to save lists in configs file and terminal history

This commit is contained in:
Eduardo Bart
2012-01-15 13:13:22 -02:00
parent a238111c07
commit 9ec40f016d
20 changed files with 228 additions and 58 deletions

View File

@@ -4,6 +4,7 @@ TopMenu = {}
local topMenu
local leftButtonsPanel
local rightButtonsPanel
local gameButtonsPanel
-- private functions
local function onLogout()
@@ -19,6 +20,7 @@ function TopMenu.init()
topMenu = displayUI('topmenu.otui')
leftButtonsPanel = topMenu:getChildById('leftButtonsPanel')
rightButtonsPanel = topMenu:getChildById('rightButtonsPanel')
gameButtonsPanel = topMenu:getChildById('gameButtonsPanel')
TopMenu.addRightButton('logoutButton', 'Logout (Ctrl+Q)', '/core_styles/icons/logout.png', onLogout)
Hotkeys.bind('Ctrl+Q', onLogout)
@@ -51,6 +53,15 @@ function TopMenu.addButton(id, description, icon, callback, right)
return button
end
function TopMenu.addGameButton(id, description, icon, callback)
local button = createWidget('GameTopButton', gameButtonsPanel)
button:setId(id)
button:setTooltip(description)
button:setIcon(resolvepath(icon, 2))
button.onClick = callback
return button
end
function TopMenu.addLeftButton(id, description, icon, callback)
return TopMenu.addButton(id, description, icon, callback, false)
end

View File

@@ -1,22 +1,45 @@
TopButton < UIButton
size: 26 26
image-color: white
image-source: /core_styles/images/top_button.png
image-clip: 0 0 26 26
image-border: 3
image-color: #ffffffff
icon-color: #ffffffff
$hover:
image-source: /core_styles/images/top_button.png
image-color: #ffffff99
image-clip: 26 0 26 26
image-border: 3
$pressed:
image-source: /core_styles/images/top_button.png
image-clip: 52 0 26 26
image-border: 3
$disabled:
image-color: #ffffff66
image-color: #ffffff44
icon-color: #ffffff44
GameTopButton < UIButton
size: 26 26
image-source: /core_styles/images/top_button2.png
image-clip: 26 0 26 26
image-color: #ffffff22
icon-color: #ffffffff
image-border: 3
$hover:
image-clip: 0 0 26 26
image-color: #ffffffff
icon-color: #ffffffff
$first:
anchors.top: parent.top
anchors.left: parent.left
margin-top: 4
margin-left: 6
$!first:
anchors.top: prev.top
anchors.left: prev.right
margin-left: 6
TopLeftButton < TopButton
$first:
@@ -54,6 +77,13 @@ TopPanel
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
width: 150
Panel
id: gameButtonsPanel
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: prev.right
anchors.right: next.left
Panel