Beispiel #1
0
    def createUI(self):
        screenWidth, screenHeight = gdata.scrnSize
        # size of dialog in layout metrics (for SimpleGridLM)
        cols = 25
        rows = 20
        # dialog width and height in pixels
        width = cols * 20 + 5
        height = rows * 20 + 4
        #creating dialog window
        self.win = ui.Window(self.app,
            modal = 1,
            escKeyClose = 1,
            movable = 0,
            title = _("Galaxy finish"),
            rect = ui.Rect((screenWidth - width) / 2, (screenHeight - height) / 2, width, height),
            layoutManager = ui.SimpleGridLM(),
        )
        self.win.subscribeAction('*', self)
        # first row is window title
        rows -= 1

        ui.Label(self.win, layout = (0, 0, cols, 1), text = _("If you are sure to finish this galaxy, click on Finish button."), align = ui.ALIGN_W)
        ui.Label(self.win, layout = (0, 1, cols, 1), text = _("You can enter message visible in finish announcement below."), align = ui.ALIGN_W)

        s = ui.Scrollbar(self.win, layout = (cols - 1, 2, 1, rows - 3))
        t = ui.Text(self.win, layout = (0, 2, cols - 1, rows - 3), id = 'vMsg')
        t.attachVScrollbar(s)

        # dialog bottom line
        ui.Title(self.win, layout = (0, rows - 1, cols - 10, 1))
        ui.TitleButton(self.win, layout = (cols - 10, rows - 1, 5, 1), text = _("Finish"), action = 'onFinish')
        ui.TitleButton(self.win, layout = (cols - 5, rows - 1, 5, 1), text = _("Cancel"), action = 'onClose')
    def createUI(self):
        w, h = gdata.scrnSize
        self.win = ui.Window(
            self.app,
            modal=1,
            escKeyClose=1,
            movable=0,
            title=_('Change quantity'),
            rect=ui.Rect((w - 264) / 2, (h - 104) / 2, 264, 104),
            layoutManager=ui.SimpleGridLM(),
        )
        # creating dialog window
        self.win.subscribeAction('*', self)

        ui.Label(self.win,
                 text=_("New quantity:"),
                 align=ui.ALIGN_E,
                 layout=(0, 1, 6, 1))
        ui.Entry(
            self.win,
            id='vQuantity',
            align=ui.ALIGN_W,
            layout=(6, 1, 3, 1),
            #text = self.quantity,
        )
        ui.Title(self.win, layout=(0, 3, 3, 1))
        ui.TitleButton(self.win,
                       layout=(3, 3, 5, 1),
                       text=_("Cancel"),
                       action="onCancel")
        okBtn = ui.TitleButton(self.win,
                               layout=(8, 3, 5, 1),
                               text=_("OK"),
                               action='onOK')
        self.win.acceptButton = okBtn
Beispiel #3
0
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(
         self.app,
         modal=1,
         movable=0,
         title=_('Question'),
         rect=ui.Rect((w - 424) / 2, (h - 124) / 2, 424, 124),
         layoutManager=ui.SimpleGridLM(),
     )
     self.win.subscribeAction('*', self)
     ui.Text(self.win,
             layout=(5, 0, 16, 4),
             id='vText',
             background=self.win.app.theme.themeBackground,
             editable=0)
     ui.Label(self.win,
              layout=(0, 0, 5, 4),
              icons=((res.loginLogoImg, ui.ALIGN_W), ))
     ui.Title(self.win,
              layout=(0, 4, 13, 1),
              id='vStatusBar',
              align=ui.ALIGN_W)
     ui.TitleButton(self.win,
                    layout=(13, 4, 4, 1),
                    id='vCancel',
                    action='onCancel')
     ui.TitleButton(self.win,
                    layout=(17, 4, 4, 1),
                    id='vConfirm',
                    action='onConfirm')
 def createUI(self):
     w, h = gdata.scrnSize
     cols = 15
     rows = 8
     width = cols * 20 + 5
     height = rows * 20 + 4
     self.win = ui.Window(self.app,
         modal = 1,
         escKeyClose = 1,
         movable = 0,
         title = _('Rename Fleet'),
         rect = ui.Rect((w - width) / 2, (h - height) / 2, width, height),
         layoutManager = ui.SimpleGridLM(),
     )
     self.win.subscribeAction('*', self)
     # rename
     ui.Label(self.win, layout = (0, 0, 5, 1), text = _('Name'), align = ui.ALIGN_W)
     ui.Entry(self.win, layout = (5, 0, 10, 1), id = 'vName', align = ui.ALIGN_E)
     ui.Check(self.win, layout = (0, 1, 15, 1), id = "vRetain", text = _("Retain name during fleet joins"),
         action = "onSelect", data = 2)
     ui.Check(self.win, layout = (0, 2, 15, 1), id = "vPrevent", text = _("Prevent all fleet joins"),
         action = "onSelect", data = 0)
     ui.Label(self.win, layout = (0, 4, 15, 1), text = _(' Note: Retaining name will prevent two'), align = ui.ALIGN_W)
     ui.Label(self.win, layout = (0, 5, 15, 1), text = _(' retain name fleets from joining.'), align = ui.ALIGN_W)
     # status bar + submit/cancel
     ui.TitleButton(self.win, layout = (10, 6, 5, 1), text = _('Rename'), action = 'onRename')
     ui.TitleButton(self.win, layout = (5, 6, 5, 1), text = _('Delete Name'), action = 'onDelete')
     ui.TitleButton(self.win, layout = (0, 6, 5, 1), text = _('Cancel'), action = 'onCancel')
