コード例 #1
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 = _("Messages and events"),
         rect = ui.Rect((w - 800 - 4 * (w != 800)) / 2, (h - 600 - 4 * (h != 600)) / 2, 800 + 4 * (w != 800), 580 + 4 * (h != 600)),
         layoutManager = ui.SimpleGridLM(),
     )
     self.win.subscribeAction('*', self)
     # forums
     ui.Listbox(self.win, layout = (0, 0, 10, 27), id = "vForums",
         columns = ((_("Channel"), "text", 5.5, ui.ALIGN_W), (_("#"), "tMsgs", 4.5, ui.ALIGN_E)),
         columnLabels = 1, action = "onForumSelected", sortable = 0)
     # topics
     ui.Listbox(self.win, layout = (10, 0, 30, 15), id = "vMessages",
         columns = (
             (_(" "), "tState", 1, ui.ALIGN_NONE),
             (_("Date"), "tDate", 4, ui.ALIGN_W),
             (_("Sender"), "tSender", 7, ui.ALIGN_W),
             (_("Subject"), "text", 0, ui.ALIGN_W),
         ),
         columnLabels = 1, action = "onMessageSelected", rmbAction = "onPostMenu")
     # messages
     ui.Title(self.win, layout = (10, 15, 5, 1),
         font = "normal-bold", align = ui.ALIGN_W)
     ui.Button(self.win, layout = (15, 15, 5, 1), text = _("New subject"),
         action = "onNewTopic", id = "vNewTopic", enabled = 0)
     ui.Button(self.win, layout = (20, 15, 5, 1), text = _("Reply"),
         action = "onReply", id = "vReply", enabled = 0)
     ui.Button(self.win, layout = (25, 15, 5, 1), text = _("Read all"),
         action = "onAllReaded", id = "vAllReaded", enabled = 0)
     ui.Button(self.win, layout = (30, 15, 5, 1), text = _("Delete"),
         action = "onDelete", id = "vDelete", enabled = 0)
     ui.Button(self.win, layout = (35, 15, 5, 1), text = _("Delete all"),
         action = "onDeleteAll", id = "vDeleteAll", enabled = 0)
     s = ui.Scrollbar(self.win, layout = (39, 16, 1, 11))
     t = ui.Text(self.win, layout = (10, 16, 29, 11), id = "vMessage", editable = 0)
     t.attachVScrollbar(s)
     # status bar
     ui.TitleButton(self.win, layout = (30, 27, 5, 1), text = _('Refresh'), action = 'onRefresh')
     ui.TitleButton(self.win, layout = (35, 27, 5, 1), text = _('Close'), action = 'onClose')
     ui.Title(self.win, id = 'vStatusBar', layout = (0, 27, 30, 1), align = ui.ALIGN_W)
     #@self.win.statusBar = self.win.vStatusBar
     # event menu
     self.eventPopup = ui.Menu(self.app, title = _("Message actions"),
         items = [
             ui.Item(_("Show location"), action = "onShowLoc"),
             ui.Item(_("Show source"), action = "onShowSource"),
             ui.Item(_("Show location and delete msg"), action = "onShowLocDel"),
             ui.Item(_("Show source and delete msg"), action = "onShowSourceDel"),
             ui.Item(_("Delete"), action = "onDelete"),
         ]
     )
     self.eventPopup.subscribeAction("*", self)
コード例 #2
0
    def createUI(self):
        w, h = gdata.scrnSize
        self.win = ui.Window(
            self.app,
            modal=1,
            escKeyClose=1,
            movable=0,
            title=_('Select component'),
            rect=ui.Rect((w - 764) / 2, (h - 304) / 2, 764, 304),
            layoutManager=ui.SimpleGridLM(),
        )
        self.win.subscribeAction('*', self)
        # component list
        ui.Listbox(self.win,
                   layout=(0, 0, 38, 13),
                   id="vList",
                   columns=(
                       (_('Name'), 'text', 9, ui.ALIGN_W),
                       (_('Type'), 'tType', 4, ui.ALIGN_W),
                       (_('Data'), 'tData', 0, ui.ALIGN_W),
                   ),
                   sortedBy=('tType', 1),
                   action="onSelect",
                   rmbAction="onCancel")

        # status bar + submit/cancel
        ui.TitleButton(self.win,
                       layout=(33, 13, 5, 1),
                       text=_('Cancel'),
                       action='onCancel')
        ui.Title(self.win,
                 id='vStatusBar',
                 layout=(0, 13, 33, 1),
                 align=ui.ALIGN_W)
コード例 #3
0
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(
         self.app,
         modal=1,
         escKeyClose=1,
         movable=0,
         title=_('Select design to upgrade to'),
         rect=ui.Rect((w - 404) / 2, (h - 463) / 2, 404, 463),
         layoutManager=ui.SimpleGridLM(),
     )
     self.win.subscribeAction('*', self)
     # component list
     ui.Listbox(self.win,
                layout=(0, 0, 20, 21),
                id="vList",
                columns=(
                    (_('Name'), 'text', 11, ui.ALIGN_W),
                    (_('Per ship'), 'tDiff', 4, ui.ALIGN_E),
                    (_('Total'), 'tTotal', 4, ui.ALIGN_E),
                ),
                columnLabels=1,
                action="onSelect",
                rmbAction="onCancel")
     # status bar + submit/cancel
     ui.TitleButton(self.win,
                    layout=(15, 21, 5, 1),
                    text=_('Cancel'),
                    action='onCancel')
     ui.Title(self.win,
              id='vStatusBar',
              layout=(0, 21, 15, 1),
              align=ui.ALIGN_W)
