Beispiel #1
0
class WizardPanel(Panel):
    def __init__(self, parent):
        Panel.__init__(self, parent=parent)
        self.panels = {}
        self.currentPanelKey = 0

        self.sizer = BoxSizer(VERTICAL)
        self.SetSizer(self.sizer)

    def AddPanel(self, newPanel, panelKey):
        panel = newPanel
        self.sizer.Add(panel, 1, EXPAND | ALL)
        self.panels[panelKey] = panel
        if (len(self.panels) > 1):
            panel.Hide()
            self.Layout()
        else:
            self.currentPanelKey = panelKey

    def SetActivePanel(self, panelKey):
        if panelKey in self.panels.keys():
            self.panels[self.currentPanelKey].Hide()
            self.panels[panelKey].Show()
            self.currentPanelKey = panelKey
            self.sizer.Layout()
Beispiel #2
0
    def build_details_social(self,sizer,row):
        types = ('alerts','feed', 'indicators')
        hsz = BoxSizer(wx.HORIZONTAL)


        d = self.details

        add = lambda c,s,*a: (d.add(c),s.Add(c,*a))

        for i, key in enumerate(types):
            checks = self.checks.get(key,())
            if not checks:
                continue

            sz = BoxSizer(wx.VERTICAL)
            tx = StaticText(self, -1, _('{show_topic}:').format(show_topic = self.protocolinfo['show_%s_label' % key]), style = wx.ALIGN_LEFT)
            from gui.textutil import CopyFont
            tx.Font = CopyFont(tx.Font, weight = wx.BOLD)

            add(tx, sz, 0, wx.BOTTOM, tx.GetDefaultBorder())
            for chk in checks:
                add(chk, sz, 0, ALL, chk.GetDefaultBorder())

            hsz.Add(sz,0)
#            if i != len(types)-1: hsz.AddSpacer(15)

        self.Sizer.Add(hsz,0,wx.BOTTOM | wx.LEFT,10)
        self.build_details_default(sizer, row)
    def __init__(self, parent):
        FrmMain.FrmMain.__init__(self, parent)
        bsLocs = self.btnDestroy.GetContainingSizer()
        self.btnDestroy.Destroy()
        for loc in locations:
            loc_id = loc.replace(" ", "_")
            loc_box = BoxSizer()
            loc_box.SetOrientation(wx.VERTICAL)
            cbl_lbl = StaticText(self)
            cbl_lbl.Label = str(loc)
            cbl_lbl.SetName("col_{}".format(loc_id))
            cbl_lbl.Bind(wx.EVT_LEFT_UP, self.btnSelectLoc_Click)
            cbl_loc = CheckListBox(self)
            cbl_loc.SetName(loc_id)
            loc_box.Add(cbl_lbl, 0, wx.ALL, 5)
            loc_box.Add(cbl_loc, 0, wx.ALL, 5)
            bsLocs.Add(loc_box, 0, wx.ALL, 5)
        for p in printers:
            lid = p["Location"].replace(" ", "_")
            loc_list = self.FindWindowByName(lid, self)
            index = len(loc_list.Items) - 1
            if index < 0:
                index = 0

            loc_list.InsertItems([p["Path"]], index)
            # loc_list.SetString(index, p["Printer"])

        self.Layout()
        self.Fit()
        self.Show(True)
Beispiel #4
0
    def __init__(self, parent):
        Panel.__init__(self, parent=parent)
        self.panels = {}
        self.currentPanelKey = 0

        self.sizer = BoxSizer(VERTICAL)
        self.SetSizer(self.sizer)
Beispiel #5
0
    def __init__(self, parent, title=u"NumberInput"):
        Dialog.__init__(self,
                        parent,
                        title=title,
                        size=(320, 240),
                        style=BORDER_NONE)
        pnl = NumberInputWindowPanel(self)

        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_0)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_1)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_2)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_3)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_4)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_5)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_6)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_7)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_8)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_9)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_00)

        self.Bind(EVT_BUTTON, pnl.on_delete, pnl.keypad_del)

        self.Bind(EVT_BUTTON, self.on_confirm, pnl.keypad_confirm)
        self.Bind(EVT_BUTTON, self.on_cancel, pnl.keypad_cancel)

        self.pnl = pnl

        # self._set_panel(pnl)
        self._sizer = BoxSizer()
        self._sizer.Clear()
        self._sizer.Add(self.pnl)
        self.SetSizer(self._sizer)
 def construct_notebook(self):
     """Constructs the main Notebook panel"""
     panel = Panel(self)
     self.notebook = Notebook(panel, style=NB_LEFT)
     self.construct_tabs()
     sizer = BoxSizer(HORIZONTAL)
     sizer.Add(self.notebook, 1, EXPAND)
     panel.SetSizer(sizer)
