Exemplo n.º 1
0
    def __init__(self):

        cdb.updateColourDB()
        colourList = cdb.getColourList()
        lenCDB = len(colourList)
        colourIndex = random.randint(0, lenCDB-1)
        self.colour = colourList[colourIndex]
    def __init__(self):
        #  self.__wxcdb    = WX_CDB
        #self.label_list = ['BLACK','RED','GREEN','MAGENTA','BLUE','BROWN','CYAN','DARKGREEN','DARKORANGE','TURQUOISE','VIOLET','GREY40','GREY50','GREY60','GREY70']
        self.label_list = [
            'BLACK', 'RED', 'AQUAMARINE', 'BLUE', 'MEDIUMBLUE', 'MIDNIGHTBLUE',
            'ROYALBLUE', 'NAVYBLUE', 'CYAN', 'GREEN', 'DARKGREEN', 'YELLOW',
            'MAGENTA', 'VIOLET', 'PURPLE1', 'GREY40', 'GREY50', 'GREY60',
            'GREY70', 'GOLD', 'PERU', 'BROWN', 'ORANGE', 'DARKORANGE', 'PINK',
            'HOTPINK', 'MAROON', 'ORCHID1'
        ]

        self.cdb_label_list = WX_CDB.getColourList()  # list ['red',blue'..]
        self.cdb_info_list = WX_CDB.getColourInfoList(
        )  # list [ ... ('LIGHTGREEN', 144, 238, 144), ...]

        self.__default_color = None
        self.default_color = 'GREY50'
Exemplo n.º 3
0
    def InitDlg(self):
        self._btbox = DLGButtonPanel(self,style=wx.SUNKEN_BORDER)
      
        self.pnl_bcb = wx.Panel(self)   
        self.cdb_label_list = WX_CDB.getColourList()  
        self.cdb_info_list  = WX_CDB.getColourInfoList()  #

        bcb = BitmapComboBox(self.pnl_bcb,size=(140,-1))
        size_h_w = 16
        slidx=0
        for c in self.color_list:

            idx = self.cdb_label_list.index(c.upper())
            (r,g,b) = self.cdb_info_list[idx][1:]
            bmp = wx.EmptyBitmapRGBA(size_h_w, size_h_w,red=r,green=g,blue=b,alpha= wx.ALPHA_OPAQUE)
            bcb.Append(c, bmp, c)
            self.Bind(wx.EVT_COMBOBOX,self.OnCombo,bcb)
            if ( self.selected_color_label == c ):
               bcb.SetSelection( bcb.GetCount() -1)
Exemplo n.º 4
0
def colorGenerator(skippedColors=10):
    """
    Selects a color from the built-in wx color database.

    Parameters
    ----------
    skippedColors: int
        Number of colors to skip in the built-in wx color database when generating the next color. Without skipping
        colors the next color may be similar to the previous color.

    Notes
    -----
    Will cycle indefinitely to accommodate large cores. Colors will repeat.
    """
    from wx.lib.colourdb import getColourList

    excludedColors = ["WHITE", "CREAM", "BLACK", "MINTCREAM"]
    colors = getColourList()
    for start in itertools.cycle(range(20, 20 + skippedColors)):
        for i in range(start, len(colors), skippedColors):
            if colors[i] not in excludedColors:
                yield colors[i]
