Ejemplo n.º 1
0
    def __init__(self,
                 parent,
                 phil,
                 backend_name='BACKEND',
                 target=None,
                 content_style='normal',
                 label_style='bold',
                 opt_size=(500, 500),
                 phil_size=(500, 500),
                 *args,
                 **kwargs):
        BaseDialog.__init__(self,
                            parent,
                            content_style=content_style,
                            label_style=label_style,
                            *args,
                            **kwargs)

        self.parent = parent
        self.target_phil = target
        self.backend = backend_name
        self.params = phil.extract()
        self.opt_size = opt_size
        self.phil_size = phil_size
        self.sash_position = None

        self.splitter = wx.SplitterWindow(self,
                                          style=wx.SP_LIVE_UPDATE
                                          | wx.SP_3DSASH | wx.SP_NOBORDER)

        # Create options panel (all objects should be called as self.options.object)
        self.options = ScrolledPanel(self.splitter, size=self.opt_size)
        self.options_sizer = wx.BoxSizer(wx.VERTICAL)
        self.options.SetSizer(self.options_sizer)

        # Create PHIL panel
        phil_label = "{} Target Settings".format(backend_name)
        self.phil_panel = wx.Panel(self.splitter, size=self.opt_size)
        phil_box = wx.StaticBox(self.phil_panel, label=phil_label)
        self.phil_sizer = wx.StaticBoxSizer(phil_box, wx.VERTICAL)
        self.phil_panel.SetSizer(self.phil_sizer)

        # Dialog control
        self.dlg_ctr = ct.DialogButtonsCtrl(self, preset='PROC_DIALOG')

        # Splitter button
        self.btn_hide_script = GenToggleButton(self, label='Show Script >>>')
        self.show_hide_script()
        self.btn_hide_script.SetValue(False)

        self.main_sizer.Add(self.btn_hide_script,
                            flag=wx.ALIGN_RIGHT | wx.ALL,
                            border=10)
        self.main_sizer.Add(self.splitter,
                            1,
                            flag=wx.EXPAND | wx.ALL,
                            border=10)
        self.main_sizer.Add(self.dlg_ctr,
                            flag=wx.EXPAND | wx.ALIGN_RIGHT | wx.RIGHT,
                            border=10)
Ejemplo n.º 2
0
 def ButtonCB(parent, **kwargs):
     button = GenToggleButton(parent, -1, "Whatevar!!!")