Beispiel #7
0
    def __init__(self,
                 parent,
                 content=None,
                 title='',
                 buttonlabel='',
                 buttoncb=None,
                 titlemaker=None,
                 prefix=''):
        SimplePanel.__init__(self, parent, wx.FULL_REPAINT_ON_RESIZE)

        sizer = self.Sizer = BoxSizer(VERTICAL)
        self.headersizer = BoxSizer(HORIZONTAL)
        self.bodysizer = BoxSizer(VERTICAL)
        sizer.Add(self.headersizer, 0, EXPAND | TOP, space_over_header)
        sizer.Add(self.bodysizer, 1, EXPAND | TOP, space_under_header)

        self.title = None
        self.combo = None
        self.button = None
        self.content = None
        self.contents = {}
        self.titlemaker = titlemaker
        if wxMac:
            self.menuitems = {}

        if title and isinstance(title, basestring):
            self.title = wx.StaticText(self,
                                       -1,
                                       ' ' + title + ' ',
                                       style=wx.ALIGN_CENTER_VERTICAL)

            #need grey backgound behind label on mac to hide the line
            if wxMac:
                self.title.BackgroundColour = wx.Color(232, 232, 232)
            self.title.Font = self.HeaderFont
            self.headersizer.Add(self.title, 0, *header_sizer_flags)

        if callable(content):
            content = self.content = content(self, prefix)
            self.bodysizer.Add(self.content, 1, pref_sizer_style, 7)
        elif isinstance(content, wx.WindowClass):
            content.Reparent(self)
            self.content = content
            self.bodysizer.Add(self.content, 1, pref_sizer_style, 7)
        elif isinstance(content, list):
            self.SetContents(content)

        if buttoncb:
            self.SetButton(buttonlabel, buttoncb)

        Bind = self.Bind
        Bind(wx.EVT_PAINT, self.OnPaint)

        #darker border if mac so it is visible for now
        if not wxMac:
            self.pen = wx.Pen(wx.Colour(213, 213, 213))
        else:
            self.pen = wx.Pen(wx.Colour(155, 155, 155))
Beispiel #8
0
    def __init__(self, parent, label, initial=""):
        super().__init__(parent)

        sizer = BoxSizer(HORIZONTAL)
        self._text_input = TextCtrl(self)
        self._text_input.SetValue(initial)
        sizer.Add(self._text_input)
        sizer.Add(StaticText(self, label=label))
        self.SetSizer(sizer)
Beispiel #9
0
 def __init__(self, message, *args, **kw):
     super().__init__(*args, **kw)
     hbox = BoxSizer()
     message = NormalText(self, label=message)
     hbox.Add(message, 0, ALL | ALIGN_CENTER, 20)
     self.SetSizer(hbox)
     self.Fit()
     self.Center()
     self.ShowModal()
Beispiel #10
0
 def construct_docs_label(self, kind, value):
     """Constructs a documentation label"""
     sizer = BoxSizer(HORIZONTAL)
     label = HidableAutoWrapStaticText(
         parent=self.scrolled_panel,
         label=value,
         kind=kind,
     )
     sizer.Add(label, -1, EXPAND)
     self.grid_sizer.Add(sizer, -1, EXPAND)