Exemplo n.º 5
0
    def __init__(self, parent, log):

        wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS|wx.SUNKEN_BORDER)

        sizer = wx.BoxSizer(wx.VERTICAL)

        cdb.updateColourDB()
        self.colourList = cdb.getColourList()
        self.count = 0
        self.log = log

        self.il = ULC.PyImageList(16, 16)

        self.idx1 = self.il.Add(images.Smiles.GetBitmap())
        self.sm_up = self.il.Add(images.SmallUpArrow.GetBitmap())
        self.sm_dn = self.il.Add(images.SmallDnArrow.GetBitmap())
        self.il.Add(images.core.GetBitmap())
        self.il.Add(images.custom.GetBitmap())
        self.il.Add(images.exit.GetBitmap())
        self.il.Add(images.expansion.GetBitmap())
        self.il.Add(decryptedBitmap.GetBitmap())
        self.il.Add(coloursBitmap.GetBitmap())

        self.list = TestUltimateListCtrl(self, -1,
                                         agwStyle=wx.LC_REPORT
                                         #| wx.BORDER_SUNKEN
                                         | wx.BORDER_NONE
                                         | wx.LC_EDIT_LABELS
                                         #| wx.LC_SORT_ASCENDING
                                         #| wx.LC_NO_HEADER
                                         | wx.LC_VRULES
                                         | wx.LC_HRULES
                                         #| wx.LC_SINGLE_SEL
                                         | ULC.ULC_HAS_VARIABLE_ROW_HEIGHT)

        self.list.SetImageList(self.il, wx.IMAGE_LIST_SMALL)
        sizer.Add(self.list, 1, wx.EXPAND)

        self.timer = wx.Timer(self, wx.ID_ANY)

        self.PopulateList()
        self.SetSizer(sizer)
        self.SetAutoLayout(True)

        self.itemDataMap = musicdata
##        listmix.ColumnSorterMixin.__init__(self, 4)

        self.Bind(ULC.EVT_LIST_ITEM_SELECTED, self.OnItemSelected, self.list)
        self.Bind(ULC.EVT_LIST_ITEM_DESELECTED, self.OnItemDeselected, self.list)
        self.Bind(ULC.EVT_LIST_ITEM_ACTIVATED, self.OnItemActivated, self.list)
        self.Bind(ULC.EVT_LIST_DELETE_ITEM, self.OnItemDelete, self.list)
        self.Bind(ULC.EVT_LIST_COL_CLICK, self.OnColClick, self.list)
        self.Bind(ULC.EVT_LIST_COL_RIGHT_CLICK, self.OnColRightClick, self.list)
        self.Bind(ULC.EVT_LIST_COL_BEGIN_DRAG, self.OnColBeginDrag, self.list)
        self.Bind(ULC.EVT_LIST_COL_DRAGGING, self.OnColDragging, self.list)
        self.Bind(ULC.EVT_LIST_COL_END_DRAG, self.OnColEndDrag, self.list)
        self.Bind(ULC.EVT_LIST_BEGIN_LABEL_EDIT, self.OnBeginEdit, self.list)
        self.Bind(ULC.EVT_LIST_BEGIN_DRAG, self.OnBeginDrag)
        self.Bind(ULC.EVT_LIST_END_DRAG, self.OnEndDrag)

        self.list.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
        self.list.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown)

        # for wxMSW
        self.list.Bind(wx.EVT_COMMAND_RIGHT_CLICK, self.OnRightClick)

        # for wxGTK
        self.list.Bind(wx.EVT_RIGHT_UP, self.OnRightClick)

        self.Bind(wx.EVT_IDLE, self.OnIdle)
        self.Bind(wx.EVT_TIMER, self.OnTimer)
Exemplo n.º 6
0
import XMLParser
from Helpers import DataSize, ChangeBaseAxis, ComparePlots
import wx.lib.agw.flatnotebook as fnb
from wx.lib.colourdb import getColourList
import subprocess
import matplotlib
file_matplotlibrc = matplotlib.matplotlib_fname()


"""
Uncomment this line if you want to replace your matplotlib settings file with the one, available in this repository
subprocess.call["cp", matplotlibrc, file_matplotlibrc]
"""

#This list has all the colors available in wx python
colors = [color for color in getColourList()]



class RedirectText(object):
	def __init__(self, aWxTextCtrl):
		self.out = aWxTextCtrl
			     
	def write(self,string):
		self.out.WriteText(string)


class CanvasPanel(wx.Frame):
	def __init__(self, data):

		"""