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 = _('Construction Centre'),
			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)
		# player listing
		ui.Title(self.win, layout = (0, 0, 15, 1), text = _('Ship Designs'),
			font = 'normal-bold', align = ui.ALIGN_W)
		ui.Listbox(self.win, layout = (0, 1, 15, 25), id = 'vDesigns',
			columns = (
				(_('#'), 'tNumber', 2, ui.ALIGN_E),
				(_('B'), 'tInBuild', 2, ui.ALIGN_E),
				(_('Name'), 'text', 8, ui.ALIGN_W),
				(_('Class'), 'tClass', 2, ui.ALIGN_W),
			),
			columnLabels = 1, action = "onSelectDesign",
		)
		ui.Button(self.win, layout = (0, 26, 7, 1), text = _("New design"),
			action = "onNewDesign")
		ui.Button(self.win, layout = (7, 26, 7, 1), text = _("Dupl. design"),
			action = "onDuplDesign", enabled = 0, id = "vDuplDesign")
		# current design
		ui.Title(self.win, layout = (15, 0, 25, 1), text = _('Design'),
			font = 'normal-bold', align = ui.ALIGN_W)
		# info
		ui.Label(self.win, layout = (15, 1, 5, 1), text = _("Name"),
			align = ui.ALIGN_W)
		ui.Entry(self.win, layout = (20, 1, 10, 1), id = "vName",
			align = ui.ALIGN_E)
		ui.Label(self.win, layout = (15, 2, 5, 1), text = _("Hull type"),
			align = ui.ALIGN_W)
		ui.ActiveLabel(self.win, layout = (20, 2, 10, 1), id = "vHull",
			align = ui.ALIGN_E, action = "onSelectHull")
		ui.Label(self.win, layout = (15, 3, 5, 1), text = _("Control unit"),
			align = ui.ALIGN_W)
		ui.ActiveLabel(self.win, layout = (20, 3, 10, 1), id = "vCtrl",
			align = ui.ALIGN_E, action = "onSelectCtrl")
		ui.Title(self.win, layout = (15, 4, 15, 1), text = _('Equipment'),
			font = 'normal-bold', align = ui.ALIGN_W)
		ui.Listbox(self.win, layout = (15, 5, 15, 19), id = 'vEquipment',
			columns = (
				(_('#'), 'tNumber', 2, ui.ALIGN_E),
				(_('Name'), 'text', 8, ui.ALIGN_W),
				(_('Data'), 'tData', 4, ui.ALIGN_W),
			),
			columnLabels = 1, action = "onEqSelectedInList"
		)
		ui.Button(self.win, layout = (15, 24, 1.2, 1), text = _("++"),
			action = "onIncrEquipment5", rmbAction = "onIncrEquipment20")
		ui.Button(self.win, layout = (16.2, 24, 1.8, 1), text = _("+"),
			action = "onIncrEquipment")
		ui.Button(self.win, layout = (18, 24, 1.8, 1), text = _("-"),
			action = "onDecrEquipment")
		ui.Button(self.win, layout = (19.8, 24, 1.2, 1), text = _("--"),
			action = "onDecrEquipment5", rmbAction = "onDecrEquipment20")
		ui.Button(self.win, layout = (21, 24, 4.5, 1), text = _("Add"),
			action = "onAddEquipment")
		ui.Button(self.win, layout = (25.5, 24, 4.5, 1), text = _("Remove"),
			action = "onRemoveEquipment")
		# ship's attrs
		ui.Label(self.win, layout = (30, 1, 5, 1), text = _("Class"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 1, 5, 1), id = "vAClass", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 2, 5, 1), text = _("Signature"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 2, 5, 1), id = "vASignature", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 3, 5, 1), text = _("Speed"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 3, 5, 1), id = "vASpeed", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 4, 5, 1), text = _("HP"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 4, 5, 1), id = "vAHP", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 5, 5, 1), text = _("Base attack"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 5, 5, 1), id = "vAAttack", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 6, 5, 1), text = _("Base defence"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 6, 5, 1), id = "vADefence", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 7, 5, 1), text = _("Military power"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 7, 5, 1), id = "vACombatPwr", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 8, 5, 1), text = _("Base exp pts"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 8, 5, 1), id = "vABaseExp", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 10, 3, 1), text = _("Tanks"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (33, 10, 7, 1), id = "vATanks", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 11, 7, 1), text = _("Support (fuel)"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (37, 11, 3, 1), id = "vASupport", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 12, 7, 1), text = _("Support (const. pts)"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (37, 12, 3, 1), id = "vACSup", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 13, 5, 1), text = _("Max. range"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 13, 5, 1), id = "vARange", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 15, 5, 1), text = _("Unused payload"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 15, 5, 1), id = "vAPayload", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 16, 5, 1), text = _("Free slots"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 16, 5, 1), id = "vASlots", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 18, 5, 1), text = _("Constr. pts"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 18, 5, 1), id = "vACCPts", align = ui.ALIGN_E)
		ui.Label(self.win, layout = (30, 20, 5, 1), text = _("Upgrade to"), align = ui.ALIGN_W)
		ui.Label(self.win, layout = (35, 20, 5, 1), id = "vAUpgrade", align = ui.ALIGN_E)
		# actions
		ui.Title(self.win, layout = (15, 25, 25, 1), text = _('Design Actions'),
			font = 'normal-bold', align = ui.ALIGN_W)
		ui.Button(self.win, layout = (15, 26, 5, 1), text = _("Upgrade"),
			id = "vUpgrade", action = "onUpgrade")
		ui.Button(self.win, layout = (20, 26, 5, 1), text = _("Scrap"),
			id = "vScrap", action = "onScrap")
		ui.Button(self.win, layout = (35, 26, 5, 1), text = _("Construct"),
			id = "vConstruct", action = "onConstruct")
		# 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)