Beispiel #11
0
    def build_details_default(self,sizer,row):

        Txt = lambda s: StaticText(self, -1, _(s))

        details = self.details

        add = lambda i, *a, **k: (sizer.Add(i, *a, **k),details.add(i))

        #                              position  span
        if hasattr(self, 'host'):
            add(Txt(_('Host:')),     (row, 0), flag = ALIGN_RIGHT|ALIGN_CENTER_VERTICAL|ALL, border = self.GetDefaultBorder())
            add(      self.host,     (row, 1), flag = EXPAND|ALL, border = self.host.GetDefaultBorder())
            add(Txt(_('Port:')),     (row, 2), flag = ALIGN_RIGHT|ALIGN_CENTER_VERTICAL|ALL, border = self.GetDefaultBorder())
            add(      self.port,     (row, 3), flag = EXPAND|ALL, border = self.port.GetDefaultBorder())
            row += 1

        if hasattr(self, 'resource'):
            add(Txt(_('Resource:')),   (row, 0), flag = ALIGN_RIGHT|ALIGN_CENTER_VERTICAL|ALL, border = self.GetDefaultBorder())
            add(      self.resource,   (row, 1), flag = EXPAND|ALL, border = self.resource.GetDefaultBorder())
            add(Txt(_('Priority:')),   (row, 2), flag = ALIGN_RIGHT|ALIGN_CENTER_VERTICAL|ALL, border = self.GetDefaultBorder())
            add(      self.priority,   (row, 3), flag = EXPAND|ALL, border = self.priority.GetDefaultBorder())
            row += 1

        if hasattr(self, 'dataproxy'):
            add(Txt(_('Data Proxy:')), (row, 0), flag = ALIGN_RIGHT|ALIGN_CENTER_VERTICAL|ALL, border = self.GetDefaultBorder())
            add(       self.dataproxy, (row, 1), (1, 3), flag = EXPAND|ALL, border = self.dataproxy.GetDefaultBorder())
            row += 1

        sub2 = BoxSizer(wx.HORIZONTAL)
        col1 = BoxSizer(wx.VERTICAL)
        col2 = BoxSizer(wx.VERTICAL)

#        add = lambda c,r,f,p,s: (details.add(c),s.Add(c,r,f,p))

        for d in getattr(self.protocolinfo, 'more_details', []):
            type_ = d['type']
            name  = d['store']
            if type_ == 'bool':
                ctrl = wx.CheckBox(self, -1, d['label'])
                setattr(self, name, ctrl)

                ctrl.SetValue(bool(getattr(self.account, name)))
                details.add(ctrl)
                col2.Add(ctrl, 0, ALL, ctrl.GetDefaultBorder())
            elif type_ == 'enum':
                ctrl = RadioPanel(self, d['elements'], details)
                setattr(self, name, ctrl)

                ctrl.SetValue(getattr(self.account, name))
                col1.Add(ctrl, 0, ALL, self.GetDefaultBorder())

        sub2.Add(col1,0,wx.RIGHT)
        sub2.Add(col2,0,wx.LEFT)

        self.Sizer.Add(sub2, 0, wx.ALIGN_CENTER_HORIZONTAL)
Beispiel #12
0
    def init_components(self):
        self.old_pw_label = wx.StaticText(self, label=_("Old Password: "******"New Password: "******"Confirm New Password: "))
        self.new2_pw_text = wx.TextCtrl(self,
                                        style=wx.TE_PASSWORD,
                                        validator=LengthLimit(1024))

        self.ok_btn = wx.Button(self, wx.ID_OK)
        self.ok_btn.Enable(False)
        self.ok_btn.SetDefault()
        self.cancel_btn = wx.Button(self, wx.ID_CANCEL)

        self.old_sizer = BoxSizer(HORIZONTAL)
        self.new1_sizer = BoxSizer(HORIZONTAL)
        self.new2_sizer = BoxSizer(HORIZONTAL)

        self.btn_sizer = build_button_sizer(self.ok_btn, self.cancel_btn, 2)

        self.main_sizer = BoxSizer(VERTICAL)

        self.Sizer = BoxSizer(HORIZONTAL)
Beispiel #13
0
    def __initCtrl(self):
        """
        Initialize the controls.
        """
        # IDs
        [self.__editorID] = PyutUtils.assignID(1)

        sizer = BoxSizer(VERTICAL)

        self.__lblEditor = StaticText(self, -1, _("Editor"))
        self.__txtEditor = TextCtrl(self, -1, size=(100, 20))
        sizer.Add(self.__lblEditor, 0, ALL, DlgFastEditOptions.GAP)
        sizer.Add(self.__txtEditor, 0, ALL, DlgFastEditOptions.GAP)

        hs = BoxSizer(HORIZONTAL)
        btnOk = Button(self, ID_OK, _("&OK"))
        hs.Add(btnOk, 0, ALL, DlgFastEditOptions.GAP)
        sizer.Add(hs, 0, CENTER)

        self.SetAutoLayout(True)
        self.SetSizer(sizer)
        sizer.Fit(self)
        sizer.SetSizeHints(self)

        btnOk.SetDefault()

        self.Bind(EVT_TEXT, self.__OnText, id=self.__editorID)

        self.__setValues()
        self.Center()

        self.__changed: bool = False
