예제 #1
0
    def OnScheduleSetup(self, evt):
        if True:
            self.scheduleDlg = wx.Dialog(self, -1, "Schedule Setup", 
                               style=wx.DEFAULT_DIALOG_STYLE|wx.SAVE, size=(400, 180))
            textDate = wx.StaticText(self.scheduleDlg, -1, "Date:", size=(30,-1))
            self.dpc = wx.GenericDatePickerCtrl(self.scheduleDlg, #size=(120,-1),
                                           style = wx.TAB_TRAVERSAL
                                           | wx.DP_DROPDOWN
                                           | wx.DP_SHOWCENTURY
                                           | wx.DP_ALLOWNONE )

            btn_selectSaved = wx.Button(self.scheduleDlg, -1, "Browse...")
            self.scheduleDlg.Bind(wx.EVT_BUTTON, self.OnSelectSaved, btn_selectSaved)
            st = wx.StaticText(self.scheduleDlg, -1, "Choose:")
            self.tc_saved = wx.TextCtrl(self.scheduleDlg, -1, "", size=(200, -1))
            
            textTime = wx.StaticText(self.scheduleDlg, -1, "Time:", size=(30,-1))
            spin2 = wx.SpinButton(self.scheduleDlg, -1, wx.DefaultPosition, (-1, 25), wx.SP_VERTICAL)
            self.time24 = masked.TimeCtrl(
                            self.scheduleDlg, -1, name="24 hour control", fmt24hr=True,
                            spinButton = spin2
                            )
            sizer = rcs.RowColSizer()

            box0 = wx.BoxSizer(wx.HORIZONTAL)
            box0.Add(st, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
            box0.Add(self.tc_saved, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
            box0.Add(btn_selectSaved, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
            sizer.Add(box0, row=1, col=1, colspan=8)
            
            box1 = wx.BoxSizer(wx.HORIZONTAL)
            box1.Add(textDate, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
            box1.Add(self.dpc, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
            sizer.Add(box1, row=2, col=1, colspan=2)
            
            box2 = wx.BoxSizer(wx.HORIZONTAL)
            box2.Add(textTime, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
            box2.Add(self.time24, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
            box2.Add(spin2, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
            sizer.Add(box2, row=2, col=4, colspan=2)
            
            btnsizer = wx.StdDialogButtonSizer()
            
            if wx.Platform != "__WXMSW__":
                btn = wx.ContextHelpButton(self)
                btnsizer.AddButton(btn)
            
            btnSave = wx.Button(self.scheduleDlg, wx.ID_SAVE)
            btnSave.SetDefault()
            self.scheduleDlg.Bind(wx.EVT_BUTTON, self.OnScheduleSave, btnSave)
            btnsizer.AddButton(btnSave)
            
            btnCancel = wx.Button(self.scheduleDlg, wx.ID_CANCEL)
            btnsizer.AddButton(btnCancel)
            btnsizer.Realize()
            sizer.Add(btnsizer, row=4, col=1, colspan=5)
            self.scheduleDlg.SetSizer(sizer)
            
            scheduleDlgCode = self.scheduleDlg.ShowModal()
            self.scheduleDlg.Destroy()
예제 #2
0
    def test_cshelp1(self):
        provider = wx.SimpleHelpProvider()
        wx.HelpProvider.Set(provider)

        pnl = wx.Panel(self.frame)
        pnl.SetHelpText("HelpMe!")
        cBtn = wx.ContextHelpButton(pnl)
예제 #3
0
파일: Options.py 프로젝트: cedrick-f/pyVot
    def __init__(self, parent, options):
        wx.Dialog.__init__(self, parent, -1,
                           u"Options de PyVot")  #, style = wx.RESIZE_BORDER)

        sizer = wx.BoxSizer(wx.VERTICAL)

        nb = nbOptions(self, options)
        sizer.Add(nb, flag=wx.EXPAND)  #|wx.ALL)

        btnsizer = wx.StdDialogButtonSizer()

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_OK)
        btn.SetHelpText(u"Enregistrer les changements")
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_CANCEL)
        btn.SetHelpText(u"Annuler les changements")
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        sizer.Add(btnsizer, flag=wx.EXPAND)  #|wx.ALL)
        self.SetMinSize((350, -1))
        #        print self.GetMinSize()
        #        self.SetSize(self.GetMinSize())
        self.SetSizerAndFit(sizer)
예제 #4
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self,
                          id=wxID_WXFRAME2,
                          name='',
                          parent=prnt,
                          pos=wx.Point(176, 176),
                          size=wx.Size(266, 64),
                          style=wx.DEFAULT_FRAME_STYLE,
                          title='Minimal context help example')
        self.SetClientSize(wx.Size(258, 37))

        self.panel1 = wx.Panel(id=wxID_WXFRAME2PANEL1,
                               name='panel1',
                               parent=self,
                               pos=wx.Point(0, 0),
                               size=wx.Size(258, 37),
                               style=wx.TAB_TRAVERSAL)

        self.textCtrl1 = wx.TextCtrl(id=wxID_WXFRAME2TEXTCTRL1,
                                     name='textCtrl1',
                                     parent=self.panel1,
                                     pos=wx.Point(8, 8),
                                     size=wx.Size(192, 21),
                                     style=0,
                                     value='textCtrl1')
        self.textCtrl1.SetHelpText('Here be expansive')
        self.textCtrl1.SetToolTipString('Here be spartan')

        self.contextHelpButton1 = wx.ContextHelpButton(parent=self.panel1,
                                                       pos=wx.Point(224, 8),
                                                       size=wx.Size(20, 19),
                                                       style=wx.BU_AUTODRAW)
예제 #5
0
    def finalise(
            self
    ):  # cette fonction est a appeler une fois tout le contenu ajoute.
        line = wx.StaticLine(self, -1, size=(20, -1), style=wx.LI_HORIZONTAL)
        self.sizer.Add(line, 0,
                       wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP,
                       5)

        self.box = wx.BoxSizer(wx.HORIZONTAL)

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            self.box.Add(btn, 0, wx.ALIGN_CENTRE | wx.ALL, 5)

        btn = wx.Button(self, wx.ID_OK, self.objet and u" Créer "
                        or u"Enregistrer")
        btn.SetHelpText(self.objet and u"Créer l'objet."
                        or u"Enregistrer les modifications.")
        btn.SetDefault()
        self.box.Add(btn, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL | wx.ALL,
                     5)

        btn = wx.Button(self, wx.ID_CANCEL, " Annuler ")
        btn.SetHelpText(u"Quitter sans rien changer.")
        self.box.Add(btn, 0,
                     wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        self.sizer.Add(self.box, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        self.SetSizer(self.sizer)
        self.SetAutoLayout(True)
        self.sizer.Fit(self)
        self.CenterOnScreen()
        if self.objet:
            self.champs['nom'].SetFocus()
예제 #6
0
    def __init__(self, parent=None, prefix=None, det_type='ME-4',
                 ioc_type='Xspress3', nmca=4,
                 title='Select Epics MCA Detector'):
        if prefix is None:
            prefix = self.def_prefix
        if det_type not in self.det_types:
            det_type = self.det_types[0]

        wx.Dialog.__init__(self, parent, wx.ID_ANY, title=title)

        self.SetBackgroundColour((240, 240, 230))
        self.SetFont(Font(9))
        if parent is not None:
            self.SetFont(parent.GetFont())

        self.ioctype = Choice(self,size=(120, -1), choices=self.ioc_types)
        self.ioctype.SetStringSelection(ioc_type)

        self.dettype = Choice(self,size=(120, -1), choices=self.det_types)
        self.dettype.SetStringSelection(det_type)

        self.prefix = wx.TextCtrl(self, -1, prefix, size=(120, -1))
        self.nelem = FloatCtrl(self, value=nmca, precision=0, minval=1,
                               size=(120, -1))

        btnsizer = wx.StdDialogButtonSizer()

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_OK)
        btn.SetHelpText("Use this detector")
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_CANCEL)
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        hline = wx.StaticLine(self, size=(225, 3), style=wx.LI_HORIZONTAL)
        sty = LEFT|wx.ALIGN_CENTER_VERTICAL
        sizer = wx.GridBagSizer(5, 2)
        def txt(label):
            return SimpleText(self, label, size=(120, -1), style=LEFT)

        sizer.Add(txt('  Detector Type'),  (0, 0), (1, 1), sty, 2)
        sizer.Add(txt('  Uses Xspress3?'), (1, 0), (1, 1), sty, 2)
        sizer.Add(txt('  Epics Prefix'),  (2, 0), (1, 1), sty, 2)
        sizer.Add(txt('  # Elements'),    (3, 0), (1, 1), sty, 2)
        sizer.Add(self.dettype,         (0, 1), (1, 1), sty, 2)
        sizer.Add(self.ioctype,         (1, 1), (1, 1), sty, 2)
        sizer.Add(self.prefix,          (2, 1), (1, 1), sty, 2)
        sizer.Add(self.nelem,           (3, 1), (1, 1), sty, 2)

        sizer.Add(hline,                (4, 0), (1, 2), sty, 2)
        sizer.Add(btnsizer,             (5, 0), (1, 2), sty, 2)
        self.SetSizer(sizer)
        sizer.Fit(self)
예제 #7
0
    def __init__(self, parent, options):
        wx.Dialog.__init__(
            self, parent, -1,
            "Options de pySéquence")  #, style = wx.RESIZE_BORDER)

        sizer = wx.BoxSizer(wx.VERTICAL)
        self.options = options
        self.parent = parent

        #
        # Le book ...
        #
        nb = wx.Notebook(self, -1)
        nb.AddPage(pnlClasse(nb, options.optClasse), "Classe")
        #        nb.AddPage(pnlAffichage(nb, options.optAffichage), _(u"Affichage"))
        #        nb.AddPage(pnlCalcul(nb, options.optCalcul), _(u"Calcul"))
        #        nb.AddPage(pnlImpression(nb, options.optImpression), _(u"Impression"))
        #        nb.AddPage(pnlCouleurs(nb, options.optCouleurs), _(u"Couleurs"))
        nb.SetMinSize((400, -1))
        sizer.Add(nb, flag=wx.EXPAND)  #|wx.ALL)
        self.nb = nb

        #
        # Les boutons ...
        #
        btnsizer = wx.StdDialogButtonSizer()

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_OK)
        help = "Valider les changements apportés aux options"
        btn.SetToolTip(wx.ToolTip(help))
        btn.SetHelpText(help)
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_CANCEL)
        help = "Annuler les changements et garder les options comme auparavant"
        btn.SetToolTip(wx.ToolTip(help))
        btn.SetHelpText(help)
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        btn = wx.Button(self, -1, "Défaut")
        help = "Rétablir les options par défaut"
        btn.SetToolTip(wx.ToolTip(help))
        btn.SetHelpText(help)
        self.Bind(wx.EVT_BUTTON, self.OnClick, btn)
        bsizer = wx.BoxSizer(wx.HORIZONTAL)
        bsizer.Add(btn)
        bsizer.Add(btnsizer, flag=wx.EXPAND | wx.ALIGN_RIGHT)

        sizer.Add(bsizer, flag=wx.EXPAND)  #|wx.ALL)
        self.SetMinSize((400, -1))
        #        print self.GetMinSize()
        #        self.SetSize(self.GetMinSize())
        self.SetSizerAndFit(sizer)
예제 #8
0
    def __init__(self, parent, motorlist):

        self.selected_motor = None
        self.motor_desc = {}
        motor_names = []
        for mot in motorlist:
            motor_names.append(mot.name)
            self.motor_desc[mot.name] = mot.notes

        pre = wx.PreDialog()
        pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
        pre.Create(parent,
                   -1,
                   'Select Motor Settings from Known Motor Types',
                   style=wx.DEFAULT_DIALOG_STYLE)
        self.PostCreate(pre)

        sizer = wx.GridBagSizer(5, 2)

        label = wx.StaticText(self, label="Select Settings from a Known Motor")
        sizer.Add(label, (0, 0), (1, 2), wx.ALIGN_CENTRE | wx.ALL, 5)

        mlabel = wx.StaticText(self, -1, "Motor Type:")

        self.choice = wx.Choice(self, -1, (250, 250), choices=motor_names)
        self.choice.Bind(wx.EVT_CHOICE, self._onName)
        self.choice.SetSelection(0)

        self.desc = wx.StaticText(self, -1, ' ', size=(220, 150))

        sizer.Add(mlabel, (1, 0), (1, 1), wx.ALIGN_CENTRE | wx.ALL, 5)
        sizer.Add(self.choice, (1, 1), (1, 1),
                  wx.ALIGN_CENTRE | wx.ALL | wx.EXPAND, 5)
        sizer.Add(self.desc, (2, 0), (1, 2), wx.ALIGN_CENTRE | wx.ALL, 5)

        line = wx.StaticLine(self, -1, size=(120, -1), style=wx.LI_HORIZONTAL)
        sizer.Add(line, (3, 0), (1, 2), wx.GROW | wx.ALIGN_CENTER, 5)

        btnsizer = wx.StdDialogButtonSizer()

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_OK)
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_CANCEL)
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        sizer.Add(btnsizer, (4, 0), (1, 2),
                  wx.ALIGN_CENTER | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        self.SetSizer(sizer)
        sizer.Fit(self)
예제 #9
0
	def __init__(self, parent):
		super(SyzygyDlg, self).__init__()
        # Instead of calling wx.Dialog.__init__ we precreate the dialog
        # so we can set an extra style that must be set before
        # creation, and then we create the GUI object using the Create
        # method.
		#pre = wx.Dialog()
		#pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
		#pre.Create(parent, -1, mtexts.txts['Syzygy'], pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)

		wx.Dialog.__init__(self)
		self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
		self.Create(parent, -1, mtexts.txts['Syzygy'], pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)

        # This next step is the most important, it turns this Python
        # object into the real wrapper of the dialog (instead of pre)
        # as far as the wxPython extension is concerned.
		#self.PostCreate(pre)

		#main vertical sizer
		mvsizer = wx.BoxSizer(wx.VERTICAL)

		#Syzygy
		ssyzygy = wx.StaticBox(self, label="")
		syzygysizer = wx.StaticBoxSizer(ssyzygy, wx.VERTICAL)
		self.syzmoonrb = wx.RadioButton(self, -1, mtexts.txts['SyzMoon'], style=wx.RB_GROUP)
		syzygysizer.Add(self.syzmoonrb, 0, wx.ALIGN_LEFT|wx.LEFT|wx.TOP, 5)
		self.syzaboverb = wx.RadioButton(self, -1, mtexts.txts['SyzAbove'])
		syzygysizer.Add(self.syzaboverb, 0, wx.ALIGN_LEFT|wx.LEFT|wx.TOP, 5)
		self.syzabovenatalrb = wx.RadioButton(self, -1, mtexts.txts['SyzAboveNatal'])
		syzygysizer.Add(self.syzabovenatalrb, 0, wx.ALIGN_LEFT|wx.LEFT|wx.TOP, 5)

		mvsizer.Add(syzygysizer, 0, wx.GROW|wx.ALL, 5)

		btnsizer = wx.StdDialogButtonSizer()

		if wx.Platform != '__WXMSW__':
			btn = wx.ContextHelpButton(self)
			btnsizer.AddButton(btn)

		btnOk = wx.Button(self, wx.ID_OK, mtexts.txts['Ok'])
		btnOk.SetHelpText(mtexts.txts['HelpOk'])
		btnOk.SetDefault()
		btnsizer.AddButton(btnOk)

		btn = wx.Button(self, wx.ID_CANCEL, mtexts.txts['Cancel'])
		btn.SetHelpText(mtexts.txts['HelpCancel'])
		btnsizer.AddButton(btn)
		btnsizer.Realize()

		mvsizer.Add(btnsizer, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 10)

		self.SetSizer(mvsizer)
		mvsizer.Fit(self)

		btnOk.SetFocus()
예제 #10
0
    def __init__(self, *args, **kwds):
        # begin wxGlade: formValve.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER
        wx.Dialog.__init__(self, *args, **kwds)
        self.panel_buttons = wx.Panel(self, -1)
        self.panel_configure = wx.Panel(self, -1, style=wx.TAB_TRAVERSAL)
        self.configure_notebook = wx.Notebook(self.panel_configure, -1, style=0)
        #self.notebook_state = wx.ScrolledWindow(self.configure_notebook, -1, style=wx.TAB_TRAVERSAL)
        self.notebook_post = wx.ScrolledWindow(self.configure_notebook, -1, style=wx.TAB_TRAVERSAL)
        self.notebook_general = wx.ScrolledWindow(self.configure_notebook, -1, style=wx.TAB_TRAVERSAL)
        self.label_0 = wx.StaticText(self.notebook_general, -1, "Number of Valves:")
        self.data['Nval'] = wx.TextCtrl(self.notebook_general, -1, "")
        self.label_1 = wx.StaticText(self.notebook_general, -1, "Valve Lift:")
        self.data['type_dat'] = wx.RadioBox(self.notebook_general, -1, "", choices=["Exponential", "Squared Sin", "User-defined"], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
        self.label_2 = wx.StaticText(self.notebook_general, -1, "Opening Angle [deg]:")
        self.data['angle_V0'] = wx.TextCtrl(self.notebook_general, -1, "")
        self.label_3 = wx.StaticText(self.notebook_general, -1, "Closing Angle [deg]:")
        self.data['angle_VC'] = wx.TextCtrl(self.notebook_general, -1, "")
        self.label_4 = wx.StaticText(self.notebook_general, -1, "Diameter [mm]:")
        self.data['Dv'] = wx.TextCtrl(self.notebook_general, -1, "")
        self.label_5 = wx.StaticText(self.notebook_general, -1, "Valve Model:")
        self.data['valve_model'] = wx.RadioBox(self.notebook_general, -1, "", choices=["Toyota", "Alessandri"], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
        self.label_6 = wx.StaticText(self.notebook_general, -1, "Type of Valve:")
        self.data['type'] = wx.RadioBox(self.notebook_general, -1, "", choices=["Intake Valve", "Exhaust Valve"], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
        self.label_7 = wx.StaticText(self.notebook_general, -1, "Max. Valve Lift [mm]:")
        self.data['Lvmax'] = wx.TextCtrl(self.notebook_general, -1, "")
        self.label_8 = wx.StaticText(self.notebook_general, -1, "Valve Lift Definition:")
        self.button_1 = wx.Button(self.notebook_general, -1, "load")
        self.button_1b = wx.Button(self.notebook_general, -1, "plot")
        self.data['Lv'] = wx.grid.Grid(self.notebook_general, -1, size=(1, 1))
        self.label_9_copy = wx.StaticText(self.notebook_general, -1, "Discharge Coefficient:")
        self.button_2 = wx.Button(self.notebook_general, -1, "load")
        self.button_2b = wx.Button(self.notebook_general, -1, "plot")
        self.data['Cd'] = wx.grid.Grid(self.notebook_general, -1, size=(1, 1))
        self.panel_31 = wx.Panel(self.notebook_general, -1)
        self.panel_32 = wx.Panel(self.notebook_general, -1)
        #self.data['histo'] = wx.grid.Grid(self.notebook_state, -1, size=(1, 1))
        self.data['histo'] = wx.CheckBox(self.notebook_post, -1, "Save Own State")
        self.data['label'] = wx.TextCtrl(self.notebook_general, -1, "")
        self.label_12 = wx.StaticText(self.notebook_general, -1, "Label:")
        #self.button_3 = wx.Button(self.notebook_state, -1, "...")
        self.accept = wx.Button(self.panel_buttons, wx.ID_OK, "")
        self.cancel = wx.Button(self.panel_buttons, wx.ID_CANCEL, "")
        self.help = wx.ContextHelpButton(self.panel_buttons)

        self.__set_properties()
        self.setContextualHelp()
        self.__do_layout()

        self.Bind(wx.EVT_RADIOBOX, self.onTypeDat, self.data['type_dat'])
        self.Bind(wx.EVT_BUTTON, self.onLoadLvmax, self.button_1)
        self.Bind(wx.EVT_BUTTON, self.onPlotLvmax, self.button_1b)
        self.Bind(wx.EVT_BUTTON, self.onLoadDC, self.button_2)
        self.Bind(wx.EVT_BUTTON, self.onPlotDC, self.button_2b)
        #self.Bind(wx.EVT_BUTTON, self.onLoadState, self.button_3)
        self.Bind(wx.EVT_BUTTON, self.ConfigureAccept, self.accept)
예제 #11
0
    def test_cshelp1(self):
        provider = wx.SimpleHelpProvider()
        wx.HelpProvider.Set(provider)

        pnl = wx.Panel(self.frame)
        pnl.SetHelpText("HelpMe!")
        cBtn = wx.ContextHelpButton(pnl)

        # Make sure we haven't borked the magic ID
        assert cBtn.GetId() == wx.ID_CONTEXT_HELP
예제 #12
0
파일: pugwindow.py 프로젝트: bcorfman/pug
    def make_toolbar(self):
        self.toolBar = wx.ToolBar(parent=self.GetParent(),
                                  pos=wx.Point(0, 64),
                                  size=wx.Size(25, 34),
                                  style=wx.RAISED_BORDER | wx.TB_HORIZONTAL)
        self.toolBar.SetAutoLayout(True)
        self.toolBar.Hide()
        #self.toolBar.SetBackgroundColour(wx.Colour(222, 222, 222))
        #self.SetToolBar(self.toolBar)
        buttonsize = WX_BUTTON_BMP_SIZE
        self.toolBar.SetToolBitmapSize(buttonsize)

        bmp = wx.ArtProvider.GetBitmap(wx.ART_TICK_MARK, wx.ART_TOOLBAR,
                                       buttonsize)
        self.toolBar.AddCheckLabelTool(
            _TOOL_AUTOREFRESH,
            "Refresh",
            bitmap=bmp,
            shortHelp="Auto Refresh",
            longHelp="Refresh values every 0.25 seconds")
        refreshButton = wx.Button(self.toolBar, _TOOL_REFRESH, "Refresh")
        self.toolBar.AddControl(refreshButton)
        self.toolBar.AddSeparator()
        refreshButton.Bind(wx.EVT_BUTTON, self.refresh)
        self.toolBar.Bind(wx.EVT_TOOL, self._evt_setting, id=_TOOL_AUTOREFRESH)
        self._attach_setting("auto_refresh", self.toolBar, _TOOL_AUTOREFRESH,
                             False)

        bmp = wx.ArtProvider.GetBitmap(wx.ART_TICK_MARK, wx.ART_TOOLBAR,
                                       buttonsize)
        self.toolBar.AddCheckLabelTool(
            _TOOL_AUTOAPPLY,
            "Auto",
            bitmap=bmp,
            shortHelp="Auto Apply",
            longHelp="Apply all changes to object automatically")
        applyButton = wx.Button(self.toolBar, _TOOL_APPLY, "Apply")
        self.toolBar.AddControl(applyButton)
        self.toolBar.AddSeparator()
        applyButton.Bind(wx.EVT_BUTTON, self.apply)
        self.toolBar.Bind(wx.EVT_TOOL, self._evt_setting, id=_TOOL_AUTOAPPLY)
        self._attach_setting("auto_apply", self.toolBar, _TOOL_AUTOAPPLY, True)

        bmp = wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_TOOLBAR,
                                       buttonsize)
        self.toolBar.AddSimpleTool(_HELP_INFO, bmp, "View help",
                                   "View help info for this object")
        context = wx.ContextHelpButton(self.toolBar)
        context.SetToolTipString(
            "Click here, then click on any attribute label")
        self.toolBar.AddControl(context)
        self.toolBar.Bind(wx.EVT_TOOL, self.show_help, id=_HELP_INFO)
        self.toolBar.Realize()
예제 #13
0
    def __init__(self,
                 parent,
                 ID,
                 title,
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=wx.DEFAULT_DIALOG_STYLE):
        provider = wx.SimpleHelpProvider()
        wx.HelpProvider_Set(provider)

        # Instead of calling wx.Dialog.__init__ we precreate the dialog
        # so we can set an extra style that must be set before
        # creation, and then we create the GUI dialog using the Create
        # method.
        pre = wx.PreDialog()
        pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
        pre.Create(parent, ID, title, pos, size, style)
        # This next step is the most important, it turns this Python
        # object into the real wrapper of the dialog (instead of pre)
        # as far as the wx.Python extension is concerned.
        self.this = pre.this
        sizer = wx.BoxSizer(wx.VERTICAL)
        box = wx.BoxSizer(wx.HORIZONTAL)

        label = wx.StaticText(self, -1, "echangelog")
        label.SetHelpText(
            "Enter text to pass to echangelog. Leave blank for multi-line entry (xterm will be launched)."
        )
        box.Add(label, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
        self.inp = wx.TextCtrl(self, -1, "", size=(280, -1))
        self.inp.SetHelpText(
            "Enter text to pass to echangelog. Leave blank for multi-line entry (xterm will be launched)."
        )
        box.Add(self.inp, 1, wx.ALIGN_CENTRE | wx.ALL, 5)
        sizer.Add(box, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        box = wx.BoxSizer(wx.HORIZONTAL)
        sizer.Add(box, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
        line = wx.StaticLine(self, -1, size=(20, -1), style=wx.LI_HORIZONTAL)
        sizer.Add(line, 0,
                  wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP, 5)
        box = wx.BoxSizer(wx.HORIZONTAL)
        btn = wx.Button(self, wx.ID_OK, " OK ")
        btn.SetDefault()
        box.Add(btn, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
        btn = wx.Button(self, wx.ID_CANCEL, " Cancel ")
        box.Add(btn, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
        btn = wx.ContextHelpButton(self)
        box.Add(btn, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
        sizer.Add(box, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
        self.SetSizer(sizer)
        self.SetAutoLayout(True)
        sizer.Fit(self)
예제 #14
0
    def __init__(self, parent=None, filelist=None,
                 title='Select Instruments File'):

        wx.Dialog.__init__(self, parent, wx.ID_ANY, title=title)

        #panel = wx.Panel(self)
        self.colors = GUIColors()
        self.SetBackgroundColour(self.colors.bg)
        if parent is not None:
            self.SetFont(parent.GetFont())

        flist = []
        for fname in filelist:
            if os.path.exists(fname):
                flist.append(fname)

        self.filebrowser = FileBrowser(self, size=(600, -1))
        self.filebrowser.SetHistory(flist)
        self.filebrowser.SetLabel('File:')
        self.filebrowser.fileMask = EIN_WILDCARD

        if filelist is not None:
            self.filebrowser.SetValue(filelist[0])

        self.message = SimpleText(self, 'Select DB File', size=(500,-1))

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.message, 0, wx.ALIGN_CENTER|wx.ALL|wx.GROW, 1)
        sizer.Add(self.filebrowser, 1, wx.ALIGN_CENTER|wx.ALL|wx.GROW, 1)

        line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL)
        sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5)

        btnsizer = wx.StdDialogButtonSizer()

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_OK)
        btn.SetHelpText("Use this Instruments File")
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_CANCEL)
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)

        self.SetSizer(sizer)
        sizer.Fit(self)
예제 #15
0
	def __init__(self, parent, li):
        # Instead of calling wx.Dialog.__init__ we precreate the dialog
        # so we can set an extra style that must be set before
        # creation, and then we create the GUI object using the Create
        # method.
		pre = wx.PreDialog()
		pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
		pre.Create(parent, -1, mtexts.txts['Places'], pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)

        # This next step is the most important, it turns this Python
        # object into the real wrapper of the dialog (instead of pre)
        # as far as the wxPython extension is concerned.
		self.PostCreate(pre)

		#main vertical sizer
		mvsizer = wx.BoxSizer(wx.VERTICAL)
		#main horizontal sizer
		mhsizer = wx.BoxSizer(wx.HORIZONTAL)

		#places
		splaces =wx.StaticBox(self, label='')
		placessizer = wx.StaticBoxSizer(splaces, wx.VERTICAL)
		ID_Places = wx.NewId()
		self.li = PlaceListCtrl(self, li, ID_Places, size=(570,230), style=wx.LC_VRULES|wx.LC_REPORT|wx.LC_SINGLE_SEL)
		placessizer.Add(self.li, 1, wx.GROW|wx.ALL, 5)

		mhsizer.Add(placessizer, 0, wx.GROW|wx.ALIGN_LEFT|wx.ALL, 0)
		mvsizer.Add(mhsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)

		btnsizer = wx.StdDialogButtonSizer()

		if wx.Platform != '__WXMSW__':
			btn = wx.ContextHelpButton(self)
			btnsizer.AddButton(btn)

		btnOk = wx.Button(self, wx.ID_OK, mtexts.txts['Ok'])
		btnOk.SetHelpText(mtexts.txts['HelpOk'])
		btnOk.SetDefault()
		btnsizer.AddButton(btnOk)
#		self.Bind(wx.EVT_BUTTON, self.onOK, id=wx.ID_OK)

#		btn = wx.Button(self, wx.ID_CANCEL, mtexts.txts['Cancel'])
#		btn.SetHelpText(mtexts.txts['HelpCancel'])
#		btnsizer.AddButton(btn)

		btnsizer.Realize()

		mvsizer.Add(btnsizer, 0, wx.GROW|wx.ALL, 10)
		self.SetSizer(mvsizer)
		mvsizer.Fit(self)

		btnOk.SetFocus()
예제 #16
0
    def __init__(self):
        self.apikey = apikey = ''
        self.steamid = steamid = ''
        self.url = url = 'http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=252490&key={0}&steamid={1}'.format(
            apikey, steamid)
        wx.Dialog.__init__(self, None, title="Please enter player information")
        iconfile = "RustLogo.ico"
        icon = wx.Icon(iconfile, wx.BITMAP_TYPE_ICO)
        self.SetIcon(icon)
        sizer = wx.BoxSizer(wx.VERTICAL)
        label = wx.StaticText(
            self, -1,
            "Please enter your SteamAPI key in the first box. \nEnter the 64bit SteamID of the player you want to query in the second box."
        )
        sizer.Add(label, 0, wx.ALIGN_CENTER | wx.ALL, 5)
        box = wx.BoxSizer(wx.HORIZONTAL)
        label = wx.StaticText(self, -1, "SteamAPI: ")
        box.Add(label, 0, wx.ALIGN_CENTER | wx.ALL, 5)
        self.api_input = api_input = wx.TextCtrl(self, -1, "", size=(80, -1))
        box.Add(api_input, 1, wx.ALIGN_CENTER | wx.ALL, 5)
        sizer.Add(box, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        box = wx.BoxSizer(wx.HORIZONTAL)
        label = wx.StaticText(self, -1, "64bit SteamID: ")
        box.Add(label, 0, wx.ALIGN_CENTER | wx.ALL, 5)
        self.steamid_input = steamid_input = wx.TextCtrl(self,
                                                         -1,
                                                         "",
                                                         size=(80, -1))
        box.Add(steamid_input, 1, wx.ALIGN_CENTER | wx.ALL, 5)
        sizer.Add(box, 0,
                  wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP, 5)
        btnsizer = wx.StdDialogButtonSizer()

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            btnsizer.AddButton(btn)

        btn1 = wx.Button(self, wx.ID_OK)
        btn1.SetDefault()
        btnsizer.AddButton(btn1)
        self.Bind(wx.EVT_BUTTON, self.OnUpdate, btn1)
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        btn2 = wx.Button(self, wx.ID_CANCEL)
        btnsizer.AddButton(btn2)
        self.Bind(wx.EVT_BUTTON, self.OnClose, btn2)
        btnsizer.Realize()
        sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
        self.SetSizer(sizer)
        sizer.Fit(self)
예제 #17
0
    def createOtherStuffHere(self):
        panel = wx.Panel(self)
        panel.SetHelpText("This is a wx.Panel.")

        self.label = wx.StaticText(panel,
                                   style=wx.WS_EX_CONTEXTHELP,
                                   label="Click me I may provide some help?",
                                   size=(200, 30))
        self.label.SetHelpText("This is the help though not so helpful!")

        self.edit = wx.TextCtrl(panel, pos=(20, 50))
        self.edit.SetHelpText("i am a edit box")

        self.helpButton = wx.ContextHelpButton(panel, pos=(20, 100))
예제 #18
0
    def __init__(self, *args, **kwds):
        # begin wxGlade: formJunction.__init__
        kwds[
            "style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.THICK_FRAME
        wx.Dialog.__init__(self, *args, **kwds)
        self.panel_buttons = wx.Panel(self, -1)
        self.panel_configure = wx.ScrolledWindow(self,
                                                 -1,
                                                 style=wx.TAB_TRAVERSAL)
        self.configure_notebook = wx.Notebook(self.panel_configure,
                                              -1,
                                              style=0)
        self.notebook_post = wx.ScrolledWindow(self.configure_notebook,
                                               -1,
                                               style=wx.TAB_TRAVERSAL)
        self.notebook_general = wx.ScrolledWindow(self.configure_notebook,
                                                  -1,
                                                  style=wx.TAB_TRAVERSAL)
        self.data['ndof'] = wx.TextCtrl(self.notebook_general, -1, "3")
        self.label_1 = wx.StaticText(self.notebook_general, -1,
                                     "Number of Nodes: ")
        self.data['nnod'] = wx.TextCtrl(self.notebook_general,
                                        -1,
                                        "",
                                        style=wx.TE_READONLY)
        self.data['modelo_junc'] = wx.RadioBox(self.notebook_general,
                                               -1,
                                               "",
                                               choices=["constant pressure"],
                                               majorDimension=0,
                                               style=wx.RA_SPECIFY_ROWS)
        #self.label_3 = wx.StaticText(self.notebook_general, -1, "State:       ")
        #self.button_5 = wx.Button(self.notebook_general, -1, "...")
        #self.data['histo'] = wx.grid.Grid(self.notebook_general, -1, size=(1, 1))
        self.data['histo'] = wx.CheckListBox(self.notebook_post, -1, (20, 20),
                                             (200, 150), [], wx.LB_MULTIPLE)
        self.data['extras'] = wx.CheckBox(
            self.notebook_post, -1, "Calculate Extras (mass I/O, rate, etc")
        self.data['label'] = wx.TextCtrl(self.notebook_general, -1, "")
        self.accept = wx.Button(self.panel_buttons, wx.ID_OK, "")
        self.cancel = wx.Button(self.panel_buttons, wx.ID_CANCEL, "")
        self.help = wx.ContextHelpButton(self.panel_buttons)

        self.__set_properties()
        self.setContextualHelp()
        self.__do_layout()

        #self.Bind(wx.EVT_TEXT, self.onChangeNdof, self.data['ndof'])
        #self.Bind(wx.EVT_BUTTON, self.onLoadState, self.button_5)
        self.Bind(wx.EVT_BUTTON, self.ConfigureAccept, self.accept)
예제 #19
0
파일: lien.py 프로젝트: Bobby-K/pyProf
    def __init__(self, parent, lien, pathref):
        wx.Dialog.__init__(self, parent, -1, "Sélection de lien")
        self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
        #         self.Create(parent, -1,  "S�lection de lien")

        sizer = wx.BoxSizer(wx.VERTICAL)

        label = wx.StaticText(
            self, -1, "Sélectionner un fichier, un dossier ou une URL")
        label.SetHelpText("Sélectionner un fichier, un dossier ou une URL")
        sizer.Add(label, 0, wx.ALIGN_CENTRE | wx.ALL, 5)

        box = wx.BoxSizer(wx.HORIZONTAL)

        label = wx.StaticText(self, -1, "Lien :")
        #        label.SetHelpText("This is the help text for the label")
        box.Add(label, 0, wx.ALIGN_CENTRE | wx.ALL, 5)

        url = URLSelectorCombo(self, lien, pathref)
        #        text.SetHelpText("Here's some help text for field #1")
        box.Add(url, 1, wx.ALIGN_CENTRE | wx.ALL, 5)
        self.url = url

        sizer.Add(box, 0, wx.GROW | wx.ALL, 5)

        line = wx.StaticLine(self, -1, size=(20, -1), style=wx.LI_HORIZONTAL)
        sizer.Add(line, 0, wx.GROW | wx.RIGHT | wx.TOP, 5)

        btnsizer = wx.StdDialogButtonSizer()

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_OK)
        btn.SetHelpText("Valider")
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_CANCEL)
        btn.SetHelpText("Annuler")
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        sizer.Add(btnsizer, 0, wx.ALL, 5)

        self.SetSizer(sizer)
        sizer.Fit(self)
예제 #20
0
파일: Dialog.py 프로젝트: ZhouYunan/PyMemo
    def __init__(self, parent, id, title, size, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE):
        pre = wx.PreDialog()
        pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
        pre.Create(parent, id, title, pos, size, style)

        self.PostCreate(pre)

        vbox = wx.BoxSizer(wx.VERTICAL)

        hbox = wx.BoxSizer(wx.HORIZONTAL)

        label = wx.StaticText(self, -1, "新建词库的名称:")
        hbox.Add(label, 0, wx.ALIGN_CENTER|wx.ALL, 5)

        text = wx.TextCtrl(self, -1, "", size=(80,-1))
        hbox.Add(text, 1, wx.ALIGN_CENTER|wx.ALL, 5)

        vbox.Add(hbox, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)

        line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL)

        vbox.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5)

        btnsizer = wx.StdDialogButtonSizer()

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_OK, "确定")
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_CANCEL, "取消")
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        vbox.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)

        self.SetSizer(vbox)
        vbox.Fit(self)
        self.Centre()
        self.Show(True)
