def __init__(self, parent, theme_name: str): # initializes this frame and its sub frames tkinter.Frame.__init__(self, parent) self.model: FinanceManagerModel = None self.color_manager: ColorManager = None self.fd: FileDisplay = FileDisplay(self) self.fd.set_listener(self) self.fd.grid(row=0, column=0, sticky=tkinter.NS) separator1 = Separator(self, orient="vertical") separator1.grid(row=0, column=1, sticky='ns') self.tv: TableVisualizer = TableVisualizer(self) self.tv.add_listener(self) self.tv.grid(row=0, column=2, sticky=tkinter.NS) separator2 = Separator(self, orient="vertical") separator2.grid(row=0, column=3, sticky='ns') self.dv: DataVisualizer = DataVisualizer(self, text="Data Visualizer") self.dv.grid(row=0, column=4, sticky=tkinter.NS) if theme_name == "dark": self.set_color_manager( ColorManager(ColorTheme.get_dark_theme_dict())) else: self.set_color_manager( ColorManager(ColorTheme.get_default_theme_dict()))
def __init__( self, parent=None ): """ Handles combobox items from every VisItem panel """ ColorManager.__init__( self, parent ) self.setupManagerUi() # necessary information referenced by the combobox item of the calling VisItem panel self.__key2ColorIdx = {} self.__colorIdx2KeyIndex = {}
def __init__(self, parent=None): """ Handles combobox items from every VisItem panel """ ColorManager.__init__(self, parent) self.setupManagerUi() # necessary information referenced by the combobox item of the calling VisItem panel self.__key2ColorIdx = {} self.__colorIdx2KeyIndex = {}
def update( self, colorMapCombobox, currentVariable, currentColorTableKey=None ): cB = colorMapCombobox keyedColorList = ColorManager.getColorTables(self, currentVariable) colorMapCombobox.clear() currentIdx = None idx=0 for keyColor in keyedColorList: self.__colorIdx2KeyIndex[(cB,idx)] = keyColor[0] self.__key2ColorIdx[(cB,keyColor[0])] = idx colorMapCombobox.addItem( keyColor[1] ) if keyColor[1]==currentVariable: currentIdx = idx idx = idx + 1 if currentColorTableKey and ((cB,currentColorTableKey) in self.__key2ColorIdx.keys()): currentIdx = self.__key2ColorIdx[(cB,currentColorTableKey)] if currentIdx: colorMapCombobox.setCurrentIndex(currentIdx)
def update(self, colorMapCombobox, currentVariable, currentColorTableKey=None): cB = colorMapCombobox keyedColorList = ColorManager.getColorTables(self, currentVariable) colorMapCombobox.clear() currentIdx = None idx = 0 for keyColor in keyedColorList: self.__colorIdx2KeyIndex[(cB, idx)] = keyColor[0] self.__key2ColorIdx[(cB, keyColor[0])] = idx colorMapCombobox.addItem(keyColor[1]) if keyColor[1] == currentVariable: currentIdx = idx idx = idx + 1 if currentColorTableKey and ((cB, currentColorTableKey) in self.__key2ColorIdx.keys()): currentIdx = self.__key2ColorIdx[(cB, currentColorTableKey)] if currentIdx: colorMapCombobox.setCurrentIndex(currentIdx)
# # colorstring.py: Easy access to ANSI terminal color. # 2018-08-29: Converted by perl2python, by Steven J. DeRose. # Original Perl version written <2006-10-04, by Steven J. DeRose. # import sys import os import re import argparse from subprocess import check_output, CalledProcessError import alogging from ColorManager import ColorManager lg = alogging.ALogger(1) cm = ColorManager() args = None __metadata__ = { 'title': "colorstring.py", 'description': "Easy access to ANSI terminal color.", 'rightsHolder': "Steven J. DeRose", 'creator': "http://viaf.org/viaf/50334488", 'type': "http://purl.org/dc/dcmitype/Software", 'language': "Python 3.7", 'created': "2018-08-29", 'modified': "2021-07-01", 'publisher': "http://github.com/sderose", 'license': "https://creativecommons.org/licenses/by-sa/3.0/" } __version__ = __metadata__['modified']