Exemplo n.º 2
0
    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=_('Construction Centre'),
                             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)
        # player listing
        ui.Title(self.win,
                 layout=(0, 0, 15, 1),
                 text=_('Ship Designs'),
                 font='normal-bold',
                 align=ui.ALIGN_W)
        ui.Listbox(self.win,
                   layout=(0, 1, 15, 25),
                   id='vDesigns',
                   columns=((_('#'), 'tNumber', 2,
                             ui.ALIGN_E), (_('B'), 'tInBuild', 2, ui.ALIGN_E),
                            (_('Name'), 'text', 8, ui.ALIGN_W),
                            (_('Class'), 'tClass', 2, ui.ALIGN_W)),
                   columnLabels=1,
                   action="onSelectDesign",
                   hoverAction="onHighlightDesign")
        ui.Button(self.win,
                  layout=(0, 26, 7, 1),
                  text=_("New design"),
                  action="onNewDesign")
        ui.Button(self.win,
                  layout=(7, 26, 7, 1),
                  text=_("Dupl. design"),
                  action="onDuplDesign",
                  enabled=0,
                  id="vDuplDesign")
        # current design
        ui.Title(self.win,
                 layout=(15, 0, 25, 1),
                 text=_('Design'),
                 font='normal-bold',
                 align=ui.ALIGN_W)
        # info
        ui.Label(self.win,
                 layout=(15, 1, 5, 1),
                 text=_("Name"),
                 align=ui.ALIGN_W)
        ui.Entry(self.win, layout=(20, 1, 10, 1), id="vName", align=ui.ALIGN_E)
        ui.Label(self.win,
                 layout=(15, 2, 5, 1),
                 text=_("Hull type"),
                 align=ui.ALIGN_W)
        ui.ActiveLabel(self.win,
                       layout=(20, 2, 10, 1),
                       id="vHull",
                       align=ui.ALIGN_E,
                       action="onSelectHull")
        ui.Label(self.win,
                 layout=(15, 3, 5, 1),
                 text=_("Control unit"),
                 align=ui.ALIGN_W)
        ui.ActiveLabel(self.win,
                       layout=(20, 3, 10, 1),
                       id="vCtrl",
                       align=ui.ALIGN_E,
                       action="onSelectCtrl")
        ui.Button(self.win,
                  layout=(15, 4, 6, 1),
                  text=_('Engines'),
                  id="vEnginesButton",
                  font='normal-bold',
                  action="onAddEngine")
        ui.Title(
            self.win,
            layout=(21, 4, 19, 1),
        )
        ui.Listbox(self.win,
                   layout=(15, 5, 25, 3),
                   id='vEngines',
                   columns=((_('#'), 'tNumber', 2,
                             ui.ALIGN_E), (_('Name'), 'text', 8, ui.ALIGN_W),
                            (_('Data'), 'tData', 14, ui.ALIGN_W)),
                   columnLabels=0,
                   action="onEqSelectedInListInc",
                   rmbAction="onEqSelectedInListDec")
        ui.Button(self.win,
                  layout=(15, 8, 6, 1),
                  text=_('Weapons'),
                  id="vWeaponsButton",
                  font='normal-bold',
                  action="onAddWeapon")
        ui.Title(
            self.win,
            layout=(21, 8, 19, 1),
        )
        ui.Listbox(self.win,
                   layout=(15, 9, 25, 4),
                   id='vWeapons',
                   columns=((_('#'), 'tNumber', 2,
                             ui.ALIGN_E), (_('Name'), 'text', 8, ui.ALIGN_W),
                            (_('Data'), 'tData', 14, ui.ALIGN_W)),
                   columnLabels=0,
                   action="onEqSelectedInListInc",
                   rmbAction="onEqSelectedInListDec")
        ui.Button(self.win,
                  layout=(15, 13, 6, 1),
                  text=_('Equipment'),
                  id="vEquipmentButton",
                  font='normal-bold',
                  action="onAddEquipment")
        ui.Title(
            self.win,
            layout=(21, 13, 19, 1),
        )
        ui.Listbox(self.win,
                   layout=(15, 14, 25, 5),
                   id='vEquipment',
                   columns=((_('#'), 'tNumber', 2,
                             ui.ALIGN_E), (_('Name'), 'text', 8, ui.ALIGN_W),
                            (_('Data'), 'tData', 14, ui.ALIGN_W)),
                   columnLabels=0,
                   action="onEqSelectedInListInc",
                   rmbAction="onEqSelectedInListDec")

        ui.Button(self.win,
                  layout=(15, 19, 6, 1),
                  text=_("Upgrade to"),
                  id="vUpgrade",
                  font='normal-bold',
                  action="onUpgrade")
        ui.Label(self.win,
                 layout=(21, 19, 6, 1),
                 id="vAUpgrade",
                 align=ui.ALIGN_E)
        ui.Title(self.win, layout=(27.5, 19, 12.5, 1))

        # ship's attrs
        ui.Label(self.win,
                 layout=(30.5, 1, 4.5, 1),
                 text=_("Class"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(35, 1, 4.75, 1),
                 id="vAClass",
                 align=ui.ALIGN_E)
        ui.Label(self.win,
                 layout=(30.5, 2, 6.5, 1),
                 text=_("Free slots"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(37, 2, 2.75, 1),
                 id="vASlots",
                 align=ui.ALIGN_E)
        ui.Label(self.win,
                 layout=(30.5, 3, 6.5, 1),
                 text=_("Unused payload"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(37, 3, 2.75, 1),
                 id="vAPayload",
                 align=ui.ALIGN_E)

        ui.Label(self.win,
                 layout=(17, 21, 4, 1),
                 text=_("HP"),
                 align=ui.ALIGN_W)
        ui.Label(self.win, layout=(21, 21, 5, 1), id="vAHP", align=ui.ALIGN_E)
        ui.Label(self.win,
                 layout=(17, 22, 4, 1),
                 text=_("Base attack"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(21, 22, 5, 1),
                 id="vAAttack",
                 align=ui.ALIGN_E)
        ui.Label(self.win,
                 layout=(17, 23, 3, 1),
                 text=_("Base defence"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(20, 23, 6, 1),
                 id="vADefence",
                 align=ui.ALIGN_E)
        ui.Label(self.win,
                 layout=(17, 24, 5, 1),
                 text=_("Military power"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(22, 24, 4, 1),
                 id="vACombatPwr",
                 align=ui.ALIGN_E)

        ui.Label(self.win,
                 layout=(28, 20, 5, 1),
                 text=_("Signature"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(33, 20, 5, 1),
                 id="vASignature",
                 align=ui.ALIGN_E)
        ui.Label(self.win,
                 layout=(28, 21, 5, 1),
                 id="vSpeed",
                 text=_("Speed"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(34, 21, 5, 1),
                 id="vASpeed",
                 align=ui.ALIGN_E)
        ui.Label(self.win,
                 layout=(28, 22, 5, 1),
                 text=_("Tanks"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(33, 22, 5, 1),
                 id="vATanks",
                 align=ui.ALIGN_E)
        ui.Label(self.win,
                 layout=(28, 23, 5, 1),
                 text=_("Max. range"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(33, 23, 5, 1),
                 id="vARange",
                 align=ui.ALIGN_E)
        ui.Label(self.win,
                 layout=(28, 24, 5, 1),
                 text=_("Constr. pts"),
                 align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(33, 24, 5, 1),
                 font='normal-bold',
                 id="vACCPts",
                 align=ui.ALIGN_E)

        # actions
        ui.Title(self.win, layout=(15, 25, 25, 1))
        ui.Button(self.win,
                  layout=(15, 26, 5, 1),
                  text=_("Scrap"),
                  id="vScrap",
                  action="onScrap")
        ui.Button(self.win,
                  layout=(35, 26, 5, 1),
                  text=_("Construct"),
                  id="vConstruct",
                  action="onConstruct",
                  enabled=0)
        # 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
    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')