Beispiel #5
0
    def createUI(self):
        w, h = gdata.scrnSize
        cols = 22
        rows = 13
        width = cols * 20 + 4
        height = rows * 20 + 24
        self.win = ui.Window(
            self.app,
            modal=1,
            escKeyClose=1,
            movable=0,
            title=_("Key Command Help"),
            rect=ui.Rect((w - width) / 2, (h - height) / 2, width, height),
            layoutManager=ui.SimpleGridLM(),
        )
        # creating dialog window
        self.win.subscribeAction('*', self)

        t = ui.Text(self.win,
                    id='vText',
                    align=ui.ALIGN_W,
                    layout=(0, 0, cols - 1, rows - 2),
                    editable=0)
        s = ui.Scrollbar(self.win, layout=(cols - 1, 0, 1, rows - 2))
        t.attachVScrollbar(s)

        ui.Title(self.win, layout=(0, rows - 1, cols - 16, 1))
        ui.TitleButton(self.win,
                       layout=(cols - 4, rows - 1, 4, 1),
                       text=_("OK"),
                       action="onCancel")
        ui.TitleButton(self.win,
                       layout=(cols - 16, rows - 1, 12, 1),
                       text=_("Do not show help/tooltip again"),
                       action="onOK")
Beispiel #6
0
    def createUI(self):
        screenWidth, screenHeight = gdata.scrnSize
        # size of dialog in layout metrics (for SimpleGridLM)
        cols = 20
        rows = 6
        # dialog width and height in pixels
        width = cols * 20 + 5
        height = rows * 20 + 4
        #creating dialog window
        self.win = ui.Window(
            self.app,
            modal=1,
            escKeyClose=1,
            movable=0,
            title=_("Search for system"),
            rect=ui.Rect(10, 25, width, height),
            layoutManager=ui.SimpleGridLM(),
        )
        self.win.subscribeAction('*', self)
        # first row is window title
        rows -= 1

        ui.Label(
            self.win,
            layout=(0, 0, cols, 1),
            text=
            _("Use wildcard search as with files (*ese* finds Presere and Shesed)"
              ),
            align=ui.ALIGN_W)
        ui.Label(
            self.win,
            layout=(0, 1, cols - 1, 1),
            text=_("* matches everything, ? matches any single character"),
            align=ui.ALIGN_W)
        ui.Label(self.win,
                 layout=(0, 2, 6, 1),
                 text=_("System name:"),
                 align=ui.ALIGN_W)
        ui.Entry(self.win,
                 layout=(6, 2, cols - 7, 1),
                 id="vSystemName",
                 align=ui.ALIGN_W)

        # dialog bottom line
        ui.Title(self.win, layout=(0, rows - 1, cols - 15, 1))
        srchBtn = ui.TitleButton(self.win,
                                 layout=(cols - 15, rows - 1, 5, 1),
                                 text=_("Find"),
                                 action='onSearch',
                                 data=1)
        ui.TitleButton(self.win,
                       layout=(cols - 10, rows - 1, 5, 1),
                       text=_("Next"),
                       action='onNext')
        ui.TitleButton(self.win,
                       layout=(cols - 5, rows - 1, 5, 1),
                       text=_("Cancel"),
                       action='onClose')
        self.win.acceptButton = srchBtn
    def createUI(self):
        w, h = gdata.scrnSize
        cols = 22
        rows = 13
        width = cols * 20 + 4
        height = rows * 20 + 24
        self.win = ui.Window(
            self.app,
            modal=1,
            escKeyClose=1,
            movable=0,
            title=_("Edit buoy"),
            rect=ui.Rect((w - width) / 2, (h - height) / 2, width, height),
            layoutManager=ui.SimpleGridLM(),
        )
        # creating dialog window
        self.win.subscribeAction('*', self)

        ui.Label(self.win,
                 text=_("Buoy text:"),
                 align=ui.ALIGN_W,
                 layout=(0, 0, 4, 1))
        ui.Label(self.win,
                 text=_("Visible to:"),
                 align=ui.ALIGN_W,
                 layout=(6, 0, 4, 1))
        ui.Check(self.win,
                 text=_("Allies"),
                 align=ui.ALIGN_W,
                 layout=(10.5, 0, 4, 1),
                 id='vAllied',
                 action="turnOff",
                 data="vAllied")
        ui.Check(self.win,
                 text=_("Scanner Share"),
                 align=ui.ALIGN_W,
                 layout=(15, 0, 6, 1),
                 id='vScanner',
                 action="turnOff",
                 data="vScanner")
        s = ui.Scrollbar(self.win, layout=(cols - 1, 1, 1, rows - 3))
        t = ui.Text(
            self.win,
            id='vText',
            align=ui.ALIGN_W,
            layout=(0, 1, cols - 1, rows - 2),
        )
        t.attachVScrollbar(s)

        ui.Title(self.win, layout=(0, rows - 1, cols - 10, 1))
        ui.TitleButton(self.win,
                       layout=(cols - 10, rows - 1, 5, 1),
                       text=_("Cancel"),
                       action="onCancel")
        okBtn = ui.TitleButton(self.win,
                               layout=(cols - 5, rows - 1, 5, 1),
                               text=_("OK"),
                               action='onOK')
        self.win.acceptButton = okBtn