예제 #21
0
    def __init__(self, parent, quote):
        # context help
        pre = wx.PreDialog()
        pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)

        # pre-init
        self.m_id = wx.NewId()
        self.m_quote = quote
        self.m_parent = parent

        # post-init
        pre.Create(parent,
                   -1,
                   "%s %s - %s" %
                   (message('quote_title'), self.m_quote.ticker(),
                    self.m_quote.market()),
                   size=(560, 370))
        self.PostCreate(pre)

        sizer = wx.BoxSizer(wx.VERTICAL)

        # property panel
        self.m_propwindow = iTradeQuotePropertiesPanel(self, wx.NewId(),
                                                       self.m_quote, None)
        sizer.Add(self.m_propwindow, 0, wx.ALIGN_CENTRE | wx.ALL, 5)

        box = wx.BoxSizer(wx.HORIZONTAL)

        # context help
        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            box.Add(btn, 0, wx.ALIGN_CENTRE | wx.ALL, 5)

        # CLOSE
        btn = wx.Button(self, wx.ID_CANCEL, message('close'))
        btn.SetHelpText(message('close_desc'))
        wx.EVT_BUTTON(self, wx.ID_CANCEL, self.OnClose)
        box.Add(btn, 0, wx.ALIGN_CENTRE | wx.ALL, 5)

        sizer.AddSizer(box, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        self.SetAutoLayout(True)
        self.SetSizerAndFit(sizer)
예제 #22
0
    def __init__(self, *args, **kwds):
        # begin wxGlade: formAtmosphere.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.THICK_FRAME
        wx.Dialog.__init__(self, *args, **kwds)
        self.panel_buttons = wx.Panel(self, -1)
        self.panel_configure = wx.ScrolledWindow(self, -1, style=wx.TAB_TRAVERSAL)
        self.panel = wx.Panel(self.panel_configure, -1)
        self.label_0 = wx.StaticText(self.panel, -1, "Density [kg/m^3]: ")
        self.data['rho'] = wx.TextCtrl(self.panel, -1, "")
        self.label_1 = wx.StaticText(self.panel, -1, "Velocity [m/s]: ")
        self.data['u'] = wx.TextCtrl(self.panel, -1, "")
        self.label_2 = wx.StaticText(self.panel, -1, "Pressure [Pa]: ")
        self.data['p'] = wx.TextCtrl(self.panel, -1, "")
        self.accept = wx.Button(self.panel_buttons, wx.ID_OK, "")
        self.cancel = wx.Button(self.panel_buttons, wx.ID_CANCEL, "")
        self.help = wx.ContextHelpButton(self.panel_buttons)

        self.__set_properties()
        self.setContextualHelp()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.ConfigureAccept, self.accept)
