def createUI(self): w, h = gdata.scrnSize cols = 15 rows = 8 width = cols * 20 + 5 height = rows * 20 + 4 self.win = ui.Window(self.app, modal = 1, escKeyClose = 1, movable = 0, title = _('Rename Fleet'), rect = ui.Rect((w - width) / 2, (h - height) / 2, width, height), layoutManager = ui.SimpleGridLM(), ) self.win.subscribeAction('*', self) # rename ui.Label(self.win, layout = (0, 0, 5, 1), text = _('Name'), align = ui.ALIGN_W) ui.Entry(self.win, layout = (5, 0, 10, 1), id = 'vName', align = ui.ALIGN_E) ui.Check(self.win, layout = (0, 1, 15, 1), id = "vRetain", text = _("Retain name during fleet joins"), action = "onSelect", data = 2) ui.Check(self.win, layout = (0, 2, 15, 1), id = "vPrevent", text = _("Prevent all fleet joins"), action = "onSelect", data = 0) ui.Label(self.win, layout = (0, 4, 15, 1), text = _(' Note: Retaining name will prevent two'), align = ui.ALIGN_W) ui.Label(self.win, layout = (0, 5, 15, 1), text = _(' retain name fleets from joining.'), align = ui.ALIGN_W) # status bar + submit/cancel ui.TitleButton(self.win, layout = (10, 6, 5, 1), text = _('Rename'), action = 'onRename') ui.TitleButton(self.win, layout = (5, 6, 5, 1), text = _('Delete Name'), action = 'onDelete') ui.TitleButton(self.win, layout = (0, 6, 5, 1), text = _('Cancel'), action = 'onCancel')
def createUI(self): w, h = gdata.scrnSize cols = 22 rows = 13 width = cols * 20 + 4 height = rows * 20 + 24 self.win = ui.Window( self.app, modal=1, escKeyClose=1, movable=0, title=_("Edit buoy"), rect=ui.Rect((w - width) / 2, (h - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), ) # creating dialog window self.win.subscribeAction('*', self) ui.Label(self.win, text=_("Buoy text:"), align=ui.ALIGN_W, layout=(0, 0, 4, 1)) ui.Label(self.win, text=_("Visible to:"), align=ui.ALIGN_W, layout=(6, 0, 4, 1)) ui.Check(self.win, text=_("Allies"), align=ui.ALIGN_W, layout=(10.5, 0, 4, 1), id='vAllied', action="turnOff", data="vAllied") ui.Check(self.win, text=_("Scanner Share"), align=ui.ALIGN_W, layout=(15, 0, 6, 1), id='vScanner', action="turnOff", data="vScanner") s = ui.Scrollbar(self.win, layout=(cols - 1, 1, 1, rows - 3)) t = ui.Text( self.win, id='vText', align=ui.ALIGN_W, layout=(0, 1, cols - 1, rows - 2), ) t.attachVScrollbar(s) ui.Title(self.win, layout=(0, rows - 1, cols - 10, 1)) ui.TitleButton(self.win, layout=(cols - 10, rows - 1, 5, 1), text=_("Cancel"), action="onCancel") okBtn = ui.TitleButton(self.win, layout=(cols - 5, rows - 1, 5, 1), text=_("OK"), action='onOK') self.win.acceptButton = okBtn
def createUI(self): w, h = gdata.scrnSize self.win = ui.Window(self.app, modal = 1, movable = 0, title = _('Outer Space Login'), rect = ui.Rect((w - 424) / 2, (h - 164) / 2, 424, 164), layoutManager = ui.SimpleGridLM(), tabChange = True, ) self.win.subscribeAction('*', self) ui.Label(self.win, text = _('Universe'), align = ui.ALIGN_E, layout = (5, 0, 6, 1) ) ui.Button(self.win, id = 'vUniverse', align = ui.ALIGN_W, layout = (11, 0, 10, 1), action = "onUniverse", ) ui.Label(self.win, text = _('Login'), align = ui.ALIGN_E, layout = (5, 1, 6, 1) ) ui.Entry(self.win, id = 'vLogin', align = ui.ALIGN_W, layout = (11, 1, 10, 1), orderNo = 1 ) ui.Label(self.win, text = _('Password'), align = ui.ALIGN_E, layout = (5, 2, 6, 1), ) ui.Entry(self.win, id = 'vPassword', align = ui.ALIGN_W, showChar = '*', layout = (11, 2, 10, 1), orderNo = 2 ) ui.Check(self.win, layout = (16.5,3,5,1), text = _('Auto-login'), id = 'vAutoLogin', checked = 0, action = "onAutoLogin") ui.Check(self.win, layout = (11.25,3,5,1), text = _('Remember'), id = 'vSavePassword', checked = 0, action = "onSavePassword") ui.Button(self.win, layout = (11, 4, 10, 1), text = _("Options"), action = "onOptions", id = "vOptions") ui.Button(self.win, layout = (11, 5, 10, 1), text = _("New account"), action = "onCreateAccount", id = "vCreate") ui.Title(self.win, layout = (0, 6, 11, 1), id = 'vMessage', align = ui.ALIGN_W) ui.TitleButton(self.win, layout = (11, 6, 5, 1), text = _('Exit'), action = 'onCancel') loginBtn = ui.TitleButton(self.win, layout = (16, 6, 5, 1), text = _('Login'), action = 'onLogin') ui.Label(self.win, layout = (0, 0, 5, 4), icons = ((res.loginLogoImg, ui.ALIGN_W),)) self.win.acceptButton = loginBtn # Universe selection self.universeMenu = ui.Menu(self.app, title = _("Universes"), width = 10, ) self.universeMenu.subscribeAction("*", self)
def createUI(self): screenWidth, screenHeight = gdata.scrnSize # size of dialog in layout metrics (for SimpleGridLM) cols = 40 rows = 29 # dialog width and height in pixels isSmallWin = screenHeight == 600 and screenWidth == 800 width = cols * 20 + 4 * (not isSmallWin) height = rows * 20 + 4 * (not isSmallWin) #creating dialog window self.win = ui.Window(self.app, modal = 1, escKeyClose = 1, movable = 0, title = _("Problems Locator"), titleOnly = isSmallWin, #rect = ui.Rect((screenWidth - width) / 2, ((screenHeight - height) / 2) * (not isSmallWin), width, height), rect = ui.Rect((screenWidth - 800 - 4 * (not isSmallWin)) / 2, (screenHeight - 600 - 4 * (not isSmallWin)) / 2, width, height), layoutManager = ui.SimpleGridLM(), ) self.win.subscribeAction('*', self) # first row is window title rows -= 1 ui.Listbox(self.win, layout = (0, 0, cols, rows - 2), id = 'vProblems', columns = [(_('System'), 'text', 10, ui.ALIGN_W), (_('Problem description'), 'vDescription', 30, ui.ALIGN_W)], columnLabels = 1, action='onShowSource', rmbAction='onShowLocation') btnWidth = 4 ui.Check(self.win, layout = (btnWidth * 0, rows - 2, btnWidth, 1), id = 'vSystems', text = _('Systems'), action = 'onToggleCondition', checked = 1) ui.Check(self.win, layout = (btnWidth * 1, rows - 2, btnWidth, 1), id = 'vPlanets', text = _('Planets'), action = 'onToggleCondition', checked = 1) ui.Check(self.win, layout = (btnWidth * 2, rows - 2, btnWidth, 1), id = 'vFleets', text = _('Fleets'), action = 'onToggleCondition', checked = 1) ui.Check(self.win, layout = (btnWidth * 3, rows - 2, btnWidth, 1), id = 'vResearch', text = _('Research'), action = 'onToggleCondition', checked = 1) ui.Check(self.win, layout = (btnWidth * 6, rows - 2, btnWidth, 1), id = 'vCritical', text = _('Critical'), action = 'onToggleCondition', checked = 1) ui.Check(self.win, layout = (btnWidth * 7, rows - 2, btnWidth, 1), id = 'vMajor', text = _('Major'), action = 'onToggleCondition', checked = 1) ui.Check(self.win, layout = (btnWidth * 8, rows - 2, btnWidth, 1), id = 'vMinor', text = _('Minor'), action = 'onToggleCondition', checked = 1) ui.Check(self.win, layout = (btnWidth * 9, rows - 2, btnWidth, 1), id = 'vInfo', text = _('Info'), action = 'onToggleCondition', checked = 0) # dialog bottom line ui.Title(self.win, layout = (0, rows - 1, cols - 5, 1)) ui.TitleButton(self.win, layout = (cols - 5, rows - 1, 5, 1), text = _("Close"), action = 'onClose')
def createUI(self): w, h = gdata.scrnSize self.win = ui.Window(self.app, modal = 1, movable = 0, title = _('Question'), rect = ui.Rect((w - 424) / 2, (h - 124) / 2, 424, 124), layoutManager = ui.SimpleGridLM(), ) self.win.subscribeAction('*', self) ui.Text(self.win, layout = (5, 0, 16, 3), id = 'vText', background = self.win.app.theme.themeBackground, editable = 0) ui.Label(self.win, layout = (0, 0, 5, 4), icons = ((res.loginLogoImg, ui.ALIGN_W),)) ui.Title(self.win, layout = (0, 4, 13, 1), id = 'vStatusBar', align = ui.ALIGN_W) ui.Check(self.win, layout = (17, 3, 4, 1), text = _('I agree'), id = 'vAgree', action = 'onAgree') ui.TitleButton(self.win, layout = (13, 4, 4, 1), id = 'vCancel', action = 'onCancel') ui.TitleButton(self.win, layout = (17, 4, 4, 1), id = 'vConfirm', action = 'onConfirm')
def createUI(self): w, h = gdata.scrnSize cols = 32 rows = 20 dlgWidth = cols * 20 + 4 dlgHeight = rows * 20 + 4 self.win = ui.Window(self.app, modal=1, escKeyClose=1, movable=0, title=_('Select structure to construct'), rect=ui.Rect((w - dlgWidth) / 2, (h - dlgHeight) / 2, dlgWidth, dlgHeight), layoutManager=ui.SimpleGridLM()) self.win.subscribeAction('*', self) rows -= 1 # title ui.Title(self.win, layout=(0, 0, cols, 1), text=_('Production planet'), align=ui.ALIGN_W, font='normal-bold') ui.ButtonArray(self.win, layout=(0, 1, cols, 3), id='vPlanets', buttonSize=(8, 1), showSlider=0, action='onSelectPlanet') ui.Title(self.win, layout=(0, 4, cols - 10, 1), text=_('Structures to construct'), align=ui.ALIGN_W, font='normal-bold') ui.Title(self.win, layout=(cols - 10, 4, 10, 1), text=_('(right click for technology info)'), align=ui.ALIGN_E, font='normal') ui.ButtonArray(self.win, layout=(0, 5, cols, 9), id='vTechs', buttonSize=(2, 3), showSlider=0, action='onConstruct', rmbAction='onInfo') ui.Title(self.win, layout=(0, 14, 18, 1), text=_('Filters'), align=ui.ALIGN_W, font='normal-bold') ui.Label(self.win, layout=(0, 15, 6, 1), text=_('Technology levels:'), align=ui.ALIGN_W) ui.Button(self.win, layout=(6, 15, 1, 1), text=_('1'), id='vLevel1', toggle=1, action='onToggleLevel', data=1) ui.Button(self.win, layout=(7, 15, 1, 1), text=_('2'), id='vLevel2', toggle=1, action='onToggleLevel', data=2) ui.Button(self.win, layout=(8, 15, 1, 1), text=_('3'), id='vLevel3', toggle=1, action='onToggleLevel', data=3) ui.Button(self.win, layout=(9, 15, 1, 1), text=_('4'), id='vLevel4', toggle=1, action='onToggleLevel', data=4) ui.Button(self.win, layout=(10, 15, 1, 1), text=_('5'), id='vLevel5', toggle=1, action='onToggleLevel', data=5) ui.Button(self.win, layout=(11, 15, 1, 1), text=_('6'), id='vLevel6', toggle=1, action='onToggleLevel', data=6) ui.Button(self.win, layout=(12, 15, 1, 1), text=_('7'), id='vLevel7', toggle=1, action='onToggleLevel', data=7) ui.Button(self.win, layout=(13, 15, 1, 1), text=_('8'), id='vLevel8', toggle=1, action='onToggleLevel', data=8) ui.Button(self.win, layout=(14, 15, 1, 1), text=_('9'), id='vLevel9', toggle=1, action='onToggleLevel', data=9) ui.Check(self.win, layout=(0, 16, 6, 1), text=_('Bio production'), id='vBioProduction', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(0, 17, 6, 1), text=_('En production'), id='vEnProduction', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(6, 16, 6, 1), text=_('CP production'), id='vCPProduction', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(6, 17, 6, 1), text=_('RP production'), id='vRPProduction', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(12, 16, 6, 1), text=_('Military'), id='vMilitary', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(12, 17, 6, 1), text=_('Morale'), id='vMorale', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Title(self.win, layout=(18, 14, 6, 1), text=_('Sort'), align=ui.ALIGN_W, font='normal-bold') ui.Check(self.win, layout=(18, 15, 6, 1), text=_('Type'), id='vSortType', checked=1, align=ui.ALIGN_W, action='onSort', data='type') ui.Check(self.win, layout=(18, 16, 6, 1), text=_('Tech Level'), id='vSortTL', checked=0, align=ui.ALIGN_W, action='onSort', data='tl') ui.Check(self.win, layout=(18, 17, 6, 1), text=_('Name'), id='vSortNone', checked=0, align=ui.ALIGN_W, action='onSort', data='none') ui.Title(self.win, layout=(24, 14, 8, 1), text=_('Options'), align=ui.ALIGN_W, font='normal-bold') ui.Label(self.win, layout=(24, 15, 3, 1), text=_('Quantity'), align=ui.ALIGN_W) ui.Entry(self.win, layout=(27, 15, 5, 1), id='vQuantity', align=ui.ALIGN_E) ui.Check(self.win, layout=(26, 16, 8, 1), id='vReportFin', text=_('Report finalization'), align=ui.ALIGN_W) ui.Title(self.win, layout=(0, rows - 1, cols - 5, 1), align=ui.ALIGN_W) ui.TitleButton(self.win, layout=(cols - 5, rows - 1, 5, 1), text=_('Cancel'), action='onCancel')
def createUI(self): w, h = gdata.scrnSize cols = 38 rows = 24 #was 23 dlgWidth = cols * 20 + 4 dlgHeight = rows * 20 + 4 self.win = ui.Window(self.app, modal=1, escKeyClose=1, movable=0, title=_('Select new task'), rect=ui.Rect((w - dlgWidth) / 2, (h - dlgHeight) / 2, dlgWidth, dlgHeight), layoutManager=ui.SimpleGridLM(), tabChange=True) self.win.subscribeAction('*', self) ui.Title(self.win, layout=(0, 0, 22, 1), text=_('Technology'), align=ui.ALIGN_W, font='normal-bold') ui.Listbox(self.win, layout=(0, 1, 22, 19), id='vTechs', columns=((_('Name'), 'text', 13, ui.ALIGN_W), (_('Lvl'), 'tLevel', 2, ui.ALIGN_E), (_('Constr'), 'tProd', 3, ui.ALIGN_E), (_('ETC'), 'tETC', 3, ui.ALIGN_E)), columnLabels=1, action='onSelectTech') # filter ui.Button(self.win, layout=(0, 20, 3, 1), text=_('Stucts'), toggle=1, id='vStructuresToggle', action='onToggleStructures') ui.Button(self.win, layout=(3, 20, 3, 1), text=_('Ships'), toggle=1, id='vShipsToggle', action='onToggleShips') ui.Button(self.win, layout=(6, 20, 3, 1), text=_('Misc'), toggle=1, id='vOtherToggle', action='onToggleOther') ui.Button(self.win, layout=(9, 20, 1, 1), text=_('1'), id='vLevel1', toggle=1, action='onToggleLevel', data=1) ui.Button(self.win, layout=(10, 20, 1, 1), text=_('2'), id='vLevel2', toggle=1, action='onToggleLevel', data=2) ui.Button(self.win, layout=(11, 20, 1, 1), text=_('3'), id='vLevel3', toggle=1, action='onToggleLevel', data=3) ui.Button(self.win, layout=(12, 20, 1, 1), text=_('4'), id='vLevel4', toggle=1, action='onToggleLevel', data=4) ui.Button(self.win, layout=(13, 20, 1, 1), text=_('5'), id='vLevel5', toggle=1, action='onToggleLevel', data=5) ui.Button(self.win, layout=(14, 20, 1, 1), text=_('6'), id='vLevel6', toggle=1, action='onToggleLevel', data=6) ui.Button(self.win, layout=(18, 20, 4, 1), text=_('Info'), action='onInfo', id='vInfo') # targets ui.Title(self.win, layout=(22, 0, 16, 1), text=_('Target planet'), align=ui.ALIGN_W, font='normal-bold') ui.Listbox(self.win, layout=(22, 1, 16, 10), id='vTargets', columns=((_('Planet'), 'text', 10, ui.ALIGN_W), (_('Owner'), 'plOwner', 5, ui.ALIGN_W)), columnLabels=1, action='onSelectPlanet') ui.Listbox(self.win, layout=(22, 11, 16, 7), id='vTSlots', columns=((_('Target slots'), 'text', 15, ui.ALIGN_W), ), columnLabels=1, action='onSelectSlot') # prod types ui.Check(self.win, layout=(0, 21, 6, 1), text=_('Bio production'), tags=['struct'], id='vBioProduction', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(6, 21, 6, 1), text=_('En production'), tags=['struct'], id='vEnProduction', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(12, 21, 6, 1), text=_('CP production'), tags=['struct'], id='vCPProduction', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(18, 21, 6, 1), text=_('RP production'), tags=['struct'], id='vRPProduction', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(24, 21, 6, 1), text=_('Military'), tags=['struct'], id='vMilitary', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(30, 21, 6, 1), text=_('Morale'), tags=['struct'], id='vMorale', checked=1, align=ui.ALIGN_W, action='onFilter') # ship types ui.Check(self.win, layout=(0, 21, 6, 1), text=_('Small'), tags=['ship'], id='vSmall', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(6, 21, 6, 1), text=_('Medium'), tags=['ship'], id='vMedium', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(12, 21, 6, 1), text=_('Large'), tags=['ship'], id='vLarge', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(18, 21, 6, 1), text=_('Civilian'), tags=['ship'], id='vCivShip', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(24, 21, 6, 1), text=_('Military'), tags=['ship'], id='vMilShip', checked=1, align=ui.ALIGN_W, action='onFilter') # build ui.Title(self.win, layout=(22, 18, 16, 1), text=_('Options'), align=ui.ALIGN_W, font='normal-bold') ui.Label(self.win, layout=(22, 19, 10, 1), text=_('Quantity'), align=ui.ALIGN_W) ui.Entry(self.win, layout=(33, 19, 5, 1), id='vQuantity', align=ui.ALIGN_E, orderNo=1) ui.Check(self.win, layout=(31, 20, 7, 1), id='vReportFin', text=_('Report finalization')) ui.Title(self.win, layout=(0, 22, 28, 1), id='vStatusBar', align=ui.ALIGN_W) ui.TitleButton(self.win, layout=(28, 22, 5, 1), text=_('Cancel'), action='onCancel') ui.TitleButton(self.win, layout=(33, 22, 5, 1), text=_('Construct'), action='onConstruct')
def createUI(self): w, h = gdata.scrnSize self.win = ui.Window(self.app, modal = 1, escKeyClose = 1, titleOnly = w == 800 and h == 600, movable = 0, title = _('Split Fleet'), rect = ui.Rect((w - 800 - 4 * (w != 800)) / 2, (h - 600 - 4 * (h != 600)) / 2, 800 + 4 * (w != 800), 580 + 4 * (h != 600)), layoutManager = ui.SimpleGridLM(), tabChange = True, ) self.win.subscribeAction('*', self) # original fleet ui.Title(self.win, layout = (0, 0, 20, 1), text = _('Original fleet'), align = ui.ALIGN_W, font = 'normal-bold') ui.Listbox(self.win, id = 'vOShips', layout = (0, 1, 20, 21), columns = ( (_('#'), 'tCount', 1.5, ui.ALIGN_NONE), (_('Name'), 'text', 5, ui.ALIGN_W), (_('Lvl'), 'tLevel', 1.5, ui.ALIGN_NONE), (_('Class'), 'tClass', 3, ui.ALIGN_E), (_('HP'), 'tHP', 4, ui.ALIGN_E), (_('Exp'), 'tExp', 2, ui.ALIGN_E), (_('Spd'), 'tSpeed', 2, ui.ALIGN_E), ), columnLabels = 1, action = 'onOShipSelected', rmbAction = 'onMoveMenu' ) # grouping options ui.Title(self.win, layout = (0, 22, 20, 1), text = _('Group by'), align = ui.ALIGN_W, font = 'normal-bold') ui.Check(self.win, layout = (0, 23, 5, 1), id = "vDesign", text = _("design"), action = "onGroup", data = DESIGN) ui.Check(self.win, layout = (5, 23, 5, 1), id = "vClass", text = _("class"), action = "onGroup", data = CLASS) ui.Check(self.win, layout = (10, 23, 5, 1), id = "vDmg", text = _("damage"), action = "onGroup", data = DAMAGE) ui.Check(self.win, layout = (15, 23, 5, 1), id = "vExpr", text = _("experience"), action = "onGroup", data = EXPERIENCE) ui.Check(self.win, layout = (0, 24, 5, 1), id = "vLevel", text = _("level"), action = "onGroup", data = LEVEL) ui.Check(self.win, layout = (5, 24, 5, 1), id = "vSpeed", text = _("speed"), action = "onGroup", data = SPEED) # tanks ui.Title(self.win, layout = (0, 25, 20, 1), text = _('Tanks'), align = ui.ALIGN_W, font = 'normal-bold') ui.Label(self.win, layout = (0, 26, 5, 1), text = _('Fuel'), align = ui.ALIGN_W) ui.Entry(self.win, layout = (5, 26, 5, 1), id = 'vOEn', action = 'onStorChng', align = ui.ALIGN_E, data ='origEn', orderNo = 15) ui.Label(self.win, layout = (10, 26, 5, 1), id = 'vOEnMax', align = ui.ALIGN_W) # new fleet ui.Title(self.win, layout = (20, 0, 20, 1), text = _('New fleet'), align = ui.ALIGN_W, font = 'normal-bold') ui.Listbox(self.win, id = 'vNShips', layout = (20, 1, 20, 21), columns = ( (_('#'), 'tCount', 1.5, ui.ALIGN_NONE), (_('Name'), 'text', 5, ui.ALIGN_W), (_('Lvl'), 'tLevel', 1.5, ui.ALIGN_NONE), (_('Class'), 'tClass', 3, ui.ALIGN_E), (_('HP'), 'tHP', 4, ui.ALIGN_E), (_('Exp'), 'tExp', 2, ui.ALIGN_E), (_('Spd'), 'tSpeed', 2, ui.ALIGN_E), ), columnLabels = 1, action = 'onNShipSelected', rmbAction = 'onNMoveMenu') # grouping ui.Title(self.win, layout = (20, 22, 16, 1), text = _('Group by'), align = ui.ALIGN_W, font = 'normal-bold') ui.Button(self.win, layout = (36, 22, 4, 1), text = _("Clear"), action = 'onClear') ui.Check(self.win, layout = (20, 23, 5, 1), id = "vNDesign", text = _("design"), action = "onNGroup", data = DESIGN) ui.Check(self.win, layout = (25, 23, 5, 1), id = "vNClass", text = _("class"), action = "onNGroup", data = CLASS) ui.Check(self.win, layout = (30, 23, 5, 1), id = "vNDmg", text = _("damage"), action = "onNGroup", data = DAMAGE) ui.Check(self.win, layout = (35, 23, 5, 1), id = "vNExpr", text = _("experience"), action = "onNGroup", data = EXPERIENCE) ui.Check(self.win, layout = (20, 24, 5, 1), id = "vNLevel", text = _("level"), action = "onNGroup", data = LEVEL) ui.Check(self.win, layout = (25, 24, 5, 1), id = "vNSpeed", text = _("speed"), action = "onNGroup", data = SPEED) # tanks ui.Title(self.win, layout = (20, 25, 20, 1), text = _('Tanks'), align = ui.ALIGN_W, font = 'normal-bold') ui.Label(self.win, layout = (20, 26, 5, 1), text = _('Fuel'), align = ui.ALIGN_W) ui.Entry(self.win, layout = (25, 26, 5, 1), id = 'vNEn', action = 'onStorChng', align = ui.ALIGN_E, data ='newEn', orderNo = 16) ui.Label(self.win, layout = (30, 26, 5, 1), id = 'vNEnMax', align = ui.ALIGN_W) # status bar + submit/cancel ui.Title(self.win, id = 'vStatusBar', layout = (0, 27, 30, 1), align = ui.ALIGN_W) ui.TitleButton(self.win, layout = (35, 27, 5, 1), text = _('Split'), action = 'onSplit') ui.TitleButton(self.win, layout = (30, 27, 5, 1), text = _('Cancel'), action = 'onCancel') self.moveRightPopup = ui.Menu(self.app, title = _("Move right"), width = 10, columns = 2, items = [ ui.Item(_("1 ship"), action = "onMoveAction", data = 1), ui.Item(_("5 ships"), action = "onMoveAction", data = 5), ui.Item(_("10 ships"), action = "onMoveAction", data = 10), ui.Item(_("50 ships"), action = "onMoveAction", data = 50), ui.Item(_("100 ships"), action = "onMoveAction", data = 100), ui.Item(_("1/2 of ships"), action = "onMoveAction", data = 0.5), ui.Item(_("1/3 of ships"), action = "onMoveAction", data = 0.34), ui.Item(_("1/4 of ships"), action = "onMoveAction", data = 0.25), ui.Item(_("All ships"), action = "onMoveAction", data = -1), ] ) self.moveRightPopup.subscribeAction("*", self) self.moveLeftPopup = ui.Menu(self.app, title = _("Move left"), width = 10, columns = 2, items = [ ui.Item(_("1 ship"), action = "onNMoveAction", data = 1), ui.Item(_("5 ships"), action = "onNMoveAction", data = 5), ui.Item(_("10 ships"), action = "onNMoveAction", data = 10), ui.Item(_("50 ships"), action = "onNMoveAction", data = 50), ui.Item(_("100 ships"), action = "onNMoveAction", data = 100), ui.Item(_("1/2 of ships"), action = "onNMoveAction", data = 0.5), ui.Item(_("1/3 of ships"), action = "onNMoveAction", data = 0.34), ui.Item(_("1/4 of ships"), action = "onNMoveAction", data = 0.25), ui.Item(_("All ships"), action = "onNMoveAction", data = -1), ] ) self.moveLeftPopup.subscribeAction("*", self)
def createUI(self): w, h = gdata.scrnSize cols = 20 rows = 25 dlgWidth = cols * 20 + 4 dlgHeight = rows * 20 + 4 self.win = ui.Window(self.app, modal=1, escKeyClose=1, movable=0, title=_('Select new global task'), rect=ui.Rect((w - dlgWidth) / 2, (h - dlgHeight) / 2, dlgWidth, dlgHeight), layoutManager=ui.SimpleGridLM(), tabChange=True) self.win.subscribeAction('*', self) ui.Title(self.win, layout=(0, 0, 20, 1), text=_('Technology'), align=ui.ALIGN_W, font='normal-bold') ui.Listbox(self.win, layout=(0, 1, 20, 19), id='vTechs', columns=((_('Name'), 'text', 14, ui.ALIGN_W), (_('Lvl'), 'tLevel', 2, ui.ALIGN_E), (_('Constr'), 'tProd', 3, ui.ALIGN_E)), columnLabels=1, action='onSelectTech') # filter ui.Button(self.win, layout=(0, 20, 3, 1), text=_('Ships'), toggle=1, id='vShipsToggle', action='onToggleShips') ui.Button(self.win, layout=(3, 20, 3, 1), text=_('Misc'), toggle=1, id='vOtherToggle', action='onToggleOther') ui.Button(self.win, layout=(6, 20, 1, 1), text=_('1'), id='vLevel1', toggle=1, action='onToggleLevel', data=1) ui.Button(self.win, layout=(7, 20, 1, 1), text=_('2'), id='vLevel2', toggle=1, action='onToggleLevel', data=2) ui.Button(self.win, layout=(8, 20, 1, 1), text=_('3'), id='vLevel3', toggle=1, action='onToggleLevel', data=3) ui.Button(self.win, layout=(9, 20, 1, 1), text=_('4'), id='vLevel4', toggle=1, action='onToggleLevel', data=4) ui.Button(self.win, layout=(10, 20, 1, 1), text=_('5'), id='vLevel5', toggle=1, action='onToggleLevel', data=5) ui.Button(self.win, layout=(11, 20, 1, 1), text=_('6'), id='vLevel6', toggle=1, action='onToggleLevel', data=6) ui.Button(self.win, layout=(12, 20, 1, 1), text=_('7'), id='vLevel7', toggle=1, action='onToggleLevel', data=7) ui.Button(self.win, layout=(13, 20, 1, 1), text=_('8'), id='vLevel8', toggle=1, action='onToggleLevel', data=8) ui.Button(self.win, layout=(14, 20, 1, 1), text=_('9'), id='vLevel9', toggle=1, action='onToggleLevel', data=9) ui.Button(self.win, layout=(15, 20, 4, 1), text=_('Info'), action='onInfo', id='vInfo') # ship types ui.Check(self.win, layout=(0, 21, 4, 1), text=_('Small'), tags=['ship'], id='vSmall', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(4, 21, 4, 1), text=_('Medium'), tags=['ship'], id='vMedium', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(8, 21, 4, 1), text=_('Large'), tags=['ship'], id='vLarge', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(12, 21, 4, 1), text=_('Civilian'), tags=['ship'], id='vCivShip', checked=1, align=ui.ALIGN_W, action='onFilter') ui.Check(self.win, layout=(16, 21, 4, 1), text=_('Military'), tags=['ship'], id='vMilShip', checked=1, align=ui.ALIGN_W, action='onFilter') # build ui.Label(self.win, layout=(0, 22, 5, 1), text=_('Quantity'), align=ui.ALIGN_W) ui.Entry(self.win, layout=(5, 22, 6, 1), id='vQuantity', align=ui.ALIGN_E, orderNo=1) ui.Check(self.win, layout=(13, 22, 7, 1), id='vReportFin', text=_('Report finalization')) ui.Title(self.win, layout=(0, 23, 10, 1), id='vStatusBar', align=ui.ALIGN_W) ui.TitleButton(self.win, layout=(10, 23, 5, 1), text=_('Cancel'), action='onCancel') ui.TitleButton(self.win, layout=(15, 23, 5, 1), text=_('Construct'), action='onConstruct')
def createUI(self): w, h = gdata.scrnSize self.win = ui.Window( self.app, modal=1, escKeyClose=1, titleOnly=w == 800 and h == 600, movable=0, title=_('Fleets Overview'), rect=ui.Rect((w - 800 - 4 * (w != 800)) / 2, (h - 600 - 4 * (h != 600)) / 2, 800 + 4 * (w != 800), 580 + 4 * (h != 600)), layoutManager=ui.SimpleGridLM(), ) self.win.subscribeAction('*', self) # playets listbox ui.Listbox(self.win, layout=(0, 0, 40, 26), id='vFleets', columns=[ (_('Fleet'), 'text', 5, ui.ALIGN_W), (_('Location'), 'tLocation', 6.5, ui.ALIGN_W), (_('Current order'), 'tOrder', 7, ui.ALIGN_W), (_('ETA'), 'tETA', 3, ui.ALIGN_E), (_('Fuel %'), 'tFuel', 3, ui.ALIGN_E), (_('Op. time'), 'tOpTime', 3, ui.ALIGN_E), (_('Range'), 'tRange', 3, ui.ALIGN_E), (_('MP'), 'tMP', 3, ui.ALIGN_E), (_('Sign'), 'tSignature', 2, ui.ALIGN_E), (_("Last upgr."), "tLastUpgrade", 3.5, ui.ALIGN_E), ], columnLabels=1, action='onSelectFleet', rmbAction="onShowLocation") ui.Check(self.win, layout=(0, 26, 5, 1), text=_('Mine'), id="vMine", checked=1, action="onToggleCondition") ui.Check(self.win, layout=(5, 26, 5, 1), text=_('Enemy'), id="vEnemy", checked=0, action="onToggleCondition") ui.Check(self.win, layout=(10, 26, 5, 1), text=_('Unfriendly'), id="vUnfriendy", checked=0, action="onToggleCondition") ui.Check(self.win, layout=(15, 26, 5, 1), text=_('Neutral'), id="vNeutral", checked=0, action="onToggleCondition") ui.Check(self.win, layout=(20, 26, 5, 1), text=_('Friendly'), id="vFriendly", checked=0, action="onToggleCondition") ui.Check(self.win, layout=(25, 26, 5, 1), text=_('Allied'), id="vAllied", checked=0, action="onToggleCondition") ui.Check(self.win, layout=(34, 26, 6, 1), text=_('Show redirects'), id="vRedirects", checked=0, action="onToggleCondition") # status bar + submit/cancel ui.TitleButton(self.win, layout=(35, 27, 5, 1), text=_('Close'), action='onClose') ui.Title(self.win, id='vStatusBar', layout=(0, 27, 35, 1), align=ui.ALIGN_W)
def createUI(self): w, h = gdata.scrnSize cols = 20 rows = 11 width = cols * 20 + 5 height = rows * 20 + 4 self.win = ui.Window( self.app, modal=1, escKeyClose=1, title=_("Set Map Overlay:"), rect=ui.Rect(10, 25, width, height), layoutManager=ui.SimpleGridLM(), ) self.win.subscribeAction('*', self) # overlay modes ui.Check(self.win, layout=(0, 0, 10, 1), id="vOVERLAY_OWNER", text=_("Standard"), action="onSelect", data=gdata.OVERLAY_OWNER) ui.Check(self.win, layout=(0, 1, 10, 1), id="vOVERLAY_DIPLO", text=_("Diplomacy"), action="onSelect", data=gdata.OVERLAY_DIPLO) ui.Check(self.win, layout=(0, 2, 10, 1), id="vOVERLAY_BIO", text=_("Environment"), action="onSelect", data=gdata.OVERLAY_BIO) ui.Check(self.win, layout=(0, 3, 10, 1), id="vOVERLAY_MIN", text=_("Minerals"), action="onSelect", data=gdata.OVERLAY_MIN) ui.Check(self.win, layout=(0, 4, 10, 1), id="vOVERLAY_SLOT", text=_("Slots"), action="onSelect", data=gdata.OVERLAY_SLOT) ui.Check(self.win, layout=(0, 5, 10, 1), id="vOVERLAY_STARGATE", text=_("Fleet Acceleration"), action="onSelect", data=gdata.OVERLAY_STARGATE) ui.Check(self.win, layout=(0, 6, 10, 1), id="vOVERLAY_DOCK", text=_("Refuel and Upgrade"), action="onSelect", data=gdata.OVERLAY_DOCK) ui.Check(self.win, layout=(0, 7, 10, 1), id="vOVERLAY_MORALE", text=_("Morale"), action="onSelect", data=gdata.OVERLAY_MORALE) ui.Check(self.win, layout=(0, 8, 10, 1), id="vOVERLAY_FAME", text=_("Pirate Fame"), action="onSelect", data=gdata.OVERLAY_FAME) ui.Check(self.win, layout=(0, 9, 10, 1), id="vOVERLAY_PIRATECOLONYCOST", text=_("Pirate Colony Cost"), tags=['pirate'], action="onSelect", data=gdata.OVERLAY_PIRATECOLONYCOST) ui.Title(self.win, layout=(0, rows - 1, cols - 15, 1)) ui.TitleButton(self.win, layout=(cols - 5, rows - 1, 5, 1), text=_("Close"), action='onClose')
def createUI(self): w, h = gdata.scrnSize self.win = ui.Window( self.app, modal=1, escKeyClose=1, movable=0, title=_('Select component'), rect=ui.Rect((w - 764) / 2, (h - 463) / 2, 764, 463), layoutManager=ui.SimpleGridLM(), ) self.win.subscribeAction('*', self) # component list ui.Listbox(self.win, layout=(0, 0, 38, 20), id="vList", columns=( (_('Name'), 'text', 9, ui.ALIGN_W), (_('Type'), 'tType', 4, ui.ALIGN_W), (_('Data'), 'tData', 0, ui.ALIGN_W), ), columnLabels=1) ui.Check(self.win, layout=(0, 20, 5, 1), text=typeText[ENGINE], id='vEngine', checked=1, action='onFilter', data=ENGINE) ui.Check(self.win, layout=(5, 20, 5, 1), text=typeText[SMALL], id='vSmall', checked=1, action='onFilter', data=SMALL) ui.Check(self.win, layout=(10, 20, 5, 1), text=typeText[MEDIUM], id='vMedium', checked=1, action='onFilter', data=MEDIUM) ui.Check(self.win, layout=(15, 20, 5, 1), text=typeText[LARGE], id='vLarge', checked=1, action='onFilter', data=LARGE) ui.Check(self.win, layout=(20, 20, 5, 1), text=typeText[PLANET], id='vPlanet', checked=1, action='onFilter', data=PLANET) ui.Check(self.win, layout=(25, 20, 5, 1), text=typeText[OTHER], id='vOther', checked=1, action='onFilter', data=OTHER) # status bar + submit/cancel ui.TitleButton(self.win, layout=(33, 21, 5, 1), text=_('Select'), action='onSelect') ui.TitleButton(self.win, layout=(28, 21, 5, 1), text=_('Cancel'), action='onCancel') ui.Title(self.win, id='vStatusBar', layout=(0, 21, 28, 1), align=ui.ALIGN_W)
def createUI(self): screenWidth, screenHeight = gdata.scrnSize # size of dialog in layout metrics (for SimpleGridLM) cols = 33 rows = 18 # dialog width and height in pixels width = cols * 20 + 5 height = rows * 20 + 4 #creating dialog window self.win = ui.Window(self.app, modal=1, escKeyClose=1, movable=0, title=_("Options"), rect=ui.Rect((screenWidth - width) / 2, (screenHeight - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), tabChange=True) self.win.subscribeAction('*', self) # first row is window title rows -= 1 # Resolution ui.Title(self.win, layout=(1, 1, 5, 1), text=_('Resolution'), align=ui.ALIGN_NONE, font='normal-bold') ui.Button(self.win, layout=(1, 2, 5, 1), id="vResolution", align=ui.ALIGN_W) ui.ActiveLabel(self.win, layout=(1, 3, 5, 1), id="vResolution2") width = 304 # 15 * 20 + 4 height = 264 # 13 * 20 + 4 self.reswin = ui.Window( self.app, modal=1, escKeyClose=1, titleOnly=0, movable=0, title=_("Select resolution"), rect=ui.Rect((screenWidth - width) / 2, (screenHeight - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), ) self.reswin.subscribeAction('*', self) # rename ui.Listbox(self.reswin, layout=(0, 0, 15, 11), id='vResolutions', columnLabels=0, columns=((None, 'text', 0, ui.ALIGN_W), ), multiselection=0) # status bar + submit/cancel ui.TitleButton(self.reswin, layout=(10, 11, 5, 1), text=_("Select"), action='onResolutionSelected') ui.TitleButton(self.reswin, layout=(5, 11, 5, 1), text=_("Cancel"), action='onResolutionCancel') ui.Title(self.reswin, id='vStatusBar', layout=(0, 11, 5, 1), align=ui.ALIGN_W) # Languages ui.Title(self.win, layout=(1, 5, 5, 1), text=_('Language'), align=ui.ALIGN_NONE, font='normal-bold') try: longLang = self.languages[self.curLang] except: longLang = self.curLang #ui.Button(self.win, layout = (1, 8, 5, 1), text = longLang, id = 'vLanguage') ui.Button(self.win, layout=(1, 6, 5, 1), text=_('Select Language'), id='vLangSel', action='onSelectLanguage') ui.ActiveLabel(self.win, layout=(1, 7, 5, 1), text=longLang, id="vLanguage") lcols = 12 lrows = 6 width = lcols * 20 + 4 height = lrows * 20 + 4 self.lwin = ui.Window( self.app, modal=1, escKeyClose=1, titleOnly=0, movable=0, title=_("Select language"), rect=ui.Rect((screenWidth - width) / 2, (screenHeight - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), ) self.lwin.subscribeAction('*', self) # rename ui.Listbox(self.lwin, layout=(0, 0, lcols, lrows - 2), id='vLanguages', columnLabels=0, columns=((None, 'text', 0, ui.ALIGN_W), ), multiselection=0, sortedBy=('text', 1)) # status bar + submit/cancel ui.TitleButton(self.lwin, layout=(lcols - 5, lrows - 2, 5, 1), text=_("Select"), action='onLanguageSelected') ui.TitleButton(self.lwin, layout=(lcols - 10, lrows - 2, 5, 1), text=_("Cancel"), action='onLanguageCancel') ui.Title(self.lwin, id='vStatusBar', layout=(0, lrows - 2, lcols - 10, 1), align=ui.ALIGN_W) # Theme ui.Title(self.win, layout=(1, 9, 5, 1), text=_('Themes'), align=ui.ALIGN_NONE, font='normal-bold') ui.Button(self.win, layout=(1, 10, 5, 1), id="vTheme", align=ui.ALIGN_W) ui.ActiveLabel(self.win, layout=(1, 11, 5, 1), id="vTheme2") width = 304 # 15 * 20 + 4 height = 264 # 13 * 20 + 4 self.twin = ui.Window( self.app, modal=1, escKeyClose=1, titleOnly=0, movable=0, title=_("Select theme"), rect=ui.Rect((screenWidth - width) / 2, (screenHeight - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), ) self.twin.subscribeAction('*', self) # rename ui.Listbox(self.twin, layout=(0, 0, 15, 11), id='vThemes', columnLabels=0, columns=((None, 'text', 0, ui.ALIGN_W), ), multiselection=0, sortedBy=('text', 1)) # status bar + submit/cancel ui.TitleButton(self.twin, layout=(10, 11, 5, 1), text=_("Select"), action='onThemeSelected') ui.TitleButton(self.twin, layout=(5, 11, 5, 1), text=_("Cancel"), action='onThemeCancel') ui.Title(self.twin, id='vStatusBar', layout=(0, 11, 5, 1), align=ui.ALIGN_W) # Screen flags ui.Title(self.win, layout=(7, 1, 5, 1), text=_('Display flags'), align=ui.ALIGN_NONE, font='normal-bold') ui.Check(self.win, layout=(7, 2, 5, 1), text=_('Fullscreen'), id='vFullscreen', checked=0) ui.Check(self.win, layout=(7, 3, 5, 1), text=_('Double buf.'), id='vDoublebuf', checked=0) ui.Check(self.win, layout=(7, 4, 5, 1), text=_('HW surface'), id='vHWSurface', checked=0) ui.Check(self.win, layout=(7, 5, 5, 1), text=_('SW surface'), id='vSWSurface', checked=0) # Defaults ui.Title(self.win, layout=(7, 7, 25, 1), text=_('Default settings'), align=ui.ALIGN_NONE, font='normal-bold') ui.Check(self.win, layout=(7, 8, 8, 1), text=_('Report finalization'), id='vReportFin', checked=0) ui.Check(self.win, layout=(15, 8, 8, 1), text=_('Display help/tooltip'), id='vDisplayHelp', checked=1) ui.Check(self.win, layout=(23, 8, 9, 1), text=_('Show coordinates'), id='vCoords', checked=1) ui.Check(self.win, layout=(7, 9, 8, 1), text=_('Players highlight'), id='vHighlights', checked=1) ui.Check(self.win, layout=(15, 9, 8, 1), text=_('Show minimap'), id='vShowMinimap', checked=1) ui.Check(self.win, layout=(23, 9, 8, 1), text=_('Show gate systems'), id='vShowGateSystems', checked=1) ui.Check(self.win, layout=(7, 10, 8, 1), text=_('Show redirects'), id='vRedirects', checked=1, tooltip=_('Starmap hotkey: CTRL-R')) ui.Check(self.win, layout=(15, 10, 8, 1), text=_('Show map grid'), id='vShowMapGrid', checked=1, tooltip=_('Starmap hotkey: CTRL-G')) ui.Check(self.win, layout=(23, 10, 8, 1), text=_('Show gate network'), id='vShowGateNetwork', checked=0, tooltip=_('Starmap hotkey: CTRL-N')) ui.Check(self.win, layout=(7, 11, 8, 1), text=_('Show map scanners'), id='vShowMapScanners', checked=1, tooltip=_('Starmap hotkey: CTRL-S')) ui.Check(self.win, layout=(15, 11, 8, 1), text=_('Show fleet lines'), id='vShowMapFleetLines', checked=1, tooltip=_('Starmap hotkey: CTRL-L')) ui.Check(self.win, layout=(23, 11, 8, 1), text=_('Show player zones'), id='vShowPlayerZones', checked=0, tooltip=_('Starmap hotkey: CTRL-P')) #ui.Button(self.win, layout = (23, 10, 9, 1), id = "vGatemode", align = ui.ALIGN_W) #ui.ActiveLabel(self.win, layout = (23, 11, 9, 1), id = "vGatemode2") #width = 304 # 15 * 20 + 4 #height = 164 # 8 * 20 + 4 #self.gnwin = ui.Window(self.app, # modal = 1, # escKeyClose = 1, # titleOnly = 0, # movable = 0, # title = _("Select gate mode"), # rect = ui.Rect((screenWidth - width) / 2, (screenHeight - height) / 2, width, height), # layoutManager = ui.SimpleGridLM(), #) #self.gnwin.subscribeAction('*', self) # rename #ui.Listbox(self.gnwin, layout = (0, 0, 15, 6), id = 'vGatemodes', columnLabels = 0, # columns = ((None, 'text', 0, ui.ALIGN_W),), multiselection = 0) # status bar + submit/cancel #ui.TitleButton(self.gnwin, layout = (10, 6, 5, 1), text = _("Select"), action = 'onGatemodeSelected') #ui.TitleButton(self.gnwin, layout = (5, 6, 5, 1), text = _("Cancel"), action = 'onGatemodeCancel') #ui.Title(self.gnwin, id = 'vStatusBar', layout = (0, 6, 5, 1), align = ui.ALIGN_W) # Login settings ui.Title(self.win, layout=(7, 13, 15, 1), text=_('Login settings'), align=ui.ALIGN_NONE, font='normal-bold') ui.Check(self.win, layout=(15, 14, 8, 1), text=_('Auto-login'), id='vAutoLogin', checked=0) ui.Check(self.win, layout=(7, 14, 8, 1), text=_('Remember password'), id='vSavePassword', checked=0, action="onChangeSavePassword") # proxy settings ui.Title(self.win, layout=(13, 1, 9, 1), text=_('Proxy'), font='normal-bold') ui.Label(self.win, layout=(13, 2, 4, 1), text=_('Host:'), align=ui.ALIGN_E) ui.Entry(self.win, layout=(17, 2, 5, 1), id='vProxyHost', align=ui.ALIGN_W, orderNo=1) ui.Label(self.win, layout=(13, 3, 4, 1), text=_('Port:'), align=ui.ALIGN_E) ui.Entry(self.win, layout=(17, 3, 5, 1), id='vProxyPort', align=ui.ALIGN_W, orderNo=2) ui.Label(self.win, layout=(13, 4, 4, 1), text=_('Username:'******'vProxyUsername', align=ui.ALIGN_W, orderNo=3) ui.Label(self.win, layout=(13, 5, 4, 1), text=_('Password:'******'vProxyPassword', align=ui.ALIGN_W, orderNo=4) # sound options ui.Title(self.win, layout=(23, 1, 9, 1), text=_('Sound / Music'), font='normal-bold') ui.Check(self.win, layout=(23, 2, 9, 1), text=_('Sounds'), id='vSoundEnabled', checked=1) ui.Scrollbar(self.win, layout=(23, 3, 9, 1), id='vSoundVolume', action="onChangeSoundVolume") ui.Check(self.win, layout=(23, 4, 9, 1), text=_('Music'), id='vMusicEnabled', checked=1) ui.Scrollbar(self.win, layout=(23, 5, 9, 1), id='vMusicVolume', action="onChangeMusicVolume") # dialog bottom line ui.Title(self.win, layout=(0, rows - 1, cols - 10, 1)) ui.TitleButton(self.win, layout=(cols - 10, rows - 1, 5, 1), text=_("Cancel"), action='onCancel') ui.TitleButton(self.win, layout=(cols - 5, rows - 1, 5, 1), text=_("OK"), action='onOK')