Beispiel #8
0
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(self.app,
         modal = 1,
         movable = 0,
         title = _('Outer Space Login'),
         rect = ui.Rect((w - 424) / 2, (h - 164) / 2, 424, 164),
         layoutManager = ui.SimpleGridLM(),
         tabChange = True,
     )
     self.win.subscribeAction('*', self)
     ui.Label(self.win,
         text = _('Universe'),
         align = ui.ALIGN_E,
         layout = (5, 0, 6, 1)
     )
     ui.Button(self.win, id = 'vUniverse',
         align = ui.ALIGN_W,
         layout = (11, 0, 10, 1),
         action = "onUniverse",
     )
     ui.Label(self.win,
         text = _('Login'),
         align = ui.ALIGN_E,
         layout = (5, 1, 6, 1)
     )
     ui.Entry(self.win, id = 'vLogin',
         align = ui.ALIGN_W,
         layout = (11, 1, 10, 1),
         orderNo = 1
     )
     ui.Label(self.win,
         text = _('Password'),
         align = ui.ALIGN_E,
         layout = (5, 2, 6, 1),
     )
     ui.Entry(self.win, id = 'vPassword',
         align = ui.ALIGN_W,
         showChar = '*',
         layout = (11, 2, 10, 1),
         orderNo = 2
     )
     ui.Check(self.win, layout = (16.5,3,5,1), text = _('Auto-login'), id = 'vAutoLogin',
         checked = 0, action = "onAutoLogin")
     ui.Check(self.win, layout = (11.25,3,5,1), text = _('Remember'), id = 'vSavePassword',
         checked = 0, action = "onSavePassword")
     ui.Button(self.win, layout = (11, 4, 10, 1), text = _("Options"), action = "onOptions", id = "vOptions")
     ui.Button(self.win, layout = (11, 5, 10, 1), text = _("New account"),
         action = "onCreateAccount", id = "vCreate")
     ui.Title(self.win, layout = (0, 6, 11, 1), id = 'vMessage', align = ui.ALIGN_W)
     ui.TitleButton(self.win, layout = (11, 6, 5, 1), text = _('Exit'), action = 'onCancel')
     loginBtn = ui.TitleButton(self.win, layout = (16, 6, 5, 1), text = _('Login'), action = 'onLogin')
     ui.Label(self.win, layout = (0, 0, 5, 4), icons = ((res.loginLogoImg, ui.ALIGN_W),))
     self.win.acceptButton = loginBtn
     # Universe selection
     self.universeMenu = ui.Menu(self.app, title = _("Universes"),
         width = 10,
     )
     self.universeMenu.subscribeAction("*", self)
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(self.app,
                          modal=1,
                          movable=0,
                          title=_('Change password'),
                          rect=ui.Rect((w - 324) / 2, (h - 104) / 2, 324,
                                       104),
                          layoutManager=ui.SimpleGridLM(),
                          tabChange=True)
     self.win.subscribeAction('*', self)
     ui.Label(self.win,
              text=_('Old password'),
              align=ui.ALIGN_E,
              layout=(0, 0, 6, 1))
     ui.Entry(self.win,
              id='vOld',
              align=ui.ALIGN_W,
              showChar='*',
              layout=(6, 0, 10, 1),
              orderNo=1)
     ui.Label(
         self.win,
         text=_('New password'),
         align=ui.ALIGN_E,
         layout=(0, 1, 6, 1),
     )
     ui.Entry(self.win,
              id='vNew',
              align=ui.ALIGN_W,
              showChar='*',
              layout=(6, 1, 10, 1),
              orderNo=2)
     ui.Label(
         self.win,
         align=ui.ALIGN_E,
         text=_('Confirm'),
         layout=(0, 2, 6, 1),
     )
     ui.Entry(self.win,
              id='vConfirm',
              align=ui.ALIGN_W,
              layout=(6, 2, 10, 1),
              showChar="*",
              orderNo=3)
     ui.Title(self.win,
              layout=(0, 3, 8, 1),
              id='vMessage',
              align=ui.ALIGN_W)
     ui.TitleButton(self.win,
                    layout=(8, 3, 4, 1),
                    text=_('Cancel'),
                    action='onCancel')
     ui.TitleButton(self.win,
                    layout=(12, 3, 4, 1),
                    text=_('Apply'),
                    action='onChange')