Beispiel #14
0
    def __init__(self, *callbacks):
        Frame.__init__(self, None, ID_ANY, "CUT")
        self.Bind(EVT_CLOSE, lambda x: self.Destroy())
        root = Panel(self, EXPAND)
        sizer = BoxSizer(VERTICAL)

        elements = []
        for element in callbacks:
            sizer.Add(element, 1, EXPAND)

        root.SetSizer(sizer)
Beispiel #15
0
    def __init__(self, parent):
        Panel.__init__(self, parent)

        startButon = Button(self, label="Start Photobox", size=((300, 100)))

        homeSizer = BoxSizer(VERTICAL)
        homeSizer.AddStretchSpacer()
        homeSizer.Add(startButon, 0, CENTER)
        homeSizer.AddStretchSpacer()

        self.SetSizer(homeSizer)
Beispiel #16
0
 def construct_entry_label(self, value):
     """Creates the primary entry label"""
     sizer = BoxSizer(HORIZONTAL)
     label = StaticText(
         self.scrolled_panel,
         label=value,
         style=ALIGN_LEFT
     )
     label.SetFont(self.header_font)
     sizer.Add(label, -1, EXPAND)
     self.grid_sizer.Add(sizer, -1, EXPAND)
Beispiel #17
0
    def __init__(self, parent, title=u"Categories", categories=[]):
        Dialog.__init__(self,
                        parent,
                        title=title,
                        size=(320, 240),
                        style=BORDER_NONE)
        pnl = CategoryInputWindowPanel(self, title, categories)

        self.pnl = pnl
        self._sizer = BoxSizer()
        self._sizer.Clear()
        self._sizer.Add(self.pnl)
        self.SetSizer(self._sizer)
Beispiel #18
0
    def __init__(self, parent):
        ScrolledWindow.__init__(self, parent)

        self.wx_image = None
        self.original_bitmap = None
        self.greyscaled_bitmap = None
        self.img_path = None

        sizer = BoxSizer(VERTICAL)
        self.static_bitmap = StaticBitmap(self)
        sizer.Add(self.static_bitmap, 1, flag=FLAG_ALL_AND_EXPAND)

        self.SetSizer(sizer)
 def get_fields(self, page, vbox, field):
     for label in sorted(settings.SETTINGS[field.original].keys()):
         hbox = BoxSizer(HORIZONTAL)
         value = settings.SETTINGS[field.original][label]
         lbl = StaticText(page, label=label)
         hbox.Add(lbl, flag=RIGHT, border=8)
         subfield = Field(None, label)
         item = self.field_from_value(page, value, subfield)
         field.add_child(subfield)
         if item is not None:
             hbox.Add(item, proportion=1)
         vbox.Add(hbox, flag=EXPAND | LEFT | RIGHT | TOP, border=5)
         vbox.Add((-1, 5))
Beispiel #20
0
    def __init__(self, parent, ID, title):
        """
        Constructor.

        @since 1.0
        @author C.Dutoit
        """
        # dialog box
        super().__init__(parent, ID, title, DefaultPosition, Size(720, 520))

        self.Center(BOTH)

        self.html = HtmlWindow(self, -1, DefaultPosition, Size(720, 520))

        htmlFileName = resource_filename(DlgHelp.HELP_PKG_NAME, 'index.html')
        self.html.LoadPage(htmlFileName)

        self.printer = HtmlEasyPrinting()

        self.box = BoxSizer(VERTICAL)
        self.box.Add(self.html, 1, GROW)
        subbox = BoxSizer(HORIZONTAL)

        btn = Button(self, ID_BACK, _("Back"))
        self.Bind(EVT_BUTTON, self.__OnBack, id=ID_BACK)
        subbox.Add(btn, 1, GROW | ALL, 2)

        btn = Button(self, ID_FORWARD, _("Forward"))
        self.Bind(EVT_BUTTON, self.__OnForward, id=ID_FORWARD)
        subbox.Add(btn, 1, GROW | ALL, 2)

        btn = Button(self, ID_PRINT, _("Print"))
        self.Bind(EVT_BUTTON, self.__OnPrint, id=ID_PRINT)
        subbox.Add(btn, 1, GROW | ALL, 2)

        btn = Button(self, ID_VIEW_SOURCE, _("View Source"))
        self.Bind(EVT_BUTTON, self.__OnViewSource, id=ID_VIEW_SOURCE)
        subbox.Add(btn, 1, GROW | ALL, 2)

        btn = Button(self, ID_OK, _("Exit"))
        subbox.Add(btn, 1, GROW | ALL, 2)

        self.box.Add(subbox, 0, GROW | BOTTOM)
        self.SetSizer(self.box)
        self.SetAutoLayout(True)
        subbox.Fit(self)
        self.box.Fit(self)

        self.OnShowDefault(None)

        self.Show(True)
