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=_("Key Command Help"), rect=ui.Rect((w - width) / 2, (h - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), ) # creating dialog window self.win.subscribeAction('*', self) t = ui.Text(self.win, id='vText', align=ui.ALIGN_W, layout=(0, 0, cols - 1, rows - 2), editable=0) s = ui.Scrollbar(self.win, layout=(cols - 1, 0, 1, rows - 2)) t.attachVScrollbar(s) ui.Title(self.win, layout=(0, rows - 1, cols - 16, 1)) ui.TitleButton(self.win, layout=(cols - 4, rows - 1, 4, 1), text=_("OK"), action="onCancel") ui.TitleButton(self.win, layout=(cols - 16, rows - 1, 12, 1), text=_("Do not show help/tooltip again"), action="onOK")
def createUI(self): w, h = gdata.scrnSize self.win = ui.Window( self.app, title=_('Unhandled exception'), modal=1, escKeyClose=1, movable=0, rect=ui.Rect((w - 724) / 2, (h - 443) / 2, 724, 443), layoutManager=ui.SimpleGridLM(), ) self.win.subscribeAction('*', self) s = ui.Scrollbar(self.win, layout=(35, 0, 1, 20)) t = ui.Text(self.win, layout=(0, 0, 35, 20), id="vText") t.attachVScrollbar(s) ui.Button(self.win, layout=(0, 20, 9, 1), text=_('Continue'), action='onContinue') ui.Button(self.win, layout=(9, 20, 9, 1), text=_('Close Application'), action='onClose') ui.Button(self.win, layout=(18, 20, 9, 1), text=_('Abort Application'), action='onAbort') ui.Button(self.win, layout=(27, 20, 9, 1), text=_('Send to server'), action='onSend', id='vSend', enabled=0)
def createUI(self): w, h = gdata.scrnSize cols = 20 rows = 13 width = cols * 20 + 4 height = rows * 20 + 24 self.win = ui.Window( self.app, modal=1, escKeyClose=1, movable=0, title=_("Show buoy text"), rect=ui.Rect((w - width) / 2, (h - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), ) # creating dialog window self.win.subscribeAction('*', self) s = ui.Scrollbar(self.win, layout=(cols - 1, 0, 1, rows - 1)) t = ui.Text(self.win, id='vText', align=ui.ALIGN_W, layout=(0, 0, cols - 1, rows - 1), editable=0) t.attachVScrollbar(s) ui.Title(self.win, layout=(0, rows - 1, cols - 5, 1)) okBtn = ui.TitleButton(self.win, layout=(cols - 5, rows - 1, 5, 1), text=_("OK"), action='onOK')
def createUI(self): screenWidth, screenHeight = gdata.scrnSize # size of dialog in layout metrics (for SimpleGridLM) cols = 25 rows = 20 # 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 = _("Galaxy finish"), rect = ui.Rect((screenWidth - width) / 2, (screenHeight - height) / 2, width, height), layoutManager = ui.SimpleGridLM(), ) self.win.subscribeAction('*', self) # first row is window title rows -= 1 ui.Label(self.win, layout = (0, 0, cols, 1), text = _("If you are sure to finish this galaxy, click on Finish button."), align = ui.ALIGN_W) ui.Label(self.win, layout = (0, 1, cols, 1), text = _("You can enter message visible in finish announcement below."), align = ui.ALIGN_W) s = ui.Scrollbar(self.win, layout = (cols - 1, 2, 1, rows - 3)) t = ui.Text(self.win, layout = (0, 2, cols - 1, rows - 3), id = 'vMsg') t.attachVScrollbar(s) # 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 = _("Finish"), action = 'onFinish') ui.TitleButton(self.win, layout = (cols - 5, rows - 1, 5, 1), text = _("Cancel"), action = 'onClose')
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, escKeyClose = 1, titleOnly = w == 800 and h == 600, movable = 0, title = _("Messages and events"), 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) # forums ui.Listbox(self.win, layout = (0, 0, 10, 27), id = "vForums", columns = ((_("Channel"), "text", 5.5, ui.ALIGN_W), (_("#"), "tMsgs", 4.5, ui.ALIGN_E)), columnLabels = 1, action = "onForumSelected", sortable = 0) # topics ui.Listbox(self.win, layout = (10, 0, 30, 15), id = "vMessages", columns = ( (_(" "), "tState", 1, ui.ALIGN_NONE), (_("Date"), "tDate", 4, ui.ALIGN_W), (_("Sender"), "tSender", 7, ui.ALIGN_W), (_("Subject"), "text", 0, ui.ALIGN_W), ), columnLabels = 1, action = "onMessageSelected", rmbAction = "onPostMenu") # messages ui.Title(self.win, layout = (10, 15, 5, 1), font = "normal-bold", align = ui.ALIGN_W) ui.Button(self.win, layout = (15, 15, 5, 1), text = _("New subject"), action = "onNewTopic", id = "vNewTopic", enabled = 0) ui.Button(self.win, layout = (20, 15, 5, 1), text = _("Reply"), action = "onReply", id = "vReply", enabled = 0) ui.Button(self.win, layout = (25, 15, 5, 1), text = _("Read all"), action = "onAllReaded", id = "vAllReaded", enabled = 0) ui.Button(self.win, layout = (30, 15, 5, 1), text = _("Delete"), action = "onDelete", id = "vDelete", enabled = 0) ui.Button(self.win, layout = (35, 15, 5, 1), text = _("Delete all"), action = "onDeleteAll", id = "vDeleteAll", enabled = 0) s = ui.Scrollbar(self.win, layout = (39, 16, 1, 11)) t = ui.Text(self.win, layout = (10, 16, 29, 11), id = "vMessage", editable = 0) t.attachVScrollbar(s) # status bar ui.TitleButton(self.win, layout = (30, 27, 5, 1), text = _('Refresh'), action = 'onRefresh') ui.TitleButton(self.win, layout = (35, 27, 5, 1), text = _('Close'), action = 'onClose') ui.Title(self.win, id = 'vStatusBar', layout = (0, 27, 30, 1), align = ui.ALIGN_W) #@self.win.statusBar = self.win.vStatusBar # event menu self.eventPopup = ui.Menu(self.app, title = _("Message actions"), items = [ ui.Item(_("Show location"), action = "onShowLoc"), ui.Item(_("Show source"), action = "onShowSource"), ui.Item(_("Show location and delete msg"), action = "onShowLocDel"), ui.Item(_("Show source and delete msg"), action = "onShowSourceDel"), ui.Item(_("Delete"), action = "onDelete"), ] ) self.eventPopup.subscribeAction("*", self)
def createUI(self): screenWidth, screenHeight = gdata.scrnSize # size of dialog in layout metrics (for SimpleGridLM) cols = 23 rows = 27 # 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=_("Empire Overview"), rect=ui.Rect((screenWidth - width) / 2, (screenHeight - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), ) self.win.subscribeAction('*', self) # first row is window title rows -= 1 s = ui.Scrollbar(self.win, layout=(cols - 1, 0, 1, rows - 1)) t = ui.Text(self.win, layout=(0, 0, cols - 1, rows - 1), id="vText", editable=0) self._textRows = rows - 1 t.attachVScrollbar(s) # 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=_("Analysis"), action="onMenu") ui.TitleButton(self.win, layout=(cols - 5, rows - 1, 5, 1), text=_("Close"), action="onClose") # analysis menu self.analysisMenu = ui.Menu(self.app, title=_("Field of analysis"), width=5, items=[ ui.Item(_("Planets"), action="onPlanetsAnalysis"), ui.Item(_("Fleets"), action="onFleetsAnalysis"), ]) self.analysisMenu.subscribeAction("*", self)
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(), ) self.win.subscribeAction('*', self) # tech data ui.Title(self.win, layout = (0, 0, 18, 1), text = _('Data'), align = ui.ALIGN_W, font = 'normal-bold') ui.Listbox(self.win, layout = (0, 1, 18, 25), id = 'vData', columns = ((_('Property'), 'text', 11, ui.ALIGN_W), (_('Value'), 'tValue', 7, ui.ALIGN_E)), columnLabels = 0) ui.Button(self.win, layout = (1, 26, 4, 1), text = _('Structure'), id = 'vStruct', toggle = 1, action = 'onShowType', data = V_STRUCT) ui.Button(self.win, layout = (5, 26, 4, 1), text = _('Ship Hull'), id = 'vHull', toggle = 1, action = 'onShowType', data = V_HULL) ui.Button(self.win, layout = (9, 26, 4, 1), text = _('Ship Eq.'), id = 'vSEquip', toggle = 1, action = 'onShowType', data = V_SEQUIP) ui.Button(self.win, layout = (13, 26, 4, 1), text = _('Project'), id = 'vProject', toggle = 1, action = 'onShowType', data = V_PROJECT) ui.Button(self.win, layout = (17, 26, 1, 1), text = '', id = 'vEmpty1', toggle = 0) ui.Button(self.win, layout = (0, 26, 1, 1), text = '', id = 'vEmpty2', toggle = 0) # text field ui.Title(self.win, layout = (18, 0, 22, 1), text = _('Description'), align = ui.ALIGN_W, font = 'normal-bold') s = ui.Scrollbar(self.win, layout = (39, 1, 1, 26)) t = ui.Text(self.win, layout = (18, 1, 21, 26), id = 'vDescr', editable = 0) t.attachVScrollbar(s) # 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 width = 764 # 38 * 20 + 4 height = 464 # 23 * 20 + 4 self.win = ui.Window(self.app, modal=1, escKeyClose=1, movable=0, title=_("New message"), rect=ui.Rect((w - width) / 2, (h - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), tabChange=True) self.win.subscribeAction('*', self) # headers ui.Label(self.win, layout=(0, 0, 5, 1), text=_("Recipient"), align=ui.ALIGN_W) ui.ActiveLabel(self.win, layout=(5, 0, 33, 1), id="vRecipient", align=ui.ALIGN_W) ui.Label(self.win, layout=(0, 1, 5, 1), text=_("Subject"), align=ui.ALIGN_W) ui.Entry(self.win, layout=(5, 1, 33, 1), id="vTopic", align=ui.ALIGN_W, orderNo=1) ui.Title(self.win, layout=(0, 2, 38, 1), text=_("Message"), font="normal-bold", align=ui.ALIGN_W) s = ui.Scrollbar(self.win, layout=(37, 3, 1, 18)) t = ui.Text(self.win, layout=(0, 3, 37, 18), id="vText", orderNo=2) t.attachVScrollbar(s) # info ui.Title(self.win, layout=(0, 21, 28, 1), id='vStatusBar', align=ui.ALIGN_W) ui.TitleButton(self.win, layout=(28, 21, 5, 1), text=_("Cancel"), action='onCancel') ui.TitleButton(self.win, layout=(33, 21, 5, 1), text=_("Send"), action='onSend') # status bar #self.win.statusBar = self.win.vStatusBar # # contact window # width = 304 # 15 * 20 + 4 height = 264 # 13 * 20 + 4 self.cwin = ui.Window( self.app, modal=1, escKeyClose=1, titleOnly=0, movable=0, title=_("Select recipient"), rect=ui.Rect((w - width) / 2, (h - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), ) self.cwin.subscribeAction('*', self) # rename ui.Listbox(self.cwin, layout=(0, 0, 15, 11), id='vContacts', columnLabels=0, columns=((None, 'text', 0, ui.ALIGN_W), ), multiselection=1, sortedBy=('text', 1)) # status bar + submit/cancel ui.TitleButton(self.cwin, layout=(10, 11, 5, 1), text=_("Select"), action='onContactSelected') ui.TitleButton(self.cwin, layout=(5, 11, 5, 1), text=_("Cancel"), action='onContactCancel') ui.Title(self.cwin, id='vStatusBar', layout=(0, 11, 5, 1), align=ui.ALIGN_W)
def createUI(self): w, h = gdata.scrnSize self.win = ui.Window(self.app, modal = 1, movable = 0, title = _('Select, which galaxy types do you want to play'), rect = ui.Rect((w - 564) / 2, (h - 404) / 2, 564, 404), layoutManager = ui.SimpleGridLM(), tabChange = True ) ui.Listbox(self.win, layout = (0, 0, 28, 7), id = 'vBookingPublic', sortedBy = ('text', 1), columns = ( ('', 'tChoice', 1, ui.ALIGN_NONE), (_('Galaxy type'), 'text', 6, ui.ALIGN_NONE), (_('Scenario'), 'tScenario', 6, ui.ALIGN_NONE), (_('Queue'), 'tCur', 3, ui.ALIGN_NONE), (_('Capacity'), 'tPos', 3, ui.ALIGN_NONE), (_('Last start'), 'tTime', 8, ui.ALIGN_E) ), columnLabels = 1, action = 'onSelect', ) ui.Listbox(self.win, layout = (0, 0, 28, 7), id = 'vBookingPrivate', sortedBy = ('tOwner', 1), columns = ( ('', 'tChoice', 1, ui.ALIGN_NONE), (_('Galaxy type'), 'text', 6, ui.ALIGN_NONE), (_('Scenario'), 'tScenario', 6, ui.ALIGN_NONE), (_('Queue'), 'tCur', 3, ui.ALIGN_NONE), (_('Capacity'), 'tPos', 3, ui.ALIGN_NONE), (_('Owner'), 'tOwner', 8, ui.ALIGN_E) ), columnLabels = 1, action = 'onSelect', ) self.win.subscribeAction('*', self) ui.Button(self.win, layout = (0, 7, 8, 1), id = "vPublicToggle", text = _('Show personal bookings'), action = 'onPublicToggle', tooltipTitle = _("Booking types"), tooltip = _("Public Bookings\nPublic bookings are recommended way how to jump into new game.\nWhen queue is full, galaxy creation is triggered, and you can start adventure with group of strangers.\n\nPrivate Bookings\nPrivate bookings are the way to start game with group of your friends.\nEvery private booking requires password chosen by the owner.\nSingle player games cannot be privately booked (as they are private by definition).") ) ui.Button(self.win, layout = (20, 7, 8, 1), id = "vCreatePrivate", text = _('Create private booking'), action = 'onCreatePrivate', tooltipTitle = _("Create Private Booking"), tooltip = _("Private bookings are way how to create games for group of friends.\n\ Every booking has to be created password protected, so you have to tell others\n\ what the password is.\n\n\ Account has limit of {0} private bookings at the time. Created galaxies\n\ no longers counts into the limit.".format(Const.BOOKING_PRIVATE_LIMIT)) ) ui.Button(self.win, layout = (20, 7, 8, 1), id = "vDeletePrivate", text = _('Delete private booking'), action = 'onDeletePrivate', tooltipTitle = _("Delete Private Booking"), tooltip = _("As the author of the booking, you can delete it at any time. No further warning will be issued.") ) ui.Button(self.win, layout = (7, 8.5, 14, 1.5), id = "vToggle", text = _('Toggle booking'), action = 'onToggleBooking') scrollBarInfo = ui.Scrollbar(self.win, layout = (27, 10.3, 1, 4.7)) textBox = ui.Text(self.win, layout = (9, 10.3, 18, 4.7), id = "vInfo", editable = 0) textBox.attachVScrollbar(scrollBarInfo) ui.Button(self.win, layout = (0.5, 10.5, 8, 1), id = "vGoalToggle", text = _('Display Goals'), action = 'onGoalToggle') ui.Label(self.win, layout = (0, 12, 4, 1), text = _("Planets:"), align = ui.ALIGN_W, tooltipTitle = _("Planets"), tooltip = _("Range of number of planets. About half of them is not colonizable at the beginning.") ) ui.Label(self.win, layout = (4, 12, 4.5, 1), id = "vPlanets", align = ui.ALIGN_E, tooltipTitle = _("Planets"), tooltip = _("Range of number of planets. About half of them is not colonizable at the beginning.") ) ui.Label(self.win, layout = (0, 13, 4, 1), text = _("Radius:"), align = ui.ALIGN_W, tooltipTitle = _("Radius"), tooltip = _("Galaxy radius, implies speed of game.") ) ui.Label(self.win, layout = (4, 13, 4.5, 1), id = "vRadius", align = ui.ALIGN_E, tooltipTitle = _("Radius"), tooltip = _("Galaxy radius, implies speed of game.") ) ui.Label(self.win, layout = (0, 14, 4, 1), text = _("Grouping:"), align = ui.ALIGN_W, tooltipTitle = _("Grouping"), tooltip = _("How many starting positions are grouped together in vicinity.") ) ui.Label(self.win, layout = (4, 14, 4.5, 1), id = "vPlayerGroup", align = ui.ALIGN_E, tooltipTitle = _("Grouping"), tooltip = _("How many starting positions are grouped together.") ) ui.Label(self.win, layout = (0, 15.2, 4, 1), text = _("Resources:"), align = ui.ALIGN_W) ui.Text (self.win, layout = (4, 15.2, 23, 1.6), id = "vResources", editable = 0) ui.Label(self.win, layout = (0, 17, 4, 1), text = _("Challenges:"), align = ui.ALIGN_W) ui.Label(self.win, layout = (4, 17, 24, 1), id = "vChallenges", align = ui.ALIGN_W) ui.Title(self.win, layout = (0, 18, 24, 1), id = 'vStatusBar', align = ui.ALIGN_W) ui.TitleButton(self.win, layout = (24, 18, 4, 1), text = _('Exit'), action = 'onCancel') self.win.statusBar = self.win.vStatusBar
def createUI(self): w, h = gdata.scrnSize cols = 14 rows = 8 width = cols * 20 + 5 height = rows * 20 + 4 self.win = ui.Window( self.app, modal=1, escKeyClose=1, movable=0, title=_('Color Definition'), rect=ui.Rect((w - width) / 2, (h - height) / 2, width, height), layoutManager=ui.SimpleGridLM(), tabChange=True, ) # creating dialog window self.win.subscribeAction('*', self) # R ui.Label(self.win, text=_("Red:"), align=ui.ALIGN_W, layout=(0, 0, 3, 1)) ui.Entry( self.win, id='vR', align=ui.ALIGN_W, layout=(7, 0, 3, 1), orderNo=1, reportValueChanged=True, ) ui.Scrollbar(self.win, layout=(0, 1, 10, 1), id='vRS', action="onChangeRed") # G ui.Label(self.win, text=_("Green:"), align=ui.ALIGN_W, layout=(0, 2, 3, 1)) ui.Entry( self.win, id='vG', align=ui.ALIGN_W, layout=(7, 2, 3, 1), orderNo=2, reportValueChanged=True, ) ui.Scrollbar(self.win, layout=(0, 3, 10, 1), id='vGS', action="onChangeGreen") # B ui.Label(self.win, text=_("Blue:"), align=ui.ALIGN_W, layout=(0, 4, 3, 1)) ui.Entry( self.win, id='vB', align=ui.ALIGN_W, layout=(7, 4, 3, 1), orderNo=3, reportValueChanged=True, ) ui.Scrollbar(self.win, layout=(0, 5, 10, 1), id='vBS', action="onChangeBlue") # color example ui.ColorBox(self.win, id='vColor', layout=(10, 0, 4, 6), margins=(4, 3, 4, 4)) #i.Title(self.win, layout = (0, 4, 2, 1)) ui.TitleButton(self.win, layout=(0, 6, 7, 1), text=_("Cancel"), action="onCancel") okBtn = ui.TitleButton(self.win, layout=(7, 6, 7, 1), text=_("OK"), action='onOK') self.win.acceptButton = okBtn
align=ui.ALIGN_W, tooltip='Enter anything you like.', layout=(0, 8, 4, 1), ).subscribeAction('*', echoHandler) x = 0 for align in (ui.ALIGN_N, ui.ALIGN_S, ui.ALIGN_E, ui.ALIGN_W): ui.ArrowButton( win, direction=align, layout=(x, 9, 1, 1), ) x += 1 slider = ui.ScrollSlider(win, shown=50, layout=(0, 10, 8, 1)) ui.ScrollSlider(win, shown=10, layout=(0, 11, 8, 1)) ui.ScrollSlider(win, shown=10, layout=(7, 0, 1, 10)) ui.Scrollbar(win, layout=(0, 12, 8, 1)).subscribeAction('*', echoHandler) ui.Scrollbar(win, layout=(6, 0, 1, 10)).subscribeAction('*', echoHandler) for x in xrange(8, 20, 2): for y in xrange(0, 10): ui.Button(win, text='%d,%d' % (x, y), layout=(x, y, 2, 1), font='small', statustip='%d,%d' % (x, y), enabled=(x + y) % 2) ui.Listbox( win, items=[ ui.Item('One'),
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')