Beispiel #10
0
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(self.app,
         modal = 1,
         escKeyClose = 1,
         titleOnly = w == 800 and h == 600,
         movable = 0,
         title = _("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)
Beispiel #11
0
    def createUI(self):
        screenWidth, screenHeight = gdata.scrnSize
        # size of dialog in layout metrics (for SimpleGridLM)
        cols = 23
        rows = 27
        # dialog width and height in pixels
        width = cols * 20 + 5
        height = rows * 20 + 4
        #creating dialog window
        self.win = ui.Window(
            self.app,
            modal=1,
            escKeyClose=1,
            movable=0,
            title=_("Empire Overview"),
            rect=ui.Rect((screenWidth - width) / 2,
                         (screenHeight - height) / 2, width, height),
            layoutManager=ui.SimpleGridLM(),
        )
        self.win.subscribeAction('*', self)
        # first row is window title
        rows -= 1

        s = ui.Scrollbar(self.win, layout=(cols - 1, 0, 1, rows - 1))
        t = ui.Text(self.win,
                    layout=(0, 0, cols - 1, rows - 1),
                    id="vText",
                    editable=0)
        self._textRows = rows - 1
        t.attachVScrollbar(s)

        # dialog bottom line
        ui.Title(self.win, layout=(0, rows - 1, cols - 10, 1))
        ui.TitleButton(self.win,
                       layout=(cols - 10, rows - 1, 5, 1),
                       text=_("Analysis"),
                       action="onMenu")
        ui.TitleButton(self.win,
                       layout=(cols - 5, rows - 1, 5, 1),
                       text=_("Close"),
                       action="onClose")

        # analysis menu
        self.analysisMenu = ui.Menu(self.app,
                                    title=_("Field of analysis"),
                                    width=5,
                                    items=[
                                        ui.Item(_("Planets"),
                                                action="onPlanetsAnalysis"),
                                        ui.Item(_("Fleets"),
                                                action="onFleetsAnalysis"),
                                    ])
        self.analysisMenu.subscribeAction("*", self)
Beispiel #12
0
 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
Beispiel #13
0
    def createUI(self):
        w, h = gdata.scrnSize
        cols = 20
        rows = 13
        width = cols * 20 + 4
        height = rows * 20 + 24
        self.win = ui.Window(
            self.app,
            modal=1,
            escKeyClose=1,
            movable=0,
            title=_("Show buoy text"),
            rect=ui.Rect((w - width) / 2, (h - height) / 2, width, height),
            layoutManager=ui.SimpleGridLM(),
        )
        # creating dialog window
        self.win.subscribeAction('*', self)

        s = ui.Scrollbar(self.win, layout=(cols - 1, 0, 1, rows - 1))
        t = ui.Text(self.win,
                    id='vText',
                    align=ui.ALIGN_W,
                    layout=(0, 0, cols - 1, rows - 1),
                    editable=0)
        t.attachVScrollbar(s)

        ui.Title(self.win, layout=(0, rows - 1, cols - 5, 1))
        okBtn = ui.TitleButton(self.win,
                               layout=(cols - 5, rows - 1, 5, 1),
                               text=_("OK"),
                               action='onOK')
    def createUI(self):
        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)
Beispiel #15
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)
 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=_('Mass Redirect Fleets to This System'),
         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)
     StarMapWidget(self.win,
                   layout=(0, 0, 40, 27),
                   id='vStarMap',
                   action='onSelectMapObj')
     # status bar + submit/cancel
     ui.TitleButton(self.win,
                    layout=(35, 27, 5, 1),
                    text=_('Done'),
                    action='onFinish')
     ui.Title(self.win,
              id='vStatusBar',
              layout=(0, 27, 35, 1),
              align=ui.ALIGN_W)
 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
