Esempio n. 1
0
 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)
Esempio n. 2
0
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(self.app,
                          modal=1,
                          movable=0,
                          title=_('Change password'),
                          rect=ui.Rect((w - 324) / 2, (h - 104) / 2, 324,
                                       104),
                          layoutManager=ui.SimpleGridLM(),
                          tabChange=True)
     self.win.subscribeAction('*', self)
     ui.Label(self.win,
              text=_('Old password'),
              align=ui.ALIGN_E,
              layout=(0, 0, 6, 1))
     ui.Entry(self.win,
              id='vOld',
              align=ui.ALIGN_W,
              showChar='*',
              layout=(6, 0, 10, 1),
              orderNo=1)
     ui.Label(
         self.win,
         text=_('New password'),
         align=ui.ALIGN_E,
         layout=(0, 1, 6, 1),
     )
     ui.Entry(self.win,
              id='vNew',
              align=ui.ALIGN_W,
              showChar='*',
              layout=(6, 1, 10, 1),
              orderNo=2)
     ui.Label(
         self.win,
         align=ui.ALIGN_E,
         text=_('Confirm'),
         layout=(0, 2, 6, 1),
     )
     ui.Entry(self.win,
              id='vConfirm',
              align=ui.ALIGN_W,
              layout=(6, 2, 10, 1),
              showChar="*",
              orderNo=3)
     ui.Title(self.win,
              layout=(0, 3, 8, 1),
              id='vMessage',
              align=ui.ALIGN_W)
     ui.TitleButton(self.win,
                    layout=(8, 3, 4, 1),
                    text=_('Cancel'),
                    action='onCancel')
     ui.TitleButton(self.win,
                    layout=(12, 3, 4, 1),
                    text=_('Apply'),
                    action='onChange')
    def createUI(self):
        w, h = gdata.scrnSize
        self.win = ui.Window(
            self.app,
            modal=1,
            escKeyClose=1,
            movable=0,
            title=_('Change quantity'),
            rect=ui.Rect((w - 264) / 2, (h - 104) / 2, 264, 104),
            layoutManager=ui.SimpleGridLM(),
        )
        # creating dialog window
        self.win.subscribeAction('*', self)

        ui.Label(self.win,
                 text=_("New quantity:"),
                 align=ui.ALIGN_E,
                 layout=(0, 1, 6, 1))
        ui.Entry(
            self.win,
            id='vQuantity',
            align=ui.ALIGN_W,
            layout=(6, 1, 3, 1),
            #text = self.quantity,
        )
        ui.Title(self.win, layout=(0, 3, 3, 1))
        ui.TitleButton(self.win,
                       layout=(3, 3, 5, 1),
                       text=_("Cancel"),
                       action="onCancel")
        okBtn = ui.TitleButton(self.win,
                               layout=(8, 3, 5, 1),
                               text=_("OK"),
                               action='onOK')
        self.win.acceptButton = okBtn
Esempio n. 4
0
 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')
