Python wx.EVT_CHOICE Examples
The following are 14
code examples of wx.EVT_CHOICE().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: Input_Dialog_OLD2.py From topoflow with MIT License | 6 votes |
def row_box(self, row): label = wx.TextCtrl(self.panel, -1, value=self.var_names[row]) model_input_types = ["Scalar", "Time series", "Grid", "Grid sequence"] dlist = wx.Choice(self.panel, -1, choices=model_input_types) # Set to current input type here text = wx.TextCtrl(self.panel, -1, self.var_setting[row]) ustr = wx.StaticText(self.panel, -1, self.var_units[row]) # self.Bind(wx.EVT_CHOICE, self.onChoice, self.var_type) box = wx.BoxSizer(wx.HORIZONTAL) box.Add(label, 0, wx.GROW, border=self.pad) box.Add(dlist, 0, wx.GROW, border=self.pad) box.Add(text, 0, wx.GROW, border=self.pad) box.Add(ustr, 0, wx.GROW, border=self.pad) # box.AddMany([label, dlist, text, ustr]) #, 1, wx.EXPAND) # self.SetSizer(box) return box #--------------------------------------------- # Create sizer box for the process timestep #---------------------------------------------
Example #2
Source File: Input_Dialog_OLD1.py From topoflow with MIT License | 6 votes |
def row_box(self, row): label = wx.TextCtrl(self.panel, -1, value=self.var_names[row]) model_input_types = ["Scalar", "Time series", "Grid", "Grid sequence"] dlist = wx.Choice(self.panel, -1, choices=model_input_types) # Set to current input type here text = wx.TextCtrl(self.panel, -1, self.var_setting[row]) ustr = wx.StaticText(self.panel, -1, self.var_units[row]) # self.Bind(wx.EVT_CHOICE, self.onChoice, self.var_type) box = wx.BoxSizer(wx.HORIZONTAL) box.Add(label, 0, wx.GROW, border=self.pad) box.Add(dlist, 0, wx.GROW, border=self.pad) box.Add(text, 0, wx.GROW, border=self.pad) box.Add(ustr, 0, wx.GROW, border=self.pad) # box.AddMany([label, dlist, text, ustr]) #, 1, wx.EXPAND) # self.SetSizer(box) return box #--------------------------------------------- # Create sizer box for the process timestep #---------------------------------------------
Example #3
Source File: Gui.py From Crypter with GNU General Public License v3.0 | 6 votes |
def set_events(self): ''' @summary: Set GUI events for the various controls ''' # Catch Language choice changes self.Bind(wx.EVT_CHOICE, self.update_language, self.BuilderLanguageChoice) # Catch config file load and save self.Bind(wx.EVT_FILEPICKER_CHANGED, self.__load_config, self.LoadFilePicker) self.Bind(wx.EVT_FILEPICKER_CHANGED, self.__save_config, self.SaveFilePicker) # BUILD button self.Bind(wx.EVT_BUTTON, self.__start_build, self.BuildButton) # Mainframe close self.Bind(wx.EVT_CLOSE, self.__close_builder, self) # Disable Open Containing Folder Button and bind event self.OpenContainingFolderButton.Disable() self.Bind(wx.EVT_BUTTON, self.__open_containing_folder, self.OpenContainingFolderButton)
Example #4
Source File: gui.py From superpaper with MIT License | 5 votes |
def create_sizer_profiles(self): # choice menu self.list_of_profiles = list_profiles() self.profnames = [] for prof in self.list_of_profiles: self.profnames.append(prof.name) self.profnames.append("Create a new profile") self.choice_profiles = wx.Choice(self, -1, name="ProfileChoice", choices=self.profnames) self.choice_profiles.Bind(wx.EVT_CHOICE, self.onSelect) st_choice_profiles = wx.StaticText(self, -1, "Setting profiles:") # name txt ctrl st_name = wx.StaticText(self, -1, "Profile name:") self.tc_name = wx.TextCtrl(self, -1, size=(self.tc_width, -1)) self.tc_name.SetMaxLength(14) # buttons self.button_new = wx.Button(self, label="New") self.button_save = wx.Button(self, label="Save") self.button_delete = wx.Button(self, label="Delete") self.button_new.Bind(wx.EVT_BUTTON, self.onCreateNewProfile) self.button_save.Bind(wx.EVT_BUTTON, self.onSave) self.button_delete.Bind(wx.EVT_BUTTON, self.onDeleteProfile) # Add elements to the sizer self.sizer_profiles.Add(st_choice_profiles, 0, wx.CENTER|wx.ALL, 5) self.sizer_profiles.Add(self.choice_profiles, 0, wx.CENTER|wx.ALL, 5) self.sizer_profiles.Add(st_name, 0, wx.CENTER|wx.ALL, 5) self.sizer_profiles.Add(self.tc_name, 0, wx.CENTER|wx.ALL, 5) self.sizer_profiles.Add(self.button_new, 0, wx.CENTER|wx.ALL, 5) self.sizer_profiles.Add(self.button_save, 0, wx.CENTER|wx.ALL, 5) self.sizer_profiles.Add(self.button_delete, 0, wx.CENTER|wx.ALL, 5)
Example #5
Source File: ConfigPanel.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def FinishSetup(self): self.shown = True if self.lines: self.AddGrid(self.lines, *self.sizerProps) spaceSizer = wx.BoxSizer(wx.HORIZONTAL) spaceSizer.Add((2, 2)) spaceSizer.Add(self.sizer, 1, wx.EXPAND | wx.TOP | wx.BOTTOM, 3) spaceSizer.Add((4, 4)) self.SetSizerAndFit(spaceSizer) #self.dialog.FinishSetup() def OnEvent(dummyEvent): self.SetIsDirty() self.Bind(wx.EVT_CHECKBOX, OnEvent) self.Bind(wx.EVT_BUTTON, OnEvent) self.Bind(wx.EVT_CHOICE, OnEvent) self.Bind(wx.EVT_TOGGLEBUTTON, OnEvent) self.Bind(wx.EVT_TEXT, OnEvent) self.Bind(wx.EVT_RADIOBOX, OnEvent) self.Bind(wx.EVT_RADIOBUTTON, OnEvent) self.Bind(wx.EVT_TREE_SEL_CHANGED, OnEvent) self.Bind(wx.EVT_DATE_CHANGED, OnEvent) self.Bind(eg.EVT_VALUE_CHANGED, OnEvent) self.Bind(wx.EVT_CHECKLISTBOX, OnEvent) self.Bind(wx.EVT_SCROLL, OnEvent) self.Bind(wx.EVT_LISTBOX, OnEvent)
Example #6
Source File: UriEditor.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def _init_ctrls(self, parent): self.UriTypeChoice = wx.Choice(parent=self, choices=self.choices) self.UriTypeChoice.SetSelection(0) self.Bind(wx.EVT_CHOICE, self.OnTypeChoice, self.UriTypeChoice) self.editor_sizer = wx.BoxSizer(wx.HORIZONTAL) self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL)
Example #7
Source File: rstbx_frame.py From dials with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, *args, **kwds): super(ZoomFrame, self).__init__(*args, **kwds) self.settings = self.GetParent().settings self.control_panel = wx.Panel(self) self.panel = rstbx.viewer.display.ZoomView(self, -1) szr = wx.BoxSizer(wx.VERTICAL) self.SetSizer(szr) szr.Add(self.control_panel) szr.Add(self.panel, 1, wx.EXPAND) self.numbers_box = wx.CheckBox(self.control_panel, -1, "Show intensity values") txt1 = wx.StaticText(self.control_panel, -1, "Text color:") self.text_color = wx.lib.colourselect.ColourSelect( self.control_panel, colour=(255, 255, 0) ) pszr = wx.BoxSizer(wx.VERTICAL) self.control_panel.SetSizer(pszr) box1 = wx.BoxSizer(wx.HORIZONTAL) pszr.Add(box1) box1.Add(self.numbers_box, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) box1.Add(txt1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) box1.Add(self.text_color, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) box2 = wx.BoxSizer(wx.HORIZONTAL) pszr.Add(box2) txt2 = wx.StaticText(self.control_panel, -1, "Magnification:") self.mag_ctrl = wx.Choice( self.control_panel, -1, choices=["%dx" % x for x in mag_levels] ) self.mag_ctrl.SetSelection(1) box2.Add(txt2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) box2.Add(self.mag_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.Bind(wx.EVT_CLOSE, lambda evt: self.Destroy(), self) self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy) self.Bind(wx.EVT_CHECKBOX, self.OnChangeSettings, self.numbers_box) self.Bind( wx.lib.colourselect.EVT_COLOURSELECT, self.OnChangeSettings, self.text_color ) self.Bind(wx.EVT_CHOICE, self.OnChangeSettings, self.mag_ctrl) szr.Fit(self.panel) self.Fit()
Example #8
Source File: panel_monitor.py From RF-Monitor with GNU General Public License v2.0 | 4 votes |
def __init__(self, parent, eventHandler): Monitor.__init__(self, None, False, False, None, None, False, [], []) self._eventHandler = eventHandler self._isRecording = False self._isRunning = False self._isLow = True self._colours = [] pre = wx.PrePanel() self._ui = load_ui('PanelMonitor.xrc') handlerNumCtrl = XrcHandlerNumCtrl() handlerMeter = XrcHandlerMeter() self._ui.AddHandler(handlerNumCtrl) self._ui.AddHandler(handlerMeter) self._ui.LoadOnPanel(pre, parent, 'PanelMonitor') self.PostCreate(pre) self._panelColour = xrc.XRCCTRL(pre, 'panelColour') self._checkEnable = xrc.XRCCTRL(pre, 'checkEnable') self._checkAlert = xrc.XRCCTRL(pre, 'checkAlert') self._checkDynamic = xrc.XRCCTRL(pre, 'checkDynamic') self._choiceFreq = xrc.XRCCTRL(pre, 'choiceFreq') self._textSignals = xrc.XRCCTRL(pre, 'textSignals') # TODO: hackish for child in self.GetChildren(): if isinstance(child, WidgetMeter): self._meterLevel = child self._sliderThreshold = xrc.XRCCTRL(pre, 'sliderThreshold') self._buttonDel = xrc.XRCCTRL(pre, 'buttonDel') self.__set_records() self._on_del = None self._panelColour.Bind(wx.EVT_LEFT_UP, self.__on_colour) self.Bind(wx.EVT_CHECKBOX, self.__on_enable, self._checkEnable) self.Bind(wx.EVT_CHECKBOX, self.__on_alert, self._checkAlert) self.Bind(wx.EVT_CHECKBOX, self.__on_dynamic, self._checkDynamic) self.Bind(wx.EVT_CHOICE, self.__on_freq, self._choiceFreq) self.Bind(wx.EVT_SLIDER, self.__on_threshold, self._sliderThreshold) self.Bind(wx.EVT_BUTTON, self.__on_del, self._buttonDel)
Example #9
Source File: runsnake.py From pyFileFixity with MIT License | 4 votes |
def SetupToolBar(self): """Create the toolbar for common actions""" tb = self.CreateToolBar(self.TBFLAGS) tsize = (24, 24) tb.ToolBitmapSize = tsize open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR, tsize) tb.AddLabelTool(ID_OPEN, "Open", open_bmp, shortHelp="Open", longHelp="Open a (c)Profile trace file") if not osx: tb.AddSeparator() # self.Bind(wx.EVT_TOOL, self.OnOpenFile, id=ID_OPEN) self.rootViewTool = tb.AddLabelTool( ID_ROOT_VIEW, _("Root View"), wx.ArtProvider.GetBitmap(wx.ART_GO_HOME, wx.ART_TOOLBAR, tsize), shortHelp=_("Display the root of the current view tree (home view)") ) self.rootViewTool = tb.AddLabelTool( ID_BACK_VIEW, _("Back"), wx.ArtProvider.GetBitmap(wx.ART_GO_BACK, wx.ART_TOOLBAR, tsize), shortHelp=_("Back to the previously activated node in the call tree") ) self.upViewTool = tb.AddLabelTool( ID_UP_VIEW, _("Up"), wx.ArtProvider.GetBitmap(wx.ART_GO_UP, wx.ART_TOOLBAR, tsize), shortHelp=_("Go one level up the call tree (highest-percentage parent)") ) if not osx: tb.AddSeparator() # TODO: figure out why the control is sizing the label incorrectly on Linux self.percentageViewTool = wx.CheckBox(tb, -1, _("Percent ")) self.percentageViewTool.SetToolTip(wx.ToolTip( _("Toggle display of percentages in list views"))) tb.AddControl(self.percentageViewTool) wx.EVT_CHECKBOX(self.percentageViewTool, self.percentageViewTool.GetId(), self.OnPercentageView) self.viewTypeTool= wx.Choice( tb, -1, choices= getattr(self.loader,'ROOTS',[]) ) self.viewTypeTool.SetToolTip(wx.ToolTip( _("Switch between different hierarchic views of the data"))) wx.EVT_CHOICE( self.viewTypeTool, self.viewTypeTool.GetId(), self.OnViewTypeTool ) tb.AddControl( self.viewTypeTool ) tb.Realize()
Example #10
Source File: LanguageSettings.py From BitTorrent with GNU General Public License v3.0 | 4 votes |
def __init__(self, parent, *a, **k): wx.Panel.__init__(self, parent, *a, **k) self.sizer = VSizer() self.SetSizer(self.sizer) if 'errback' in k: self.errback = k.pop('errback') else: self.errback = self.set_language_failed # widgets self.box = wx.StaticBox(self, label="Translate %s into:" % app_name) self.language_names = ["System default",] + [language_names[l] for l in languages] languages.insert(0, '') self.languages = languages self.choice = wx.Choice(self, choices=self.language_names) self.Bind(wx.EVT_CHOICE, self.set_language, self.choice) restart = wx.StaticText(self, -1, "You must restart %s for the\nlanguage " "setting to take effect." % app_name) self.bottom_error = wx.StaticText(self, -1, '') self.bottom_error.SetForegroundColour(error_color) # sizers self.box_sizer = wx.StaticBoxSizer(self.box, wx.VERTICAL) # set menu selection and warning item if necessary self.valid = True lang = read_language_file() if lang is not None: try: i = self.languages.index(lang) self.choice.SetSelection(i) except ValueError, e: self.top_error = wx.StaticText(self, -1, "This version of %s does not \nsupport the language '%s'."%(app_name,lang),) self.top_error.SetForegroundColour(error_color) self.box_sizer.Add(self.top_error, flag=wx.TOP|wx.LEFT|wx.RIGHT, border=SPACING) # BUG add menu separator # BUG change color of extra menu item self.choice.Append(lang) self.choice.SetSelection(len(self.languages)) self.valid = False
Example #11
Source File: GUI_utils.py From topoflow with MIT License | 4 votes |
def Labeled_Droplist(frame, panel, sizer, \ label, choice_list, function, \ button1=None, b1_function=None, \ button2=None, b2_function=None, \ box_width=280, border=5, \ choice_number=0): L1 = wx.StaticText(panel, -1, label) sizer.Add(L1, 0, wx.ALL, border) D1 = wx.Choice(panel, -1, choices=choice_list, \ size=(box_width, -1)) D1.Select(choice_number) sizer.Add(D1, 0, wx.ALL, border) frame.Bind(wx.EVT_CHOICE, function, D1) #--------------------------- # Option to add 1st button #--------------------------- if (button1 is None): null_item1 = wx.StaticText(panel, -1, "") sizer.Add(null_item1, 0, wx.ALL, border) else: B1 = wx.Button(panel, -1, button1) sizer.Add(B1, 0, wx.ALL, border) frame.Bind(wx.EVT_BUTTON, b1_function, B1) #--------------------------- # Option to add 2nd button #--------------------------- if (button2 is None): null_item2 = wx.StaticText(panel, -1, "") sizer.Add(null_item2, 0, wx.ALL, border) else: B2 = wx.Button(panel, -1, button2) sizer.Add(B2, 0, wx.ALL, border) frame.Bind(wx.EVT_BUTTON, b2_function, B2) return D1 # (droplist object) # Labeled_Droplist #----------------------------------------------------------------
Example #12
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 4 votes |
def Configure(self, mode = 0, state = 0): self.stt = state panel=eg.ConfigPanel(self) topSizer = wx.StaticBoxSizer( wx.StaticBox(panel, -1, self.text.rbLabel), wx.VERTICAL ) boolSizer = wx.BoxSizer(wx.HORIZONTAL) rb0 = panel.RadioButton(mode==0, self.text.numVal, style=wx.RB_GROUP) rb1 = panel.RadioButton(mode==1, self.text.strVal) rb2 = panel.RadioButton(mode==2, self.text.boolVal) statChoice = wx.Choice(panel, -1, choices = self.text.states) statChoice.Select(state) boolSizer.Add(rb2,0,wx.TOP,3) boolSizer.Add(statChoice) topSizer.Add(rb0,0,wx.TOP,3) topSizer.Add(rb1,0,wx.TOP,7) topSizer.Add(boolSizer,0,wx.TOP,5) panel.sizer.Add(topSizer) def onState(evt): self.stt = evt.GetSelection() evt.Skip() statChoice.Bind(wx.EVT_CHOICE, onState) def onRadio(evt = None): flg = rb2.GetValue() statChoice.Enable(flg) sel = self.stt if flg else -1 statChoice.SetSelection(sel) if evt: evt.Skip() rb0.Bind(wx.EVT_RADIOBUTTON, onRadio) rb1.Bind(wx.EVT_RADIOBUTTON, onRadio) rb2.Bind(wx.EVT_RADIOBUTTON, onRadio) onRadio() while panel.Affirmed(): state = state if self.stt == -1 else self.stt panel.SetResult( (rb0.GetValue(),rb1.GetValue(),rb2.GetValue()).index(True), state, ) #===============================================================================
Example #13
Source File: rstbx_frame.py From dials with BSD 3-Clause "New" or "Revised" License | 4 votes |
def setup_toolbar(self): btn = self.toolbar.AddLabelTool( id=-1, label="Load file", bitmap=icons.hkl_file.GetBitmap(), shortHelp="Load file", kind=wx.ITEM_NORMAL, ) self.Bind(wx.EVT_MENU, self.OnLoadFile, btn) btn = self.toolbar.AddLabelTool( id=-1, label="Settings", bitmap=icons.advancedsettings.GetBitmap(), shortHelp="Settings", kind=wx.ITEM_NORMAL, ) self.Bind(wx.EVT_MENU, self.OnShowSettings, btn) btn = self.toolbar.AddLabelTool( id=-1, label="Zoom", bitmap=icons.search.GetBitmap(), shortHelp="Zoom", kind=wx.ITEM_NORMAL, ) self.Bind(wx.EVT_MENU, self.OnZoom, btn) txt = wx.StaticText(self.toolbar, -1, "Image:") self.toolbar.AddControl(txt) self.image_chooser = wx.Choice(self.toolbar, -1, size=(300, -1)) self.toolbar.AddControl(self.image_chooser) self.Bind(wx.EVT_CHOICE, self.OnChooseImage, self.image_chooser) btn = self.toolbar.AddLabelTool( id=wx.ID_BACKWARD, label="Previous", bitmap=bitmaps.fetch_icon_bitmap("actions", "1leftarrow"), shortHelp="Previous", kind=wx.ITEM_NORMAL, ) self.Bind(wx.EVT_MENU, self.OnPrevious, btn) btn = self.toolbar.AddLabelTool( id=wx.ID_FORWARD, label="Next", bitmap=bitmaps.fetch_icon_bitmap("actions", "1rightarrow"), shortHelp="Next", kind=wx.ITEM_NORMAL, ) self.Bind(wx.EVT_MENU, self.OnNext, btn)
Example #14
Source File: rstbx_frame.py From dials with BSD 3-Clause "New" or "Revised" License | 4 votes |
def __init__(self, *args, **kwds): wx.Panel.__init__(self, *args, **kwds) self.settings = self.GetParent().settings self._sizer = wx.BoxSizer(wx.VERTICAL) s = self._sizer self.SetSizer(self._sizer) grid = wx.FlexGridSizer(cols=2, rows=2) s.Add(grid) txt1 = wx.StaticText(self, -1, "Zoom level:") grid.Add(txt1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.zoom_ctrl = wx.Choice( self, -1, choices=["Auto", "25%", "50%", "100%", "200%", "400%", "800%"] ) self.zoom_ctrl.SetSelection(self.settings.zoom_level) grid.Add(self.zoom_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) txt11 = wx.StaticText(self, -1, "Color scheme:") grid.Add(txt11, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.color_ctrl = wx.Choice( self, -1, choices=["grayscale", "rainbow", "heatmap", "invert"] ) self.color_ctrl.SetSelection(0) grid.Add(self.color_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self._sizer.Fit(self) box = wx.BoxSizer(wx.HORIZONTAL) s.Add(box) txt2 = wx.StaticText(self, -1, "Brightness") box.Add(txt2, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.brightness_ctrl = wx.Slider( self, -1, size=(200, -1), style=wx.SL_AUTOTICKS | wx.SL_LABELS ) box.Add(self.brightness_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.brightness_ctrl.SetMin(1) self.brightness_ctrl.SetMax(500) self.brightness_ctrl.SetValue(self.settings.brightness) self.brightness_ctrl.SetTickFreq(25) self.center_ctrl = wx.CheckBox(self, -1, "Mark beam center") self.center_ctrl.SetValue(self.settings.show_beam_center) s.Add(self.center_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.spots_ctrl = wx.CheckBox(self, -1, "Show spotfinder results") self.spots_ctrl.SetValue(self.settings.show_spotfinder_spots) s.Add(self.spots_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.integ_ctrl = wx.CheckBox(self, -1, "Show integration results") self.integ_ctrl.SetValue(self.settings.show_integration) s.Add(self.integ_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) # self.invert_ctrl = wx.CheckBox(self, -1, "Invert beam center axes") # self.invert_ctrl.SetValue(self.settings.invert_beam_center_axes) # s.Add(self.invert_ctrl, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) self.Bind(wx.EVT_CHOICE, self.OnUpdate, self.zoom_ctrl) self.Bind(wx.EVT_CHOICE, self.OnUpdate, self.color_ctrl) self.Bind(wx.EVT_SLIDER, self.OnUpdateBrightness, self.brightness_ctrl) self.Bind(wx.EVT_CHECKBOX, self.OnUpdate2, self.center_ctrl) self.Bind(wx.EVT_CHECKBOX, self.OnUpdate2, self.spots_ctrl) txt3 = wx.StaticText(self, -1, "Thumbnail view:") s.Add(txt3, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.thumb_panel = rstbx.viewer.display.ThumbnailView( parent=self, size=(256, 256), style=wx.SUNKEN_BORDER ) s.Add(self.thumb_panel, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) # self.Bind(wx.EVT_CHECKBOX, self.OnUpdate2, self.invert_ctrl)