Beispiel #18
0
	def createUI(self):
		self.win = ui.Window(self.app,
			modal = 1,
			escKeyClose = 1,
			titleOnly = 1,
			movable = 0,
			title = _('Split Fleet'),
			rect = ui.Rect(0, 0, 800, 580),
			layoutManager = ui.SimpleGridLM(),
		)
		self.win.subscribeAction('*', self)
		# original fleet
		# status bar + submit/cancel
		ui.TitleButton(self.win, layout = (35, 27, 5, 1), text = _('Close'), action = 'onClose')
		ui.TitleButton(self.win, layout = (30, 27, 5, 1), text = _('Cancel'), action = 'onCancel')
		ui.Title(self.win, id = 'vStatusBar', layout = (0, 27, 30, 1), align = ui.ALIGN_W)
		self.win.statusBar = self.win.vStatusBar
Beispiel #19
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)
Beispiel #20
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')
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(self.app,
                          modal=1,
                          movable=0,
                          title=_('Select starting position'),
                          rect=ui.Rect((w - 424) / 2, (h - 264) / 2, 424,
                                       264),
                          layoutManager=ui.SimpleGridLM(),
                          tabChange=True)
     ui.Listbox(self.win,
                layout=(0, 0, 21, 10),
                id='vPos',
                columns=((_('Galaxy'), 'text', 5, ui.ALIGN_W),
                         (_('Position'), 'tPos', 0, ui.ALIGN_W)),
                columnLabels=1)
     self.win.subscribeAction('*', self)
     ui.Label(self.win, layout=(0, 10, 5, 1), text=_("VIP Password:"))
     ui.Entry(self.win,
              layout=(5, 10, 5, 1),
              id='vPassword',
              align=ui.ALIGN_W,
              showChar='*',
              orderNo=1)
     ui.Title(self.win,
              layout=(0, 11, 13, 1),
              id='vStatusBar',
              align=ui.ALIGN_W)
     ui.TitleButton(self.win,
                    layout=(13, 11, 4, 1),
                    text=_('Exit'),
                    action='onCancel')
     ui.TitleButton(self.win,
                    layout=(17, 11, 4, 1),
                    text=_('Select'),
                    action='onSelect')
     self.win.statusBar = self.win.vStatusBar
 def createUI(self):
     w, h = gdata.scrnSize
     self.win = ui.Window(self.app,
                          modal=1,
                          escKeyClose=1,
                          titleOnly=w == 800 and h == 600,
                          movable=0,
                          title=_('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)
    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")
Beispiel #24
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)
Beispiel #25
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)
Beispiel #26
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)
Beispiel #27
0
    def createUI(self):
        w, h = gdata.scrnSize
        self.win = ui.Window(
            self.app,
            modal=1,
            escKeyClose=1,
            movable=0,
            #            title = _('Redirect Fleets'),
            rect=ui.Rect(300 + (w - 800 - 4 * (w != 800)) / 2,
                         180 + (h - 600 - 4 * (h != 600)) / 2,
                         400 + 4 * (w != 800), 400 + 4 * (h != 600)),
            layoutManager=ui.SimpleGridLM(),
        )
        self.win.subscribeAction('*', self)
        StarMapWidget(self.win, layout=(0, 0, 20, 19), id='vStarMap')

        ui.TitleButton(self.win,
                       layout=(15, 19, 5, 1),
                       text=_('Cancel'),
                       action='onCancel')
        ui.Title(self.win,
                 id='vStatusBar',
                 layout=(0, 19, 15, 1),
                 align=ui.ALIGN_W)