コード例 #4
0
    def createUI(self):
        screenWidth, screenHeight = gdata.scrnSize
        # size of dialog in layout metrics (for SimpleGridLM)
        cols = 36
        rows = 27
        # dialog width and height in pixels
        width = cols * 20 + 5
        height = rows * 20 + 4
        #creating dialog window
        self.win = ui.Window(self.app,
            modal = 1,
            escKeyClose = 1,
            movable = 0,
            title = _("Planets analysis"),
            rect = ui.Rect((screenWidth - width) / 2, (screenHeight - height) / 2, width, height),
            layoutManager = ui.SimpleGridLM(),
        )
        self.win.subscribeAction('*', self)
        # first row is window title
        rows -= 1

        halfCols = cols / 2
        ui.Title(self.win, layout = (0, 0, halfCols, 1), text = _("Structures"),
            align = ui.ALIGN_W, id = "vStructuresTitle", font = "normal-bold")
        ui.Listbox(self.win, layout = (0, 1, halfCols, rows - 2), id = "vStructures",
            columns = (
                (_("Structure name"), "text", halfCols - 5, ui.ALIGN_W),
                (_("Total #"), "tStructCount", 4, ui.ALIGN_E)
            ),
            columnLabels = 1, action = "onSelectStruct", sortable = True)

        ui.Title(self.win, layout = (halfCols, 0, halfCols, 1), text = "",
            align = ui.ALIGN_W, id = "vPlanetsTitle", font = "normal-bold")
        ui.Listbox(self.win, layout = (halfCols, 1, halfCols, rows - 2), id = "vPlanets",
            columns = (
                (_("Planet name"), "text", halfCols - 5, ui.ALIGN_W),
                (_("# of structs"), "tStructCount", 4, ui.ALIGN_E)
            ),
            columnLabels = 1, action = "onSelectPlanet", rmbAction = "onShowLocation", sortable = True)

        # dialog bottom line
        ui.Title(self.win, layout = (0, rows - 1, cols - 5, 1))
        ui.TitleButton(self.win, layout = (cols - 5, rows - 1, 5, 1), text = _("Close"), action = "onClose")
コード例 #5
0
 def createUI(self):
     screenWidth, screenHeight = gdata.scrnSize
     # size of dialog in layout metrics (for SimpleGridLM)
     cols = 20
     rows = 24
     # 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=_("Fleet Details"),
         rect=ui.Rect((screenWidth - width) / 2,
                      (screenHeight - height) / 2, width, height),
         layoutManager=ui.SimpleGridLM(),
     )
     self.win.subscribeAction('*', self)
     # playets listbox
     ui.Listbox(self.win,
                layout=(0, 0, cols, rows - 3),
                id='vClassData',
                columns=[(_('Class'), 'text', 8, ui.ALIGN_W),
                         (_('Small'), 'tSm', 4, ui.ALIGN_E),
                         (_('Medium'), 'tMed', 4, ui.ALIGN_E),
                         (_('Large'), 'tLg', 4, ui.ALIGN_E)],
                columnLabels=1,
                sortable=0)
     ui.Button(self.win,
               layout=(0, rows - 3, 10, 1),
               text=_('Use Dmg Inheritance'),
               id="vInherit",
               toggle=1,
               action="onToggleCondition",
               data="showInheritance")
     ui.Button(self.win,
               layout=(10, rows - 3, 10, 1),
               text=_('Use Max HPs'),
               id="vMaxHP",
               toggle=1,
               action="onToggleCondition",
               data="showMaxHPs")
     # status bar + submit/cancel
     ui.TitleButton(self.win,
                    layout=(cols - 5, rows - 2, 5, 1),
                    text=_('Close'),
                    action='onClose')
     ui.Title(self.win,
              id='vStatusBar',
              layout=(0, rows - 2, cols - 5, 1),
              align=ui.ALIGN_W)
コード例 #6
0
ファイル: PlayerSelectDlg.py プロジェクト: taislin/outerspace
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(self.app,
                          modal=1,
                          movable=0,
                          title=_('Select gaming session'),
                          rect=ui.Rect((w - 564) / 2, (h - 264) / 2, 564,
                                       264),
                          layoutManager=ui.SimpleGridLM(),
                          tabChange=True)
     ui.Listbox(self.win,
                layout=(0, 0, 28, 10),
                id='vPos',
                columns=((_('Type'), 'type', 4,
                          ui.ALIGN_W), (_('Galaxy'), 'text', 8, ui.ALIGN_W),
                         (_('Position'), 'tPos', 0, ui.ALIGN_W)),
                action='onListSelect',
                columnLabels=1)
     self.win.subscribeAction('*', self)
     ui.Button(
         self.win,
         layout=(20, 10, 8, 1),
         text=_('Book New Game'),
         action='onBooking',
         tooltipTitle=_("New galaxy"),
         tooltip=
         _("Allows you to either start new single player galaxy, or get in a queue for\ngame with other players. That game will start when queue fills the capacity,\nand will show up in this dialog as active.\n\nYou can queue for multiple galaxies. Only single player games has account limit."
           ))
     ui.Button(
         self.win,
         layout=(0, 10, 8, 1),
         id='vToggle',
         text=_('Show Open Slots'),
         action='onToggleNew',
         tooltipTitle=_("Open slots"),
         tooltip=
         _("Slots available in already running galaxies, there is no telling\nwhat state the game or the empire is in."
           ))
     ui.Title(self.win,
              layout=(0, 11, 20, 1),
              id='vStatusBar',
              align=ui.ALIGN_W)
     ui.TitleButton(self.win,
                    layout=(20, 11, 4, 1),
                    text=_('Exit'),
                    action='onCancel')
     ui.TitleButton(self.win,
                    layout=(24, 11, 4, 1),
                    text=_('Select'),
                    action='onSelect')
     self.win.statusBar = self.win.vStatusBar
コード例 #7
0
	def createUI(self):
		screenWidth, screenHeight = gdata.scrnSize
		# size of dialog in layout metrics (for SimpleGridLM)
		cols = 40
		rows = 29
		# dialog width and height in pixels
		isSmallWin = screenHeight == 600 and screenWidth == 800
		width = cols * 20 + 4 * (not isSmallWin)
		height = rows * 20 + 4 * (not isSmallWin)
		#creating dialog window
		self.win = ui.Window(self.app,
			modal = 1,
			escKeyClose = 1,
			movable = 0,
			title = _("Problems Locator"),
			titleOnly = isSmallWin,
			#rect = ui.Rect((screenWidth - width) / 2, ((screenHeight - height) / 2) * (not isSmallWin), width, height),
			rect = ui.Rect((screenWidth - 800 - 4 * (not isSmallWin)) / 2, (screenHeight - 600 - 4 * (not isSmallWin)) / 2, width, height),
			layoutManager = ui.SimpleGridLM(),
		)
		self.win.subscribeAction('*', self)
		# first row is window title
		rows -= 1

		ui.Listbox(self.win, layout = (0, 0, cols, rows - 2), id = 'vProblems',
			columns = [(_('System'), 'text', 10, ui.ALIGN_W),
			(_('Problem description'), 'vDescription', 30, ui.ALIGN_W)],
			columnLabels = 1, action='onShowSource', rmbAction='onShowLocation')

		btnWidth = 4
		ui.Check(self.win, layout = (btnWidth * 0, rows - 2, btnWidth, 1), id = 'vSystems',
			text = _('Systems'), action = 'onToggleCondition', checked = 1)
		ui.Check(self.win, layout = (btnWidth * 1, rows - 2, btnWidth, 1), id = 'vPlanets',
			text = _('Planets'), action = 'onToggleCondition', checked = 1)
		ui.Check(self.win, layout = (btnWidth * 2, rows - 2, btnWidth, 1), id = 'vFleets',
			text = _('Fleets'), action = 'onToggleCondition', checked = 1)
		ui.Check(self.win, layout = (btnWidth * 3, rows - 2, btnWidth, 1), id = 'vResearch',
			text = _('Research'), action = 'onToggleCondition', checked = 1)

		ui.Check(self.win, layout = (btnWidth * 6, rows - 2, btnWidth, 1), id = 'vCritical',
			text = _('Critical'), action = 'onToggleCondition', checked = 1)
		ui.Check(self.win, layout = (btnWidth * 7, rows - 2, btnWidth, 1), id = 'vMajor',
			text = _('Major'), action = 'onToggleCondition', checked = 1)
		ui.Check(self.win, layout = (btnWidth * 8, rows - 2, btnWidth, 1), id = 'vMinor',
			text = _('Minor'), action = 'onToggleCondition', checked = 1)
		ui.Check(self.win, layout = (btnWidth * 9, rows - 2, btnWidth, 1), id = 'vInfo',
			text = _('Info'), action = 'onToggleCondition', checked = 0)

		# dialog bottom line
		ui.Title(self.win, layout = (0, rows - 1, cols - 5, 1))
		ui.TitleButton(self.win, layout = (cols - 5, rows - 1, 5, 1), text = _("Close"), action = 'onClose')