Beispiel #21
0
    def __init__(self,
                 parent,
                 windowId,
                 dlgTitle: str,
                 pyutModel: Union[PyutClass, PyutInterface],
                 editInterface: bool = False):

        super().__init__(parent,
                         windowId,
                         dlgTitle,
                         style=RESIZE_BORDER | CAPTION)

        self._parent = parent  # TODO  Do I really need to stash this

        from org.pyut.ui.Mediator import Mediator

        self.logger: Logger = DlgEditClassCommon.clsLogger
        self._editInterface: bool = editInterface
        self._mediator: Mediator = Mediator()

        self._pyutModel: CommonClassType = pyutModel
        self._pyutModelCopy: CommonClassType = deepcopy(pyutModel)

        self.SetAutoLayout(True)

        if editInterface is True:
            lbl: str = _('Interface Name')
        else:
            lbl = _('Class Name')

        lblName: StaticText = StaticText(self, ID_ANY, lbl)
        self._txtName: TextCtrl = TextCtrl(self,
                                           ID_TEXT_NAME,
                                           "",
                                           size=(125, -1))

        # Name and Stereotype sizer
        self._szrNameStereotype: BoxSizer = BoxSizer(HORIZONTAL)

        self._szrNameStereotype.Add(lblName, 0, ALL | ALIGN_CENTER, 5)
        self._szrNameStereotype.Add(self._txtName, 1, ALIGN_CENTER)

        self._szrButtons: BoxSizer = self.createButtonContainer()

        self._szrMain: BoxSizer = BoxSizer(VERTICAL)

        self._szrMain.Add(self._szrNameStereotype, 0,
                          ALL | ALIGN_CENTER_HORIZONTAL, 5)

        self.SetSizer(self._szrMain)
Beispiel #22
0
    def _setupMainDialogLayout(self, textControl: TextCtrl, label: StaticText):

        sizerButtons: BoxSizer = self._createDialogButtons()
        # Sizer for all components
        szrMain: BoxSizer = BoxSizer(VERTICAL)
        szrMain.Add(label, 0, BOTTOM, 5)
        szrMain.Add(textControl, 1, EXPAND | BOTTOM, 10)
        szrMain.Add(sizerButtons, 0, ALIGN_CENTER_HORIZONTAL)

        # Border
        szrBorder: BoxSizer = BoxSizer(VERTICAL)
        szrBorder.Add(szrMain, 1, EXPAND | ALL, 10)
        self.SetSizer(szrBorder)
        szrBorder.Fit(self)
Beispiel #23
0
    def __init__(self, parent):
        Dialog.__init__(self,
                        parent,
                        title=u"Entries",
                        size=(320, 240),
                        style=BORDER_NONE)

        pnl = EntryListWindowPanel(self)
        self._pnl = pnl

        self._sizer = BoxSizer()
        self._sizer.Clear()
        self._sizer.Add(self._pnl)
        self.SetSizer(self._sizer)
Beispiel #24
0
    def layout(self):
        vbox = BoxSizer(VERTICAL)
        self.SetSizer(vbox)

        hbox = BoxSizer(HORIZONTAL)
        hbox.Add(self.time, 0, ALIGN_TOP | ALL, 5)
        hbox.Add(self.caption, 1, EXPAND | ALL | FIXED_MINSIZE, 5)
        hbox.Add(self.delete_button, 0, ALIGN_TOP | TOP | RIGHT, 5)

        vbox.Add(hbox, 1, EXPAND)
        vbox.Add(self.under_line, 0, ALL | ALIGN_CENTER, 3)
