def on_design_button(self): "Button 'Show Design Window' was pressed" if self.widget and config.debugging and wx.GetKeyState(wx.WXK_SHIFT): import utilities utilities.StructurePrinter(self.widget) return if not self.widget or not self.is_visible(): common.app_tree.show_toplevel(None, self) else: self.hide_widget() self.design.update_label()
def on_preview(self, refresh=False): if self.preview_widget and compat.IS_PHOENIX and config.debugging and wx.KeyboardState().ShiftDown(): # print structure for debugging import utilities utilities.StructurePrinter(self.preview_widget) return new_label = None if self.preview_widget is None: self.preview_widget = common.app_tree.app.preview(self, self._preview_position) if self.preview_widget: new_label = _('Close Preview') else: self._preview_position = self.preview_widget.GetPosition() # remember position self.preview_widget.Close() self.preview_widget = None new_label = _('Show Preview') if refresh: wx.CallAfter(self.on_preview) if new_label is not None: self.properties["preview"].set_label(new_label)