コード例 #8
0
 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
コード例 #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=_('Systems Overview'),
                          rect=ui.Rect((w - 800 - 4 * (w != 800)) / 2,
                                       (h - 600 - 4 * (h != 600)) / 2,
                                       800 + 4 * (w != 800),
                                       580 + 4 * (h != 600)),
                          layoutManager=ui.SimpleGridLM(),
     )
     self.win.subscribeAction('*', self)
     # playets listbox
     ui.Listbox(self.win, layout=(0, 0, 40, 26), id='vPlanets',
                columns=[(_('System'), 'text', 5.75, ui.ALIGN_W),
                (_('# Pl'), 'tSyPnum', 2, ui.ALIGN_E),
                (_('Mine'), 'tSyPYnum', 2, ui.ALIGN_E),
                (_('Other'), 'tSyPTnum', 2, ui.ALIGN_E),
                (_('Biomatter'), 'tSyBioRes', 3, ui.ALIGN_E),
                (_('Bio+-'), 'tSyBio', 2, ui.ALIGN_E),
                (_('En'), 'tSyEnRes', 3, ui.ALIGN_E),
                (_('En+-'), 'tSyEn', 2, ui.ALIGN_E),
                (_('%Fuel'), 'tSyRefuel', 2.25, ui.ALIGN_E),
                (_('%Max'), 'tSyRefuelMax', 2.25, ui.ALIGN_E),
                (_('%Repair'), 'tSyRepair', 3, ui.ALIGN_E),
                (_('Upgrade'), 'tSyUpgrade', 3, ui.ALIGN_E),
                (_('+Gate %'), 'tSyGate', 3, ui.ALIGN_E),
                (_('Strat Res'), 'tStRes', 3.75, ui.ALIGN_E)],
                columnLabels=1, action='onSelectSystem', rmbAction="onShowLocation")
     ui.Button(self.win, layout=(0, 26, 5, 1), text=_('My Systems'), id="vMine",
               toggle=1, action="onToggleCondition", data="showMine")
     ui.Button(self.win, layout=(5, 26, 5, 1), text=_('Other Cmdrs'), id="vOtherPlayers",
               toggle=1, action="onToggleCondition", data="showOtherPlayers")
     ui.Button(self.win, layout=(10, 26, 5, 1), text=_('Colonizable'), id="vColonizable",
               toggle=1, action="onToggleCondition", data="showColonizable")
     ui.Button(self.win, layout=(15, 26, 5, 1), text=_('Uncolonizable'), id="vUncolonizable",
               toggle=1, action="onToggleCondition", data="showUncolonizable")
     ui.Button(self.win, layout=(20, 26, 5, 1), text=_('Show Problems'), id="vProblems",
               toggle=1, action="onToggleCondition", data="showProblems")
     # 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)
コード例 #10
0
 def createUI(self):
     screenWidth, screenHeight = gdata.scrnSize
     # size of dialog in layout metrics (for SimpleGridLM)
     cols = 23
     rows = 12
     # 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=_("Mine Field Details"),
         rect=ui.Rect((screenWidth - width) / 2,
                      (screenHeight - height) / 2, width, height),
         layoutManager=ui.SimpleGridLM(),
     )
     self.win.subscribeAction('*', self)
     # playets listbox
     ui.Listbox(self.win,
                layout=(0, 0, cols, rows - 2),
                id='vMines',
                columns=[(_('Type'), 'text', 7, ui.ALIGN_W),
                         (_('Number'), 'tNum', 3, ui.ALIGN_E),
                         (_('Min Dmg'), 'tMinDmg', 3, ui.ALIGN_E),
                         (_('Max Dmg'), 'tMaxDmg', 3, ui.ALIGN_E),
                         (_('Attack'), 'tAtt', 3, ui.ALIGN_E),
                         (_('Ign. Shld'), 'tIS', 3, ui.ALIGN_E)],
                columnLabels=1,
                sortable=0)
     # status bar + submit/cancel
     ui.TitleButton(self.win,
                    layout=(cols - 5, rows - 2, 5, 1),
                    text=_('Close'),
                    action='onClose')
     ui.Title(self.win,
              id='vStatusBar',
              layout=(0, rows - 2, cols - 5, 1),
              align=ui.ALIGN_W)