Beispiel #28
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)
Beispiel #29
0
    def createUI(self):
        w, h = gdata.scrnSize
        cols = 32
        rows = 20
        dlgWidth = cols * 20 + 4
        dlgHeight = rows * 20 + 4
        self.win = ui.Window(self.app,
                             modal=1,
                             escKeyClose=1,
                             movable=0,
                             title=_('Select structure to construct'),
                             rect=ui.Rect((w - dlgWidth) / 2,
                                          (h - dlgHeight) / 2, dlgWidth,
                                          dlgHeight),
                             layoutManager=ui.SimpleGridLM())
        self.win.subscribeAction('*', self)
        rows -= 1  # title

        ui.Title(self.win,
                 layout=(0, 0, cols, 1),
                 text=_('Production planet'),
                 align=ui.ALIGN_W,
                 font='normal-bold')
        ui.ButtonArray(self.win,
                       layout=(0, 1, cols, 3),
                       id='vPlanets',
                       buttonSize=(8, 1),
                       showSlider=0,
                       action='onSelectPlanet')

        ui.Title(self.win,
                 layout=(0, 4, cols - 10, 1),
                 text=_('Structures to construct'),
                 align=ui.ALIGN_W,
                 font='normal-bold')
        ui.Title(self.win,
                 layout=(cols - 10, 4, 10, 1),
                 text=_('(right click for technology info)'),
                 align=ui.ALIGN_E,
                 font='normal')
        ui.ButtonArray(self.win,
                       layout=(0, 5, cols, 9),
                       id='vTechs',
                       buttonSize=(2, 3),
                       showSlider=0,
                       action='onConstruct',
                       rmbAction='onInfo')

        ui.Title(self.win,
                 layout=(0, 14, 18, 1),
                 text=_('Filters'),
                 align=ui.ALIGN_W,
                 font='normal-bold')
        ui.Label(self.win,
                 layout=(0, 15, 6, 1),
                 text=_('Technology levels:'),
                 align=ui.ALIGN_W)
        ui.Button(self.win,
                  layout=(6, 15, 1, 1),
                  text=_('1'),
                  id='vLevel1',
                  toggle=1,
                  action='onToggleLevel',
                  data=1)
        ui.Button(self.win,
                  layout=(7, 15, 1, 1),
                  text=_('2'),
                  id='vLevel2',
                  toggle=1,
                  action='onToggleLevel',
                  data=2)
        ui.Button(self.win,
                  layout=(8, 15, 1, 1),
                  text=_('3'),
                  id='vLevel3',
                  toggle=1,
                  action='onToggleLevel',
                  data=3)
        ui.Button(self.win,
                  layout=(9, 15, 1, 1),
                  text=_('4'),
                  id='vLevel4',
                  toggle=1,
                  action='onToggleLevel',
                  data=4)
        ui.Button(self.win,
                  layout=(10, 15, 1, 1),
                  text=_('5'),
                  id='vLevel5',
                  toggle=1,
                  action='onToggleLevel',
                  data=5)
        ui.Button(self.win,
                  layout=(11, 15, 1, 1),
                  text=_('6'),
                  id='vLevel6',
                  toggle=1,
                  action='onToggleLevel',
                  data=6)
        ui.Button(self.win,
                  layout=(12, 15, 1, 1),
                  text=_('7'),
                  id='vLevel7',
                  toggle=1,
                  action='onToggleLevel',
                  data=7)
        ui.Button(self.win,
                  layout=(13, 15, 1, 1),
                  text=_('8'),
                  id='vLevel8',
                  toggle=1,
                  action='onToggleLevel',
                  data=8)
        ui.Button(self.win,
                  layout=(14, 15, 1, 1),
                  text=_('9'),
                  id='vLevel9',
                  toggle=1,
                  action='onToggleLevel',
                  data=9)

        ui.Check(self.win,
                 layout=(0, 16, 6, 1),
                 text=_('Bio production'),
                 id='vBioProduction',
                 checked=1,
                 align=ui.ALIGN_W,
                 action='onFilter')
        ui.Check(self.win,
                 layout=(0, 17, 6, 1),
                 text=_('En production'),
                 id='vEnProduction',
                 checked=1,
                 align=ui.ALIGN_W,
                 action='onFilter')
        ui.Check(self.win,
                 layout=(6, 16, 6, 1),
                 text=_('CP production'),
                 id='vCPProduction',
                 checked=1,
                 align=ui.ALIGN_W,
                 action='onFilter')
        ui.Check(self.win,
                 layout=(6, 17, 6, 1),
                 text=_('RP production'),
                 id='vRPProduction',
                 checked=1,
                 align=ui.ALIGN_W,
                 action='onFilter')
        ui.Check(self.win,
                 layout=(12, 16, 6, 1),
                 text=_('Military'),
                 id='vMilitary',
                 checked=1,
                 align=ui.ALIGN_W,
                 action='onFilter')
        ui.Check(self.win,
                 layout=(12, 17, 6, 1),
                 text=_('Morale'),
                 id='vMorale',
                 checked=1,
                 align=ui.ALIGN_W,
                 action='onFilter')

        ui.Title(self.win,
                 layout=(18, 14, 6, 1),
                 text=_('Sort'),
                 align=ui.ALIGN_W,
                 font='normal-bold')
        ui.Check(self.win,
                 layout=(18, 15, 6, 1),
                 text=_('Type'),
                 id='vSortType',
                 checked=1,
                 align=ui.ALIGN_W,
                 action='onSort',
                 data='type')
        ui.Check(self.win,
                 layout=(18, 16, 6, 1),
                 text=_('Tech Level'),
                 id='vSortTL',
                 checked=0,
                 align=ui.ALIGN_W,
                 action='onSort',
                 data='tl')
        ui.Check(self.win,
                 layout=(18, 17, 6, 1),
                 text=_('Name'),
                 id='vSortNone',
                 checked=0,
                 align=ui.ALIGN_W,
                 action='onSort',
                 data='none')

        ui.Title(self.win,
                 layout=(24, 14, 8, 1),
                 text=_('Options'),
                 align=ui.ALIGN_W,
                 font='normal-bold')
        ui.Label(self.win,
                 layout=(24, 15, 3, 1),
                 text=_('Quantity'),
                 align=ui.ALIGN_W)
        ui.Entry(self.win,
                 layout=(27, 15, 5, 1),
                 id='vQuantity',
                 align=ui.ALIGN_E)
        ui.Check(self.win,
                 layout=(26, 16, 8, 1),
                 id='vReportFin',
                 text=_('Report finalization'),
                 align=ui.ALIGN_W)

        ui.Title(self.win, layout=(0, rows - 1, cols - 5, 1), align=ui.ALIGN_W)
        ui.TitleButton(self.win,
                       layout=(cols - 5, rows - 1, 5, 1),
                       text=_('Cancel'),
                       action='onCancel')
