parent
0fa61333fa
commit
ce3b02fa09
After Width: | Height: | Size: 262 B |
@ -0,0 +1,10 @@
|
||||
Panel
|
||||
layout: verticalBox
|
||||
size: 64 48
|
||||
|
||||
MenuButton
|
||||
text: New
|
||||
|
||||
MenuButton
|
||||
text: Quit
|
||||
onClick: exit()
|
@ -0,0 +1,29 @@
|
||||
MenuButton < UIButton
|
||||
color: white
|
||||
size: 40 18
|
||||
align: center
|
||||
border-image:
|
||||
source: /core_styles/images/menu.png
|
||||
size: 64 24
|
||||
|
||||
state.hover:
|
||||
border-image:
|
||||
source: /core_styles/images/menu.png
|
||||
offset: 0 24
|
||||
size: 64 24
|
||||
color: black
|
||||
|
||||
TopMenuButton < MenuButton
|
||||
onMousePress: |
|
||||
function(self, mousePos, mouseButton)
|
||||
local popupMenu = UI.loadAndDisplay(self:getStyle()['popup menu'])
|
||||
if popupMenu then
|
||||
popupMenu:moveTo({ x = self:getX(), y = self:getY() + self:getHeight()})
|
||||
popupMenu.onMouseRelease = function(self) self:destroy() end
|
||||
end
|
||||
end
|
||||
|
||||
TopMenuButton
|
||||
text: File
|
||||
position: 80 0
|
||||
popup menu: /playground/filemenu.otui
|
@ -1 +1,10 @@
|
||||
-- place any code for testing purposes here
|
||||
-- place any code for testing purposes here
|
||||
|
||||
function displayMenuPopup(file, parent)
|
||||
end
|
||||
|
||||
local function init()
|
||||
UI.loadAndDisplay('/playground/menubar.otui')
|
||||
end
|
||||
|
||||
addEvent(init)
|
Loading…
Reference in new issue