コード例 #11
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=_('Planets Overview'),
                          rect=ui.Rect((w - 800 - 4 * (w != 800)) / 2, (h - 600 - 4 * (h != 600)) / 2, 800 + 4 * (w != 800), 580 + 4 * (h != 600)),
                          layoutManager=ui.SimpleGridLM())
     self.win.subscribeAction('*', self)
     # playets listbox
     ui.Listbox(self.win, layout=(0, 0, 40, 26), id='vPlanets',
                columns=[(_('Planet'), 'text', 6, ui.ALIGN_W),
                (_('Type'), 'tPlType', 3.5, ui.ALIGN_W),
                (_('Env'), 'tPlBio', 1.5, ui.ALIGN_E),
                (_('Min'), 'tPlMin', 1.5, ui.ALIGN_E),
                (_('En'), 'tPlEn', 1.5, ui.ALIGN_E),
                (_('Bio+-'), 'tChangeBio', 2.0, ui.ALIGN_E),
                (_('En+-'), 'tChangeEn', 2.0, ui.ALIGN_E),
                (_('Free'), 'tFree', 2.0, ui.ALIGN_E),
                (_('Sl.'), 'tSpace', 1.5, ui.ALIGN_E),
                (_('D.'), 'tDiam', 1.5, ui.ALIGN_E),
                (_('Mrl'), 'tMorale', 2, ui.ALIGN_E),
                (_('CP'), 'tProd', 2, ui.ALIGN_E),
                (_('RP'), 'tSci', 2, ui.ALIGN_E),
                (_('ETC'), 'tETC', 2.5, ui.ALIGN_E),
                (_('Tot.ETC'), 'tTotalETC', 2.5, ui.ALIGN_E),
                (_('Constructing'), 'tConstrInfo', 7.0, ui.ALIGN_W)],
                columnLabels=1, action='onSelectPlanet', rmbAction="onShowLocation")
     ui.Button(self.win, layout=(0, 26, 5, 1), text=_('My planets'), id="vMine",
               toggle=1, action="onToggleCondition", data="showMine")
     ui.Button(self.win, layout=(5, 26, 5, 1), text=_('Other cmdrs'), id="vOtherPlayers",
               toggle=1, action="onToggleCondition", data="showOtherPlayers")
     ui.Button(self.win, layout=(10, 26, 5, 1), text=_('Colonizable'), id="vColonizable",
               toggle=1, action="onToggleCondition", data="showColonizable")
     ui.Button(self.win, layout=(15, 26, 5, 1), text=_('Uncolonizable'), id="vUncolonizable",
               toggle=1, action="onToggleCondition", data="showUncolonizable")
     # 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)
コード例 #12
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(),
		)
		self.win.subscribeAction('*', self)
		# tech data
		ui.Title(self.win, layout = (0, 0, 18, 1), text = _('Data'),
			align = ui.ALIGN_W, font = 'normal-bold')
		ui.Listbox(self.win, layout = (0, 1, 18, 25), id = 'vData',
			columns = ((_('Property'), 'text', 11, ui.ALIGN_W),
			(_('Value'), 'tValue', 7, ui.ALIGN_E)),
			columnLabels = 0)
		ui.Button(self.win, layout = (1, 26, 4, 1), text = _('Structure'),
			id = 'vStruct', toggle = 1, action = 'onShowType', data = V_STRUCT)
		ui.Button(self.win, layout = (5, 26, 4, 1), text = _('Ship Hull'),
			id = 'vHull', toggle = 1, action = 'onShowType', data = V_HULL)
		ui.Button(self.win, layout = (9, 26, 4, 1), text = _('Ship Eq.'),
			id = 'vSEquip', toggle = 1, action = 'onShowType', data = V_SEQUIP)
		ui.Button(self.win, layout = (13, 26, 4, 1), text = _('Project'),
			id = 'vProject', toggle = 1, action = 'onShowType', data = V_PROJECT)
		ui.Button(self.win, layout = (17, 26, 1, 1), text = '',
			id = 'vEmpty1', toggle = 0)
		ui.Button(self.win, layout = (0, 26, 1, 1), text = '',
			id = 'vEmpty2', toggle = 0)
		# text field
		ui.Title(self.win, layout = (18, 0, 22, 1), text = _('Description'),
			align = ui.ALIGN_W, font = 'normal-bold')
		s = ui.Scrollbar(self.win, layout = (39, 1, 1, 26))
		t = ui.Text(self.win, layout = (18, 1, 21, 26), id = 'vDescr', editable = 0)
		t.attachVScrollbar(s)
		# status bar + submit/cancel
		ui.TitleButton(self.win, layout = (35, 27, 5, 1), text = _('Close'), action = 'onClose')
		ui.Title(self.win, id = 'vStatusBar', layout = (0, 27, 35, 1), align = ui.ALIGN_W)
コード例 #13
0
 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
