- Timestamp:
- Feb 20, 2011, 12:47:57 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/data/gui/scripts/DecisionPopup.lua
r7726 r7922 3 3 local P = createMenuSheet("DecisionPopup") 4 4 5 P.buttonList = {}6 7 function P.onShow()8 --indices to iterate through buttonlist9 P.oldindex = -210 P.index = -111 end12 13 5 function P.onLoad() 14 6 15 7 --button are arranged in a 1x2 matrix 16 local item = { 8 P:initButtons(1, 2) 9 10 P:setButton(1, 1, { 17 11 ["button"] = winMgr:getWindow("orxonox/DecisionPopup_button_yes"), 18 ["function"] = P.button_yes 19 } 20 P.buttonList[1] = item 12 ["callback"] = P.button_yes 13 }) 21 14 22 local item ={15 P:setButton(1, 2, { 23 16 ["button"] = winMgr:getWindow("orxonox/DecisionPopup_button_no"), 24 [" function"] = P.button_no25 } 26 P.buttonList[2] = item 17 ["callback"] = P.button_no 18 }) 19 end 27 20 21 function P.onShow() 22 P:setSelection(1, 1) 28 23 end 29 24 … … 51 46 end 52 47 53 function P.onKeyPressed()54 buttonIteratorHelper(P.buttonList, code, P, 1, 2)55 end56 57 48 return P 58 49
Note: See TracChangeset
for help on using the changeset viewer.