Beispiel #30
0
 def createUI(self):
     w, h = gdata.scrnSize
     cols = 38
     rows = 24  #was 23
     dlgWidth = cols * 20 + 4
     dlgHeight = rows * 20 + 4
     self.win = ui.Window(self.app,
                          modal=1,
                          escKeyClose=1,
                          movable=0,
                          title=_('Select new task'),
                          rect=ui.Rect((w - dlgWidth) / 2,
                                       (h - dlgHeight) / 2, dlgWidth,
                                       dlgHeight),
                          layoutManager=ui.SimpleGridLM(),
                          tabChange=True)
     self.win.subscribeAction('*', self)
     ui.Title(self.win,
              layout=(0, 0, 22, 1),
              text=_('Technology'),
              align=ui.ALIGN_W,
              font='normal-bold')
     ui.Listbox(self.win,
                layout=(0, 1, 22, 19),
                id='vTechs',
                columns=((_('Name'), 'text', 13,
                          ui.ALIGN_W), (_('Lvl'), 'tLevel', 2, ui.ALIGN_E),
                         (_('Constr'), 'tProd', 3,
                          ui.ALIGN_E), (_('ETC'), 'tETC', 3, ui.ALIGN_E)),
                columnLabels=1,
                action='onSelectTech')
     # filter
     ui.Button(self.win,
               layout=(0, 20, 3, 1),
               text=_('Stucts'),
               toggle=1,
               id='vStructuresToggle',
               action='onToggleStructures')
     ui.Button(self.win,
               layout=(3, 20, 3, 1),
               text=_('Ships'),
               toggle=1,
               id='vShipsToggle',
               action='onToggleShips')
     ui.Button(self.win,
               layout=(6, 20, 3, 1),
               text=_('Misc'),
               toggle=1,
               id='vOtherToggle',
               action='onToggleOther')
     ui.Button(self.win,
               layout=(9, 20, 1, 1),
               text=_('1'),
               id='vLevel1',
               toggle=1,
               action='onToggleLevel',
               data=1)
     ui.Button(self.win,
               layout=(10, 20, 1, 1),
               text=_('2'),
               id='vLevel2',
               toggle=1,
               action='onToggleLevel',
               data=2)
     ui.Button(self.win,
               layout=(11, 20, 1, 1),
               text=_('3'),
               id='vLevel3',
               toggle=1,
               action='onToggleLevel',
               data=3)
     ui.Button(self.win,
               layout=(12, 20, 1, 1),
               text=_('4'),
               id='vLevel4',
               toggle=1,
               action='onToggleLevel',
               data=4)
     ui.Button(self.win,
               layout=(13, 20, 1, 1),
               text=_('5'),
               id='vLevel5',
               toggle=1,
               action='onToggleLevel',
               data=5)
     ui.Button(self.win,
               layout=(14, 20, 1, 1),
               text=_('6'),
               id='vLevel6',
               toggle=1,
               action='onToggleLevel',
               data=6)
     ui.Button(self.win,
               layout=(18, 20, 4, 1),
               text=_('Info'),
               action='onInfo',
               id='vInfo')
     # targets
     ui.Title(self.win,
              layout=(22, 0, 16, 1),
              text=_('Target planet'),
              align=ui.ALIGN_W,
              font='normal-bold')
     ui.Listbox(self.win,
                layout=(22, 1, 16, 10),
                id='vTargets',
                columns=((_('Planet'), 'text', 10, ui.ALIGN_W),
                         (_('Owner'), 'plOwner', 5, ui.ALIGN_W)),
                columnLabels=1,
                action='onSelectPlanet')
     ui.Listbox(self.win,
                layout=(22, 11, 16, 7),
                id='vTSlots',
                columns=((_('Target slots'), 'text', 15, ui.ALIGN_W), ),
                columnLabels=1,
                action='onSelectSlot')
     # prod types
     ui.Check(self.win,
              layout=(0, 21, 6, 1),
              text=_('Bio production'),
              tags=['struct'],
              id='vBioProduction',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     ui.Check(self.win,
              layout=(6, 21, 6, 1),
              text=_('En production'),
              tags=['struct'],
              id='vEnProduction',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     ui.Check(self.win,
              layout=(12, 21, 6, 1),
              text=_('CP production'),
              tags=['struct'],
              id='vCPProduction',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     ui.Check(self.win,
              layout=(18, 21, 6, 1),
              text=_('RP production'),
              tags=['struct'],
              id='vRPProduction',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     ui.Check(self.win,
              layout=(24, 21, 6, 1),
              text=_('Military'),
              tags=['struct'],
              id='vMilitary',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     ui.Check(self.win,
              layout=(30, 21, 6, 1),
              text=_('Morale'),
              tags=['struct'],
              id='vMorale',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     # ship types
     ui.Check(self.win,
              layout=(0, 21, 6, 1),
              text=_('Small'),
              tags=['ship'],
              id='vSmall',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     ui.Check(self.win,
              layout=(6, 21, 6, 1),
              text=_('Medium'),
              tags=['ship'],
              id='vMedium',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     ui.Check(self.win,
              layout=(12, 21, 6, 1),
              text=_('Large'),
              tags=['ship'],
              id='vLarge',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     ui.Check(self.win,
              layout=(18, 21, 6, 1),
              text=_('Civilian'),
              tags=['ship'],
              id='vCivShip',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     ui.Check(self.win,
              layout=(24, 21, 6, 1),
              text=_('Military'),
              tags=['ship'],
              id='vMilShip',
              checked=1,
              align=ui.ALIGN_W,
              action='onFilter')
     # build
     ui.Title(self.win,
              layout=(22, 18, 16, 1),
              text=_('Options'),
              align=ui.ALIGN_W,
              font='normal-bold')
     ui.Label(self.win,
              layout=(22, 19, 10, 1),
              text=_('Quantity'),
              align=ui.ALIGN_W)
     ui.Entry(self.win,
              layout=(33, 19, 5, 1),
              id='vQuantity',
              align=ui.ALIGN_E,
              orderNo=1)
     ui.Check(self.win,
              layout=(31, 20, 7, 1),
              id='vReportFin',
              text=_('Report finalization'))
     ui.Title(self.win,
              layout=(0, 22, 28, 1),
              id='vStatusBar',
              align=ui.ALIGN_W)
     ui.TitleButton(self.win,
                    layout=(28, 22, 5, 1),
                    text=_('Cancel'),
                    action='onCancel')
     ui.TitleButton(self.win,
                    layout=(33, 22, 5, 1),
                    text=_('Construct'),
                    action='onConstruct')