コード例 #14
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,
         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)
     ui.Title(self.win,
              layout=(0, 27, 35, 1),
              id='vStatusBar',
              align=ui.ALIGN_W)
     ui.TitleButton(self.win,
                    layout=(35, 27, 5, 1),
                    text=_('Close'),
                    action='onCloseDlg')
     # fleet selection
     ui.Listbox(self.win,
                id='vShips',
                layout=(0, 0, 20, 12),
                columns=(
                    (_('Name'), 'text', 6.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='onShipSelected')
     # fleet data
     ui.Label(self.win,
              text=_('Coordinates'),
              layout=(20, 0, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vFCoordinates',
              layout=(25, 0, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Orbiting'),
              layout=(30, 0, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vFOrbiting',
              layout=(35, 0, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Max speed'),
              layout=(20, 1, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vFMaxSpeed',
              layout=(25, 1, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Signature'),
              layout=(30, 1, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vFSignature',
              layout=(35, 1, 5, 1),
              align=ui.ALIGN_E)
     # commands
     ui.Title(self.win,
              text=_('Commands'),
              align=ui.ALIGN_W,
              font='normal-bold',
              layout=(20, 12, 20, 1))
     ui.Listbox(self.win,
                layout=(20, 13, 20, 10),
                id='vCommands',
                columns=(('', 'current', 1, 0), (_('#'), 'tIndex', 1, 0),
                         (_('Command'), 'text', 5, ui.ALIGN_W),
                         (_('Target'), 'targetName', 7,
                          ui.ALIGN_W), (_('Info'), 'data', 7, ui.ALIGN_W)),
                columnLabels=1,
                action='onSelectCommand',
                sortable=False)
     ui.Button(self.win,
               text=_('New cmd'),
               layout=(20, 23, 4, 1),
               action='onNewCommand')
     ui.Button(self.win,
               text=_('Set active'),
               layout=(24, 23, 4, 1),
               id='vCommandSetActive',
               action='onSetActiveCommand')
     ui.Button(self.win,
               text=_('Delete cmd'),
               layout=(28, 23, 4, 1),
               id='vCommandDel',
               action='onDeleteCommand')
     ui.Button(self.win,
               text=_('Delete All'),
               layout=(32, 23, 4, 1),
               action='onDeleteAllCommands')
     ui.ArrowButton(self.win,
                    layout=(36, 23, 1, 1),
                    direction=ui.ALIGN_N,
                    id='vCommandUp',
                    action='onCommandMove',
                    data=-1)
     ui.ArrowButton(self.win,
                    layout=(37, 23, 1, 1),
                    direction=ui.ALIGN_S,
                    id='vCommandDown',
                    action='onCommandMove',
                    data=1)
     ui.Title(self.win,
              text=_('Other commands'),
              align=ui.ALIGN_W,
              font='normal-bold',
              layout=(20, 24, 20, 1))
     ui.Button(self.win,
               text=_('Split fleet'),
               id='vSplitButton',
               layout=(20, 25, 5, 1),
               action='onSplitFleet')
     ui.Button(self.win,
               text=_('Rename fleet'),
               id='vRenameButton',
               layout=(25, 25, 5, 1),
               action='onRenameFleet')
     ui.Button(self.win,
               text=_('Fleet Specs'),
               id='vFleetSpecs',
               layout=(30, 25, 5, 1),
               action='onFleetSpecs')
     ui.Button(self.win,
               text=_('Auto delete'),
               id='vAutoDeleteButton',
               layout=(35, 25, 5, 1),
               action='onAutoDelete')
     ui.Button(self.win,
               text=_('Scout wave'),
               id='vScoutWaveButton',
               layout=(20, 26, 5, 1),
               action='onScoutWaveFleet')
     ui.Button(self.win,
               text=_('Scrap fleet'),
               id='vScrapButton',
               layout=(25, 26, 5, 1),
               action='onScrapFleet')
     # ship data
     ui.Title(self.win,
              text=_('Ship Data'),
              layout=(0, 12, 15, 1),
              align=ui.ALIGN_W,
              font='normal-bold')
     ui.Button(self.win,
               text=_("Scrap"),
               layout=(15, 12, 5, 1),
               action="onDeleteSelectedShip")
     ui.Label(self.win,
              text=_('Name'),
              layout=(0, 13, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vShipModel',
              layout=(5, 13, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Class'),
              layout=(10, 13, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vShipClass',
              layout=(15, 13, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Attack eff'),
              layout=(0, 14, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vShipAtt',
              layout=(5, 14, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Defence eff'),
              layout=(10, 14, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vShipDef',
              layout=(15, 14, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Max speed'),
              layout=(0, 15, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vShipMaxSpeed',
              layout=(5, 15, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Scanner Pwr'),
              layout=(10, 15, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vShipScannerPwr',
              layout=(15, 15, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Tanks'),
              layout=(0, 16, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vShipStorages',
              layout=(5, 16, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Signature'),
              layout=(10, 16, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vShipSignature',
              layout=(15, 16, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Support'),
              layout=(0, 17, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vShipSupport',
              layout=(5, 17, 5, 1),
              align=ui.ALIGN_E)
     ui.Label(self.win,
              text=_('Max HP'),
              layout=(10, 17, 5, 1),
              align=ui.ALIGN_W)
     ui.Label(self.win,
              id='vShipMaxHP',
              layout=(15, 17, 5, 1),
              align=ui.ALIGN_E)
     ui.Title(self.win,
              text=_("Equipment"),
              layout=(0, 18, 20, 1),
              align=ui.ALIGN_W,
              font='normal-bold')
     ui.Listbox(self.win,
                id='vShipEquipment',
                layout=(0, 19, 20, 8),
                columns=((_('Name'), 'text', 8, ui.ALIGN_W),
                         (_('Data'), 'tData', 0, ui.ALIGN_W)),
                columnLabels=1)
コード例 #15
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",
		)
		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)
コード例 #16
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)
コード例 #17
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)
コード例 #18
0
ファイル: BookingDlg.py プロジェクト: WittsEnd2/Space-Scanner
    def createUI(self):
        w, h = gdata.scrnSize
        self.win = ui.Window(self.app,
            modal = 1,
            movable = 0,
            title = _('Select, which galaxy types do you want to play'),
            rect = ui.Rect((w - 564) / 2, (h - 404) / 2, 564, 404),
            layoutManager = ui.SimpleGridLM(),
            tabChange = True
        )
        ui.Listbox(self.win, layout = (0, 0, 28, 7), id = 'vBookingPublic',
                        sortedBy = ('text', 1),
                        columns = (
                                ('', 'tChoice', 1, ui.ALIGN_NONE),
                                (_('Galaxy type'), 'text', 6, ui.ALIGN_NONE),
                                (_('Scenario'), 'tScenario', 6, ui.ALIGN_NONE),
                                (_('Queue'), 'tCur', 3, ui.ALIGN_NONE),
                                (_('Capacity'), 'tPos', 3, ui.ALIGN_NONE),
                                (_('Last start'), 'tTime', 8, ui.ALIGN_E)
                                ),
                        columnLabels = 1,
                        action = 'onSelect',
                        )
        ui.Listbox(self.win, layout = (0, 0, 28, 7), id = 'vBookingPrivate',
                        sortedBy = ('tOwner', 1),
                        columns = (
                                ('', 'tChoice', 1, ui.ALIGN_NONE),
                                (_('Galaxy type'), 'text', 6, ui.ALIGN_NONE),
                                (_('Scenario'), 'tScenario', 6, ui.ALIGN_NONE),
                                (_('Queue'), 'tCur', 3, ui.ALIGN_NONE),
                                (_('Capacity'), 'tPos', 3, ui.ALIGN_NONE),
                                (_('Owner'), 'tOwner', 8, ui.ALIGN_E)
                                ),
                        columnLabels = 1,
                        action = 'onSelect',
                        )
        self.win.subscribeAction('*', self)

        ui.Button(self.win, layout = (0, 7, 8, 1), id = "vPublicToggle", text = _('Show personal bookings'), action = 'onPublicToggle',
            tooltipTitle = _("Booking types"),
            tooltip = _("Public Bookings\nPublic bookings are recommended way how to jump into new game.\nWhen queue is full, galaxy creation is triggered, and you can start adventure with group of strangers.\n\nPrivate Bookings\nPrivate bookings are the way to start game with group of your friends.\nEvery private booking requires password chosen by the owner.\nSingle player games cannot be privately booked (as they are private by definition).")
                )
        ui.Button(self.win, layout = (20, 7, 8, 1), id = "vCreatePrivate", text = _('Create private booking'), action = 'onCreatePrivate',
                tooltipTitle = _("Create Private Booking"),
                tooltip = _("Private bookings are way how to create games for group of friends.\n\
Every booking has to be created password protected, so you have to tell others\n\
what the password is.\n\n\
Account has limit of {0} private bookings at the time. Created galaxies\n\
no longers counts into the limit.".format(Const.BOOKING_PRIVATE_LIMIT))
                )

        ui.Button(self.win, layout = (20, 7, 8, 1), id = "vDeletePrivate", text = _('Delete private booking'), action = 'onDeletePrivate',
                tooltipTitle = _("Delete Private Booking"),
                tooltip = _("As the author of the booking, you can delete it at any time. No further warning will be issued.")
                )

        ui.Button(self.win, layout = (7, 8.5, 14, 1.5), id = "vToggle", text = _('Toggle booking'), action = 'onToggleBooking')
        scrollBarInfo = ui.Scrollbar(self.win, layout = (27, 10.3, 1, 4.7))
        textBox = ui.Text(self.win, layout = (9, 10.3, 18, 4.7), id = "vInfo", editable = 0)
        textBox.attachVScrollbar(scrollBarInfo)

        ui.Button(self.win, layout = (0.5, 10.5, 8, 1), id = "vGoalToggle", text = _('Display Goals'), action = 'onGoalToggle')
        ui.Label(self.win, layout = (0, 12, 4, 1), text = _("Planets:"), align = ui.ALIGN_W,
                tooltipTitle = _("Planets"),
                tooltip = _("Range of number of planets. About half of them is not colonizable at the beginning.")
                )
        ui.Label(self.win, layout = (4, 12, 4.5, 1), id = "vPlanets", align = ui.ALIGN_E,
                tooltipTitle = _("Planets"),
                tooltip = _("Range of number of planets. About half of them is not colonizable at the beginning.")
                )
        ui.Label(self.win, layout = (0, 13, 4, 1), text = _("Radius:"), align = ui.ALIGN_W,
                tooltipTitle = _("Radius"),
                tooltip = _("Galaxy radius, implies speed of game.")
                )
        ui.Label(self.win, layout = (4, 13, 4.5, 1), id = "vRadius", align = ui.ALIGN_E,
                tooltipTitle = _("Radius"),
                tooltip = _("Galaxy radius, implies speed of game.")
                )
        ui.Label(self.win, layout = (0, 14, 4, 1), text = _("Grouping:"), align = ui.ALIGN_W,
                tooltipTitle = _("Grouping"),
                tooltip = _("How many starting positions are grouped together in vicinity.")
                )
        ui.Label(self.win, layout = (4, 14, 4.5, 1), id = "vPlayerGroup", align = ui.ALIGN_E,
                tooltipTitle = _("Grouping"),
                tooltip = _("How many starting positions are grouped together.")
                )

        ui.Label(self.win, layout = (0, 15.2, 4, 1), text = _("Resources:"), align = ui.ALIGN_W)
        ui.Text (self.win, layout = (4, 15.2, 23, 1.6), id = "vResources", editable = 0)
        ui.Label(self.win, layout = (0, 17, 4, 1), text = _("Challenges:"), align = ui.ALIGN_W)
        ui.Label(self.win, layout = (4, 17, 24, 1), id = "vChallenges", align = ui.ALIGN_W)

        ui.Title(self.win, layout = (0, 18, 24, 1), id = 'vStatusBar', align = ui.ALIGN_W)
        ui.TitleButton(self.win, layout = (24, 18, 4, 1), text = _('Exit'), action = 'onCancel')
        self.win.statusBar = self.win.vStatusBar
コード例 #19
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 = _('Research'),
			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)
		ui.Title(self.win, layout = (0, 27, 35, 1), id = 'vStatusBar',
			align = ui.ALIGN_W)
		ui.TitleButton(self.win, layout = (35, 27, 5, 1), text = _('Close'),
			action = 'onCloseDlg')
		# TODO self.win.statusBar = self.win.vStatusBar
		# known techs
		ui.Title(self.win, layout = (0, 0, 20, 1), text = _('Known technologies'),
			align = ui.ALIGN_W, font = 'normal-bold')
		ui.Listbox(self.win, layout = (0, 1, 20, 25), id = 'vKTechs',
			columns = ((_('Name'), 'text', 10, ui.ALIGN_W), (_('Lvl'), 'tLevel', 1.5, 0),
			(_('Str'), 'tStruct', 1, 0), (_('Sh'), 'tShip', 1, 0),
			(_('ETC'), 'tETC', 0, ui.ALIGN_E)), columnLabels = 1, action = 'onSelectKTech')
		ui.Button(self.win, layout = (0, 26, 5, 1), text = _('Improve'),
			action = 'onStartImprovement')
		ui.Button(self.win, layout = (5, 26, 5, 1), id = "vSCompl", text = _('Show completed'),
			action = 'onToggleComleted', toggle = 1, pressed = 0)
		ui.Button(self.win, layout = (15, 26, 5, 1), text = _('Info'),
			action = 'onKTechInfo')
		# unknown techs
		ui.Title(self.win, layout = (20, 0, 20, 1), text = _('Researchable technologies'),
			align = ui.ALIGN_W, font = 'normal-bold')
		ui.Listbox(self.win, layout = (20, 1, 20, 12), id = 'vRTechs',
			columns = ((_('Name'), 'text', 10, ui.ALIGN_W), (_('Lvl'), 'tLevel', 1.5, 0),
			(_('Str'), 'tStruct', 1, 0), (_('Sh'), 'tShip', 1, 0),
			(_('ETC'), 'tETC', 0, ui.ALIGN_E)), columnLabels = 1, action = 'onSelectRTech')
		ui.Button(self.win, layout = (20, 13, 5, 1), text = _('Research'),
			action = 'onStartResearch')
		ui.Button(self.win, layout = (35, 13, 5, 1), text = _('Info'),
			action = 'onRTechInfo')
		# research queue
		ui.Title(self.win, layout = (20, 14, 20, 1), text = _('Research queue'),
			align = ui.ALIGN_W, id = 'vRQueueTitle', font = 'normal-bold')
		ui.Listbox(self.win, layout = (20, 15, 20, 11), id = 'vRQueue',
			columns = (
				(_('R'), 'tImpToMax', 1, ui.ALIGN_NONE),
				(_('Name'), 'text', 10, ui.ALIGN_W),
				(_('Lvl'), 'tLevel', 1.5, 0),
				(_('Progress'), 'tProgress', 3.5, ui.ALIGN_E),
				(_('ETC'), 'tETC', 0, ui.ALIGN_E)
			),
			columnLabels = 1, action = 'onSelectRQueueTech', sortable = False)
		ui.Button(self.win, layout = (20, 26, 2, 1), text =_("TOP"),
			id = 'vRQueueTop', action = 'onRTaskMove', data = -9999,
			tooltip = _("Move selected technology to the top of the queue."))
		ui.ArrowButton(self.win, layout = (22, 26, 1, 1), direction = ui.ALIGN_N,
			id = 'vRQueueUp', action = 'onRTaskMove', data = -1)
		ui.ArrowButton(self.win, layout = (23, 26, 1, 1), direction = ui.ALIGN_S,
			id = 'vRQueueDown', action = 'onRTaskMove', data = 1)
		ui.Button(self.win, layout = (24, 26, 4, 1), text = _('Repeat'),
			id = 'vRQueueRepat', action = 'onRTaskRepeat', toggle = 1,
			tooltip = _("Repeat research of this technology until the technology is fully improved."))
		ui.Button(self.win, layout = (28, 26, 3, 1), text = _('Abort'),
			id = 'vRQueueAbort', action = 'onRTaskAbort')
		ui.Button(self.win, layout = (31, 26, 4, 1), text = _('Info'),
			id = 'vRQueueInfo', action = 'onRQueueTechInfo')
		ui.Label(self.win, layout = (35, 26, 4, 1), id = "vRTotal", align = ui.ALIGN_E,
			tooltip = _("Total amount of time needed to research all technologies in the queue"))
コード例 #20
0
        for y in xrange(0, 10):
            ui.Button(win,
                      text='%d,%d' % (x, y),
                      layout=(x, y, 2, 1),
                      font='small',
                      statustip='%d,%d' % (x, y),
                      enabled=(x + y) % 2)

    ui.Listbox(
        win,
        items=[
            ui.Item('One'),
            ui.Item('Two'),
            ui.Item('Three'),
            ui.Item('Four'),
            ui.Item('Five'),
            ui.Item('Six'),
            ui.Item('Seven'),
            ui.Item('Eight')
        ],
        layout=(0, 13, 8, 7),
        multiselection=1,
    ).subscribeAction('*', echoHandler)

    ui.Listbox(
        win,
        items=[
            ui.Item('One', size=1),
            ui.Item('Two', size=2),
            ui.Item('Three', size=3),
            ui.Item('Four', size=4),
コード例 #21
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)
コード例 #22
0
ファイル: NewTaskDlg.py プロジェクト: WittsEnd2/Space-Scanner
 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')
コード例 #23
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')
コード例 #24
0
 def createUI(self):
     self.win = ui.Window(
         self.app,
         modal=1,
         escKeyClose=1,
         titleOnly=1,
         movable=0,
         title=_('Events'),
         rect=ui.Rect(0, 0, 800, 580),
         layoutManager=ui.SimpleGridLM(),
     )
     self.win.subscribeAction('*', self)
     # message box
     ui.Listbox(self.win,
                layout=(0, 0, 40, 26),
                id='vMessages',
                columns=((_('Time'), 'tTime', 3, ui.ALIGN_E),
                         (_('Source'), 'tSource', 8, ui.ALIGN_W),
                         (_('Location'), 'tLocation', 8, ui.ALIGN_W),
                         (_('Message'), 'tMessage', 0, ui.ALIGN_W)),
                columnLabels=1,
                action='onMessageSelect',
                multiselection=0,
                rmbAction="onPostMenu")
     ui.Button(self.win,
               layout=(0, 26, 5, 1),
               text=_('Delete'),
               id='vDelete',
               action='onDelete')
     ui.Button(self.win,
               layout=(5, 26, 5, 1),
               text=_('Delete All'),
               id='vDeleteAll',
               action='onDeleteAll')
     ui.Button(self.win,
               layout=(30, 26, 5, 1),
               text=_('Minor msgs'),
               id='vShowMIN',
               action='onShowInfo',
               toggle=1,
               pressed=1)
     ui.Button(self.win,
               layout=(35, 26, 5, 1),
               text=_('Info msgs'),
               id='vShowInfo',
               action='onShowInfo',
               toggle=1,
               pressed=1,
               foreground=(0xc0, 0xc0, 0xc0))
     # 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)
     # menu
     self.popup = ui.Menu(self.app,
                          title=_("Message actions"),
                          items=[
                              ui.Item(_("Show location"),
                                      action="onShowLoc"),
                              ui.Item(_("Show source"),
                                      action="onShowSource"),
                              ui.Item(_("Show location and delete msg"),
                                      action="onShowLocDel"),
                              ui.Item(_("Show source and delete msg"),
                                      action="onShowSourceDel"),
                              ui.Item(_("Delete"), action="onDelete"),
                          ])
     self.popup.subscribeAction("*", self)
コード例 #25
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=_('Fleets Overview'),
            rect=ui.Rect((w - 800 - 4 * (w != 800)) / 2,
                         (h - 600 - 4 * (h != 600)) / 2, 800 + 4 * (w != 800),
                         580 + 4 * (h != 600)),
            layoutManager=ui.SimpleGridLM(),
        )
        self.win.subscribeAction('*', self)
        # playets listbox
        ui.Listbox(self.win,
                   layout=(0, 0, 40, 26),
                   id='vFleets',
                   columns=[
                       (_('Fleet'), 'text', 5, ui.ALIGN_W),
                       (_('Location'), 'tLocation', 6.5, ui.ALIGN_W),
                       (_('Current order'), 'tOrder', 7, ui.ALIGN_W),
                       (_('ETA'), 'tETA', 3, ui.ALIGN_E),
                       (_('Fuel %'), 'tFuel', 3, ui.ALIGN_E),
                       (_('Op. time'), 'tOpTime', 3, ui.ALIGN_E),
                       (_('Range'), 'tRange', 3, ui.ALIGN_E),
                       (_('MP'), 'tMP', 3, ui.ALIGN_E),
                       (_('Sign'), 'tSignature', 2, ui.ALIGN_E),
                       (_("Last upgr."), "tLastUpgrade", 3.5, ui.ALIGN_E),
                   ],
                   columnLabels=1,
                   action='onSelectFleet',
                   rmbAction="onShowLocation")

        ui.Check(self.win,
                 layout=(0, 26, 5, 1),
                 text=_('Mine'),
                 id="vMine",
                 checked=1,
                 action="onToggleCondition")
        ui.Check(self.win,
                 layout=(5, 26, 5, 1),
                 text=_('Enemy'),
                 id="vEnemy",
                 checked=0,
                 action="onToggleCondition")
        ui.Check(self.win,
                 layout=(10, 26, 5, 1),
                 text=_('Unfriendly'),
                 id="vUnfriendy",
                 checked=0,
                 action="onToggleCondition")
        ui.Check(self.win,
                 layout=(15, 26, 5, 1),
                 text=_('Neutral'),
                 id="vNeutral",
                 checked=0,
                 action="onToggleCondition")
        ui.Check(self.win,
                 layout=(20, 26, 5, 1),
                 text=_('Friendly'),
                 id="vFriendly",
                 checked=0,
                 action="onToggleCondition")
        ui.Check(self.win,
                 layout=(25, 26, 5, 1),
                 text=_('Allied'),
                 id="vAllied",
                 checked=0,
                 action="onToggleCondition")
        ui.Check(self.win,
                 layout=(34, 26, 6, 1),
                 text=_('Show redirects'),
                 id="vRedirects",
                 checked=0,
                 action="onToggleCondition")
        # status bar + submit/cancel
        ui.TitleButton(self.win,
                       layout=(35, 27, 5, 1),
                       text=_('Close'),
                       action='onClose')
        ui.Title(self.win,
                 id='vStatusBar',
                 layout=(0, 27, 35, 1),
                 align=ui.ALIGN_W)
コード例 #26
0
    def createUI(self):
        w, h = gdata.scrnSize
        self.win = ui.Window(
            self.app,
            modal=1,
            escKeyClose=1,
            movable=0,
            title=_('Select component'),
            rect=ui.Rect((w - 764) / 2, (h - 463) / 2, 764, 463),
            layoutManager=ui.SimpleGridLM(),
        )
        self.win.subscribeAction('*', self)
        # component list
        ui.Listbox(self.win,
                   layout=(0, 0, 38, 20),
                   id="vList",
                   columns=(
                       (_('Name'), 'text', 9, ui.ALIGN_W),
                       (_('Type'), 'tType', 4, ui.ALIGN_W),
                       (_('Data'), 'tData', 0, ui.ALIGN_W),
                   ),
                   columnLabels=1)

        ui.Check(self.win,
                 layout=(0, 20, 5, 1),
                 text=typeText[ENGINE],
                 id='vEngine',
                 checked=1,
                 action='onFilter',
                 data=ENGINE)
        ui.Check(self.win,
                 layout=(5, 20, 5, 1),
                 text=typeText[SMALL],
                 id='vSmall',
                 checked=1,
                 action='onFilter',
                 data=SMALL)
        ui.Check(self.win,
                 layout=(10, 20, 5, 1),
                 text=typeText[MEDIUM],
                 id='vMedium',
                 checked=1,
                 action='onFilter',
                 data=MEDIUM)
        ui.Check(self.win,
                 layout=(15, 20, 5, 1),
                 text=typeText[LARGE],
                 id='vLarge',
                 checked=1,
                 action='onFilter',
                 data=LARGE)
        ui.Check(self.win,
                 layout=(20, 20, 5, 1),
                 text=typeText[PLANET],
                 id='vPlanet',
                 checked=1,
                 action='onFilter',
                 data=PLANET)
        ui.Check(self.win,
                 layout=(25, 20, 5, 1),
                 text=typeText[OTHER],
                 id='vOther',
                 checked=1,
                 action='onFilter',
                 data=OTHER)

        # status bar + submit/cancel
        ui.TitleButton(self.win,
                       layout=(33, 21, 5, 1),
                       text=_('Select'),
                       action='onSelect')
        ui.TitleButton(self.win,
                       layout=(28, 21, 5, 1),
                       text=_('Cancel'),
                       action='onCancel')
        ui.Title(self.win,
                 id='vStatusBar',
                 layout=(0, 21, 28, 1),
                 align=ui.ALIGN_W)
コード例 #27
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=_('Diplomacy'),
                          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.Listbox(
         self.win,
         layout=(0, 0, 40, 14),
         id='vContacts',
         columns=((_('Name'), 'text', 8,
                   ui.ALIGN_W), (_('Relation'), 'tRelation', 4, ui.ALIGN_E),
                  (_('Population'), 'tPopulation', 4,
                   ui.ALIGN_E), (_('Planets'), 'tPlanets', 4, ui.ALIGN_E),
                  (_('Structures'), 'tStructures', 4, ui.ALIGN_E),
                  (_('Production'), 'tProduction', 4,
                   ui.ALIGN_E), (_('Research'), 'tScience', 4, ui.ALIGN_E),
                  (_('Military pwr'), 'tFleetPwr', 4,
                   ui.ALIGN_E), (_("Contact"), "tContact", 4, ui.ALIGN_E)),
         columnLabels=1,
         action="onContactSelected",
         rmbAction="onHighlightMenu")
     # Voting
     ui.Button(self.win,
               layout=(0, 14, 5, 1),
               text=_("Elect"),
               id="vVoteFor",
               action="onVoteFor")
     ui.Button(self.win,
               layout=(5, 14, 5, 1),
               text=_("Abstain"),
               id="vAbstain",
               action="onAbstain")
     # Highlights
     ui.Button(self.win,
               layout=(24, 14, 8, 1),
               text=_("Highlights On"),
               id="vHighlight",
               action="onHighlight")
     ui.Button(self.win,
               layout=(32, 14, 8, 1),
               text=_("Highligh Off"),
               id="vUHighlight",
               action="onUHighlight")
     # pacts
     ui.Title(self.win,
              layout=(0, 15, 20, 1),
              text=_('Pacts'),
              font='normal-bold',
              align=ui.ALIGN_W)
     ui.Listbox(self.win,
                layout=(0, 16, 20, 10),
                id='vPacts',
                columns=((_('I'), 'tState1', 3, ui.ALIGN_W),
                         (_('Partner'), 'tState2', 3,
                          ui.ALIGN_W), (_('Pact'), 'text', 13, ui.ALIGN_W)),
                columnLabels=1,
                action="onPactSelected")
     ui.Button(self.win,
               layout=(0, 26, 20, 1),
               text=_("On"),
               id="vChangePactState",
               action="onPactChange",
               enabled=0)
     # conditions
     ui.Title(self.win,
              layout=(20, 15, 20, 1),
              text=_('Conditions'),
              id="vCondTitle",
              font='normal-bold',
              align=ui.ALIGN_W)
     ui.Listbox(self.win,
                layout=(20, 16, 20, 10),
                id='vConditions',
                columns=((_('I'), 'tState1', 3, ui.ALIGN_W),
                         (_('Partner'), 'tState2', 3,
                          ui.ALIGN_W), (_('Pact'), 'text', 13, ui.ALIGN_W)),
                columnLabels=1,
                multiselection=1)
     ui.Button(self.win,
               layout=(20, 26, 15, 1),
               text=_("Change"),
               id="vPactConditions",
               action="onPactChange",
               enabled=0,
               data="CONDS")
     ui.Button(self.win,
               layout=(35, 26, 5, 1),
               text=_("Reset"),
               id="vPactCondReset",
               action="onPactChange",
               enabled=0,
               data="CONDSRESET")
     # 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)
     # highlight menu
     self.eventPopup = ui.Menu(self.app,
                               title=_("Highligh actions"),
                               items=[
                                   ui.Item(_("Define color"),
                                           action="onColorDefinition"),
                                   ui.Item(_("Disable highlight"),
                                           action="onDeleteHighlight")
                               ])
     self.eventPopup.subscribeAction("*", self)
コード例 #28
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')