예제 #23
0
    def __init__(self, parent, curSelected=(0, 1)):
        iTradeSizedDialog.__init__(self,
                                   parent,
                                   -1,
                                   message('converter_title'),
                                   size=(420, 420),
                                   style=wx.DEFAULT_DIALOG_STYLE
                                   | wx.RESIZE_BORDER)

        # container
        container = self.GetContentsPane()
        container.SetSizerType("vertical")

        # resizable pane
        pane = sc.SizedPanel(container, -1)
        pane.SetSizerType("form")
        pane.SetSizerProps(expand=True)

        # Row 1 : Org Currency Value
        self.wxOrgVal = masked.Ctrl(pane,
                                    integerWidth=9,
                                    fractionWidth=2,
                                    controlType=masked.controlTypes.NUMBER,
                                    allowNegative=False,
                                    groupDigits=True,
                                    groupChar=getGroupChar(),
                                    decimalChar=getDecimalChar(),
                                    selectOnEntry=True)
        self.wxOrgVal.SetValue(1)
        masked.EVT_NUM(self, self.wxOrgVal.GetId(), self.OnValueChange)

        self.wxOrgCur = wx.ComboBox(pane,
                                    -1,
                                    "",
                                    size=wx.Size(80, -1),
                                    style=wx.CB_DROPDOWN | wx.CB_READONLY)

        list = list_of_currencies()
        (curFrom, curTo) = curSelected

        for c in list:
            self.wxOrgCur.Append(c, c)

        self.wxOrgCur.SetSelection(curFrom)
        self.m_orgcur = list[curFrom]
        wx.EVT_COMBOBOX(self, self.wxOrgCur.GetId(), self.OnOrgCurrency)

        # Row 2 : Dest Currency Value
        self.wxDestVal = wx.StaticText(pane,
                                       -1,
                                       "",
                                       size=(100, -1),
                                       style=wx.ALIGN_RIGHT
                                       | wx.ST_NO_AUTORESIZE)
        self.wxDestVal.SetLabel('')
        self.wxDestVal.SetSizerProps(valign='center')
        self.wxDestCur = wx.ComboBox(pane,
                                     -1,
                                     "",
                                     size=wx.Size(80, -1),
                                     style=wx.CB_DROPDOWN | wx.CB_READONLY)

        for c in list:
            self.wxDestCur.Append(c, c)

        self.wxDestCur.SetSelection(curTo)
        self.m_destcur = list[curTo]
        wx.EVT_COMBOBOX(self, self.wxDestCur.GetId(), self.OnDestCurrency)

        # Last Row : OK and Cancel
        btnpane = sc.SizedPanel(container, -1)
        btnpane.SetSizerType("horizontal")
        btnpane.SetSizerProps(expand=True)

        # context help
        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)

        # CLOSE
        btn = wx.Button(btnpane, wx.ID_CANCEL, message('close'))
        btn.SetHelpText(message('close_desc'))

        # a little trick to make sure that you can't resize the dialog to
        # less screen space than the controls need
        self.Fit()
        self.SetMinSize(self.GetSize())

        EVT_UPDATE_CONVERT(self, self.OnUpdateConvert)

        # convert now
        self.convertValue()
