def __bind_events(self): wx.EVT_SIZE(self, self.on_size) self.Bind( wx.EVT_LEFT_DOWN, self.on_select_layer ) self.label_name.Bind( wx.EVT_LEFT_DOWN, self.on_select_layer ) self.Bind( wx.EVT_LEFT_DCLICK, self.on_edit_layer ) self.label_name.Bind( wx.EVT_LEFT_DCLICK, self.on_edit_layer ) self.Bind( wx.EVT_BUTTON, self.on_toggle_lock, self.tog_lock ) self.Bind( wx.EVT_BUTTON, self.on_toggle_hide, self.tog_hide ) pynebula.pyBindSignal( self.layer.layer, 'layerlocked', self, 'onlayerlocked', 0 )
def refresh(self): if self.first_refresh: # Do the binding here because the object state doesn't exist yet # when this menu is created pynebula.pyBindSignal(app.get_object_state(), 'toolselected', self, 'ontoolselectedsignal', 0) self.first_refresh = False
def __bind_events(self): self.Bind(imgbox.EVT_IMAGE, self.on_select_brush, self.imgbox_brushes) self.Bind(events.EVT_CHANGING, self.on_brush_size, self.slider_size) self.Bind(events.EVT_CHANGED, self.on_brush_size, self.slider_size) self.Bind(wx.EVT_BUTTON, self.on_brush_size_range, self.button_range) self.Bind(imgbox.EVT_IMAGE, self.on_select_tool, self.imgbox_tools) pynebula.pyBindSignal(self.terrain, 'paintbrushsizechanged', self, 'onpaintbrushsizechanged', 0)
def __bind_events(self): pynebula.pyBindSignal( self.__get_module(), 'debugoptionchanged', self, 'onsignaldebugoptionchanged', 0 )
def __bind_signal(self, tool_id, signal_name, receiver_method): try: tool = pynebula.lookup(self.tool_paths[tool_id]) except: cjr.show_error_message("Tool '" + self.tool_paths[tool_id] + "' not found") else: pynebula.pyBindSignal(tool, signal_name, self, receiver_method, 0)
def __bind_events(self): self.Bind(events.EVT_CHANGING, self.on_change_speed, self.slider_speed) self.Bind(events.EVT_CHANGED, self.on_change_speed, self.slider_speed) self.Bind(wx.EVT_TOGGLEBUTTON, self.on_toggle_pause, self.button_debug) self.Bind(wx.EVT_BUTTON, self.on_apply_event, self.button_apply) self.Bind(wx.EVT_BUTTON, self.on_discard_event, self.button_discard) pynebula.pyBindSignal( app.get_ai_tester(), 'pendingeventchanged', self, 'onpendingeventchanged', 0 )
def __bind_signal(self, tool_id, signal_name, receiver_method): try: tool = pynebula.lookup( self.tool_paths[tool_id] ) except: cjr.show_error_message( "Tool '" + self.tool_paths[tool_id] + "' not found" ) else: pynebula.pyBindSignal(tool, signal_name, self, receiver_method, 0)
def __bind_events(self): wx.EVT_SIZE(self, self.on_size) self.Bind(wx.EVT_LEFT_DOWN, self.on_select_layer) self.label_name.Bind(wx.EVT_LEFT_DOWN, self.on_select_layer) self.Bind(wx.EVT_LEFT_DCLICK, self.on_edit_layer) self.label_name.Bind(wx.EVT_LEFT_DCLICK, self.on_edit_layer) self.Bind(wx.EVT_BUTTON, self.on_toggle_lock, self.tog_lock) self.Bind(wx.EVT_BUTTON, self.on_toggle_hide, self.tog_hide) pynebula.pyBindSignal(self.layer.layer, 'layerlocked', self, 'onlayerlocked', 0)
def refresh(self): if self.first_refresh: # Do the binding here because the object state doesn't exist yet # when this menu is created pynebula.pyBindSignal( app.get_object_state(), 'toolselected', self, 'ontoolselectedsignal', 0 ) self.first_refresh = False
def _bind_events(self): ToolPanel._bind_events(self) self.Bind(events.EVT_CHANGING, self.on_height, self.slider_height) self.Bind(events.EVT_CHANGED, self.on_height, self.slider_height) self.Bind(wx.EVT_CHECKBOX, self.on_check_adaptive, self.checkbox_adaptive) self.Bind(events.EVT_CHANGING, self.on_adaptive, self.slider_adaptive) self.Bind(events.EVT_CHANGED, self.on_adaptive, self.slider_adaptive) # Nebula signals pynebula.pyBindSignal(self.tool, 'refreshflattenheight', self, 'onheightsignal', 0)
def __bind_events(self): self.Bind(imgbox.EVT_IMAGE, self.on_select_brush, self.imgbox_brushes) self.Bind(events.EVT_CHANGING, self.on_brush_size, self.slider_size) self.Bind(events.EVT_CHANGED, self.on_brush_size, self.slider_size) self.Bind(wx.EVT_BUTTON, self.on_brush_size_range, self.button_range) self.Bind(imgbox.EVT_IMAGE, self.on_select_tool, self.imgbox_tools) pynebula.pyBindSignal( self.terrain, 'paintbrushsizechanged', self, 'onpaintbrushsizechanged', 0 )
def __bind_events(self): self.Bind( wx.EVT_CHECKLISTBOX, self.on_attribute_toggled, self.clbox ) pynebula.pyBindSignal( app.get_object_state(), 'selectionchanged', self, 'onselectionchanged', 0 )
def __bind_events(self): pynebula.pyBindSignal( app.get_object_state(), 'selectionchanged', self, 'onselectionchanged', 0 ) self.Bind( wx.EVT_BUTTON, self.on_click_close_button, self.button_close )
def refresh(self): """Update some checkmarks""" self.Check(ID_SnapToGrid, cfg.Repository.getsettingvalue(cfg.ID_Grid)['snap enabled']) self.Check( ID_AngleSnap, cfg.Repository.getsettingvalue(cfg.ID_AngleSnapping)['enabled']) self.Check( ID_SizeSnap, cfg.Repository.getsettingvalue(cfg.ID_SizeSnapping)['enabled']) self.Check(ID_SingleViewport, servers.get_viewport_ui().getsingleviewport()) pynebula.pyBindSignal(app.get_object_state(), 'lockedmodechanged', self, 'on_locked_mode_changed', 0)
def refresh( self ): """Update some checkmarks""" self.Check( ID_SnapToGrid, cfg.Repository.getsettingvalue(cfg.ID_Grid)['snap enabled'] ) self.Check( ID_AngleSnap, cfg.Repository.getsettingvalue(cfg.ID_AngleSnapping)['enabled'] ) self.Check( ID_SizeSnap, cfg.Repository.getsettingvalue(cfg.ID_SizeSnapping)['enabled'] ) self.Check( ID_SingleViewport, servers.get_viewport_ui().getsingleviewport() ) pynebula.pyBindSignal( app.get_object_state(), 'lockedmodechanged', self, 'on_locked_mode_changed', 0 )
def __bind_events(self): self.Bind( wx.EVT_NOTEBOOK_PAGE_CHANGED, self.on_page_changed ) pynebula.pyBindSignal( servers.get_kernel_server(), 'objectdeleted', self, 'onobjectdeleted', 0 ) #bind to events on property tab if I have one if self.__has_property_tab(): self.property_tab.Bind( propertyview.EVT_OK_REQUESTED, self.__handle_ok_on_property_tab ) self.property_tab.Bind( propertyview.EVT_CANCEL_REQUESTED, self.__handle_cancel_on_property_tab )
def _bind_events(self): ToolPanel._bind_events(self) self.Bind( events.EVT_CHANGING, self.on_height, self.slider_height ) self.Bind( events.EVT_CHANGED, self.on_height, self.slider_height ) self.Bind( wx.EVT_CHECKBOX, self.on_check_adaptive, self.checkbox_adaptive ) self.Bind( events.EVT_CHANGING, self.on_adaptive, self.slider_adaptive ) self.Bind( events.EVT_CHANGED, self.on_adaptive, self.slider_adaptive ) # Nebula signals pynebula.pyBindSignal( self.tool, 'refreshflattenheight', self, 'onheightsignal', 0 )
def refresh(self): self.menu_options.refresh() if self.first_refresh: # Do the binding here because the object state doesn't exist yet # when this menu is created pynebula.pyBindSignal( app.get_ai_tester(), 'gameplayupdatingenabled', self, 'ongameplayupdatingenabled', 0, ) pynebula.pyBindSignal(app.get_ai_tester(), 'gameplayupdatingdisabled', self, 'ongameplayupdatingdisabled', 0) pynebula.pyBindSignal(app.get_ai_tester(), 'soundsourcesenabled', self, 'onsoundsourcesenabled', 0) pynebula.pyBindSignal(app.get_ai_tester(), 'soundsourcesdisabled', self, 'onsoundsourcesdisabled', 0) self.first_refresh = False
def __init__(self, parent, modal=False): togwin.ChildToggableDialog.__init__( self, "Entity Browser", parent ) self.entity_browser = EntityBrowser(self, modal) self.__create_toolbar() sizer = wx.BoxSizer(wx.VERTICAL) horizontal_line = wx.StaticLine( self, -1, (-1, -1), (-1, -1), wx.LI_HORIZONTAL ) sizer.Add(horizontal_line, 0, wx.EXPAND) sizer.Add(self.entity_browser, 1, wx.EXPAND|wx.ALL, cfg.BORDER_WIDTH) self.SetSizer(sizer) self.SetSize(wx.Size(430, 510)) # Binding this signals will be warned about object changes pynebula.pyBindSignal( app.get_object_state(), 'singleentityplaced', self.entity_browser, 'refresh', 0 ) pynebula.pyBindSignal( app.get_object_state(), 'entitymodified', self.entity_browser, 'refresh', 0 ) pynebula.pyBindSignal( app.get_object_state(), 'selectionchanged', self.entity_browser, 'selectionchanged', 0 )
def __bind_events(self): pynebula.pyBindSignal(app.get_object_state(), 'selectionchanged', self, 'onselectionchanged', 0) self.Bind(wx.EVT_BUTTON, self.on_click_close_button, self.button_close)
def __init__(self): pynebula.pyBindSignal( app.get_object_state(), 'singleentityplaced', self, 'onentityplaced', 0 )
def __bind_events(self): self.Bind(wx.EVT_CHECKLISTBOX, self.on_attribute_toggled, self.clbox) pynebula.pyBindSignal(app.get_object_state(), 'selectionchanged', self, 'onselectionchanged', 0)