Esempio n. 5
0
    def createUI(self):
        screenWidth, screenHeight = gdata.scrnSize
        # size of dialog in layout metrics (for SimpleGridLM)
        cols = 20
        rows = 6
        # 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=_("Search for system"),
            rect=ui.Rect(10, 25, 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=
            _("Use wildcard search as with files (*ese* finds Presere and Shesed)"
              ),
            align=ui.ALIGN_W)
        ui.Label(
            self.win,
            layout=(0, 1, cols - 1, 1),
            text=_("* matches everything, ? matches any single character"),
            align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(0, 2, 6, 1),
                 text=_("System name:"),
                 align=ui.ALIGN_W)
        ui.Entry(self.win,
                 layout=(6, 2, cols - 7, 1),
                 id="vSystemName",
                 align=ui.ALIGN_W)

        # dialog bottom line
        ui.Title(self.win, layout=(0, rows - 1, cols - 15, 1))
        srchBtn = ui.TitleButton(self.win,
                                 layout=(cols - 15, rows - 1, 5, 1),
                                 text=_("Find"),
                                 action='onSearch',
                                 data=1)
        ui.TitleButton(self.win,
                       layout=(cols - 10, rows - 1, 5, 1),
                       text=_("Next"),
                       action='onNext')
        ui.TitleButton(self.win,
                       layout=(cols - 5, rows - 1, 5, 1),
                       text=_("Cancel"),
                       action='onClose')
        self.win.acceptButton = srchBtn
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(
         self.app,
         modal=1,
         escKeyClose=1,
         movable=0,
         title=_('Rename system'),
         rect=ui.Rect((w - 404) / 2, (h - 164) / 2, 400 + 4, 164),
         layoutManager=ui.SimpleGridLM(),
     )
     self.win.subscribeAction('*', self)
     # rename
     ui.Title(self.win,
              layout=(0, 0, 10, 1),
              text=_('System name'),
              font='normal-bold',
              align=ui.ALIGN_W)
     ui.Label(self.win,
              layout=(0, 1, 5, 1),
              text=_('Name'),
              align=ui.ALIGN_W)
     ui.Entry(self.win, layout=(5, 1, 5, 1), id='vName', align=ui.ALIGN_E)
     ui.Title(self.win,
              layout=(10, 0, 10, 1),
              text=_('Planet numbering'),
              font='normal-bold',
              align=ui.ALIGN_W)
     ui.Listbox(self.win,
                layout=(10, 1, 10, 5),
                id='vNumbers',
                columnLabels=0,
                columns=((None, 'text', 0, ui.ALIGN_W), ))
     # status bar + submit/cancel
     ui.TitleButton(self.win,
                    layout=(15, 6, 5, 1),
                    text=_('Rename'),
                    action='onClose')
     ui.TitleButton(self.win,
                    layout=(10, 6, 5, 1),
                    text=_('Cancel'),
                    action='onCancel')
     ui.Title(self.win,
              id='vStatusBar',
              layout=(0, 6, 10, 1),
              align=ui.ALIGN_W)
     #self.win.statusBar = self.win.vStatusBar
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(self.app,
                          modal=1,
                          movable=0,
                          title=_('Select starting position'),
                          rect=ui.Rect((w - 424) / 2, (h - 264) / 2, 424,
                                       264),
                          layoutManager=ui.SimpleGridLM(),
                          tabChange=True)
     ui.Listbox(self.win,
                layout=(0, 0, 21, 10),
                id='vPos',
                columns=((_('Galaxy'), 'text', 5, ui.ALIGN_W),
                         (_('Position'), 'tPos', 0, ui.ALIGN_W)),
                columnLabels=1)
     self.win.subscribeAction('*', self)
     ui.Label(self.win, layout=(0, 10, 5, 1), text=_("VIP Password:"))
     ui.Entry(self.win,
              layout=(5, 10, 5, 1),
              id='vPassword',
              align=ui.ALIGN_W,
              showChar='*',
              orderNo=1)
     ui.Title(self.win,
              layout=(0, 11, 13, 1),
              id='vStatusBar',
              align=ui.ALIGN_W)
     ui.TitleButton(self.win,
                    layout=(13, 11, 4, 1),
                    text=_('Exit'),
                    action='onCancel')
     ui.TitleButton(self.win,
                    layout=(17, 11, 4, 1),
                    text=_('Select'),
                    action='onSelect')
     self.win.statusBar = self.win.vStatusBar
	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)
