def properties_changed(self, modified): if not modified or "value" in modified and self.widget: self.widget.SetValue(self.value) if not modified or "label" in modified: if self.widget: self.widget.SetLabel(self.label) self._set_widget_best_size() common.app_tree.refresh(self.node, refresh_label=True) BitmapMixin._properties_changed(self, modified) self._set_widget_best_size() EditStylesMixin.properties_changed(self, modified) ManagedBase.properties_changed(self, modified)
def _properties_changed(self, modified, actions): "update label (and size if label/stockitem have changed)" if "bitmap" in modified: self.properties["bitmap_dir"].set_blocked( not self.check_prop_truth("bitmap")) label_modified = not modified or ("label" in modified or "font" in modified) if not modified or "stockitem" in modified: # if stockitem is set, label needs to be deactivated and window id is wxID_... if self.properties["stockitem"].is_active(): self.properties["label"].set_blocked(True) new_id = "wxID_" + self.stockitem if common.history: common.history.monitor_property(self.properties["id"]) self.properties["id"].set(new_id, deactivate=True) #self.properties["id"].default_value = new_id # avoid this value to be written to XML l = ButtonStockItems.stock_ids[self.stockitem] if self.widget: self.widget.SetLabel(l) else: self.properties["label"].set_blocked(False) label_modified = True if modified and "font" in modified and wx.Platform == '__WXGTK__': # on GTK setting a smaller font would fail actions.update(("recreate2", "label", "sizeevent")) return if label_modified and self.properties["label"].is_active( ) and self.widget: self.widget.SetLabel(self.label) label_modified = True if label_modified or (modified and "stockitem" in modified): actions.update(("layout", "label", "sizeevent")) if modified and ("label" in modified or "stockitem" in modified): actions.add("label") if "bitmap_dir" in modified and self.widget: self.widget.SetBitmapPosition(self.bitmap_dir) BitmapMixin._properties_changed(self, modified, actions) EditStylesMixin._properties_changed(self, modified, actions) ManagedBase._properties_changed(self, modified, actions)
def properties_changed(self, modified=None): "update label (and size if label/stockitem have changed)" label_modified = not modified or "label" in modified if not modified or "stockitem" in modified: # if stockitem is set, label needs to be deactivated and window id is wxID_... if self.properties["stockitem"].is_active(): self.properties["label"].set_blocked(True) new_id = "wxID_" + self.stockitem self.properties["id"].set(new_id, deactivate=True) #self.properties["id"].default_value = new_id # avoid this value to be written to XML l = ButtonStockItems.stock_ids[self.stockitem] if self.widget: self.widget.SetLabel(l) else: self.properties["label"].set_blocked(False) #self.properties["id"].default_value = "wxID_ANY" label_modified = True if label_modified and self.properties["label"].is_active(): if self.widget: self.widget.SetLabel(self.label) if (label_modified or "name" in modified) and common.app_tree: common.app_tree.refresh(self, refresh_label=True, refresh_image=False) if "bitmap" in modified: self.properties["bitmap_dir"].set_blocked( not self.check_prop_truth("bitmap")) if "bitmap_dir" in modified and self.widget: self.widget.SetBitmapPosition(self.bitmap_dir) BitmapMixin._properties_changed(self, modified) self._set_widget_best_size() EditStylesMixin.properties_changed(self, modified) ManagedBase.properties_changed(self, modified)
def properties_changed(self, modified=None): "update label (and size if label/stockitem have changed)" BitmapMixin._properties_changed(self, modified) EditStylesMixin.properties_changed(self, modified) ManagedBase.properties_changed(self, modified)
def _properties_changed(self, modified, actions): "update label (and size if label/stockitem have changed)" BitmapMixin._properties_changed(self, modified, actions) EditStylesMixin._properties_changed(self, modified, actions) ManagedBase._properties_changed(self, modified, actions)