예제 #24
0
    def __init__(
            self, parent, id, title, size=wx.DefaultSize, pos=wx.DefaultPosition,
            style=wx.DEFAULT_DIALOG_STYLE, name='dialog'
            ):

        # Instead of calling wx.Dialog.__init__ we precreate the dialog
        # so we can set an extra style that must be set before
        # creation, and then we create the GUI object using the Create
        # method.
        wx.Dialog.__init__(self)
        self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
        self.Create(parent, id, title, pos, size, style, name)

        # Now continue with the normal construction of the dialog
        # contents
        sizer = wx.BoxSizer(wx.VERTICAL)

        label = wx.StaticText(self, -1, "This is a wx.Dialog")
        label.SetHelpText("This is the help text for the label")
        sizer.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)

        box = wx.BoxSizer(wx.HORIZONTAL)

        label = wx.StaticText(self, -1, "Field #1:")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)

        text = wx.TextCtrl(self, -1, "", size=(80,-1))
        text.SetHelpText("Here's some help text for field #1")
        box.Add(text, 1, wx.ALIGN_CENTRE|wx.ALL, 5)

        sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)

        box = wx.BoxSizer(wx.HORIZONTAL)

        label = wx.StaticText(self, -1, "Field #2:")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 0, wx.ALIGN_CENTRE|wx.ALL, 5)

        text = wx.TextCtrl(self, -1, "", size=(80,-1))
        text.SetHelpText("Here's some help text for field #2")
        box.Add(text, 1, wx.ALIGN_CENTRE|wx.ALL, 5)

        sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)

        line = wx.StaticLine(self, -1, size=(20,-1), style=wx.LI_HORIZONTAL)
        sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5)

        btnsizer = wx.StdDialogButtonSizer()

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_OK)
        btn.SetHelpText("The OK button completes the dialog")
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_CANCEL)
        btn.SetHelpText("The Cancel button cancels the dialog. (Cool, huh?)")
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)

        self.SetSizer(sizer)
        sizer.Fit(self)
예제 #25
0
    def __init__(self, parent, quote, filter = False, market = None, filterEnabled=True, tradableOnly=False):

        iTradeSizedDialog.__init__(self,parent,-1,message('quote_select_title'), size=(460, 460),style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        self.m_parent = parent

        # init
        if quote:
            self.m_isin = quote.isin()
            self.m_ticker = quote.ticker()
            self.m_market = quote.market()
            self.m_place = quote.place()
        else:
            self.m_isin = ''
            self.m_ticker = ''
            self.m_market = market
            self.m_place = market2place(market)

        self.m_filter = filter
        self.m_qlist = QLIST_ALL
        self.m_qlist_tradableOnly = tradableOnly

        self.m_editing = True

        tID = wx.NewId()
        self.m_imagelist = wx.ImageList(16,16)
        self.sm_q = self.m_imagelist.Add(wx.Bitmap(os.path.join(itrade_config.dirRes, 'quote.png')))
        self.sm_i = self.m_imagelist.Add(wx.Bitmap(os.path.join(itrade_config.dirRes, 'invalid.png')))
        self.sm_up = self.m_imagelist.Add(wx.Bitmap(os.path.join(itrade_config.dirRes, 'sm_up.png')))
        self.sm_dn = self.m_imagelist.Add(wx.Bitmap(os.path.join(itrade_config.dirRes, 'sm_down.png')))

        # container
        container = self.GetContentsPane()
        container.SetSizerType("vertical")

        # resizable pane
        pane = sc.SizedPanel(container, -1)
        pane.SetSizerType("horizontal")
        pane.SetSizerProps(expand=True)

        # pane : ISIN or Name selection
        label = wx.StaticText(pane, -1, message('quote_select_isin'))
        label.SetSizerProps(valign='center')

        tID = wx.NewId()
        self.wxIsinCtrl = wx.TextCtrl(pane, tID, self.m_isin)
        self.wxIsinCtrl.SetSizerProps(expand=True)
        wx.EVT_TEXT(self, tID, self.OnISINEdited)

        label = wx.StaticText(pane, -1, message('quote_select_ticker'))
        label.SetSizerProps(valign='center')

        tID = wx.NewId()
        self.wxTickerCtrl = wx.TextCtrl(pane, tID, self.m_ticker)
        self.wxTickerCtrl.SetSizerProps(expand=True)
        wx.EVT_TEXT(self, tID, self.OnTickerEdited)

        # resizable pane
        pane = sc.SizedPanel(container, -1)
        pane.SetSizerType("horizontal")
        pane.SetSizerProps(expand=True)

        # pane : market & list filters
        self.wxLabelMarketCtrl = wx.StaticText(pane, -1, message('quote_select_market'))
        self.wxLabelMarketCtrl.SetSizerProps(valign='center')

        self.wxMarketCtrl = wx.ComboBox(pane,-1, "", style=wx.CB_DROPDOWN|wx.CB_READONLY)
        self.wxMarketCtrl.SetSizerProps(expand=True)
        wx.EVT_COMBOBOX(self,self.wxMarketCtrl.GetId(),self.OnMarket)

        count = 0
        idx = 0
        for eachCtrl in list_of_markets(bFilterMode=False):
            self.wxMarketCtrl.Append(eachCtrl,eachCtrl)
            if eachCtrl==self.m_market:
                idx = count
            count = count + 1

        self.wxMarketCtrl.SetSelection(idx)

        self.wxLabelQListCtrl = wx.StaticText(pane, -1, message('quote_select_list'))
        self.wxLabelQListCtrl.SetSizerProps(valign='center')

        self.wxQListCtrl = wx.ComboBox(pane,-1, "", style=wx.CB_DROPDOWN|wx.CB_READONLY)
        self.wxQListCtrl.SetSizerProps(expand=True)
        wx.EVT_COMBOBOX(self,self.wxQListCtrl.GetId(),self.OnQuoteList)

        self.wxQListCtrl.Append(message('quote_select_alllist'),QLIST_ALL)
        self.wxQListCtrl.Append(message('quote_select_syslist'),QLIST_SYSTEM)
        self.wxQListCtrl.Append(message('quote_select_usrlist'),QLIST_USER)
        if not self.m_qlist_tradableOnly:
            self.wxQListCtrl.Append(message('quote_select_indiceslist'),QLIST_INDICES)
        self.wxQListCtrl.Append(message('quote_select_trackerslist'),QLIST_TRACKERS)
        self.wxQListCtrl.SetSelection(self.m_qlist)

        # select traded or not
        tID = wx.NewId()
        self.wxFilterCtrl = wx.CheckBox(container, tID, message('quote_select_filterfield'))
        self.wxFilterCtrl.SetValue(self.m_filter)
        wx.EVT_CHECKBOX(self, tID, self.OnFilter)
        self.wxFilterCtrl.Enable(filterEnabled)

        # List
        self.m_list = iTradeSelectorListCtrl(container, tID, style = wx.LC_REPORT | wx.SUNKEN_BORDER,size=(440, 380))
        self.m_list.SetSizerProps(expand=True)
        self.m_list.SetImageList(self.m_imagelist, wx.IMAGE_LIST_SMALL)

        # Now that the list exists we can init the other base class,
        # see wxPython/lib/mixins/listctrl.py
        wxl.ColumnSorterMixin.__init__(self, 5)

        wx.EVT_LIST_COL_CLICK(self, tID, self.OnColClick)
        wx.EVT_LIST_ITEM_ACTIVATED(self, tID, self.OnItemActivated)
        wx.EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected)

        # Last Row : OK and Cancel
        btnpane = sc.SizedPanel(container, -1)
        btnpane.SetSizerType("horizontal")
        btnpane.SetSizerProps(expand=True)

        # context help
        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(btnpane)

        # OK
        self.wxOK = wx.Button(btnpane, wx.ID_OK, message('valid'))
        self.wxOK.SetDefault()
        self.wxOK.SetHelpText(message('valid_desc'))
        wx.EVT_BUTTON(self, wx.ID_OK, self.OnValid)

        # CANCEL
        btn = wx.Button(btnpane, wx.ID_CANCEL, message('cancel'))
        btn.SetHelpText(message('cancel_desc'))

        # set the right filter and fit everything
        self.OnFilter()

        EVT_POSTINIT(self, self.OnPostInit)
        wx.PostEvent(self,PostInitEvent())