Esempio n. 9
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 = _('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)
Esempio n. 10
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)
Esempio n. 11
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)
Esempio n. 12
0
    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 - 124) / 2, 424, 145),
            layoutManager=ui.SimpleGridLM(),
            tabChange=True,
        )
        self.win.subscribeAction('*', self)
        ui.Label(self.win,
                 text=_('Login'),
                 align=ui.ALIGN_E,
                 layout=(5, 0, 6, 1))
        ui.Entry(self.win,
                 id='vLogin',
                 align=ui.ALIGN_W,
                 layout=(11, 0, 10, 1),
                 orderNo=1)
        ui.Label(
            self.win,
            text=_('Password'),
            align=ui.ALIGN_E,
            layout=(5, 1, 6, 1),
        )
        ui.Entry(self.win,
                 id='vPassword',
                 align=ui.ALIGN_W,
                 showChar='*',
                 layout=(11, 1, 10, 1),
                 orderNo=2)

        # Add a target server entry
        ui.Label(
            self.win,
            text=_('Server'),
            align=ui.ALIGN_E,
            layout=(5, 2, 6, 1),
        )
        ui.Entry(self.win,
                 id='vTargetServer',
                 align=ui.ALIGN_W,
                 layout=(11, 2, 10, 1),
                 orderNo=3)
        ui.Button(self.win,
                  layout=(11, 3, 10, 1),
                  text=_("Options"),
                  action="onOptions",
                  id="vOptions")
        ui.Button(self.win,
                  layout=(11, 4, 10, 1),
                  text=_("New account"),
                  action="onCreateAccount",
                  id="vCreate")
        ui.Title(self.win,
                 layout=(0, 5, 11, 1),
                 id='vMessage',
                 align=ui.ALIGN_W)
        ui.TitleButton(self.win,
                       layout=(11, 5, 5, 1),
                       text=_('Exit'),
                       action='onCancel')
        loginBtn = ui.TitleButton(self.win,
                                  layout=(16, 5, 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
Esempio n. 13
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 = _('New Command'),
         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)
     StarMapWidget(self.win, layout = (0, 0, 40, 24),
         id = 'vStarMap', action = 'onSelectMapObj')
     # order buttons
     ui.Title(self.win, layout = (0, 24, 40, 1), text = _('Select command'),
         font = 'normal-bold', align = ui.ALIGN_W)
     ui.Button(self.win, layout = (0, 25, 5, 1), text = _('Move'), toggle = 1,
         id = 'vMoveBtn', action = 'onSelectCommand', data = Const.FLACTION_MOVE)
     ui.Button(self.win, layout = (5, 25, 5, 1), text = _('Refuel at'), toggle = 1,
         id = 'vRefuelBtn', action = 'onSelectCommand', data = Const.FLACTION_REFUEL)
     ui.Button(self.win, layout = (10, 25, 5, 1), text = _('Deploy'), toggle = 1,
         id = 'vDeplShipBtn', action = 'onSelectCommand', data = Const.FLACTION_DEPLOY)
     ui.Button(self.win, layout = (15, 25, 5, 1), text = _('Wait'), toggle = 1,
         id = 'vWaitBtn', action = 'onSelectCommand', data = Const.FLACTION_WAIT)
     ui.Button(self.win, layout = (20, 25, 5, 1), text = _('Declare War'), toggle = 1,
         id = 'vAttackBtn', action = 'onSelectCommand', data = Const.FLACTION_DECLAREWAR)
     ui.Button(self.win, layout = (25, 25, 5, 1), text = _('Repeat'), toggle = 1,
         id = 'vRepeatBtn', action = 'onSelectCommand', data = Const.FLACTION_REPEATFROM)
     ui.Button(self.win, layout = (30, 25, 5, 1), text = _('Use Wormhole'), toggle = 1,
         id = 'vWormholeBtn', action = 'onSelectCommand', data = Const.FLACTION_ENTERWORMHOLE)
     # Target indicator
     ui.Label(self.win, layout = (0, 26, 5, 1), text = _('Target'),
         align = ui.ALIGN_W, tags = [Const.FLACTION_MOVE, Const.FLACTION_DEPLOY, Const.FLACTION_REFUEL, Const.FLACTION_ENTERWORMHOLE])
     ui.Label(self.win, layout = (0, 26, 5, 1), text = _('At commander'),
         align = ui.ALIGN_W, tags = [Const.FLACTION_DECLAREWAR])
     ui.Label(self.win, layout = (5, 26, 10, 1), id = 'vTarget',
         align = ui.ALIGN_E, tags = [Const.FLACTION_MOVE, Const.FLACTION_DEPLOY,
         Const.FLACTION_DECLAREWAR, Const.FLACTION_REFUEL, Const.FLACTION_ENTERWORMHOLE])
     # Delay indicator
     ui.Label(self.win, layout = (0, 26, 5, 1), text = _('Turns'),
         align = ui.ALIGN_W, tags = [Const.FLACTION_WAIT])
     ui.Entry(self.win, layout = (5, 26, 5, 1), id = 'vTurns', text = '1',
         align = ui.ALIGN_E, tags = [Const.FLACTION_WAIT], orderNo = 1)
     # Ship to deploy
     ui.Label(self.win, layout = (15, 26, 5, 1), text = _('Ship'),
         align = ui.ALIGN_E, tags = [Const.FLACTION_DEPLOY])
     ui.Button(self.win, layout = (20, 26, 10, 1), id = 'vDeplShip',
         align = ui.ALIGN_NONE, tags = [Const.FLACTION_DEPLOY], action = 'onDeplShipChange')
     # Repeat
     ui.Label(self.win, layout = (0, 26, 10, 1), text = _('Start from command #'),
         align = ui.ALIGN_W, tags = [Const.FLACTION_REPEATFROM])
     ui.Entry(self.win, layout = (10, 26, 5, 1), id = 'vStartFrom', text = _('1'),
         align = ui.ALIGN_E, tags = [Const.FLACTION_REPEATFROM], orderNo = 2)
     ui.Label(self.win, layout = (36, 26, 2, 1), text = _("ETA:"), align = ui.ALIGN_W)
     ui.Label(self.win, layout = (38, 26, 2, 1), id = 'vEta', align = ui.ALIGN_E)
     # status bar + submit/cancel
     ui.TitleButton(self.win, layout = (35, 27, 5, 1), text = _('Order'), action = 'onOrder')
     ui.TitleButton(self.win, layout = (30, 27, 5, 1), text = _('Cancel'), action = 'onCancel')
     ui.Title(self.win, id = 'vStatusBar', layout = (0, 27, 30, 1), align = ui.ALIGN_W)
Esempio n. 14
0
    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
Esempio n. 15
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')
Esempio n. 16
0
 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')
Esempio n. 17
0
 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')
Esempio n. 18
0
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(self.app,
                          modal=1,
                          movable=0,
                          title=_('Create account'),
                          rect=ui.Rect((w - 424) / 2, (h - 144) / 2, 424,
                                       144),
                          layoutManager=ui.SimpleGridLM(),
                          tabChange=True)
     self.win.subscribeAction('*', self)
     ui.Label(self.win,
              text=_('Nick'),
              align=ui.ALIGN_E,
              layout=(5, 0, 6, 1))
     ui.Entry(self.win,
              id='vNick',
              align=ui.ALIGN_W,
              layout=(11, 0, 10, 1),
              orderNo=1)
     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=2)
     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=3)
     ui.Label(
         self.win,
         align=ui.ALIGN_E,
         text=_('Confirm'),
         layout=(5, 3, 6, 1),
     )
     ui.Entry(self.win,
              id='vConfirm',
              align=ui.ALIGN_W,
              layout=(11, 3, 10, 1),
              showChar="*",
              orderNo=4)
     ui.Label(
         self.win,
         align=ui.ALIGN_E,
         text=_('E-mail'),
         layout=(5, 4, 6, 1),
     )
     ui.Entry(self.win,
              id='vEmail',
              align=ui.ALIGN_W,
              layout=(11, 4, 10, 1),
              orderNo=5)
     ui.Title(self.win,
              layout=(0, 5, 13, 1),
              id='vMessage',
              align=ui.ALIGN_W)
     ui.TitleButton(self.win,
                    layout=(13, 5, 4, 1),
                    text=_('Cancel'),
                    action='onCancel')
     ui.TitleButton(self.win,
                    layout=(17, 5, 4, 1),
                    text=_('Create'),
                    action='onCreate')
     ui.Label(self.win,
              layout=(0, 0, 5, 4),
              icons=((res.loginLogoImg, ui.ALIGN_W), ))
Esempio n. 19
0
    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')
Esempio n. 20
0
               (icon2, ui.ALIGN_NW),
               (icon2, ui.ALIGN_NE),
               (icon2, ui.ALIGN_SW),
               (icon2, ui.ALIGN_SE),
           ),
           layout=(0, 5, 5, 2))
 statusBar = ui.Label(
     win,
     align=ui.ALIGN_W,
     tooltip='This is a status bar which contains reports about...',
     layout=(0, 7, 6, 1),
 )
 app.statusBar = statusBar
 ui.Entry(
     win,
     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)