Beispiel #25
0
class NumberInputWindow(Dialog):
    MAX_VALUE = 999999.99

    def __init__(self, parent, title=u"NumberInput"):
        Dialog.__init__(self,
                        parent,
                        title=title,
                        size=(320, 240),
                        style=BORDER_NONE)
        pnl = NumberInputWindowPanel(self)

        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_0)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_1)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_2)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_3)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_4)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_5)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_6)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_7)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_8)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_9)
        self.Bind(EVT_BUTTON, pnl.on_input_callback, pnl.keypad_00)

        self.Bind(EVT_BUTTON, pnl.on_delete, pnl.keypad_del)

        self.Bind(EVT_BUTTON, self.on_confirm, pnl.keypad_confirm)
        self.Bind(EVT_BUTTON, self.on_cancel, pnl.keypad_cancel)

        self.pnl = pnl

        # self._set_panel(pnl)
        self._sizer = BoxSizer()
        self._sizer.Clear()
        self._sizer.Add(self.pnl)
        self.SetSizer(self._sizer)

    def on_confirm(self, e):
        self.pnl.on_confirm(None)
        self.EndModal(ID_OK)

    def on_cancel(self, e):
        self.pnl.on_cancel(None)
        self.EndModal(ID_CANCEL)

    def get_result(self):
        return self.pnl.get_result()

    def get_value(self):
        return self.pnl.get_value()
Beispiel #26
0
    def layout(self):
        vbox = BoxSizer(VERTICAL)
        self.SetSizer(vbox)
        hbox = BoxSizer(HORIZONTAL)

        hbox.Add(self.start_btn, 1, ALIGN_CENTER | RIGHT, 10)
        hbox.Add(self.pause_btn, 1, ALIGN_CENTER | RIGHT | LEFT, 5)
        hbox.Add(self.reset_btn, 1, ALIGN_CENTER | LEFT, 10)

        vbox.Add(self.time_display, 0, ALIGN_CENTER | ALL, 10)
        vbox.Add(hbox, 1, ALIGN_CENTER)
        vbox.Add(StaticLine(self, ID_ANY, size=(3000, 2)), 0, TOP, 5)

        self.pause_btn.Disable()
        self.reset_btn.Disable()
Beispiel #27
0
 def construct_gui(self):
     """Constructs the page GUI"""
     self.scrolled_panel = ScrolledPanel(self)
     self.scrolled_panel.SetAutoLayout(1)
     self.scrolled_panel.SetupScrolling()
     self.main_sizer = BoxSizer(HORIZONTAL)
     self.grid_sizer = FlexGridSizer(1, 10, 10)
     for index, entry in enumerate(self.config):
         self.construct_entry_row(entry, index)
     self.grid_sizer.AddGrowableCol(0, 1)
     scroll_sizer = BoxSizer(HORIZONTAL)
     scroll_sizer.Add(self.grid_sizer, 1, EXPAND | ALL, 20)
     self.scrolled_panel.SetSizer(scroll_sizer)
     self.main_sizer.Add(self.scrolled_panel, 1, EXPAND)
     self.SetSizer(self.main_sizer)
Beispiel #28
0
    def __init__(self, parent: Window, wxID: int = wxNewIdRef()):

        super().__init__(parent,
                         wxID,
                         'About',
                         DefaultPosition,
                         size=Size(width=390, height=250))

        self._versionFont: Font = self.GetFont()

        self._versionFont.SetFamily(FONTFAMILY_DEFAULT)

        self._version: Version = Version()  # Get the singleton

        dlgButtonsContainer: Sizer = self._createDialogButtonsContainer()

        # Main sizer
        mainSizer: BoxSizer = BoxSizer(VERTICAL)
        dialogSizer: BoxSizer = self._createUpperDialog()

        mainSizer.Add(dialogSizer, 0, ALL | ALIGN_LEFT, 5)
        mainSizer.Add(dlgButtonsContainer, 0, ALL | ALIGN_CENTER, 5)

        # noinspection PyUnresolvedReferences
        self.SetAutoLayout(True)
        # noinspection PyUnresolvedReferences
        self.SetSizer(mainSizer)
        self.Center(BOTH)
        self.SetBackgroundColour(WHITE)

        self.Bind(EVT_BUTTON, self._onOk, id=ID_OK)
        self.Bind(EVT_CLOSE, self._onOk)