예제 #26
0
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt,
              pos=wx.Point(556, 295), size=wx.Size(516, 476),
              style=wx.DEFAULT_FRAME_STYLE, title='Everything')
        self._init_utils()
        self.SetClientSize(wx.Size(508, 449))
        self.SetMenuBar(self.menuBar1)
        self.Center(wx.BOTH)

        self.toolBar1 = wx.ToolBar(id=wxID_FRAME1TOOLBAR1, name='toolBar1',
              parent=self, pos=wx.Point(0, 0), size=wx.Size(508, 27),
              style=wx.TB_HORIZONTAL | wx.NO_BORDER)
        self.SetToolBar(self.toolBar1)

        self.statusBar1 = wx.StatusBar(id=wxID_FRAME1STATUSBAR1,
              name='statusBar1', parent=self, style=0)
        self.statusBar1.SetPosition(wx.Point(0, 308))
        self.statusBar1.SetSize(wx.Size(422, 20))
        self._init_coll_statusBar1_Fields(self.statusBar1)
        self.SetStatusBar(self.statusBar1)

        self.notebook1 = wx.Notebook(id=wxID_FRAME1NOTEBOOK1, name='notebook1',
              parent=self, pos=wx.Point(0, 27), size=wx.Size(508, 383),
              style=0)

        self.panel1 = wx.Panel(id=wxID_FRAME1PANEL1, name='panel1',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(500, 357),
              style=wx.TAB_TRAVERSAL)

        self.splitterWindow1 = wx.SplitterWindow(id=wxID_FRAME1SPLITTERWINDOW1,
              name='splitterWindow1', parent=self.panel1, point=wx.Point(8, 8),
              size=wx.Size(200, 100), style=wx.SP_3D)

        self.scrolledWindow1 = wx.ScrolledWindow(id=wxID_FRAME1SCROLLEDWINDOW1,
              name='scrolledWindow1', parent=self.splitterWindow1,
              pos=wx.Point(2, 2), size=wx.Size(98, 96),
              style=wx.SUNKEN_BORDER | wx.TAB_TRAVERSAL)
        self.scrolledWindow1.SetToolTipString('wxScrolledWindow')

        self.sashWindow1 = wx.SashWindow(id=wxID_FRAME1SASHWINDOW1,
              name='sashWindow1', parent=self.splitterWindow1, pos=wx.Point(107,
              2), size=wx.Size(91, 96), style=wx.CLIP_CHILDREN | wx.SW_3D)
        self.splitterWindow1.SplitVertically(self.scrolledWindow1,
              self.sashWindow1, 100)

        self.sashLayoutWindow1 = wx.SashLayoutWindow(id=wxID_FRAME1SASHLAYOUTWINDOW1,
              name='sashLayoutWindow1', parent=self.panel1, pos=wx.Point(8,
              120), size=wx.Size(200, 80), style=wx.CLIP_CHILDREN | wx.SW_3D)

        self.window1 = wx.Window(id=wxID_FRAME1WINDOW1, name='window1',
              parent=self.panel1, pos=wx.Point(216, 120), size=wx.Size(96, 80),
              style=wx.SIMPLE_BORDER)
        self.window1.SetCursor(self.stockCursor1)

        self.dynamicSashWindow1 = wx.gizmos.DynamicSashWindow(id=wxID_FRAME1DYNAMICSASHWINDOW1,
              name='dynamicSashWindow1', parent=self.panel1, pos=wx.Point(216,
              8), size=wx.Size(100, 100), style=wx.CLIP_CHILDREN)

        self.panel2 = wx.Panel(id=wxID_FRAME1PANEL2, name='panel2',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(500, 357),
              style=wx.TAB_TRAVERSAL)

        self.staticText1 = wx.StaticText(id=wxID_FRAME1STATICTEXT1,
              label='staticText1', name='staticText1', parent=self.panel2,
              pos=wx.Point(16, 16), size=wx.Size(52, 13), style=0)

        self.textCtrl1 = wx.TextCtrl(id=wxID_FRAME1TEXTCTRL1, name='textCtrl1',
              parent=self.panel2, pos=wx.Point(16, 40), size=wx.Size(100, 21),
              style=0, value='textCtrl1')

        self.comboBox1 = wx.ComboBox(choices=[], id=wxID_FRAME1COMBOBOX1,
              name='comboBox1', parent=self.panel2, pos=wx.Point(16, 72),
              size=wx.Size(125, 21), style=0, validator=wx.DefaultValidator,
              value='comboBox1')

        self.choice1 = wx.Choice(choices=[], id=wxID_FRAME1CHOICE1,
              name='choice1', parent=self.panel2, pos=wx.Point(16, 104),
              size=wx.Size(125, 21), style=0, validator=wx.DefaultValidator)

        self.checkBox1 = wx.CheckBox(id=wxID_FRAME1CHECKBOX1, label='checkBox1',
              name='checkBox1', parent=self.panel2, pos=wx.Point(16, 136),
              size=wx.Size(73, 13), style=0)

        self.radioButton1 = wx.RadioButton(id=wxID_FRAME1RADIOBUTTON1,
              label='radioButton1', name='radioButton1', parent=self.panel2,
              pos=wx.Point(16, 160), size=wx.Size(80, 20), style=0)

        self.slider1 = wx.Slider(id=wxID_FRAME1SLIDER1, maxValue=100,
              minValue=0, name='slider1', parent=self.panel2,
              point=wx.Point(152, 16), size=wx.Size(136, 20),
              style=wx.SL_HORIZONTAL, validator=wx.DefaultValidator, value=0)
        self.slider1.Bind(wx.EVT_SCROLL, self.OnSlider1Slider)

        self.scrollBar1 = wx.ScrollBar(id=wxID_FRAME1SCROLLBAR1,
              name='scrollBar1', parent=self.panel2, pos=wx.Point(16, 192),
              size=wx.Size(120, 14), style=wx.SB_HORIZONTAL)
        self.scrollBar1.SetThumbPosition(0)

        self.staticBitmap1 = wx.StaticBitmap(bitmap=Everything_img.getBoaBitmap(),
              id=wxID_FRAME1STATICBITMAP1, name='staticBitmap1',
              parent=self.panel2, pos=wx.Point(160, 136), size=wx.Size(16, 16),
              style=0)

        self.staticLine1 = wx.StaticLine(id=wxID_FRAME1STATICLINE1,
              name='staticLine1', parent=self.panel2, pos=wx.Point(15, 216),
              size=wx.Size(121, 2), style=0)

        self.staticBox1 = wx.StaticBox(id=wxID_FRAME1STATICBOX1,
              label='staticBox1', name='staticBox1', parent=self.panel2,
              pos=wx.Point(152, 120), size=wx.Size(144, 40), style=0)

        self.htmlWindow1 = wx.html.HtmlWindow(id=wxID_FRAME1HTMLWINDOW1,
              name='htmlWindow1', parent=self.panel2, pos=wx.Point(152, 168),
              size=wx.Size(144, 80), style=wx.html.HW_SCROLLBAR_AUTO)

        self.lEDNumberCtrl1 = wx.gizmos.LEDNumberCtrl(id=wxID_FRAME1LEDNUMBERCTRL1,
              parent=self.panel2, pos=wx.Point(152, 40), size=wx.Size(136, 40),
              style=wx.gizmos.LED_ALIGN_CENTER)
        self.lEDNumberCtrl1.SetValue('123')

        self.panel3 = wx.Panel(id=wxID_FRAME1PANEL3, name='panel3',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(500, 357),
              style=wx.TAB_TRAVERSAL)

        self.button1 = wx.Button(id=wxID_FRAME1BUTTON1, label='button1',
              name='button1', parent=self.panel3, pos=wx.Point(16, 16),
              size=wx.Size(75, 23), style=0)
        self.button1.Bind(wx.EVT_BUTTON, self.OnButton1Button,
              id=wxID_FRAME1BUTTON1)
        self.button1.Bind(wx.EVT_LEFT_UP, self.OnButton1LeftUp)

        self.bitmapButton1 = wx.BitmapButton(bitmap=Everything_img.getBoaBitmap(),
              id=wxID_FRAME1BITMAPBUTTON1, name='bitmapButton1',
              parent=self.panel3, pos=wx.Point(16, 56), size=wx.Size(72, 24),
              style=wx.BU_AUTODRAW, validator=wx.DefaultValidator)
        self.bitmapButton1.Bind(wx.EVT_BUTTON, self.OnBitmapbutton1Button,
              id=wxID_FRAME1BITMAPBUTTON1)

        self.spinButton1 = wx.SpinButton(id=wxID_FRAME1SPINBUTTON1,
              name='spinButton1', parent=self.panel3, pos=wx.Point(136, 96),
              size=wx.Size(32, 16), style=wx.SP_HORIZONTAL)
        self.spinButton1.Bind(wx.EVT_COMMAND_SCROLL,
              self.OnSpinbutton1CommandScroll, id=wxID_FRAME1SPINBUTTON1)

        self.toggleButton1 = wx.ToggleButton(id=wxID_FRAME1TOGGLEBUTTON1,
              label='toggleButton1', name='toggleButton1', parent=self.panel3,
              pos=wx.Point(104, 16), size=wx.Size(81, 23), style=0)
        self.toggleButton1.Bind(wx.EVT_BUTTON, self.OnTogglebutton1Button,
              id=wxID_FRAME1TOGGLEBUTTON1)

        self.genButton1 = wx.lib.buttons.GenButton(ID=wxID_FRAME1GENBUTTON1,
              label='genButton1', name='genButton1', parent=self.panel3,
              pos=wx.Point(16, 160), size=wx.Size(88, 37), style=0)

        self.genBitmapButton1 = wx.lib.buttons.GenBitmapButton(ID=wxID_FRAME1GENBITMAPBUTTON1,
              bitmap=Everything_img.getBoaBitmap(), name='genBitmapButton1',
              parent=self.panel3, pos=wx.Point(16, 192), size=wx.Size(59, 58),
              style=0)

        self.genToggleButton1 = wx.lib.buttons.GenToggleButton(ID=wxID_FRAME1GENTOGGLEBUTTON1,
              label='genToggleButton1', name='genToggleButton1',
              parent=self.panel3, pos=wx.Point(104, 160), size=wx.Size(113, 37),
              style=0)

        self.genBitmapToggleButton1 = wx.lib.buttons.GenBitmapToggleButton(ID=wxID_FRAME1GENBITMAPTOGGLEBUTTON1,
              bitmap=Everything_img.getBoaBitmap(),
              name='genBitmapToggleButton1', parent=self.panel3,
              pos=wx.Point(72, 192), size=wx.Size(59, 58), style=0)

        self.genBitmapTextToggleButton1 = wx.lib.buttons.GenBitmapTextToggleButton(ID=wxID_FRAME1GENBITMAPTEXTTOGGLEBUTTON1,
              bitmap=Everything_img.getBoaBitmap(),
              label='genBitmapTextToggleButton1',
              name='genBitmapTextToggleButton1', parent=self.panel3,
              pos=wx.Point(128, 192), size=wx.Size(88, 58), style=0)

        self.contextHelpButton1 = wx.ContextHelpButton(parent=self.panel3,
              pos=wx.Point(136, 64), size=wx.Size(20, 19),
              style=wx.BU_AUTODRAW)

        self.panel4 = wx.Panel(id=wxID_FRAME1PANEL4, name='panel4',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(500, 357),
              style=wx.TAB_TRAVERSAL)

        self.radioBox1 = wx.RadioBox(choices=['asd'], id=wxID_FRAME1RADIOBOX1,
              label='radioBox1', majorDimension=1, name='radioBox1',
              parent=self.panel4, point=wx.Point(16, 16), size=wx.DefaultSize,
              style=wx.RA_SPECIFY_COLS, validator=wx.DefaultValidator)

        self.listBox1 = wx.ListBox(choices=[], id=wxID_FRAME1LISTBOX1,
              name='listBox1', parent=self.panel4, pos=wx.Point(16, 64),
              size=wx.Size(115, 63), style=0, validator=wx.DefaultValidator)

        self.checkListBox1 = wx.CheckListBox(choices=[],
              id=wxID_FRAME1CHECKLISTBOX1, name='checkListBox1',
              parent=self.panel4, pos=wx.Point(16, 136), size=wx.Size(115, 63),
              style=0, validator=wx.DefaultValidator)

        self.grid1 = wx.grid.Grid(id=wxID_FRAME1GRID1, name='grid1',
              parent=self.panel4, pos=wx.Point(144, 16), size=wx.Size(128, 112),
              style=0)

        self.listCtrl1 = wx.ListCtrl(id=wxID_FRAME1LISTCTRL1, name='listCtrl1',
              parent=self.panel4, pos=wx.Point(280, 16), size=wx.Size(100, 30),
              style=wx.LC_ICON, validator=wx.DefaultValidator)

        self.treeCtrl1 = wx.TreeCtrl(id=wxID_FRAME1TREECTRL1, name='treeCtrl1',
              parent=self.panel4, pos=wx.Point(280, 56), size=wx.Size(100, 80),
              style=wx.TR_HAS_BUTTONS, validator=wx.DefaultValidator)

        self.editableListBox1 = wx.gizmos.EditableListBox(id=wxID_FRAME1EDITABLELISTBOX1,
              label='editableListBox1', name='editableListBox1',
              parent=self.panel4, pos=wx.Point(152, 152), size=wx.Size(200,
              100))

        self.panel5 = wx.Panel(id=wxID_FRAME1PANEL5, name='panel5',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(500, 357),
              style=wx.TAB_TRAVERSAL)
        self.panel5.SetAutoLayout(True)

        self.window2 = wx.Window(id=wxID_FRAME1WINDOW2, name='window2',
              parent=self.panel5, pos=wx.Point(446, 16), size=wx.Size(40, 40),
              style=0)
        self.window2.SetBackgroundColour(wx.Colour(128, 255, 0))
        self.window2.SetConstraints(LayoutAnchors(self.window2, False, True,
              True, False))

        self.window3 = wx.Window(id=wxID_FRAME1WINDOW3, name='window3',
              parent=self.panel5, pos=wx.Point(16, 299), size=wx.Size(40, 40),
              style=0)
        self.window3.SetBackgroundColour(wx.Colour(128, 255, 0))
        self.window3.SetConstraints(LayoutAnchors(self.window3, True, False,
              False, True))

        self.window4 = wx.Window(id=wxID_FRAME1WINDOW4, name='window4',
              parent=self.panel5, pos=wx.Point(446, 299), size=wx.Size(40, 40),
              style=0)
        self.window4.SetBackgroundColour(wx.Colour(128, 255, 0))
        self.window4.SetConstraints(LayoutAnchors(self.window4, False, False,
              True, True))

        self.window5 = wx.Window(id=wxID_FRAME1WINDOW5, name='window5',
              parent=self.panel5, pos=wx.Point(16, 16), size=wx.Size(40, 40),
              style=0)
        self.window5.SetBackgroundColour(wx.Colour(128, 255, 0))
        self.window5.SetConstraints(LayoutAnchors(self.window5, True, True,
              False, False))

        self.window6 = wx.Window(id=wxID_FRAME1WINDOW6, name='window6',
              parent=self.panel5, pos=wx.Point(192, 16), size=wx.Size(126, 40),
              style=0)
        self.window6.SetBackgroundColour(wx.Colour(128, 255, 0))
        self.window6.SetConstraints(LayoutAnchors(self.window6, True, True,
              True, False))

        self.window7 = wx.Window(id=wxID_FRAME1WINDOW7, name='window7',
              parent=self.panel5, pos=wx.Point(446, 120), size=wx.Size(40, 115),
              style=0)
        self.window7.SetBackgroundColour(wx.Colour(128, 255, 0))
        self.window7.SetConstraints(LayoutAnchors(self.window7, False, True,
              True, True))

        self.window8 = wx.Window(id=wxID_FRAME1WINDOW8, name='window8',
              parent=self.panel5, pos=wx.Point(192, 299), size=wx.Size(126, 40),
              style=0)
        self.window8.SetBackgroundColour(wx.Colour(128, 255, 0))
        self.window8.SetConstraints(LayoutAnchors(self.window8, True, False,
              True, True))

        self.window9 = wx.Window(id=wxID_FRAME1WINDOW9, name='window9',
              parent=self.panel5, pos=wx.Point(16, 120), size=wx.Size(40, 115),
              style=0)
        self.window9.SetBackgroundColour(wx.Colour(128, 255, 0))
        self.window9.SetConstraints(LayoutAnchors(self.window9, True, True,
              False, True))

        self.window10 = wx.Window(id=wxID_FRAME1WINDOW10, name='window10',
              parent=self.panel5, pos=wx.Point(225, 147), size=wx.Size(40, 40),
              style=0)
        self.window10.SetBackgroundColour(wx.Colour(128, 255, 0))
        self.window10.SetConstraints(LayoutAnchors(self.window10, False, False,
              False, False))

        self.panel6 = wx.Panel(id=wxID_FRAME1PANEL6, name='panel6',
              parent=self.notebook1, pos=wx.Point(0, 0), size=wx.Size(500, 357),
              style=wx.TAB_TRAVERSAL)

        self.gauge1 = wx.Gauge(id=wxID_FRAME1GAUGE1, name='gauge1',
              parent=self.panel2, pos=wx.Point(152, 88), range=100,
              size=wx.Size(136, 16), style=wx.GA_SMOOTH | wx.GA_HORIZONTAL,
              validator=wx.DefaultValidator)
        self.gauge1.SetValue(50)

        self._init_coll_toolBar1_Tools(self.toolBar1)
        self._init_coll_notebook1_Pages(self.notebook1)
예제 #27
0
	def __init__(self, parent, options, ephepath):
		super(PrimDirsDlg, self).__init__()
        # Instead of calling wx.Dialog.__init__ we precreate the dialog
        # so we can set an extra style that must be set before
        # creation, and then we create the GUI object using the Create
        # method.
		#pre = wx.Dialog()
		#pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
		#pre.Create(parent, -1, mtexts.txts['PrimaryDirs'], pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)

		wx.Dialog.__init__(self)
		self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
		self.Create(parent, -1, mtexts.txts['PrimaryDirs'], pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)

        # This next step is the most important, it turns this Python
        # object into the real wrapper of the dialog (instead of pre)
        # as far as the wxPython extension is concerned.
		#self.PostCreate(pre)

		self.parent = parent
		self.options = options
		self.ephepath = ephepath

		self.fsselections = self.options.pdfixstarssel[:]

		self.cpdlons = options.pdcustomerlon[:]
		self.cpdlats = options.pdcustomerlat[:]
		self.southern = options.pdcustomersouthern

		self.cpd2lons = options.pdcustomer2lon[:]
		self.cpd2lats = options.pdcustomer2lat[:]
		self.southern2 = options.pdcustomer2southern

		#main vertical sizer
		mvsizer = wx.BoxSizer(wx.VERTICAL)
		#main horizontal sizer
		mhsizer = wx.BoxSizer(wx.HORIZONTAL)

		#Type
		stype = wx.StaticBox(self, label='')
		typesizer = wx.StaticBoxSizer(stype, wx.VERTICAL)
		self.placidiansemiarcrb = wx.RadioButton(self, -1, mtexts.txts['PlacidianSemiArc'], style=wx.RB_GROUP)
		typesizer.Add(self.placidiansemiarcrb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 5)
		self.placidiansemiarcrb.SetHelpText(mtexts.txts['HelpPlacidianSemiArc'])
		self.placidianutprb = wx.RadioButton(self, -1, mtexts.txts['PlacidianUnderThePole'])
		typesizer.Add(self.placidianutprb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 5)
		self.placidianutprb.SetHelpText(mtexts.txts['HelpPlacidianUnderThePole'])
		self.regiomontanrb = wx.RadioButton(self, -1, mtexts.txts['Regiomontan'])
		typesizer.Add(self.regiomontanrb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 5)
		self.regiomontanrb.SetHelpText(mtexts.txts['HelpRegiomontan'])
		self.campanianrb = wx.RadioButton(self, -1, mtexts.txts['Campanian'])
		typesizer.Add(self.campanianrb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 5)
		self.campanianrb.SetHelpText(mtexts.txts['HelpCampanian'])
		self.Bind(wx.EVT_RADIOBUTTON, self.onPlacidian, id=self.placidiansemiarcrb.GetId())
		self.Bind(wx.EVT_RADIOBUTTON, self.onPlacidianUTP, id=self.placidianutprb.GetId())
		self.Bind(wx.EVT_RADIOBUTTON, self.onRegiomontan, id=self.regiomontanrb.GetId())
		self.Bind(wx.EVT_RADIOBUTTON, self.onCampanian, id=self.campanianrb.GetId())

