def __init__(self, context, path): wx.App.__init__(self, 0) self.supported_languages = supported_languages import meerk40t.gui.icons as icons self.timer = wx.Timer(self, id=wx.ID_ANY) self.Bind(wx.EVT_TIMER, context._kernel.scheduler_main, self.timer) context._kernel.scheduler_handles_main_thread_jobs = False self.timer.Start(10) icons.DARKMODE = wx.SystemSettings().GetColour(wx.SYS_COLOUR_WINDOW)[0] < 127 icons.icon_r = 230 icons.icon_g = 230 icons.icon_b = 230 Module.__init__(self, context, path) self.locale = None self.Bind(wx.EVT_CLOSE, self.on_app_close) self.Bind(wx.EVT_QUERY_END_SESSION, self.on_app_close) # MAC DOCK QUIT. self.Bind(wx.EVT_END_SESSION, self.on_app_close) self.Bind(wx.EVT_END_PROCESS, self.on_app_close) # This catches events when the app is asked to activate by some other process self.Bind(wx.EVT_ACTIVATE_APP, self.OnActivate) # App started add the except hook sys.excepthook = handleGUIException wx.ToolTip.SetAutoPop(10000) wx.ToolTip.SetDelay(100) wx.ToolTip.SetReshow(0)
def __init__(self, parent): super().__init__(self, None) self.Font = parent.Font self.BackgroundColour = parent.BackgroundColour self.ForegroundColour = parent.ForegroundColour self.sizer = wx.BoxSizer(wx.VERTICAL) self.MinSize = (wx.SystemSettings().GetMetric(wx.SYS_SCREEN_X) / 5, -1) self.MaxSize = (parent.Size.Width, -1) self.build(parent.colors.get('but_bg', wx.NullColour))
def InitUI(self): panel = wx.Panel(self) font = wx.SystemSettings().GetFont(wx.SYS_SYSTEM_FONT) font.SetPointSize(9) vbox = wx.BoxSizer(wx.VERTICAL) hbox1 = wx.BoxSizer(wx.HORIZONTAL) st1 = wx.StaticText(panel, label='Class Name') st1.SetFont(font) hbox1.Add(st1, flag=wx.RIGHT, border = 8) tc = wx.TextCtrl(panel) hbox1.Add(tc, proportion=1) vbox.Add(hbox1, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.TOP, border=10) vbox.Add((-1, 10)) hbox2 = wx.BoxSizer(wx.HORIZONTAL) st2 = wx.StaticText(panel, label='Matching CLasses') st2.SetFont(font) hbox2.Add(st2) vbox.Add(hbox2, flag=wx.LEFT|wx.TOP, border=10) vbox.Add((-1, 10)) hbox3 = wx.BoxSizer(wx.HORIZONTAL) tc2 = wx.TextCtrl(panel, style=wx.TE_MULTILINE) hbox3.Add(tc2, proportion=1, flag=wx.EXPAND) vbox.Add(hbox3, proportion=1, flag=wx.LEFT|wx.RIGHT|wx.EXPAND, border=10) vbox.Add((-1, 25)) hbox4 = wx.BoxSizer(wx.HORIZONTAL) cb1 = wx.CheckBox(panel, label='Case Sensitive') cb1.SetFont(font) hbox4.Add(cb1) cb2 = wx.CheckBox(panel, label='Nested Classed') cb2.SetFont(font) hbox4.Add(cb2, flag=wx.LEFT, border=10) cb3 = wx.CheckBox(panel, label='Non-project classed') cb3.SetFont(font) hbox4.Add(cb3, flag=wx.LEFT, border=10) vbox.Add(hbox4, flag=wx.LEFT, border=10) vbox.Add((-1, 25)) hbox5 = wx.BoxSizer(wx.HORIZONTAL) btn1 = wx.Button(panel, label='Ok', size=(70,30)) hbox5.Add(btn1) btn2 = wx.Button(panel, label='Close', size=(70,30)) hbox5.Add(btn2, flag=wx.LEFT|wx.BOTTOM, border=5) vbox.Add(hbox5, flag=wx.ALIGN_RIGHT|wx.RIGHT, border=10) panel.SetSizer(vbox)
def __mono_font(self): s = wx.SystemSettings().GetFont(wx.SYS_DEFAULT_GUI_FONT).GetPointSize() mono_font = wx.Font( int(s * 0.9), # point size wx.FONTFAMILY_MODERN, # family, wx.FONTSTYLE_NORMAL, # style, wx.FONTWEIGHT_NORMAL, # weight, underline=False, encoding=wx.FONTENCODING_SYSTEM) return mono_font
def __text_font(self): s = wx.SystemSettings().GetFont(wx.SYS_DEFAULT_GUI_FONT).GetPointSize() text_font = wx.Font( s, # point size wx.FONTFAMILY_DEFAULT, # family, wx.FONTSTYLE_NORMAL, # style, wx.FONTWEIGHT_NORMAL, # weight, underline=False, faceName="Calibri", encoding=wx.FONTENCODING_SYSTEM) return text_font
def __init__(self, model, parent, **kw): if hasAgw: style = 'agwStyle' else: style = 'style' if style not in kw: kw[style] = CT.TR_HIDE_ROOT | CT.TR_FULL_ROW_HIGHLIGHT |\ CT.TR_HAS_BUTTONS | CT.TR_LINES_AT_ROOT | CT.TR_SINGLE super(CTreeView, self).__init__(parent=parent, model=model, **kw) self.SetBackgroundColour(wx.SystemSettings().GetColour( wx.SYS_COLOUR_WINDOW)) self.RefreshItems()
def initStandardLayout(self): self.configPanel = self.configPanelClass(parent=self, pg=self) # set up this page to be managed by AUI self.auiManager = aui.AuiManager() self.auiManager.SetManagedWindow(self) # new aui toolbar self.toolbar = aui.AuiToolBar(self) self.initStandardToolbarControls() # realize the new toolbar self.toolbar.Realize() # add toolbar pane toolbarAuiInfo = ( aui.AuiPaneInfo().Name('toolbar').Caption(self.name + ' Tools').ToolbarPane(). Top().CloseButton(False).LeftDockable(False).RightDockable(False)) self.auiManager.AddPane(self.toolbar, toolbarAuiInfo) # add configPanel pane configPaneAuiInfo = (aui.AuiPaneInfo().Name('config').Caption( self.name + ' Configuration').Right().TopDockable(False).BottomDockable(False)) # setup best size, leave room for scrollbars configPanelSizer = self.configPanel.GetSizer() if configPanelSizer is not None: minSize = configPanelSizer.GetMinSize() systemSettings = wx.SystemSettings() bestSize = (minSize[0] + systemSettings.GetMetric(wx.SYS_VSCROLL_X), minSize[1] + systemSettings.GetMetric(wx.SYS_HSCROLL_Y)) configPaneAuiInfo.BestSize(bestSize) # add config pane to aui manager self.auiManager.AddPane(self.configPanel, configPaneAuiInfo) # start with config pane hidden configPaneAuiInfo.Hide() # update aui manager for changes to take effect self.auiManager.Update()
def background_initialization(self): # Initialize the application # here we could read some config file, load some resources, etc # while we show the Splash window # for this example, we simply create a dictionary with the config # (and sleep some time to simulate we're doing something). a = 1.5 for i in range(1000000): a *= float(i) title_font = wx.SystemSettings().GetFont(wx.SYS_DEFAULT_GUI_FONT) title_font = title_font.Bold() title_font = title_font.Scale(2.) button_font = wx.Font(12, # point size wx.FONTFAMILY_DEFAULT, # family, wx.FONTSTYLE_NORMAL, # style, wx.FONTWEIGHT_NORMAL, # weight, underline=False, faceName="Calibri", encoding=wx.FONTENCODING_SYSTEM) self.cfg['FRAME_STYLE'] = wx.DEFAULT_FRAME_STYLE | wx.CLOSE_BOX # Fix the size of the objects self.cfg['FRAME_WIDTH'] = 640 self.cfg['FRAME_HEIGHT'] = 480 self.cfg['TITLE_HEIGHT'] = 64 # Fix the COLORS self.cfg['TITLE_BG_COLOUR'] = wx.Colour(65, 65, 60, alpha=wx.ALPHA_OPAQUE) self.cfg['TITLE_FG_COLOUR'] = wx.Colour(250, 250, 250, alpha=wx.ALPHA_OPAQUE) self.cfg['FG_COLOUR'] = wx.Colour(250, 250, 240, alpha=wx.ALPHA_OPAQUE) self.cfg['BG_COLOUR'] = wx.Colour(45, 45, 40, alpha=wx.ALPHA_OPAQUE) # Fix the font self.cfg['TITLE_TEXT_FONT'] = title_font self.cfg['BUTTON_TEXT_FONT'] = button_font
def reset(self): """Fill the dictionary with the default values.""" font = wx.SystemSettings().GetFont(wx.SYS_DEFAULT_GUI_FONT) font_height = font.GetPixelSize()[1] self.__dict__ = dict( frame_style=wx.DEFAULT_FRAME_STYLE | wx.CLOSE_BOX, frame_size=self.__frame_size(), icons_theme="Refine", fg_color=wx.Colour(230, 230, 230), header_fg_color=wx.Colour(160, 160, 160), action_fg_color=wx.Colour(130, 130, 130), bg_color=wx.Colour(20, 20, 20, alpha=wx.ALPHA_OPAQUE), header_bg_color=wx.Colour(40, 40, 40, alpha=wx.ALPHA_OPAQUE), action_bg_color=wx.Colour(30, 30, 30, alpha=wx.ALPHA_OPAQUE), text_font=self.__text_font(), header_text_font=self.__header_font(), action_text_font=self.__action_font(), mono_text_font=self.__mono_font(), title_height=font_height * 5, action_height=font_height * 3, )
def __init__(self, fp): super().__init__(fp) self["__LabPype__"] = Img.LabPype.GetIcon() if self["FONTFACE_CANVAS"] == "": self["FONTFACE_CANVAS"] = wx.SystemSettings().GetFont( wx.SYS_DEFAULT_GUI_FONT).GetFaceName() if self["FONTFACE_FIXED"] == "": self["FONTFACE_FIXED"] = wx.SystemSettings().GetFont( wx.SYS_ANSI_FIXED_FONT).GetFaceName() # GUI self["PEN_CONNECTION"] = wx.Pen(self["COLOR_CONNECTION"], 3) self["PEN_CONNECTION_SELECTION1"] = wx.Pen(self["COLOR_SELECTION"], 11) self["PEN_CONNECTION_SELECTION2"] = wx.Pen( UI.AlphaBlend(self["COLOR_BG_B"], self["COLOR_SELECTION"], 0.5), 9) self["PEN_SELECTION"] = wx.Pen(self["COLOR_SELECTION"], 1) self["BRUSH_SELECTION"] = wx.Brush( UI.AlphaBlend(self["COLOR_BG_B"], self["COLOR_SELECTION"], 0.3)) # Brush self["BRUSH_WIDGET_DONE"] = wx.Brush(self["COLOR_WIDGET_DONE"]) self["BRUSH_WIDGET_WAIT"] = wx.Brush(self["COLOR_WIDGET_WAIT"]) self["BRUSH_WIDGET_WORK"] = wx.Brush(self["COLOR_WIDGET_WORK"]) self["BRUSH_WIDGET_FAIL"] = wx.Brush(self["COLOR_WIDGET_FAIL"]) self["BRUSH_ANCHOR_RECV"] = wx.Brush(self["COLOR_ANCHOR_RECV"]) self["BRUSH_ANCHOR_SEND"] = wx.Brush(self["COLOR_ANCHOR_SEND"]) self["BRUSH_ANCHOR_PASS"] = wx.Brush(self["COLOR_ANCHOR_PASS"]) self["BRUSH_ANCHOR_FAIL"] = wx.Brush(self["COLOR_ANCHOR_FAIL"]) # Font self.SetMainFont(9, self["FONTFACE_MAIN"]) self["FONT_H1"] = wx.Font(24, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, self["FONTFACE_MAIN"]) self["FONT_H2"] = wx.Font(20, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, self["FONTFACE_MAIN"]) self["FONT_H3"] = wx.Font(16, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, self["FONTFACE_MAIN"]) self["FONT_H4"] = wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, self["FONTFACE_MAIN"]) self["FONT_CANVAS"] = wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, self["FONTFACE_CANVAS"]) self["FONT_FIXED"] = wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, self["FONTFACE_FIXED"]) # Bitmap for key in ( "TOOL_OPTION", "TOOL_DELETE", "TOOL_FILE_N", "TOOL_FILE_O", "TOOL_FILE_S", "TOOL_ALGN_L", "TOOL_ALGN_V", "TOOL_ALGN_R", "TOOL_ALGN_T", "TOOL_ALGN_H", "TOOL_ALGN_B", "TOOL_DIST_H", "TOOL_DIST_V", "TOOL_MOVE_U", "TOOL_MOVE_D", "TOOL_MOVE_T", "TOOL_MOVE_B", "TOOL_T_ANCR", "TOOL_T_NAME", "TOOL_T_SNAP", "TOOL_T_CURV", "TOOL_T_DIAG", "TOOL_T_FSCN", "TOOL_CANCEL", "TOOL_T_SHOW", "TOOL_T_TEXT", "TOOL_MANAGE", "DIALOG_MISC", "DIALOG_ATCH", "DIALOG_DTCH", "DIALOG_LOCA", ): self[key] = UI.GetBitmaps(self.GetBitmap(key), 20, 20) for key in ("MANAGE_ADD", "MANAGE_DEL"): self[key] = self.GetBitmap(key) # Resources for widget drawing self["INDICATOR"] = UI.GetBitmaps(self.GetBitmap("INDICATOR"), 10, 10) self.DefaultIcon = Img.WIDGET.GetBitmap() self.MaskCanvas = Img.MASK_CANVAS.GetBitmap() self.MaskGadget = Img.MASK_GADGET.GetBitmap() self.MaskCursor = Img.MASK_CURSOR.GetBitmap() self.RectCanvas = wx.Rect(0, 0, 56, 56) self.RectGadget = wx.Rect(0, 0, 32, 32) self.RectCursor = wx.Rect(0, 0, 30, 30) self.WidgetPen = wx.Pen("#000000", 1)
def __init__(self, parent, giface, menuModel, margin=False): GPrompt.__init__(self, parent=parent, giface=giface, menuModel=menuModel) wx.stc.StyledTextCtrl.__init__(self, self.panel, id=wx.ID_ANY) # # styles # self.SetWrapMode(True) self.SetUndoCollection(True) # # create command and map lists for autocompletion # self.AutoCompSetIgnoreCase(False) # # line margins # # TODO print number only from cmdlog self.SetMarginWidth(1, 0) self.SetMarginWidth(2, 0) if margin: self.SetMarginType(0, wx.stc.STC_MARGIN_NUMBER) self.SetMarginWidth(0, 30) else: self.SetMarginWidth(0, 0) # # miscellaneous # self.SetViewWhiteSpace(False) self.SetUseTabs(False) self.UsePopUp(True) self.SetUseHorizontalScrollBar(True) # support light and dark mode bg_color = wx.SystemSettings().GetColour(wx.SYS_COLOUR_WINDOW) fg_color = wx.SystemSettings().GetColour(wx.SYS_COLOUR_WINDOWTEXT) selection_color = wx.SystemSettings().GetColour(wx.SYS_COLOUR_HIGHLIGHT) self.StyleSetBackground(wx.stc.STC_STYLE_DEFAULT, bg_color) self.StyleSetForeground(wx.stc.STC_STYLE_DEFAULT, fg_color) self.SetCaretForeground(fg_color) self.SetSelBackground(True, selection_color) self.StyleClearAll() # # bindings # self.Bind(wx.EVT_WINDOW_DESTROY, self.OnDestroy) self.Bind(wx.EVT_CHAR, self.OnChar) self.Bind(wx.EVT_KEY_DOWN, self.OnKeyPressed) self.Bind(wx.stc.EVT_STC_AUTOCOMP_SELECTION, self.OnItemSelected) self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnItemChanged) if sys.platform != "darwin": # unstable on Mac with wxPython 3 self.Bind(wx.EVT_KILL_FOCUS, self.OnKillFocus) # signal which requests showing of a notification self.showNotification = Signal("GPromptSTC.showNotification") # signal to notify selected command self.commandSelected = Signal("GPromptSTC.commandSelected")
def setFont(self): self.Font = wx.SystemSettings().GetFont(wx.SYS_DEFAULT_GUI_FONT) charwMax = wx.SystemSettings().GetMetric(wx.SYS_SCREEN_X) * 0.0035 charw = self.CharWidth self.Font = self.Font.Scaled(round(charwMax / charw, 1))
def is_dark(self): return wx.SystemSettings().GetColour(wx.SYS_COLOUR_WINDOW)[0] < 127
def background_color(self): return wx.SystemSettings().GetColour(wx.SYS_COLOUR_WINDOW)
def is_dark(self): # wxPython's SysAppearance does not always deliver a reliable response from # wx.SystemSettings().GetAppearance().IsDark() # so lets tick with 'old way', although this one is fishy... result = wx.SystemSettings().GetColour(wx.SYS_COLOUR_WINDOW)[0] < 127 return result
def init_mgr(self) -> None: """Initialize AuiManager and attach panes. NOTE: We are NOT USING wx.aui, but wx.lib.agw.aui, a pure Python implementation of wx.aui. As such, the correct documentation on wxpython.org should begin with https://wxpython.org/Phoenix/docs/html/wx.lib.agw.aui rather than https://wxpython.org/Phoenix/docs/html/wx.aui. """ if self._mgr is not None: return # create auimanager and set flags self._mgr = aui.AuiManager(self, agwFlags= aui.AUI_MGR_ALLOW_FLOATING | aui.AUI_MGR_TRANSPARENT_DRAG | aui.AUI_MGR_TRANSPARENT_HINT | aui.AUI_MGR_HINT_FADE | aui.AUI_MGR_LIVE_RESIZE | aui.AUI_MGR_AUTONB_NO_CAPTION) # set auto notebook style self._mgr.SetAutoNotebookStyle( aui.AUI_NB_TOP | aui.AUI_NB_TAB_SPLIT | aui.AUI_NB_TAB_MOVE | aui.AUI_NB_SCROLL_BUTTONS | aui.AUI_NB_WINDOWLIST_BUTTON | aui.AUI_NB_MIDDLE_CLICK_CLOSE | aui.AUI_NB_CLOSE_ON_ACTIVE_TAB | aui.AUI_NB_TAB_FLOAT) # set aui colors and style # see https://wxpython.org/Phoenix/docs/html/wx.lib.agw.aui.dockart.AuiDefaultDockArt.html dockart = aui.AuiDefaultDockArt() dockart.SetMetric(aui.AUI_DOCKART_SASH_SIZE, 3) dockart.SetMetric(aui.AUI_DOCKART_CAPTION_SIZE, 18) dockart.SetMetric(aui.AUI_DOCKART_PANE_BUTTON_SIZE, 16) dockart.SetColor(aui.AUI_DOCKART_BACKGROUND_COLOUR, wx.SystemSettings().GetColour(wx.SYS_COLOUR_MENU)) dockart.SetColor(aui.AUI_DOCKART_BACKGROUND_GRADIENT_COLOUR, wx.SystemSettings().GetColour(wx.SYS_COLOUR_MENU)) dockart.SetColor(aui.AUI_DOCKART_SASH_COLOUR, wx.SystemSettings().GetColour(wx.SYS_COLOUR_MENU)) dockart.SetColor(aui.AUI_DOCKART_ACTIVE_CAPTION_COLOUR, '#FFFFFF') dockart.SetColor(aui.AUI_DOCKART_INACTIVE_CAPTION_COLOUR, '#FFFFFF') dockart.SetMetric(aui.AUI_DOCKART_GRADIENT_TYPE, aui.AUI_GRADIENT_NONE) self._mgr.SetArtProvider(dockart) tabart = CustomAuiTabArt() self._mgr.SetAutoNotebookTabArt(tabart) # initialize relevant panels self.panels['viewport'] = ViewportPanel(self) self.panels['console'] = ConsolePanel(self) self.panels['timeline'] = TimelinePanel(self) self.panels['controller'] = ControllerPanel(self) self.panels['properties'] = PropertiesPanel(self) self.panels['machine_toolbar'] = MachineToolbar(self) self.panels['pathgen_toolbar'] = PathgenToolbar(self) # add viewport panel self._mgr.AddPane( self.panels['viewport'], aui.AuiPaneInfo().Name('viewport').Caption('Viewport'). Dock().Center().MaximizeButton().MinimizeButton().DefaultPane().MinSize(350, 250)) # add console, timeline panel self._mgr.AddPane( self.panels['console'], aui.AuiPaneInfo().Name('console').Caption('Console'). Dock().Bottom().Position(0).Layer(0).MinSize(280, 180).Show(True)) self._mgr.AddPane( self.panels['timeline'], aui.AuiPaneInfo().Name('timeline').Caption('Timeline'). Dock().Bottom().Position(1).Layer(0).MinSize(280, 180).Show(True), target=self._mgr.GetPane('console')) # add properties and controller panel self._mgr.AddPane( self.panels['properties'], aui.AuiPaneInfo().Name('properties').Caption('Properties'). Dock().Right().Position(0).Layer(1).MinSize(280, 200).Show(True)) self._mgr.AddPane( self.panels['controller'], aui.AuiPaneInfo().Name('controller').Caption('Controller'). Dock().Right().Position(1).Layer(1).MinSize(280, 200).Show(True)) # set first tab of all auto notebooks as the one selected for notebook in self._mgr.GetNotebooks(): notebook.SetSelection(0) # add toolbar panels self.panels['machine_toolbar'].Realize() self._mgr.AddPane( self.panels['machine_toolbar'], aui.AuiPaneInfo().Name('machine_toolbar').Caption('Machine Toolbar'). ToolbarPane().BottomDockable(False).Top().Layer(10)) self.panels['pathgen_toolbar'].Realize() self._mgr.AddPane( self.panels['pathgen_toolbar'], aui.AuiPaneInfo().Name('pathgen_toolbar').Caption('Pathgen Toolbar'). ToolbarPane().BottomDockable(False).Top().Layer(10)) self._mgr.Update()
def _update_ribbon_artprovider_for_dark_mode(provider): def _set_ribbon_colour(provider, art_id_list, colour): for id_ in art_id_list: try: provider.SetColour(id_, colour) except: # Not all colorcodes are supported by all providers. # So lets ignore it pass TEXTCOLOUR = wx.SystemSettings().GetColour(wx.SYS_COLOUR_BTNTEXT) BTNFACE_HOVER = copy.copy(wx.SystemSettings().GetColour( wx.SYS_COLOUR_HIGHLIGHT)) INACTIVE_BG = copy.copy(wx.SystemSettings().GetColour( wx.SYS_COLOUR_INACTIVECAPTION)) INACTIVE_TEXT = copy.copy(wx.SystemSettings().GetColour( wx.SYS_COLOUR_GRAYTEXT)) TOOLTIP_FG = copy.copy(wx.SystemSettings().GetColour( wx.SYS_COLOUR_INFOTEXT)) TOOLTIP_BG = copy.copy(wx.SystemSettings().GetColour(wx.SYS_COLOUR_INFOBK)) BTNFACE = copy.copy(wx.SystemSettings().GetColour(wx.SYS_COLOUR_BTNFACE)) BTNFACE_HOVER = BTNFACE_HOVER.ChangeLightness(50) HIGHLIGHT = copy.copy(wx.SystemSettings().GetColour( wx.SYS_COLOUR_HOTLIGHT)) texts = [ RB.RIBBON_ART_BUTTON_BAR_LABEL_COLOUR, RB.RIBBON_ART_PANEL_LABEL_COLOUR, ] _set_ribbon_colour(provider, texts, TEXTCOLOUR) disabled = [ RB.RIBBON_ART_GALLERY_BUTTON_DISABLED_FACE_COLOUR, RB.RIBBON_ART_TAB_LABEL_COLOUR, ] _set_ribbon_colour(provider, disabled, INACTIVE_TEXT) backgrounds = [ # Toolbar element backgrounds RB.RIBBON_ART_TOOL_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_TOOL_BACKGROUND_TOP_GRADIENT_COLOUR, RB.RIBBON_ART_TOOL_BACKGROUND_COLOUR, RB.RIBBON_ART_TOOL_BACKGROUND_GRADIENT_COLOUR, RB.RIBBON_ART_TOOL_HOVER_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_TOOL_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR, RB.RIBBON_ART_TOOL_HOVER_BACKGROUND_COLOUR, RB.RIBBON_ART_TOOL_HOVER_BACKGROUND_GRADIENT_COLOUR, RB.RIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR, RB.RIBBON_ART_TOOL_ACTIVE_BACKGROUND_COLOUR, RB.RIBBON_ART_TOOL_ACTIVE_BACKGROUND_GRADIENT_COLOUR, # Page Background RB.RIBBON_ART_PAGE_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_PAGE_BACKGROUND_TOP_GRADIENT_COLOUR, RB.RIBBON_ART_PAGE_BACKGROUND_COLOUR, RB.RIBBON_ART_PAGE_BACKGROUND_GRADIENT_COLOUR, RB.RIBBON_ART_PAGE_HOVER_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_PAGE_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR, RB.RIBBON_ART_PAGE_HOVER_BACKGROUND_COLOUR, RB.RIBBON_ART_PAGE_HOVER_BACKGROUND_GRADIENT_COLOUR, # Art Gallery RB.RIBBON_ART_GALLERY_HOVER_BACKGROUND_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_BACKGROUND_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_BACKGROUND_GRADIENT_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_FACE_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_GRADIENT_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_HOVER_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_HOVER_FACE_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_GRADIENT_COLOUR, RB.RIBBON_ART_GALLERY_BUTTON_ACTIVE_BACKGROUND_TOP_COLOUR, # Panel backgrounds RB.RIBBON_ART_PANEL_ACTIVE_BACKGROUND_COLOUR, RB.RIBBON_ART_PANEL_ACTIVE_BACKGROUND_GRADIENT_COLOUR, RB.RIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_PANEL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR, RB.RIBBON_ART_PANEL_LABEL_BACKGROUND_COLOUR, RB.RIBBON_ART_PANEL_LABEL_BACKGROUND_GRADIENT_COLOUR, RB.RIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_COLOUR, RB.RIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_GRADIENT_COLOUR, # Tab Background RB.RIBBON_ART_TAB_CTRL_BACKGROUND_COLOUR, RB.RIBBON_ART_TAB_CTRL_BACKGROUND_GRADIENT_COLOUR, RB.RIBBON_ART_TAB_HOVER_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_TAB_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR, RB.RIBBON_ART_TAB_HOVER_BACKGROUND_COLOUR, RB.RIBBON_ART_TAB_HOVER_BACKGROUND_GRADIENT_COLOUR, RB.RIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR, RB.RIBBON_ART_TAB_ACTIVE_BACKGROUND_COLOUR, RB.RIBBON_ART_TAB_ACTIVE_BACKGROUND_GRADIENT_COLOUR, ] _set_ribbon_colour(provider, backgrounds, BTNFACE) highlights = [ RB.RIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_COLOUR, RB.RIBBON_ART_PANEL_HOVER_LABEL_BACKGROUND_GRADIENT_COLOUR, ] _set_ribbon_colour(provider, highlights, HIGHLIGHT) borders = [ RB.RIBBON_ART_PANEL_BUTTON_HOVER_FACE_COLOUR, ] _set_ribbon_colour(provider, borders, wx.RED) lowlights = [ RB.RIBBON_ART_TAB_HOVER_BACKGROUND_TOP_COLOUR, RB.RIBBON_ART_TAB_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR, ] _set_ribbon_colour(provider, lowlights, INACTIVE_BG)