Beispiel #29
0
    def __init__(self, parent):
        """
        """
        dialogStyle: int = RESIZE_BORDER | SYSTEM_MENU | CAPTION | FRAME_FLOAT_ON_PARENT | STAY_ON_TOP
        dialogSize: Size = Size(DEFAULT_WIDTH, DEFAULT_HEIGHT)
        super().__init__(parent, ID_ANY, _("Tips"), DefaultPosition,
                         dialogSize, dialogStyle)

        self._prefs: PyutPreferences = PyutPreferences()
        self._tipsFileName: str = PyutUtils.retrieveResourcePath(
            f'{DlgTips.TIPS_FILENAME}')

        self._tipHandler = TipHandler(fqFileName=self._tipsFileName)

        upSizer: BoxSizer = self._buildUpperDialog(
            self._tipHandler.getCurrentTipText())
        loSizer: BoxSizer = self._buildLowerDialog()

        self.SetAutoLayout(True)

        mainSizer: BoxSizer = BoxSizer(VERTICAL)

        mainSizer.Add(upSizer, WX_SIZER_NOT_CHANGEABLE, ALL | ALIGN_CENTER, 5)
        mainSizer.Add(self._chkShowTips, WX_SIZER_NOT_CHANGEABLE,
                      ALL | ALIGN_CENTER, 5)
        mainSizer.Add(loSizer, WX_SIZER_NOT_CHANGEABLE, ALL | ALIGN_CENTER, 5)

        mainSizer.Fit(self)

        self.Center(dir=VERTICAL)
        self.AcceptsFocus()
        self.SetSizer(mainSizer)

        self._bindEventHandlers()
Beispiel #30
0
    def __init__(self, theParent, imageOptions: ImageOptions = ImageOptions()):

        [
            self.__selectedFileId, self.__imageWidthId, self.__imageHeightId,
            self.__horizontalGapId, self.__verticalGapId, self.__fileSelectBtn,
            self.__imageFormatChoiceId
        ] = PyutUtils.assignID(7)

        super().__init__(theParent, theTitle='UML Image Generation Options')

        self.logger: Logger = getLogger(__name__)
        self._imageOptions: ImageOptions = imageOptions

        fs: StaticBoxSizer = self.__layoutFileSelection()
        imgS: StaticBoxSizer = self.__layoutImageSizeControls()
        imgF: StaticBoxSizer = self.__layoutImageFormatChoice()
        imgP: StaticBoxSizer = self.__layoutImagePadding()

        hs: Sizer = self._createDialogButtonsContainer(buttons=OK | CANCEL)

        mainSizer: BoxSizer = BoxSizer(orient=VERTICAL)
        mainSizer.Add(fs, 0, ALL | EXPAND, 5)
        mainSizer.Add(imgS, 0, ALL, 5)
        mainSizer.Add(imgF, 0, ALL, 5)
        mainSizer.Add(imgP, 0, ALL, 5)
        mainSizer.Add(hs, 0, ALIGN_RIGHT)

        self.SetSizer(mainSizer)

        mainSizer.Fit(self)
        self._bindEventHandlers()

        self.Bind(EVT_BUTTON, self._OnCmdOk, id=ID_OK)
        self.Bind(EVT_CLOSE, self._OnClose, id=ID_CANCEL)
Beispiel #31
0
    def __init__(self, parent, label = '', alignment = default_alignment):
        BoxSizer.__init__(self, HORIZONTAL)

        self.parent    = parent
        self.label     = self.flabel = label
        self.fontcolor = wx.BLACK
        self.font      = default_font()
        self.alignment = alignment

        #Child used to hook into drawing events
        self.anchor = wx.Window(parent, -1 ,size=(1, 1),
                                style = wx.BORDER_NONE | wx.TRANSPARENT_WINDOW)
        self.anchor.Bind(wx.EVT_ERASE_BACKGROUND, Null)

        if hasattr(parent, 'ChildPaints'):
            parent.ChildPaints += self.PaintSlave
        else:
            self.anchor.Bind(wx.EVT_PAINT,self.OnPaint)

        self.CalcSize()