#		self.placidianutprb.Enable(False)

		vsizer = wx.BoxSizer(wx.VERTICAL)
		vsizer.Add(typesizer, 1, wx.GROW|wx.ALIGN_LEFT|wx.TOP, 5)

		#Subtype
		vzodsizer = wx.BoxSizer(wx.VERTICAL)
		label = wx.StaticText(self, -1, mtexts.txts['UseSZ']+':')
		vzodsizer.Add(label, 0, wx.ALIGN_LEFT|wx.ALL, 2)
		self.szneitherrb = wx.RadioButton(self, -1, mtexts.txts['SZNeither'], style=wx.RB_GROUP)
		self.szneitherrb.SetHelpText(mtexts.txts['HelpSZNeither'])
		vzodsizer.Add(self.szneitherrb, 0, wx.ALIGN_LEFT|wx.ALL, 2)
		self.szpromissorrb = wx.RadioButton(self, -1, mtexts.txts['SZPromissor'])
		self.szpromissorrb.SetHelpText(mtexts.txts['HelpSZPromissor'])
		vzodsizer.Add(self.szpromissorrb, 0, wx.ALIGN_LEFT|wx.ALL, 2)
		self.szsignificatorrb = wx.RadioButton(self, -1, mtexts.txts['SZSignificator'])
		self.szsignificatorrb.SetHelpText(mtexts.txts['HelpSZSignificator'])
		vzodsizer.Add(self.szsignificatorrb, 0, wx.ALIGN_LEFT|wx.ALL, 2)
		self.szbothrb = wx.RadioButton(self, -1, mtexts.txts['SZBoth'])
		self.szbothrb.SetHelpText(mtexts.txts['HelpSZBoth'])
		vzodsizer.Add(self.szbothrb, 0, wx.ALIGN_LEFT|wx.ALL, 2)
		hzodsizer = wx.BoxSizer(wx.HORIZONTAL)
		self.szbianchinickb = wx.CheckBox(self, -1, mtexts.txts['Bianchini'])
		hzodsizer.Add(self.szbianchinickb, 0, wx.ALIGN_LEFT|wx.LEFT, 20)
		vzodsizer.Add(hzodsizer, 0, wx.ALIGN_LEFT|wx.ALL, 2)

		ssubtype = wx.StaticBox(self, label='')
		subtypesizer = wx.StaticBoxSizer(ssubtype, wx.VERTICAL)
		self.mundanerb = wx.RadioButton(self, -1, mtexts.txts['Mundane'], style=wx.RB_GROUP)
		subtypesizer.Add(self.mundanerb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 5)
		self.mundanerb.SetHelpText(mtexts.txts['HelpMundane'])
		self.zodiacalrb = wx.RadioButton(self, -1, mtexts.txts['Zodiacal'])
		self.zodiacalrb.SetHelpText(mtexts.txts['HelpZodiacal'])
		subtypesizer.Add(self.zodiacalrb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 5)
		subtypesizer.Add(vzodsizer, 0, wx.ALIGN_LEFT|wx.LEFT, 20)
		self.bothrb = wx.RadioButton(self, -1, mtexts.txts['Both'])
		subtypesizer.Add(self.bothrb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 5)

		self.Bind(wx.EVT_RADIOBUTTON, self.onMundane, id=self.mundanerb.GetId())
		self.Bind(wx.EVT_RADIOBUTTON, self.onZodiacal, id=self.zodiacalrb.GetId())
		self.Bind(wx.EVT_RADIOBUTTON, self.onSZNeither, id=self.szneitherrb.GetId())
		self.Bind(wx.EVT_RADIOBUTTON, self.onSZPromissor, id=self.szpromissorrb.GetId())
		self.Bind(wx.EVT_RADIOBUTTON, self.onSZSignificator, id=self.szsignificatorrb.GetId())
		self.Bind(wx.EVT_RADIOBUTTON, self.onSZBoth, id=self.szbothrb.GetId())
		self.Bind(wx.EVT_RADIOBUTTON, self.onBoth, id=self.bothrb.GetId())

		vsizer.Add(subtypesizer, 0, wx.GROW|wx.ALIGN_LEFT|wx.BOTTOM, 5)

		self.zodopt = wx.StaticBox(self, label=mtexts.txts['ZodiacalOpts'])
		zodoptsizer = wx.StaticBoxSizer(self.zodopt, wx.VERTICAL)
		self.aspspromstosigsckb = wx.CheckBox(self, -1, mtexts.txts['ZodAspsPromsToSigs1'])
		zodoptsizer.Add(self.aspspromstosigsckb, 0, wx.ALIGN_LEFT|wx.TOP|wx.LEFT|wx.RIGHT, 5)
		vsubsizer = wx.BoxSizer(wx.VERTICAL)
		self.labelzodopt1 = wx.StaticText(self, -1, mtexts.txts['ZodAspsPromsToSigs2'])
		vsubsizer.Add(self.labelzodopt1, 0, wx.ALIGN_LEFT|wx.LEFT, 30)
		zodoptsizer.Add(vsubsizer, 0, wx.ALIGN_LEFT|wx.ALL, 2)
		self.promstosigaspsckb = wx.CheckBox(self, -1, mtexts.txts['ZodPromsToSigAsps1'])
		zodoptsizer.Add(self.promstosigaspsckb, 0, wx.ALIGN_LEFT|wx.TOP|wx.LEFT|wx.RIGHT, 5)
		vsubsizer = wx.BoxSizer(wx.VERTICAL)
		self.labelzodopt2 = wx.StaticText(self, -1, mtexts.txts['ZodPromsToSigAsps2'])
		vsubsizer.Add(self.labelzodopt2, 0, wx.ALIGN_LEFT|wx.LEFT, 30)
		zodoptsizer.Add(vsubsizer, 0, wx.ALIGN_LEFT|wx.ALL, 2)
		self.ascmchcsaqspromsckb = wx.CheckBox(self, -1, mtexts.txts['ZodAscMCHCsAsProms'])
		zodoptsizer.Add(self.ascmchcsaqspromsckb, 0, wx.ALIGN_LEFT|wx.TOP|wx.LEFT|wx.RIGHT, 5)

		vsizer.Add(zodoptsizer, 0, wx.GROW|wx.ALIGN_LEFT|wx.BOTTOM, 5)
		mhsizer.Add(vsizer, 0, wx.GROW|wx.ALIGN_LEFT|wx.LEFT, 0)

		#Apply
		sapply = wx.StaticBox(self, label='')
		applysizer = wx.StaticBoxSizer(sapply, wx.VERTICAL)
		fgsizer = wx.FlexGridSizer(2, gap=wx.Size(0,0))
		vsizer = wx.BoxSizer(wx.VERTICAL)
		label = wx.StaticText(self, -1, mtexts.txts['Promissors'])
		vsizer.Add(label, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promsunckb = wx.CheckBox(self, -1, mtexts.txts['Sun'])
		vsizer.Add(self.promsunckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.prommoonckb = wx.CheckBox(self, -1, mtexts.txts['Moon'])
		vsizer.Add(self.prommoonckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		hsubsizer = wx.BoxSizer(wx.HORIZONTAL)
		vsubsizer = wx.BoxSizer(wx.VERTICAL)
		self.secmotionckb = wx.CheckBox(self, -1, mtexts.txts['SecondaryMotion'])
		vsubsizer.Add(self.secmotionckb, 0)#, wx.ALIGN_LEFT|wx.LEFT, 15)
		self.secmotionitercb = wx.ComboBox(self, -1, mtexts.smiterList[0], size=(100, -1), choices=mtexts.smiterList, style=wx.CB_DROPDOWN|wx.CB_READONLY)
		vsubsizer.Add(self.secmotionitercb, 0)#, wx.ALIGN_LEFT|wx.LEFT, 15)
		hsubsizer.Add(vsubsizer, 0, wx.ALIGN_LEFT|wx.LEFT, 15)
		vsizer.Add(hsubsizer, 0, wx.ALIGN_LEFT|wx.ALL, 2)
		self.prommercuryckb = wx.CheckBox(self, -1, mtexts.txts['Mercury'])
		vsizer.Add(self.prommercuryckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promvenusckb = wx.CheckBox(self, -1, mtexts.txts['Venus'])
		vsizer.Add(self.promvenusckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.prommarsckb = wx.CheckBox(self, -1, mtexts.txts['Mars'])
		vsizer.Add(self.prommarsckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promjupiterckb = wx.CheckBox(self, -1, mtexts.txts['Jupiter'])
		vsizer.Add(self.promjupiterckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promsaturnckb = wx.CheckBox(self, -1, mtexts.txts['Saturn'])
		vsizer.Add(self.promsaturnckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promuranusckb = wx.CheckBox(self, -1, mtexts.txts['Uranus'])
		vsizer.Add(self.promuranusckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promneptuneckb = wx.CheckBox(self, -1, mtexts.txts['Neptune'])
		vsizer.Add(self.promneptuneckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promplutockb = wx.CheckBox(self, -1, mtexts.txts['Pluto'])
		vsizer.Add(self.promplutockb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promanodeckb = wx.CheckBox(self, -1, mtexts.txts['AscNode'])
		vsizer.Add(self.promanodeckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promdnodeckb = wx.CheckBox(self, -1, mtexts.txts['DescNode'])
		vsizer.Add(self.promdnodeckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promantsckb = wx.CheckBox(self, -1, mtexts.txts['Antiscia'])
		vsizer.Add(self.promantsckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.prommidpointsckb = wx.CheckBox(self, -1, mtexts.txts['MidPoints'])
		vsizer.Add(self.prommidpointsckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promlofckb = wx.CheckBox(self, -1, mtexts.txts['LoF'])
		vsizer.Add(self.promlofckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.promtermsckb = wx.CheckBox(self, -1, mtexts.txts['Terms2'])
		vsizer.Add(self.promtermsckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		hsizer = wx.BoxSizer(wx.HORIZONTAL)
		self.promfixstarsckb = wx.CheckBox(self, -1, '')
		hsizer.Add(self.promfixstarsckb, 0, wx.ALIGN_LEFT|wx.ALIGN_CENTER_VERTICAL)
		ID_FixStars = wx.NewId()
		self.btnFixStars = wx.Button(self, ID_FixStars, mtexts.txts['FixStars2'])
		if not options.pdfixstars:
			self.btnFixStars.Enable(False)
		self.Bind(wx.EVT_BUTTON, self.onFixStars, id=ID_FixStars)
		self.Bind(wx.EVT_CHECKBOX, self.onFixStarsCheck, id=self.promfixstarsckb.GetId())
		hsizer.Add(self.btnFixStars, 0, wx.ALIGN_LEFT)
		vsizer.Add(hsizer, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)

		self.Bind(wx.EVT_CHECKBOX, self.onPromMoon, id=self.prommoonckb.GetId())

		fgsizer.Add(vsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)

		vsizer = wx.BoxSizer(wx.VERTICAL)
		self.conjunctiockb = wx.CheckBox(self, -1, mtexts.txts['Conjunctio'])
		vsizer.Add(self.conjunctiockb, 0, wx.ALIGN_LEFT|wx.TOP, 20)
		self.semisextilckb = wx.CheckBox(self, -1, mtexts.txts['Semisextil'])
		vsizer.Add(self.semisextilckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.semiquadratckb = wx.CheckBox(self, -1, mtexts.txts['Semiquadrat'])
		vsizer.Add(self.semiquadratckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.sextilckb = wx.CheckBox(self, -1, mtexts.txts['Sextil'])
		vsizer.Add(self.sextilckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.quintileckb = wx.CheckBox(self, -1, mtexts.txts['Quintile'])
		vsizer.Add(self.quintileckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.quadratckb = wx.CheckBox(self, -1, mtexts.txts['Quadrat'])
		vsizer.Add(self.quadratckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.trigonckb = wx.CheckBox(self, -1, mtexts.txts['Trigon'])
		vsizer.Add(self.trigonckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.sesquiquadratckb = wx.CheckBox(self, -1, mtexts.txts['Sesquiquadrat'])
		vsizer.Add(self.sesquiquadratckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.biquintileckb = wx.CheckBox(self, -1, mtexts.txts['Biquintile'])
		vsizer.Add(self.biquintileckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.quinqunxckb = wx.CheckBox(self, -1, mtexts.txts['Quinqunx'])
		vsizer.Add(self.quinqunxckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.oppositiockb = wx.CheckBox(self, -1, mtexts.txts['Oppositio'])
		vsizer.Add(self.oppositiockb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.mundaneparckb = wx.CheckBox(self, -1, mtexts.txts['Parallel'])
		vsizer.Add(self.mundaneparckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)
		self.raptparckb = wx.CheckBox(self, -1, mtexts.txts['RaptParallel'])
		vsizer.Add(self.raptparckb, 0, wx.ALIGN_LEFT|wx.TOP, 2)

		scustomer = wx.StaticBox(self, label=mtexts.txts['Promissors'])
		customersizer = wx.StaticBoxSizer(scustomer, wx.VERTICAL)
		vsubsizer = wx.BoxSizer(wx.VERTICAL)
		hsizer = wx.BoxSizer(wx.HORIZONTAL)
		self.customerckb = wx.CheckBox(self, -1, '')
		hsizer.Add(self.customerckb, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT)
		ID_Customer = wx.NewId()
		self.btnCustomer = wx.Button(self, ID_Customer, mtexts.txts['Customer2'])
		self.Bind(wx.EVT_BUTTON, self.onCustomer, id=ID_Customer)
		self.Bind(wx.EVT_CHECKBOX, self.onCustomerCheck, id=self.customerckb.GetId())
		hsizer.Add(self.btnCustomer, 0, wx.ALIGN_LEFT)
		vsubsizer.Add(hsizer, 0, wx.ALIGN_LEFT|wx.TOP|wx.BOTTOM, 2)
		customersizer.Add(vsubsizer, 0, wx.ALIGN_LEFT|wx.ALL, 2)
		vsizer.Add(customersizer, 0, wx.ALIGN_LEFT|wx.TOP, 10)

		scustomer2 = wx.StaticBox(self, label=mtexts.txts['Significators'])
		customer2sizer = wx.StaticBoxSizer(scustomer2, wx.VERTICAL)
		vsubsizer = wx.BoxSizer(wx.VERTICAL)
		hsizer = wx.BoxSizer(wx.HORIZONTAL)
		self.customer2ckb = wx.CheckBox(self, -1, '')
		hsizer.Add(self.customer2ckb, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT)
		ID_Customer2 = wx.NewId()
		self.btnCustomer2 = wx.Button(self, ID_Customer2, mtexts.txts['User2'])
		self.Bind(wx.EVT_BUTTON, self.onCustomer2, id=ID_Customer2)
		self.Bind(wx.EVT_CHECKBOX, self.onCustomer2Check, id=self.customer2ckb.GetId())
		hsizer.Add(self.btnCustomer2, 0, wx.ALIGN_LEFT)
		vsubsizer.Add(hsizer, 0, wx.ALIGN_LEFT|wx.TOP|wx.BOTTOM, 2)
		customer2sizer.Add(vsubsizer, 0, wx.ALIGN_LEFT|wx.ALL, 2)
		vsizer.Add(customer2sizer, 0, wx.ALIGN_LEFT|wx.TOP, 5)

		fgsizer.Add(vsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)

		vsizer = wx.BoxSizer(wx.VERTICAL)
		label = wx.StaticText(self, -1, mtexts.txts['Significators'])
		vsizer.Add(label, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigascckb = wx.CheckBox(self, -1, 'Asc')
		vsizer.Add(self.sigascckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigmcckb = wx.CheckBox(self, -1, 'MC')
		vsizer.Add(self.sigmcckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sighousecuspsckb = wx.CheckBox(self, -1, mtexts.txts['HouseCusps'])
		vsizer.Add(self.sighousecuspsckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)

		self.sigsunckb = wx.CheckBox(self, -1, mtexts.txts['Sun'])
		vsizer.Add(self.sigsunckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigmoonckb = wx.CheckBox(self, -1, mtexts.txts['Moon'])
		vsizer.Add(self.sigmoonckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigmercuryckb = wx.CheckBox(self, -1, mtexts.txts['Mercury'])
		vsizer.Add(self.sigmercuryckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigvenusckb = wx.CheckBox(self, -1, mtexts.txts['Venus'])
		vsizer.Add(self.sigvenusckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigmarsckb = wx.CheckBox(self, -1, mtexts.txts['Mars'])
		vsizer.Add(self.sigmarsckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigjupiterckb = wx.CheckBox(self, -1, mtexts.txts['Jupiter'])
		vsizer.Add(self.sigjupiterckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigsaturnckb = wx.CheckBox(self, -1, mtexts.txts['Saturn'])
		vsizer.Add(self.sigsaturnckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.siguranusckb = wx.CheckBox(self, -1, mtexts.txts['Uranus'])
		vsizer.Add(self.siguranusckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.signeptuneckb = wx.CheckBox(self, -1, mtexts.txts['Neptune'])
		vsizer.Add(self.signeptuneckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigplutockb = wx.CheckBox(self, -1, mtexts.txts['Pluto'])
		vsizer.Add(self.sigplutockb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.siganodeckb = wx.CheckBox(self, -1, mtexts.txts['AscNode'])
		vsizer.Add(self.siganodeckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigdnodeckb = wx.CheckBox(self, -1, mtexts.txts['DescNode'])
		vsizer.Add(self.sigdnodeckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.siglofckb = wx.CheckBox(self, -1, mtexts.txts['LoF'])
		vsizer.Add(self.siglofckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.sigsyzckb = wx.CheckBox(self, -1, mtexts.txts['Syzygy'])
		vsizer.Add(self.sigsyzckb, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)

		fgsizer.Add(vsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)

		vsizer = wx.BoxSizer(wx.VERTICAL)
		ID_PromissorsDes = wx.NewId()
		btn = wx.Button(self, ID_PromissorsDes, mtexts.txts['DeselectAll'])
		vsizer.Add(btn, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.Bind(wx.EVT_BUTTON, self.onPromissorsDes, id=ID_PromissorsDes)
		ID_PromissorsSel = wx.NewId()
		btn = wx.Button(self, ID_PromissorsSel, mtexts.txts['SelectAll'])
		vsizer.Add(btn, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.Bind(wx.EVT_BUTTON, self.onPromissorsSel, id=ID_PromissorsSel)

		fgsizer.Add(vsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)

		vsizer = wx.BoxSizer(wx.VERTICAL)
		ID_AspectsDes = wx.NewId()
		btn = wx.Button(self, ID_AspectsDes, mtexts.txts['DeselectAll'])
		vsizer.Add(btn, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.Bind(wx.EVT_BUTTON, self.onAspectsDes, id=ID_AspectsDes)
		ID_AspectsSel = wx.NewId()
		btn = wx.Button(self, ID_AspectsSel, mtexts.txts['SelectAll'])
		vsizer.Add(btn, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.Bind(wx.EVT_BUTTON, self.onAspectsSel, id=ID_AspectsSel)

		fgsizer.Add(vsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)

		vsizer = wx.BoxSizer(wx.VERTICAL)
		ID_SignificatorsDes = wx.NewId()
		btn = wx.Button(self, ID_SignificatorsDes, mtexts.txts['DeselectAll'])
		vsizer.Add(btn, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.Bind(wx.EVT_BUTTON, self.onSignificatorsDes, id=ID_SignificatorsDes)
		ID_SignificatorsSel = wx.NewId()
		btn = wx.Button(self, ID_SignificatorsSel, mtexts.txts['SelectAll'])
		vsizer.Add(btn, 0, wx.ALIGN_LEFT|wx.ALL|wx.TOP, 2)
		self.Bind(wx.EVT_BUTTON, self.onSignificatorsSel, id=ID_SignificatorsSel)

		fgsizer.Add(vsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)
		applysizer.Add(fgsizer, 0, wx.ALIGN_LEFT, 5)
		mhsizer.Add(applysizer, 0, wx.GROW|wx.ALIGN_LEFT|wx.ALL, 5)
		mvsizer.Add(mhsizer, 0, wx.GROW|wx.ALIGN_LEFT|wx.LEFT, 5)

		btnsizer = wx.StdDialogButtonSizer()

		if wx.Platform != '__WXMSW__':
			btn = wx.ContextHelpButton(self)
			btnsizer.AddButton(btn)

		btnOk = wx.Button(self, wx.ID_OK, mtexts.txts['Ok'])
		btnsizer.AddButton(btnOk)
		btnOk.SetHelpText(mtexts.txts['HelpOk'])
		btnOk.SetDefault()

		btn = wx.Button(self, wx.ID_CANCEL, mtexts.txts['Cancel'])
		btnsizer.AddButton(btn)
		btn.SetHelpText(mtexts.txts['HelpCancel'])

		btnsizer.Realize()
		mvsizer.Add(btnsizer, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 10)

		self.SetSizer(mvsizer)
		mvsizer.Fit(self)

		btnOk.SetFocus()
예제 #28
0
	def __init__(self, parent, time):
		super(TransitMonthDlg, self).__init__()
        # Instead of calling wx.Dialog.__init__ we precreate the dialog
        # so we can set an extra style that must be set before
        # creation, and then we create the GUI object using the Create
        # method.

		#pre = wx.Dialog()
		#pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
		#pre.Create(parent, -1, mtexts.txts['Transit'].capitalize(), pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)

		wx.Dialog.__init__(self)
		self.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
		self.Create(parent, -1, mtexts.txts['Transit'].capitalize(), pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)

        # This next step is the most important, it turns this Python
        # object into the real wrapper of the dialog (instead of pre)
        # as far as the wxPython extension is concerned.
		#self.PostCreate(pre)

		#main vertical sizer
		mvsizer = wx.BoxSizer(wx.VERTICAL)

		#Time
		rnge = 3000
		checker = rangechecker.RangeChecker()
		if checker.isExtended():
			rnge = 5000
		self.stime =wx.StaticBox(self, label='')
		timesizer = wx.StaticBoxSizer(self.stime, wx.VERTICAL)
		vsizer = wx.BoxSizer(wx.VERTICAL)
		fgsizer = wx.FlexGridSizer(1, gap=wx.Size(0,0))
		label = wx.StaticText(self, -1, mtexts.txts['Year']+':')
		vsizer.Add(label, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.LEFT, 0)
		self.year = wx.TextCtrl(self, -1, '', validator=intvalidator.IntValidator(0, rnge), size=(50,-1))
		vsizer.Add(self.year, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.LEFT, 0)
		fgsizer.Add(vsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)
		if checker.isExtended():
			self.year.SetHelpText(mtexts.txts['HelpYear'])
		else:
			self.year.SetHelpText(mtexts.txts['HelpYear2'])
		self.year.SetMaxLength(4)
		vsizer = wx.BoxSizer(wx.VERTICAL)
		label = wx.StaticText(self, -1, mtexts.txts['Month']+':')
		vsizer.Add(label, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.LEFT, 0)
		self.month = wx.TextCtrl(self, -1, '', validator=intvalidator.IntValidator(1, 12), size=(50,-1))
		vsizer.Add(self.month, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.LEFT, 0)
		fgsizer.Add(vsizer, 0, wx.ALIGN_LEFT|wx.ALL, 5)
		self.month.SetHelpText(mtexts.txts['HelpMonth'])
		self.month.SetMaxLength(2)

		timesizer.Add(fgsizer, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5)

		mvsizer.Add(timesizer, 0, wx.GROW|wx.ALIGN_LEFT|wx.LEFT|wx.RIGHT, 5)

		#Initialize
		self.year.SetValue(str(time.year))
		self.month.SetValue(str(time.month))

		btnsizer = wx.StdDialogButtonSizer()

		if wx.Platform != '__WXMSW__':
			btn = wx.ContextHelpButton(self)
			btnsizer.AddButton(btn)

		btnOk = wx.Button(self, wx.ID_OK, mtexts.txts['Ok'])
		btnsizer.AddButton(btnOk)
		btnOk.SetHelpText(mtexts.txts['HelpOk'])
		btnOk.SetDefault()

		btn = wx.Button(self, wx.ID_CANCEL, mtexts.txts['Cancel'])
		btnsizer.AddButton(btn)
		btn.SetHelpText(mtexts.txts['HelpCancel'])

		btnsizer.Realize()

		mvsizer.Add(btnsizer, 0, wx.GROW|wx.ALL, 10)
		self.SetSizer(mvsizer)
		mvsizer.Fit(self)

		btnOk.SetFocus()

		self.Bind(wx.EVT_BUTTON, self.onOK, id=wx.ID_OK)
예제 #29
0
    def __init__(self, parent, printer=None):
        wx.Frame.__init__(self,
                          parent,
                          title="ProjectLayer Control",
                          style=(wx.DEFAULT_FRAME_STYLE
                                 | wx.WS_EX_CONTEXTHELP))
        self.SetExtraStyle(wx.FRAME_EX_CONTEXTHELP)
        self.pronterface = parent
        self.display_frame = DisplayFrame(self,
                                          title="ProjectLayer Display",
                                          printer=printer)

        self.panel = wx.Panel(self)

        vbox = wx.BoxSizer(wx.VERTICAL)
        buttonbox = wx.StaticBoxSizer(
            wx.StaticBox(self.panel, label="Controls"), wx.HORIZONTAL)

        load_button = wx.Button(self.panel, -1, "Load")
        load_button.Bind(wx.EVT_BUTTON, self.load_file)
        load_button.SetHelpText(
            "Choose an SVG file created from Slic3r or Skeinforge, or a zip file of bitmap images (with extension: .3dlp.zip)."
        )
        buttonbox.Add(load_button,
                      flag=wx.LEFT | wx.RIGHT | wx.BOTTOM,
                      border=5)

        present_button = wx.Button(self.panel, -1, "Present")
        present_button.Bind(wx.EVT_BUTTON, self.start_present)
        present_button.SetHelpText("Starts the presentation of the slices.")
        buttonbox.Add(present_button,
                      flag=wx.LEFT | wx.RIGHT | wx.BOTTOM,
                      border=5)

        self.pause_button = wx.Button(self.panel, -1, "Pause")
        self.pause_button.Bind(wx.EVT_BUTTON, self.pause_present)
        self.pause_button.SetHelpText(
            "Pauses the presentation. Can be resumed afterwards by clicking this button, or restarted by clicking present again."
        )
        buttonbox.Add(self.pause_button,
                      flag=wx.LEFT | wx.RIGHT | wx.BOTTOM,
                      border=5)

        stop_button = wx.Button(self.panel, -1, "Stop")
        stop_button.Bind(wx.EVT_BUTTON, self.stop_present)
        stop_button.SetHelpText("Stops presenting the slices.")
        buttonbox.Add(stop_button,
                      flag=wx.LEFT | wx.RIGHT | wx.BOTTOM,
                      border=5)

        self.help_button = wx.ContextHelpButton(self.panel)
        buttonbox.Add(self.help_button,
                      flag=wx.LEFT | wx.RIGHT | wx.BOTTOM,
                      border=5)

        fieldboxsizer = wx.StaticBoxSizer(
            wx.StaticBox(self.panel, label="Settings"), wx.VERTICAL)
        fieldsizer = wx.GridBagSizer(10, 10)

        # Left Column

        fieldsizer.Add(wx.StaticText(self.panel, -1, "Layer (mm):"),
                       pos=(0, 0),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.thickness = wx.TextCtrl(
            self.panel,
            -1,
            str(self._get_setting("project_layer", "0.1")),
            size=(125, -1))
        self.thickness.Bind(wx.EVT_TEXT, self.update_thickness)
        self.thickness.SetHelpText(
            "The thickness of each slice. Should match the value used to slice the model.  SVG files update this value automatically, 3dlp.zip files have to be manually entered."
        )
        fieldsizer.Add(self.thickness, pos=(0, 1))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "Exposure (s):"),
                       pos=(1, 0),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.interval = wx.TextCtrl(
            self.panel,
            -1,
            str(self._get_setting("project_interval", "0.5")),
            size=(125, -1))
        self.interval.Bind(wx.EVT_TEXT, self.update_interval)
        self.interval.SetHelpText("How long each slice should be displayed.")
        fieldsizer.Add(self.interval, pos=(1, 1))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "Blank (s):"),
                       pos=(2, 0),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.pause = wx.TextCtrl(self.panel,
                                 -1,
                                 str(self._get_setting("project_pause",
                                                       "0.5")),
                                 size=(125, -1))
        self.pause.Bind(wx.EVT_TEXT, self.update_pause)
        self.pause.SetHelpText(
            "The pause length between slices. This should take into account any movement of the Z axis, plus time to prepare the resin surface (sliding, tilting, sweeping, etc)."
        )
        fieldsizer.Add(self.pause, pos=(2, 1))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "Scale:"),
                       pos=(3, 0),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.scale = wx.SpinCtrlDouble(self.panel,
                                       -1,
                                       initial=self._get_setting(
                                           'project_scale', 1.0),
                                       inc=0.1,
                                       size=(125, -1))
        self.scale.SetDigits(3)
        self.scale.Bind(wx.EVT_SPINCTRLDOUBLE, self.update_scale)
        self.scale.SetHelpText("The additional scaling of each slice.")
        fieldsizer.Add(self.scale, pos=(3, 1))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "Direction:"),
                       pos=(4, 0),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.direction = wx.ComboBox(self.panel,
                                     -1,
                                     choices=["Top Down", "Bottom Up"],
                                     value=self._get_setting(
                                         'project_direction', "Top Down"),
                                     size=(125, -1))
        self.direction.Bind(wx.EVT_COMBOBOX, self.update_direction)
        self.direction.SetHelpText(
            "The direction the Z axis should move. Top Down is where the projector is above the model, Bottom up is where the projector is below the model."
        )
        fieldsizer.Add(self.direction,
                       pos=(4, 1),
                       flag=wx.ALIGN_CENTER_VERTICAL)

        fieldsizer.Add(wx.StaticText(self.panel, -1, "Overshoot (mm):"),
                       pos=(5, 0),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.overshoot = wx.SpinCtrlDouble(self.panel,
                                           -1,
                                           initial=self._get_setting(
                                               'project_overshoot', 3.0),
                                           inc=0.1,
                                           min=0,
                                           size=(125, -1))
        self.overshoot.SetDigits(1)
        self.overshoot.Bind(wx.EVT_SPINCTRLDOUBLE, self.update_overshoot)
        self.overshoot.SetHelpText(
            "How far the axis should move beyond the next slice position for each slice. For Top Down printers this would dunk the model under the resi and then return. For Bottom Up printers this would raise the base away from the vat and then return."
        )
        fieldsizer.Add(self.overshoot, pos=(5, 1))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "Pre-lift Gcode:"),
                       pos=(6, 0),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.prelift_gcode = wx.TextCtrl(self.panel,
                                         -1,
                                         str(
                                             self._get_setting(
                                                 "project_prelift_gcode",
                                                 "").replace("\\n", '\n')),
                                         size=(-1, 35),
                                         style=wx.TE_MULTILINE)
        self.prelift_gcode.SetHelpText(
            "Additional gcode to run before raising the Z axis. Be sure to take into account any additional time needed in the pause value, and be careful what gcode is added!"
        )
        self.prelift_gcode.Bind(wx.EVT_TEXT, self.update_prelift_gcode)
        fieldsizer.Add(self.prelift_gcode, pos=(6, 1), span=(2, 1))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "Post-lift Gcode:"),
                       pos=(6, 2),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.postlift_gcode = wx.TextCtrl(self.panel,
                                          -1,
                                          str(
                                              self._get_setting(
                                                  "project_postlift_gcode",
                                                  "").replace("\\n", '\n')),
                                          size=(-1, 35),
                                          style=wx.TE_MULTILINE)
        self.postlift_gcode.SetHelpText(
            "Additional gcode to run after raising the Z axis. Be sure to take into account any additional time needed in the pause value, and be careful what gcode is added!"
        )
        self.postlift_gcode.Bind(wx.EVT_TEXT, self.update_postlift_gcode)
        fieldsizer.Add(self.postlift_gcode, pos=(6, 3), span=(2, 1))

        # Right Column

        fieldsizer.Add(wx.StaticText(self.panel, -1, "X (px):"),
                       pos=(0, 2),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        projectX = int(math.floor(float(self._get_setting("project_x", 1920))))
        self.X = wx.SpinCtrl(self.panel,
                             -1,
                             str(projectX),
                             max=999999,
                             size=(125, -1))
        self.X.Bind(wx.EVT_SPINCTRL, self.update_resolution)
        self.X.SetHelpText("The projector resolution in the X axis.")
        fieldsizer.Add(self.X, pos=(0, 3))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "Y (px):"),
                       pos=(1, 2),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        projectY = int(math.floor(float(self._get_setting("project_y", 1200))))
        self.Y = wx.SpinCtrl(self.panel,
                             -1,
                             str(projectY),
                             max=999999,
                             size=(125, -1))
        self.Y.Bind(wx.EVT_SPINCTRL, self.update_resolution)
        self.Y.SetHelpText("The projector resolution in the Y axis.")
        fieldsizer.Add(self.Y, pos=(1, 3))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "OffsetX (mm):"),
                       pos=(2, 2),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.offset_X = wx.SpinCtrlDouble(self.panel,
                                          -1,
                                          initial=self._get_setting(
                                              "project_offset_x", 0.0),
                                          inc=1,
                                          size=(125, -1))
        self.offset_X.SetDigits(1)
        self.offset_X.Bind(wx.EVT_SPINCTRLDOUBLE, self.update_offset)
        self.offset_X.SetHelpText(
            "How far the slice should be offset from the edge in the X axis.")
        fieldsizer.Add(self.offset_X, pos=(2, 3))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "OffsetY (mm):"),
                       pos=(3, 2),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.offset_Y = wx.SpinCtrlDouble(self.panel,
                                          -1,
                                          initial=self._get_setting(
                                              "project_offset_y", 0.0),
                                          inc=1,
                                          size=(125, -1))
        self.offset_Y.SetDigits(1)
        self.offset_Y.Bind(wx.EVT_SPINCTRLDOUBLE, self.update_offset)
        self.offset_Y.SetHelpText(
            "How far the slice should be offset from the edge in the Y axis.")
        fieldsizer.Add(self.offset_Y, pos=(3, 3))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "ProjectedX (mm):"),
                       pos=(4, 2),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.projected_X_mm = wx.SpinCtrlDouble(self.panel,
                                                -1,
                                                initial=self._get_setting(
                                                    "project_projected_x",
                                                    505.0),
                                                inc=1,
                                                size=(125, -1))
        self.projected_X_mm.SetDigits(1)
        self.projected_X_mm.Bind(wx.EVT_SPINCTRLDOUBLE,
                                 self.update_projected_Xmm)
        self.projected_X_mm.SetHelpText(
            "The actual width of the entire projected image. Use the Calibrate grid to show the full size of the projected image, and measure the width at the same level where the slice will be projected onto the resin."
        )
        fieldsizer.Add(self.projected_X_mm, pos=(4, 3))

        fieldsizer.Add(wx.StaticText(self.panel, -1, "Z Axis Speed (mm/min):"),
                       pos=(5, 2),
                       flag=wx.ALIGN_CENTER_VERTICAL)
        self.z_axis_rate = wx.SpinCtrl(
            self.panel,
            -1,
            str(self._get_setting("project_z_axis_rate", 200)),
            max=9999,
            size=(125, -1))
        self.z_axis_rate.Bind(wx.EVT_SPINCTRL, self.update_z_axis_rate)
        self.z_axis_rate.SetHelpText(
            "Speed of the Z axis in mm/minute. Take into account that slower rates may require a longer pause value."
        )
        fieldsizer.Add(self.z_axis_rate, pos=(5, 3))

        fieldboxsizer.Add(fieldsizer)

        # Display

        displayboxsizer = wx.StaticBoxSizer(
            wx.StaticBox(self.panel, label="Display"), wx.VERTICAL)
        displaysizer = wx.GridBagSizer(10, 10)

        displaysizer.Add(wx.StaticText(self.panel, -1, "Fullscreen:"),
                         pos=(0, 0),
                         flag=wx.ALIGN_CENTER_VERTICAL)
        self.fullscreen = wx.CheckBox(self.panel, -1)
        self.fullscreen.Bind(wx.EVT_CHECKBOX, self.update_fullscreen)
        self.fullscreen.SetHelpText("Toggles the project screen to full size.")
        displaysizer.Add(self.fullscreen,
                         pos=(0, 1),
                         flag=wx.ALIGN_CENTER_VERTICAL)

        displaysizer.Add(wx.StaticText(self.panel, -1, "Calibrate:"),
                         pos=(0, 2),
                         flag=wx.ALIGN_CENTER_VERTICAL)
        self.calibrate = wx.CheckBox(self.panel, -1)
        self.calibrate.Bind(wx.EVT_CHECKBOX, self.show_calibrate)
        self.calibrate.SetHelpText(
            "Toggles the calibration grid. Each grid should be 10mmx10mm in size. Use the grid to ensure the projected size is correct. See also the help for the ProjectedX field."
        )
        displaysizer.Add(self.calibrate,
                         pos=(0, 3),
                         flag=wx.ALIGN_CENTER_VERTICAL)

        displaysizer.Add(wx.StaticText(self.panel, -1, "1st Layer:"),
                         pos=(0, 4),
                         flag=wx.ALIGN_CENTER_VERTICAL)

        first_layer_boxer = wx.BoxSizer(wx.HORIZONTAL)
        self.first_layer = wx.CheckBox(self.panel, -1)
        self.first_layer.Bind(wx.EVT_CHECKBOX, self.show_first_layer)
        self.first_layer.SetHelpText(
            "Displays the first layer of the model. Use this to project the first layer for longer so it holds to the base. Note: this value does not affect the first layer when the \"Present\" run is started, it should be used manually."
        )

        first_layer_boxer.Add(self.first_layer, flag=wx.ALIGN_CENTER_VERTICAL)

        first_layer_boxer.Add(wx.StaticText(self.panel, -1, " (s):"),
                              flag=wx.ALIGN_CENTER_VERTICAL)
        self.show_first_layer_timer = wx.SpinCtrlDouble(self.panel,
                                                        -1,
                                                        initial=-1,
                                                        inc=1,
                                                        size=(125, -1))
        self.show_first_layer_timer.SetDigits(1)
        self.show_first_layer_timer.SetHelpText(
            "How long to display the first layer for. -1 = unlimited.")
        first_layer_boxer.Add(self.show_first_layer_timer,
                              flag=wx.ALIGN_CENTER_VERTICAL)
        displaysizer.Add(first_layer_boxer,
                         pos=(0, 6),
                         flag=wx.ALIGN_CENTER_VERTICAL)

        displaysizer.Add(wx.StaticText(self.panel, -1, "Red:"),
                         pos=(0, 7),
                         flag=wx.ALIGN_CENTER_VERTICAL)
        self.layer_red = wx.CheckBox(self.panel, -1)
        self.layer_red.Bind(wx.EVT_CHECKBOX, self.show_layer_red)
        self.layer_red.SetHelpText(
            "Toggles whether the image should be red. Useful for positioning whilst resin is in the printer as it should not cause a reaction."
        )
        displaysizer.Add(self.layer_red,
                         pos=(0, 8),
                         flag=wx.ALIGN_CENTER_VERTICAL)

        displayboxsizer.Add(displaysizer)

        # Info
        infosizer = wx.StaticBoxSizer(wx.StaticBox(self.panel, label="Info"),
                                      wx.VERTICAL)

        infofieldsizer = wx.GridBagSizer(10, 10)

        filelabel = wx.StaticText(self.panel, -1, "File:")
        filelabel.SetHelpText("The name of the model currently loaded.")
        infofieldsizer.Add(filelabel, pos=(0, 0))
        self.filename = wx.StaticText(self.panel, -1, "")

        infofieldsizer.Add(self.filename, pos=(0, 1))

        totallayerslabel = wx.StaticText(self.panel, -1, "Total Layers:")
        totallayerslabel.SetHelpText(
            "The total number of layers found in the model.")
        infofieldsizer.Add(totallayerslabel, pos=(1, 0))
        self.total_layers = wx.StaticText(self.panel, -1)

        infofieldsizer.Add(self.total_layers, pos=(1, 1))

        currentlayerlabel = wx.StaticText(self.panel, -1, "Current Layer:")
        currentlayerlabel.SetHelpText("The current layer being displayed.")
        infofieldsizer.Add(currentlayerlabel, pos=(2, 0))
        self.current_layer = wx.StaticText(self.panel, -1, "0")
        infofieldsizer.Add(self.current_layer, pos=(2, 1))

        estimatedtimelabel = wx.StaticText(self.panel, -1, "Estimated Time:")
        estimatedtimelabel.SetHelpText(
            "An estimate of the remaining time until print completion.")
        infofieldsizer.Add(estimatedtimelabel, pos=(3, 0))
        self.estimated_time = wx.StaticText(self.panel, -1, "")
        infofieldsizer.Add(self.estimated_time, pos=(3, 1))

        infosizer.Add(infofieldsizer)

        #

        vbox.Add(buttonbox,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP | wx.BOTTOM,
                 border=10)
        vbox.Add(fieldboxsizer,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
                 border=10)
        vbox.Add(displayboxsizer,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
                 border=10)
        vbox.Add(infosizer,
                 flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM,
                 border=10)

        self.panel.SetSizer(vbox)
        self.panel.Fit()
        self.Fit()
        self.SetPosition((0, 0))
        self.Show()
예제 #30
0
    def __init__(self, parent, ID, title, size, pos, style):
        wx.Dialog.__init__(self, parent, ID, title, size, pos, style)

        # Instead of calling wx.Dialog.__init__ we precreate the dialog
        # so we can set an extra style that must be set before
        # creation, and then we create the GUI object using the Create
        # method.
        pre = wx.PreDialog()
        pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
        pre.Create(parent, ID, title, pos, size, style)

        # This next step is the most important, it turns this Python
        # object into the real wrapper of the dialog (instead of pre)
        # as far as the wxPython extension is concerned.
        self.PostCreate(pre)

        # Now continue with the normal constru ction of the dialog
        # contents
        sizer = wx.BoxSizer(wx.VERTICAL)
        # wx.StaticText(self.NewFrame.panel, -1, 'URL', (10, 20), size=(100, 25))
        label = wx.StaticText(self, -1, 'URL', (10, 20), size=(100, 25))
        label.SetHelpText("This is the help text for the label")
        sizer.Add(label, 0, wx.ALIGN_CENTRE | wx.ALL, 5)

        box = wx.BoxSizer(wx.HORIZONTAL)

        label = wx.StaticText(self, -1, "Field #1:")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 0, wx.ALIGN_CENTRE | wx.ALL, 5)

        text = wx.TextCtrl(self, -1, "", size=(80, -1))
        text.SetHelpText("Here's some help text for field #1")
        box.Add(text, 1, wx.ALIGN_CENTRE | wx.ALL, 5)

        sizer.Add(box, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        box = wx.BoxSizer(wx.HORIZONTAL)

        label = wx.StaticText(self, -1, "Field #2:")
        label.SetHelpText("This is the help text for the label")
        box.Add(label, 0, wx.ALIGN_CENTRE | wx.ALL, 5)

        text = wx.TextCtrl(self, -1, "", size=(80, -1))
        text.SetHelpText("Here's some help text for field #2")
        box.Add(text, 1, wx.ALIGN_CENTRE | wx.ALL, 5)

        sizer.Add(box, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        line = wx.StaticLine(self, -1, size=(20, -1), style=wx.LI_HORIZONTAL)
        sizer.Add(line, 0,
                  wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP, 5)

        btnsizer = wx.StdDialogButtonSizer()

        if wx.Platform != "__WXMSW__":
            btn = wx.ContextHelpButton(self)
            btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_OK)
        btn.SetHelpText("The OK button completes the dialog")
        btn.SetDefault()
        btnsizer.AddButton(btn)

        btn = wx.Button(self, wx.ID_CANCEL)
        btn.SetHelpText("The Cancel button cancels the dialog. (Cool, huh?)")
        btnsizer.AddButton(btn)
        btnsizer.Realize()

        sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)

        self.SetSizer(sizer)
        sizer.Fit(self)