我们从Python开源项目中,提取了以下35个代码示例,用于说明如何使用wx.StaticBoxSizer()。
def __init__(self, parent): """Constructor""" self.notUseDetaul = None wx.Panel.__init__(self, parent=parent, size = (500,800)) B = wx.StaticBox(self, -1) BSizer = wx.StaticBoxSizer(B, wx.VERTICAL) self.imagesDir = os.path.join(".", "images") self.screenShotDir = os.path.join(".", "screenShot") self.defaultScreenShotImage = wx.Image(os.path.join(self.imagesDir, "default.png"), wx.BITMAP_TYPE_PNG).ConvertToBitmap() self.screenShot = wx.StaticBitmap(self,-1, self.defaultScreenShotImage) self.screenShot.Bind(wx.EVT_LEFT_DOWN, self.DrawOrReloadAll) self.statusBar = wx.StaticText(self, -1, "") BSizer.Add(self.statusBar) BSizer.Add(self.screenShot,5,wx.EXPAND, 5) self.SetSizer(BSizer) pub.subscribe(self.updateStatus, "update") pub.subscribe(self.DrawFromSelectedNode, "DrawFromSelectedNode") pub.subscribe(self.DoSwipeOrInput, "DoSwipeOrInput") self.hasDrew = False
def __init__(self, parent): """Constructor""" wx.Panel.__init__(self, parent=parent) B = wx.StaticBox(self, -1) self.BSizer = wx.StaticBoxSizer(B, wx.VERTICAL) self.tree = XMLTree(parent=self, ID=-1) self.tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.onSelectItem) self.tree.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK, self.getFullXpath) self.BSizer.Add(self.tree, 5, wx.EXPAND, 5) self.SetSizer(self.BSizer) cDir = os.getcwd() self.xmlPath = os.path.join(cDir,"Hierarchy","window_dump.xml") pub.subscribe(self.updateTree, "updateTree") pub.subscribe(self.setSelectedNode, "setSelectedNode") pub.subscribe(self.DoSearch, "DoSearch")
def __init__(self, parent): wx.Panel.__init__(self, parent, -1) # ????? self.response_text = wx.TextCtrl(self, -1, style=wx.TE_MULTILINE) response_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Response")) response_sizer.Add(self.response_text, 1, wx.EXPAND) # ??????? self.doc_text = wx.TextCtrl(self, -1, style=wx.TE_MULTILINE | wx.TE_READONLY) doc_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Document")) doc_sizer.Add(self.doc_text, 1, wx.EXPAND) main_box = wx.BoxSizer(wx.VERTICAL) main_box.Add(response_sizer, 1, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) main_box.Add(doc_sizer, 1, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) self.SetSizer(main_box) self.response_text.Bind(wx.EVT_CHAR, self.on_key_down) self.doc_text.Bind(wx.EVT_CHAR, self.on_key_down)
def __do_layout(self): # begin wxGlade: TerminalSettingsDialog.__do_layout sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) self.sizer_4_staticbox.Lower() sizer_4 = wx.StaticBoxSizer(self.sizer_4_staticbox, wx.VERTICAL) sizer_4.Add(self.checkbox_echo, 0, wx.ALL, 4) sizer_4.Add(self.checkbox_unprintable, 0, wx.ALL, 4) sizer_4.Add(self.radio_box_newline, 0, 0, 0) sizer_2.Add(sizer_4, 0, wx.EXPAND, 0) sizer_3.Add(self.button_ok, 0, 0, 0) sizer_3.Add(self.button_cancel, 0, 0, 0) sizer_2.Add(sizer_3, 0, wx.ALL | wx.ALIGN_RIGHT, 4) self.SetSizer(sizer_2) sizer_2.Fit(self) self.Layout() # end wxGlade
def __do_layout(self): # begin wxGlade: TerminalSettingsDialog.__do_layout sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) sizer_4 = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Input/Output"), wx.VERTICAL) sizer_4.Add(self.checkbox_echo, 0, wx.ALL, 4) sizer_4.Add(self.checkbox_unprintable, 0, wx.ALL, 4) sizer_4.Add(self.radio_box_newline, 0, 0, 0) sizer_2.Add(sizer_4, 0, wx.EXPAND, 0) sizer_3.Add(self.button_ok, 0, 0, 0) sizer_3.Add(self.button_cancel, 0, 0, 0) sizer_2.Add(sizer_3, 0, wx.ALL|wx.ALIGN_RIGHT, 4) self.SetAutoLayout(1) self.SetSizer(sizer_2) sizer_2.Fit(self) sizer_2.SetSizeHints(self) self.Layout() # end wxGlade
def __init__(self, parent, frame, ID, label): wx.Panel.__init__(self, parent, ID) self.frame = frame box = wx.StaticBox(self, -1, label) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.next_button = wx.Button(self, -1, label="Next 100") self.next_button.Bind(wx.EVT_BUTTON, self.on_next) self.previous_button = wx.Button(self, -1, label="Previous 100") self.previous_button.Bind(wx.EVT_BUTTON, self.on_previous) manual_box = wx.BoxSizer(wx.HORIZONTAL) manual_box.Add(self.previous_button, flag=wx.ALIGN_CENTER_VERTICAL) manual_box.AddSpacer(10) manual_box.Add(self.next_button, flag=wx.ALIGN_CENTER_VERTICAL) sizer.Add(manual_box, 0, wx.ALL, 10) self.SetSizer(sizer) sizer.Fit(self)
def createWidgetsFrame(self): staticBox = wx.StaticBox( self.panel, -1, "Widgets Frame", size=(285, -1) ) self.statBoxSizerV = wx.StaticBoxSizer(staticBox, wx.VERTICAL) #----------------------------------------------------------
def createManageFilesFrame(self): staticBox = wx.StaticBox( self.panel, -1, "Manage Files", size=(285, -1) ) self.statBoxSizerMgrV = wx.StaticBoxSizer(staticBox, wx.VERTICAL) #----------------------------------------------------------
def addStaticBoxWithLabels(self): boxSizerH = wx.BoxSizer(wx.HORIZONTAL) staticBox = wx.StaticBox( self.panel, -1, "Labels within a Frame" ) staticBoxSizerV = wx.StaticBoxSizer( staticBox, wx.VERTICAL ) boxSizerV = wx.BoxSizer( wx.VERTICAL ) staticText1 = wx.StaticText( self.panel, -1, " Choose a number:" ) boxSizerV.Add( staticText1, 0, wx.ALL) staticText2 = wx.StaticText( self.panel, -1, " Label 2") boxSizerV.Add( staticText2, 0, wx.ALL ) #------------------------------------------------------ staticBoxSizerV.Add( boxSizerV, 0, wx.ALL ) boxSizerH.Add(staticBoxSizerV) #------------------------------------------------------ boxSizerH.Add(wx.ComboBox(self.panel, size=(70, -1))) #------------------------------------------------------ boxSizerH.Add(wx.SpinCtrl(self.panel, size=(50, -1), style=wx.BORDER_RAISED)) # Add local boxSizer to main frame self.statBoxSizerV.Add( boxSizerH, 1, wx.ALL ) #----------------------------------------------------------
def __init__(self, parent, run, api): """Initialize the RunPanel. Args: parent: The parent Window for this panel. run: The sequencing run that should be displayed. api: An initialized instance of an API for interacting with IRIDA. """ ScrolledPanel.__init__(self, parent, style=wx.SUNKEN_BORDER) box = wx.StaticBox(self, label=run.sample_sheet_name) self._timer = wx.Timer(self) self._run = run self._progress_value = 0 self._last_progress = 0 self._last_timer_progress = 0 self._sample_panels = {} # the current overall progress for the run is calculated as a percentage # of the total file size of all samples in the run. self._progress_max = sum(sample.get_files_size() for sample in run.samples_to_upload) logging.info("Total file size for run is {}".format(self._progress_max)) self._sizer = wx.StaticBoxSizer(box, wx.VERTICAL) pub.subscribe(self._upload_started, run.upload_started_topic) pub.subscribe(self._handle_progress, run.upload_progress_topic) pub.subscribe(self._upload_complete, run.upload_completed_topic) pub.subscribe(self._upload_failed, run.upload_failed_topic) for sample in run.sample_list: self._sample_panels[sample.get_id()] = SamplePanel(self, sample, run, api) self._sizer.Add(self._sample_panels[sample.get_id()], flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=5) self.SetSizer(self._sizer) self.Bind(wx.EVT_TIMER, self._update_progress_timer, self._timer) self.Layout() self.SetupScrolling()
def __init__(self, parent, label='', orient=wx.VERTICAL): wx.StaticBoxSizer.__init__(self, wx.StaticBox(parent, label=label), orient=orient)
def __do_layout(self): # begin wxGlade: Dialogo_texto.__do_layout self.sizer_1_staticbox.Lower() sizer_1 = wx.StaticBoxSizer(self.sizer_1_staticbox, wx.VERTICAL) sizer_1.Add(self.salida_texto, 0, wx.ALL | wx.EXPAND, 4) sizer_1.Add(self.bnt_salida_ok, 0, wx.ALIGN_RIGHT | wx.RIGHT | wx.SHAPED, 5) self.SetSizer(sizer_1) sizer_1.Fit(self) self.Layout() # end wxGlade # end of class Dialogo_texto
def MakeRange(self, i, inc=1.0): if len(self.parent.datarangelist) < (i+1): min = self.scalebar_ranges[i][0] max = self.scalebar_ranges[i][1] self.parent.datarangelist.append( [min, max] ) current_min = min current_max = max else: min = self.parent.datarangelist[i][0] max = self.parent.datarangelist[i][1] current_min = self.scalebar_ranges[i][0] current_max = self.scalebar_ranges[i][1] label= "Range %d"%((i+1)) range = abs(max - min) if range > MAX_INT: newinc = range/MAX_INT else: newinc = inc self.sbox.append( wx.StaticBox(self, label=label, style=wx.SUNKEN_BORDER) ) self.sboxs.append( wx.StaticBoxSizer(self.sbox[-1],wx.VERTICAL) ) self.shbox.append( wx.BoxSizer(wx.HORIZONTAL) ) self.valuemax.append( SpinnerObject(self,"Max:",max,min,newinc,current_max,50,150) ) self.shbox[-1].Add(self.valuemax[-1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.shbox[-1].Add((5, -1)) self.valuemin.append( SpinnerObject(self,"Min:",max,min,newinc,current_min,50,150) ) self.shbox[-1].Add(self.valuemin[-1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.sboxs[-1].Add(self.shbox[-1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.vbox.Add(self.sboxs[-1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
def __init__(self, parent): """Constructor""" wx.Panel.__init__(self, parent=parent) self.gd = GD.Grid(self) self.gd.CreateGrid(20, 2) self.gd.SetRowLabelSize(0) self.gd.SetColLabelSize(0) self.B = wx.StaticBox(self, -1, "Node Detail") BSizer = wx.StaticBoxSizer(self.B, wx.VERTICAL) BSizer.Add(self.gd, 1, wx.EXPAND|wx.ALL) self.SetSizer(BSizer) pub.subscribe(self.updateNodeDetail, "updateNodeDetail") pub.subscribe(self.updateXPath, "updateXPath") self.Bind(wx.EVT_SIZE, self.ResizeGrid)
def __do_layout(self): # begin wxGlade: add_div.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_10 = wx.BoxSizer(wx.HORIZONTAL) sizer_7 = wx.BoxSizer(wx.HORIZONTAL) sizer_8 = wx.BoxSizer(wx.VERTICAL) self.sizer_9_staticbox.Lower() sizer_9 = wx.StaticBoxSizer(self.sizer_9_staticbox, wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) self.sizer_4_staticbox.Lower() sizer_4 = wx.StaticBoxSizer(self.sizer_4_staticbox, wx.VERTICAL) sizer_4_copy = wx.BoxSizer(wx.HORIZONTAL) sizer_6 = wx.BoxSizer(wx.VERTICAL) sizer_5 = wx.BoxSizer(wx.VERTICAL) sizer_5.Add(self.label_1, 0, 0, 0) sizer_5.Add(self.combo_box_1, 0, 0, 0) sizer_4_copy.Add(sizer_5, 0, 0, 0) sizer_6.Add(self.label_2, 0, wx.LEFT, 85) sizer_6.Add(self.combo_box_2, 0, wx.LEFT, 85) sizer_4_copy.Add(sizer_6, 0, wx.EXPAND, 20) sizer_4.Add(sizer_4_copy, 0, wx.SHAPED, 0) sizer_3.Add(sizer_4, 0, 0, 0) sizer_2.Add(sizer_3, 0, wx.BOTTOM, 20) sizer_7.Add(self.list_box_1, 0, 0, 0) sizer_8.Add(self.button_1, 0, wx.TOP, 20) sizer_9.Add(self.text_ctrl_1, 0, 0, 0) sizer_9.Add(self.button_2, 0, wx.TOP, 10) sizer_8.Add(sizer_9, 1, wx.TOP | wx.EXPAND, 50) sizer_7.Add(sizer_8, 1, wx.EXPAND, 0) sizer_2.Add(sizer_7, 1, wx.EXPAND, 0) sizer_10.Add(self.button_3, 0, wx.LEFT, 200) sizer_2.Add(sizer_10, 0, wx.TOP | wx.EXPAND, 40) self.panel_1.SetSizer(sizer_2) sizer_1.Add(self.panel_1, 1, wx.ALL | wx.EXPAND, 12) self.SetSizer(sizer_1) self.Layout() self.Centre() # end wxGlade
def __init__(self, parent, ID): wx.Panel.__init__(self, parent, ID) box = wx.StaticBox(self, -1, "relabelling key") sizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.real = wx.StaticText(self, label="REAL") self.real.SetBackgroundColour(wx.WHITE) self.real.SetForegroundColour("#3366FF") self.bogus = wx.StaticText(self, label="BOGUS") self.bogus.SetBackgroundColour(wx.WHITE) self.bogus.SetForegroundColour("#FF0066") self.ghost = wx.StaticText(self, label="GHOST") self.ghost.SetBackgroundColour(wx.WHITE) self.ghost.SetForegroundColour("#9933FF") manual_box = wx.BoxSizer(wx.HORIZONTAL) manual_box.Add(self.real, flag=wx.ALIGN_CENTER_VERTICAL) manual_box.Add(self.bogus, flag=wx.ALIGN_CENTER_VERTICAL) manual_box.Add(self.ghost, flag=wx.ALIGN_CENTER_VERTICAL) sizer.Add(manual_box, 0, wx.ALL, 10) self.SetSizer(sizer) sizer.Fit(self)
def __init__(self, parent, frame, ID): wx.Panel.__init__(self, parent, ID) self.frame = frame box = wx.StaticBox(self, -1, "data set control") sizer = wx.StaticBoxSizer(box, wx.VERTICAL) """ self.fp_button = wx.Button(self, -1, label="FP") self.fp_button.Bind(wx.EVT_BUTTON, self.on_fp) self.tp_button = wx.Button(self, -1, label="TP") self.tp_button.Bind(wx.EVT_BUTTON, self.on_tp) self.fn_button = wx.Button(self, -1, label="FN") self.fn_button.Bind(wx.EVT_BUTTON, self.on_fn) self.tn_button = wx.Button(self, -1, label="TN") self.tn_button.Bind(wx.EVT_BUTTON, self.on_tn) """ self.real_button = wx.Button(self, -1, label="Real") self.real_button.Bind(wx.EVT_BUTTON, self.on_real) self.bogus_button = wx.Button(self, -1, label="Bogus") self.bogus_button.Bind(wx.EVT_BUTTON, self.on_bogus) manual_box = wx.BoxSizer(wx.HORIZONTAL) """ manual_box.Add(self.tp_button, border=2, flag=wx.ALIGN_CENTER_VERTICAL) manual_box.Add(self.fp_button, border=2, flag=wx.ALIGN_CENTER_VERTICAL) manual_box.Add(self.tn_button, border=2, flag=wx.ALIGN_CENTER_VERTICAL) manual_box.Add(self.fn_button, border=2, flag=wx.ALIGN_CENTER_VERTICAL) """ manual_box.Add(self.real_button, border=2, flag=wx.ALIGN_CENTER_VERTICAL) manual_box.Add(self.bogus_button, border=2, flag=wx.ALIGN_CENTER_VERTICAL) sizer.Add(manual_box, 0, wx.ALL, 10) self.SetSizer(sizer) sizer.Fit(self)
def redraw_item(self, redraw_keys, redraw_value): sizer = redraw_keys['item'] sizer_parent = redraw_keys['sizer_parent'] config = redraw_keys['get_config'](redraw_value, keys=redraw_keys) config_gui = redraw_keys['get_gui'](redraw_value) panel = redraw_keys['panel_parent'] fnc = redraw_keys['bind_item']['function'] bind = redraw_keys['bind_item']['bind'] key = redraw_keys['key'] static_box = None if isinstance(sizer, wx.StaticBoxSizer): static_box = sizer.GetStaticBox() item_index = 0 self.detach_all_children(sizer) for index, item_sizer in enumerate(sizer_parent.GetChildren()): if item_sizer.GetSizer() == sizer: item_index = index sizer_parent.Detach(index) if static_box: static_box.Destroy() sizer.Destroy() new_sizer = fnc(panel=panel, item=redraw_keys['redraw_target'], value=config, bind=bind, gui=config_gui, key=key) sizer_parent.Insert(item_index, new_sizer, 0, wx.EXPAND) self.redraw_map[key[0]][key[1]]['item'] = new_sizer self.main_grid.Layout()
def create_preorder(self): self.w = wx.StaticBox(self.get_parent(), self.id, self.label, self.pos, self.size, self.style, self.name) self.sized = wx.StaticBoxSizer(self.w, self.orient)
def __init__(self, *args, **kwargs): sbkw, kwargs = pop_registers(static_box_keys, kwargs) wx.StaticBox.__init__(self, args[0], **sbkw) if kwargs.get('orient') is None: orient = wx.VERTICAL else: orient = kwargs.pop('orient') self._sizer = wx.StaticBoxSizer(self, orient)
def create_well_choice(self): sb_well = wx.StaticBox(self, label=u"Poço:") sbs_well = wx.StaticBoxSizer(sb_well, wx.VERTICAL) self.well_choice = wx.Choice(self) self.well_choice.Bind(wx.EVT_CHOICE, self.on_well_input) sbs_well.Add(self.well_choice, proportion=1, flag=wx.EXPAND) self.sizer.Add(sbs_well) self.selected_well = None
def create_logs_choices(self, labels): sb = wx.StaticBox(self, label=u"Perfis:") sbs = wx.StaticBoxSizer(sb, wx.VERTICAL) fgs = wx.FlexGridSizer(len(labels), 2, 4, 4) self.choices = [] for label in labels: st = wx.StaticText(self, label=label + ": ") choice = wx.Choice(self) fgs.Add(st) fgs.Add(choice) self.choices.append(choice) sbs.Add(fgs, proportion=1, flag=wx.EXPAND) self.sizer.Add(sbs)
def __init__(self, parent=None, default_user="", default_pass=""): wx.Panel.__init__(self, parent) border = wx.StaticBox(self, label="User authorization") sizer = wx.StaticBoxSizer(border, wx.VERTICAL) self._status_label_user = ProcessingPlaceholderText(self) self._status_label_pass = ProcessingPlaceholderText(self) username_sizer = wx.BoxSizer(wx.VERTICAL) username_label = wx.StaticText(self, label="Username") username_label.SetToolTipString("Your IRIDA username") username_sizer.Add(username_label, flag=wx.EXPAND | wx.BOTTOM, border=2) username_input_sizer = wx.BoxSizer(wx.HORIZONTAL) self._username = wx.TextCtrl(self) self._username.Bind(wx.EVT_KILL_FOCUS, self._username_changed) self._username.SetValue(default_user) username_input_sizer.Add(self._username, flag=wx.EXPAND, proportion=1) username_input_sizer.Add(self._status_label_user, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5, proportion=0) username_sizer.Add(username_input_sizer, flag=wx.EXPAND) sizer.Add(username_sizer, flag=wx.EXPAND | wx.ALL, border=5) password_sizer = wx.BoxSizer(wx.VERTICAL) password_label = wx.StaticText(self, label="Password") password_label.SetToolTipString("Your IRIDA password") password_sizer.Add(password_label, flag=wx.EXPAND | wx.BOTTOM, border=2) password_input_sizer = wx.BoxSizer(wx.HORIZONTAL) self._password = wx.TextCtrl(self, style=wx.TE_PASSWORD) self._password.Bind(wx.EVT_KILL_FOCUS, self._password_changed) self._password.SetValue(default_pass) password_input_sizer.Add(self._password, flag=wx.EXPAND, proportion=1) password_input_sizer.Add(self._status_label_pass, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5, proportion=0) password_sizer.Add(password_input_sizer, flag=wx.EXPAND) sizer.Add(password_sizer, flag=wx.EXPAND | wx.ALL, border=5) self.SetSizerAndFit(sizer) self.Layout() pub.subscribe(self._handle_connection_error, APIConnectorTopics.connection_error_user_credentials_topic) pub.subscribe(self._status_label_user.SetSuccess, APIConnectorTopics.connection_success_topic) pub.subscribe(self._status_label_pass.SetSuccess, APIConnectorTopics.connection_success_topic) self.Bind(wx.EVT_CLOSE, self._on_close)
def __init__(self, parent=None, default_client_id="", default_client_secret=""): wx.Panel.__init__(self, parent) border = wx.StaticBox(self, label="Client authorization") sizer = wx.StaticBoxSizer(border, wx.VERTICAL) self._client_id_status_label = ProcessingPlaceholderText(self) self._client_secret_status_label = ProcessingPlaceholderText(self) client_id_sizer = wx.BoxSizer(wx.VERTICAL) client_id_label = wx.StaticText(self, label="Client ID") client_id_label.SetToolTipString("Your IRIDA client ID") client_id_sizer.Add(client_id_label, flag=wx.EXPAND | wx.BOTTOM, border=2) client_id_input_sizer = wx.BoxSizer(wx.HORIZONTAL) self._client_id = wx.TextCtrl(self) self._client_id.Bind(wx.EVT_KILL_FOCUS, self._client_id_changed) self._client_id.SetValue(default_client_id) client_id_input_sizer.Add(self._client_id, flag=wx.EXPAND, proportion=1) client_id_input_sizer.Add(self._client_id_status_label, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5, proportion=0) client_id_sizer.Add(client_id_input_sizer, flag=wx.EXPAND) sizer.Add(client_id_sizer, flag=wx.EXPAND | wx.ALL, border=5) client_secret_sizer = wx.BoxSizer(wx.VERTICAL) client_secret_label = wx.StaticText(self, label="Client Secret") client_secret_label.SetToolTipString("Your IRIDA client secret") client_secret_sizer.Add(client_secret_label, flag=wx.EXPAND | wx.BOTTOM, border=2) client_secret_input_sizer = wx.BoxSizer(wx.HORIZONTAL) self._client_secret = wx.TextCtrl(self) self._client_secret.Bind(wx.EVT_KILL_FOCUS, self._client_secret_changed) self._client_secret.SetValue(default_client_secret) client_secret_input_sizer.Add(self._client_secret, flag=wx.EXPAND, proportion=1) client_secret_input_sizer.Add(self._client_secret_status_label, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5, proportion=0) client_secret_sizer.Add(client_secret_input_sizer, flag=wx.EXPAND) sizer.Add(client_secret_sizer, flag=wx.EXPAND | wx.ALL, border=5) self.SetSizerAndFit(sizer) self.Layout() pub.subscribe(self._client_id_status_label.SetError, APIConnectorTopics.connection_error_client_id_topic) pub.subscribe(self._client_secret_status_label.SetError, APIConnectorTopics.connection_error_client_secret_topic) pub.subscribe(self._client_id_status_label.SetSuccess, APIConnectorTopics.connection_success_topic) pub.subscribe(self._client_secret_status_label.SetSuccess, APIConnectorTopics.connection_success_topic) pub.subscribe(self._client_id_status_label.SetSuccess, APIConnectorTopics.connection_success_valid_client_id) pub.subscribe(self._client_secret_status_label.SetSuccess, APIConnectorTopics.connection_success_valid_client_secret) self.Bind(wx.EVT_CLOSE, self._on_close)
def __init__(self, parent): wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = StaticTextNew(self, label="Replace Voxels in Numpy Array") title.SetToolTipNew("Useful for viewing data with a cut-out section.") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Input File: ", "",150,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*") vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.output_filename = TextPanelObject(self, "Output File: ", "",150,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*") vbox.Add(self.output_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) title2 = wx.StaticText(self, label="Start dimensions:") vbox.Add(title2 ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.sdims=[{} for i in range(3)] self.sdims[0] = SpinnerObject(self,"i",MAX_INT_16,0,1,0,20,60) self.sdims[1] = SpinnerObject(self,"j",MAX_INT_16,0,1,0,20,60) self.sdims[2] = SpinnerObject(self,"k",MAX_INT_16,0,1,0,20,60) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.sdims[0], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox.Add(self.sdims[1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox.Add(self.sdims[2], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) vbox.Add(hbox, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) title3 = wx.StaticText(self, label="End dimensions:") vbox.Add(title3 ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.edims=[{} for i in range(3)] self.edims[0] = SpinnerObject(self,"i",MAX_INT_16,0,1,0,20,60) self.edims[1] = SpinnerObject(self,"j",MAX_INT_16,0,1,0,20,60) self.edims[2] = SpinnerObject(self,"k",MAX_INT_16,0,1,0,20,60) hbox1 = wx.BoxSizer(wx.HORIZONTAL) hbox1.Add(self.edims[0], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox1.Add(self.edims[1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox1.Add(self.edims[2], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) vbox.Add(hbox1, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) sbox1 = wx.StaticBox(self, label="Complex Value", style=wx.SUNKEN_BORDER) sboxs1 = wx.StaticBoxSizer(sbox1,wx.VERTICAL) hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.real = SpinnerObject(self,"Real:",MAX_INT_16,MIN_INT_16,0.1,1.0,50,150) hbox2.Add(self.real, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) hbox2.Add((5, -1)) self.imag = SpinnerObject(self,"Imag:",MAX_INT_16,MIN_INT_16,0.1,0.0,50,150) hbox2.Add(self.imag, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) sboxs1.Add(hbox2, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add(sboxs1, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox )
def __init__(self,parent,ancestor): from math import pi self.ancestor = ancestor wx.ScrolledWindow.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = wx.StaticText(self, label="View Support array") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.support = TextPanelObject(self, "Support: ", "",100,'*.npy') vbox.Add(self.support, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Data array: ", "",100,'*.npy') vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((-1, 5)) self.sbox1 = wx.StaticBox(self, label="Isosurface", style=wx.BORDER_DEFAULT) self.sboxs1 = wx.StaticBoxSizer(self.sbox1,wx.VERTICAL) self.hbox1 = wx.BoxSizer(wx.HORIZONTAL) self.contour_support = SpinnerObject(self,"Support:",1.0,0.0,0.1,0.5,100,100) self.hbox1.Add(self.contour_support,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.hbox1.Add((20, -1)) self.opacity = SpinnerObject(self,"Opacity:",1.0,0.0,0.1,0.5,130,100) self.hbox1.Add(self.opacity,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.sboxs1.Add(self.hbox1,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.contour = SpinnerObject(self,"Data:",MAX_INT,MIN_INT,1,100,100,100) self.hbox2.Add(self.contour,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.hbox2.Add((20, -1)) self.feature_angle = SpinnerObject(self,"Feature Angle:",180,0,1,90,130,100) self.hbox2.Add(self.feature_angle,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.sboxs1.Add(self.hbox2,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.sboxs1.Add((-1, 5)) vbox.Add(self.sboxs1,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((-1, 5)) self.hbox6 = wx.BoxSizer(wx.HORIZONTAL) self.chkbox_axes = wx.CheckBox(self, -1, 'View axes', size=(200, 20)) self.chkbox_axes.SetValue(False) self.hbox6.Add(self.chkbox_axes, 1,flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=2) self.hbox6.Add((-1, 5)) self.axes_fontfactor = SpinnerObject(self,"Font Factor:",MAX_INT,1,1,2,100,100) self.hbox6.Add(self.axes_fontfactor, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=2) vbox.Add(self.hbox6, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP|wx.BOTTOM, border=2) vbox.Add((-1, 5)) button_view = wx.Button(self, label="View", size=(70, 30)) button_view.Bind(wx.EVT_BUTTON, self.SeqParser ) vbox.Add(button_view,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox ) self.FitInside() self.SetScrollRate(5, 5)
def __init__(self, parent): wx.Panel.__init__(self, parent, -1) # URL??? self.method_choice = wx.Choice(self, -1, size=(80, -1), choices=[u'GET', u'POST']) self.method_choice.SetSelection(0) self.url_text = wx.TextCtrl(self, -1) url_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "URL")) url_sizer.Add(self.method_choice, 0) url_sizer.Add(self.url_text, 1, wx.EXPAND | wx.LEFT, 2) # ?? self.post_params_text = wx.TextCtrl(self, -1, size=(-1, 150), style=wx.TE_MULTILINE | wx.HSCROLL) post_params_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Post Params"), wx.VERTICAL) post_params_sizer.Add(self.post_params_text, 1, wx.EXPAND | wx.TOP, 5) # ??? self.headers_text = wx.TextCtrl(self, -1, size=(-1, 150), style=wx.TE_MULTILINE | wx.HSCROLL) headers_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Headers")) headers_sizer.Add(self.headers_text, 1, wx.EXPAND) # ???? self.template_choice = wx.Choice(self, -1, size=(150, -1), choices=[]) template_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Template")) template_sizer.Add(self.template_choice, 1, wx.EXPAND) # ????????? self.slice_text = wx.TextCtrl(self, -1) slice_sizer = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Response slice startswith")) slice_sizer.Add(self.slice_text, 1, wx.EXPAND) # ?? self.transform_button = wx.Button(self, -1, u'Only Transform', size=(130, 30)) self.request_transform_button = wx.Button(self, -1, u'Request And Transform', size=(170, 30)) button_sizer = wx.BoxSizer(wx.HORIZONTAL) button_sizer.Add((0, 0), 1) button_sizer.Add(self.transform_button, 0) button_sizer.Add(self.request_transform_button, 0) main_box = wx.BoxSizer(wx.VERTICAL) main_box.Add(url_sizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) main_box.Add(post_params_sizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) main_box.Add(headers_sizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) main_box.Add(template_sizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) main_box.Add(slice_sizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) main_box.Add(button_sizer, 0, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, 5) self.SetSizer(main_box) self.preload_templates() self.Bind(wx.EVT_BUTTON, self.on_request_transform_button_click, self.request_transform_button) self.Bind(wx.EVT_BUTTON, self.on_transform_button_click, self.transform_button)
def InitUI(self): self.panel = wx.Panel(self, wx.ID_ANY) # Info Text infotext = _(u'Close all open Applications, it is possible that programs will be closed without a warning ' u'and system could reboot without further confirmation.') infobox = wx.StaticBox(self.panel, -1, _(u'Attention')) infoboxbsizer = wx.StaticBoxSizer(infobox, wx.VERTICAL) info = wx.StaticText(self.panel, label=infotext) info.Wrap(380) infoboxbsizer.Add(info, 0) self.gauge = wx.Gauge(self.panel, size=(24, 26)) self.update_label = wx.StaticText(self.panel, label=_(u'Current Progress:')) self.update_box = wx.TextCtrl(self.panel, style=wx.TE_READONLY) self.update_box.SetBackgroundColour(wx.WHITE) self.chk_shutdown = wx.CheckBox(self.panel, size=(160,20), label=_(u"Shutdown after update")) self.logButton = wx.Button(self.panel, size=(54,26), label="LOG") self.logButton.SetToolTip(wx.ToolTip(_(u'Open WPKG Log'))) self.logButton.SetBitmap(img.get('log')) self.startButton = wx.Button(self.panel, label=_(u"Update")) self.abortButton = wx.Button(self.panel, label=_(u"Cancel")) self.logButton.Disable() self.abortButton.Disable() self.line = wx.StaticLine(self.panel, -1, size=(2,2), style=wx.LI_HORIZONTAL) self.startButton.Bind(wx.EVT_BUTTON, self.OnStartButton) self.abortButton.Bind(wx.EVT_BUTTON, self.OnAbortButton) self.logButton.Bind(wx.EVT_BUTTON, self.OnLogButton) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer2 = wx.BoxSizer(wx.HORIZONTAL) self.sizer.Add(infoboxbsizer, 0, wx.ALL | wx.EXPAND, 5) self.sizer.Add(self.gauge, 0, wx.ALL | wx.EXPAND, 5) self.sizer.Add(self.update_label, 0, wx.ALL | wx.EXPAND, 5) self.sizer.Add(self.update_box, 0, wx.ALL | wx.EXPAND, 5) self.sizer.Add(self.line, 0, wx.ALL | wx.EXPAND, 5) self.sizer.Add(self.chk_shutdown, 0, wx.LEFT | wx.EXPAND, 7) self.sizer2.Add(self.logButton, 0) self.sizer2.AddStretchSpacer() self.sizer2.Add(self.startButton, 0)#, wx.RIGHT, 2) self.sizer2.Add(self.abortButton, 0) self.sizer.Add(self.sizer2, 0, wx.ALL | wx.EXPAND, 5) self.panel.SetSizerAndFit(self.sizer) self.Center()
def __do_layout(self): # begin wxGlade: SerialConfigDialog.__do_layout sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) self.sizer_flow_staticbox.Lower() sizer_flow = wx.StaticBoxSizer(self.sizer_flow_staticbox, wx.HORIZONTAL) self.sizer_timeout_staticbox.Lower() sizer_timeout = wx.StaticBoxSizer(self.sizer_timeout_staticbox, wx.HORIZONTAL) self.sizer_format_staticbox.Lower() sizer_format = wx.StaticBoxSizer(self.sizer_format_staticbox, wx.VERTICAL) grid_sizer_1 = wx.FlexGridSizer(3, 2, 0, 0) self.sizer_1_staticbox.Lower() sizer_1 = wx.StaticBoxSizer(self.sizer_1_staticbox, wx.VERTICAL) sizer_basics = wx.FlexGridSizer(3, 2, 0, 0) sizer_basics.Add(self.label_2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4) sizer_basics.Add(self.choice_port, 0, wx.EXPAND, 0) sizer_basics.Add(self.label_1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4) sizer_basics.Add(self.combo_box_baudrate, 0, wx.EXPAND, 0) sizer_basics.AddGrowableCol(1) sizer_1.Add(sizer_basics, 0, wx.EXPAND, 0) sizer_2.Add(sizer_1, 0, wx.EXPAND, 0) grid_sizer_1.Add(self.label_3, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4) grid_sizer_1.Add(self.choice_databits, 1, wx.EXPAND | wx.ALIGN_RIGHT, 0) grid_sizer_1.Add(self.label_4, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4) grid_sizer_1.Add(self.choice_stopbits, 1, wx.EXPAND | wx.ALIGN_RIGHT, 0) grid_sizer_1.Add(self.label_5, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4) grid_sizer_1.Add(self.choice_parity, 1, wx.EXPAND | wx.ALIGN_RIGHT, 0) sizer_format.Add(grid_sizer_1, 1, wx.EXPAND, 0) self.panel_format.SetSizer(sizer_format) sizer_2.Add(self.panel_format, 0, wx.EXPAND, 0) sizer_timeout.Add(self.checkbox_timeout, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4) sizer_timeout.Add(self.text_ctrl_timeout, 0, 0, 0) sizer_timeout.Add(self.label_6, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4) self.panel_timeout.SetSizer(sizer_timeout) sizer_2.Add(self.panel_timeout, 0, wx.EXPAND, 0) sizer_flow.Add(self.checkbox_rtscts, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4) sizer_flow.Add(self.checkbox_xonxoff, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4) sizer_flow.Add((10, 10), 1, wx.EXPAND, 0) self.panel_flow.SetSizer(sizer_flow) sizer_2.Add(self.panel_flow, 0, wx.EXPAND, 0) sizer_3.Add(self.button_ok, 0, 0, 0) sizer_3.Add(self.button_cancel, 0, 0, 0) sizer_2.Add(sizer_3, 0, wx.ALL | wx.ALIGN_RIGHT, 4) self.SetSizer(sizer_2) sizer_2.Fit(self) self.Layout() # end wxGlade
def __do_layout(self): # begin wxGlade: SerialConfigDialog.__do_layout # end wxGlade sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) sizer_basics = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Basics"), wx.VERTICAL) sizer_5 = wx.BoxSizer(wx.HORIZONTAL) sizer_5.Add(self.label_2, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) sizer_5.Add(self.combo_box_port, 1, 0, 0) sizer_basics.Add(sizer_5, 0, wx.RIGHT|wx.EXPAND, 0) if self.show & SHOW_BAUDRATE: sizer_baudrate = wx.BoxSizer(wx.HORIZONTAL) sizer_baudrate.Add(self.label_1, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) sizer_baudrate.Add(self.choice_baudrate, 1, wx.ALIGN_RIGHT, 0) sizer_basics.Add(sizer_baudrate, 0, wx.EXPAND, 0) sizer_2.Add(sizer_basics, 0, wx.EXPAND, 0) if self.show & SHOW_FORMAT: sizer_8 = wx.BoxSizer(wx.HORIZONTAL) sizer_7 = wx.BoxSizer(wx.HORIZONTAL) sizer_6 = wx.BoxSizer(wx.HORIZONTAL) sizer_format = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Data Format"), wx.VERTICAL) sizer_6.Add(self.label_3, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) sizer_6.Add(self.choice_databits, 1, wx.ALIGN_RIGHT, 0) sizer_format.Add(sizer_6, 0, wx.EXPAND, 0) sizer_7.Add(self.label_4, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) sizer_7.Add(self.choice_stopbits, 1, wx.ALIGN_RIGHT, 0) sizer_format.Add(sizer_7, 0, wx.EXPAND, 0) sizer_8.Add(self.label_5, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) sizer_8.Add(self.choice_parity, 1, wx.ALIGN_RIGHT, 0) sizer_format.Add(sizer_8, 0, wx.EXPAND, 0) sizer_2.Add(sizer_format, 0, wx.EXPAND, 0) if self.show & SHOW_TIMEOUT: sizer_timeout = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Timeout"), wx.HORIZONTAL) sizer_timeout.Add(self.checkbox_timeout, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) sizer_timeout.Add(self.text_ctrl_timeout, 0, 0, 0) sizer_timeout.Add(self.label_6, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) sizer_2.Add(sizer_timeout, 0, 0, 0) if self.show & SHOW_FLOW: sizer_flow = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Flow Control"), wx.HORIZONTAL) sizer_flow.Add(self.checkbox_rtscts, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) sizer_flow.Add(self.checkbox_xonxoff, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 4) sizer_flow.Add((10,10), 1, wx.EXPAND, 0) sizer_2.Add(sizer_flow, 0, wx.EXPAND, 0) sizer_3.Add(self.button_ok, 0, 0, 0) sizer_3.Add(self.button_cancel, 0, 0, 0) sizer_2.Add(sizer_3, 0, wx.ALL|wx.ALIGN_RIGHT, 4) self.SetAutoLayout(1) self.SetSizer(sizer_2) sizer_2.Fit(self) sizer_2.SetSizeHints(self) self.Layout()
def create_static_box(self, **kwargs): panel = kwargs.get('panel') value = kwargs.get('value') gui = kwargs.get('gui') key = kwargs.get('key') static_box = wx.StaticBox(panel, label=translate_key(MODULE_KEY.join(key))) static_sizer = wx.StaticBoxSizer(static_box, wx.VERTICAL) instatic_sizer = wx.BoxSizer(wx.VERTICAL) spacer_size = 7 max_text_size = 0 text_ctrls = [] log.debug("Working on {0}".format(MODULE_KEY.join(key))) spacer = False hidden_items = gui.get('hidden', []) for item, value in value.items(): if item in hidden_items and not self.show_hidden: continue view = gui.get(item, {}).get('view', type(value)) if view in self.value_map.keys(): fnction = self.value_map[view] elif callable(value): fnction = self.value_map['button'] else: return item_dict = fnction['function'](panel=static_box, item=item, value=value, key=key + [item], bind=fnction['bind'], gui=gui.get(item, {}), from_sb=True) if 'text_size' in item_dict: if max_text_size < item_dict.get('text_size'): max_text_size = item_dict['text_size'] text_ctrls.append(item_dict['text_ctrl']) spacer = True if not spacer else instatic_sizer.AddSpacer(spacer_size) instatic_sizer.Add(item_dict['item'], 0, wx.EXPAND, 5) if max_text_size: for ctrl in text_ctrls: ctrl.SetMinSize((max_text_size + 50, ctrl.GetSize()[1])) item_count = instatic_sizer.GetItemCount() if not item_count: static_sizer.Destroy() return wx.BoxSizer(wx.VERTICAL) static_sizer.Add(instatic_sizer, 0, wx.EXPAND | wx.ALL, 5) return static_sizer
def __init__(self, data_index_uid, display, is_range, min_idx, max_idx, *args, **kwargs): super(DimensionPanel, self).__init__(*args, **kwargs) self.SetSize(300, 50) # self.data_index_uid = data_index_uid OM = ObjectManager(self) obj = OM.get(data_index_uid) # main_sizer = wx.StaticBoxSizer(wx.VERTICAL, self, obj.name) # self.top_panel = wx.Panel(self) self.top_sizer = wx.BoxSizer(wx.HORIZONTAL) # self.check_display = wx.CheckBox(self.top_panel, -1, label='Display') self.check_display.Bind(wx.EVT_CHECKBOX, self._on_check_display) self.top_sizer.Add(self.check_display, 1, wx.ALIGN_CENTER|wx.LEFT, 30) # self.check_range = wx.CheckBox(self.top_panel, -1, label='Range') self.check_range.Bind(wx.EVT_CHECKBOX, self._on_check_range) self.top_sizer.Add(self.check_range, 1, wx.ALIGN_CENTER|wx.RIGHT, 30) self.top_panel.SetSizer(self.top_sizer) # main_sizer.Add(self.top_panel, 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 3) # self.label = obj.name self.vec = obj.data self.display = display self.is_range = is_range # self.bottom_panel = wx.Panel(self) self.bottom_sizer = wx.BoxSizer(wx.VERTICAL) self.slider = RangeSlider(self.bottom_panel) self.bottom_sizer.Add(self.slider, 0, wx.EXPAND) self.text_value = wx.StaticText(self.bottom_panel, -1) self.bottom_sizer.Add(self.text_value, 0, wx.ALIGN_CENTER) self.bottom_panel.SetSizer(self.bottom_sizer) # main_sizer.Add(self.bottom_panel, 0, wx.EXPAND) # self.slider.SetRange(0, len(self.vec)-1) self.min_idx = min_idx self.max_idx = max_idx # if self.display: self.set_check_display(1) else: self.set_check_display(0) # self.Bind(wx.EVT_PAINT, self._on_paint) self.SetSizer(main_sizer) main_sizer.Layout()