diff --git a/demo/AlphaDrawing.py b/demo/AlphaDrawing.py index 1e656df2..d24d5145 100644 --- a/demo/AlphaDrawing.py +++ b/demo/AlphaDrawing.py @@ -38,8 +38,8 @@ then these squares should be transparent. dc.DrawRoundedRectangle(rect, 8) # some additional testing stuff - #dc.SetPen(wx.Pen(wx.Colour(0,0,255, 196))) - #dc.SetBrush(wx.Brush(wx.Colour(0,0,255, 64))) + #dc.SetPen(wx.Pen(wx.Colour(0, 0, 255, 196))) + #dc.SetBrush(wx.Brush(wx.Colour(0, 0, 255, 64))) #dc.DrawCircle(50, 275, 25) #dc.DrawEllipse(100, 275, 75, 50) diff --git a/demo/AnalogClock.py b/demo/AnalogClock.py index 10085cfe..f1c00c31 100644 --- a/demo/AnalogClock.py +++ b/demo/AnalogClock.py @@ -49,7 +49,7 @@ class TestPanel(wx.Panel): ac.SHOW_HOURS_HAND| \ ac.SHOW_MINUTES_HAND| \ ac.SHOW_SHADOWS) - colour = wx.Colour(0, 255, 255) + colour = wx.CYAN c4.SetForegroundColour(colour) colour = wx.Colour(0, 132, 132) c4.SetShadowColour(colour) diff --git a/demo/I18N.py b/demo/I18N.py index 9c6f5c2c..1775e248 100644 --- a/demo/I18N.py +++ b/demo/I18N.py @@ -93,7 +93,7 @@ class LanguageSelectPanel(wx.Panel): self.langCtrlContainer = wx.Panel(id=wxID_LANGUAGESELECTPANELLANGCTRLCONTAINER, name='langCtrlContainer', parent=self, style=wx.TAB_TRAVERSAL) - self.langCtrlContainer.SetBackgroundColour(wx.Colour(255, 255, 255)) + self.langCtrlContainer.SetBackgroundColour(wx.WHITE) self.langCtrlContainer.Bind(wx.EVT_SIZE, self.OnLangCtrlContainerSize) self.langFilterRB = wx.RadioBox(choices=['Translated example languages', diff --git a/demo/LayoutAnchors.py b/demo/LayoutAnchors.py index 65d4c315..f15ae6fe 100644 --- a/demo/LayoutAnchors.py +++ b/demo/LayoutAnchors.py @@ -70,7 +70,7 @@ class AnchorsDemoFrame(wx.Frame): pos = (8, 40) ) - self.backgroundPanel.SetBackgroundColour(wx.Colour(255, 255, 255)) + self.backgroundPanel.SetBackgroundColour(wx.WHITE) self.backgroundPanel.SetConstraints( anchors.LayoutAnchors(self.backgroundPanel, True, True, True, True) ) diff --git a/demo/MDISashDemo.py b/demo/MDISashDemo.py index e5d03d49..8048ff8a 100644 --- a/demo/MDISashDemo.py +++ b/demo/MDISashDemo.py @@ -56,7 +56,7 @@ class MyParentFrame(wx.MDIParentFrame): win.SetDefaultSize((1000, 30)) win.SetOrientation(wx.adv.LAYOUT_HORIZONTAL) win.SetAlignment(wx.adv.LAYOUT_TOP) - win.SetBackgroundColour(wx.Colour(255, 0, 0)) + win.SetBackgroundColour(wx.RED) win.SetSashVisible(wx.adv.SASH_BOTTOM, True) self.topWindow = win @@ -67,7 +67,7 @@ class MyParentFrame(wx.MDIParentFrame): win.SetDefaultSize((1000, 30)) win.SetOrientation(wx.adv.LAYOUT_HORIZONTAL) win.SetAlignment(wx.adv.LAYOUT_BOTTOM) - win.SetBackgroundColour(wx.Colour(0, 0, 255)) + win.SetBackgroundColour(wx.BLUE) win.SetSashVisible(wx.adv.SASH_TOP, True) self.bottomWindow = win @@ -78,7 +78,7 @@ class MyParentFrame(wx.MDIParentFrame): win.SetDefaultSize((120, 1000)) win.SetOrientation(wx.adv.LAYOUT_VERTICAL) win.SetAlignment(wx.adv.LAYOUT_LEFT) - win.SetBackgroundColour(wx.Colour(0, 255, 0)) + win.SetBackgroundColour(wx.GREEN) win.SetSashVisible(wx.adv.SASH_RIGHT, True) win.SetExtraBorderSize(10) textWindow = wx.TextCtrl(win, -1, "", style=wx.TE_MULTILINE|wx.SUNKEN_BORDER) @@ -92,7 +92,7 @@ class MyParentFrame(wx.MDIParentFrame): win.SetDefaultSize((120, 1000)) win.SetOrientation(wx.adv.LAYOUT_VERTICAL) win.SetAlignment(wx.adv.LAYOUT_LEFT) - win.SetBackgroundColour(wx.Colour(0, 255, 255)) + win.SetBackgroundColour(wx.CYAN) win.SetSashVisible(wx.adv.SASH_RIGHT, True) self.leftWindow2 = win diff --git a/demo/RichTextCtrl.py b/demo/RichTextCtrl.py index 9b991623..7ac6b1cb 100644 --- a/demo/RichTextCtrl.py +++ b/demo/RichTextCtrl.py @@ -210,7 +210,7 @@ class RichTextFrame(wx.Frame): # Create and initialize text attributes self.textAttr = rt.RichTextAttr() - self.SetFontStyle(fontColor=wx.Colour(0, 0, 0), fontBgColor=wx.Colour(255, 255, 255), fontFace='Times New Roman', fontSize=10, fontBold=False, fontItalic=False, fontUnderline=False) + self.SetFontStyle(fontColor=wx.BLACK, fontBgColor=wx.WHITE, fontFace='Times New Roman', fontSize=10, fontBold=False, fontItalic=False, fontUnderline=False) self.rtc.WriteText('Start with plain text. ') self.SetFontStyle(fontBold=True) self.rtc.WriteText('Bold. ') diff --git a/demo/RichToolTip.py b/demo/RichToolTip.py index 8b50219e..925ce8f6 100644 --- a/demo/RichToolTip.py +++ b/demo/RichToolTip.py @@ -1 +1 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- import random from collections import OrderedDict import wx import wx.adv import images TipKindDict = OrderedDict([ (0, ["TipKind_None", "Don't show any tip, the tooltip will be (roughly) rectangular."]), (1, ["TipKind_TopLeft", "Show a right triangle tip in the top left corner of the tooltip."]), (2, ["TipKind_Top", "Show an equilateral triangle tip in the middle of the tooltip top side."]), (3, ["TipKind_TopRight", "Show a right triangle tip in the top right corner of the tooltip."]), (4, ["TipKind_BottomLeft", "Show a right triangle tip in the bottom left corner of the tooltip."]), (5, ["TipKind_Bottom", "Show an equilateral triangle tip in the middle of the tooltip bottom side."]), (6, ["TipKind_BottomRight", "Show a right triangle tip in the bottom right corner of the tooltip."]), (7, ["TipKind_Auto", "Choose the appropriate tip shape and position automatically."]), ]) HEX = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'] randBmps = ['phoenix_title.png','new_folder.png','lbroll.png','lbnews.png', 'filesave.png','canada.gif','toucan.png','sttbutton.png'] randStrs = ['wxPython Rocks!', 'Python is the best', 'IOIOI\nOIOIO\n'*3, 'Test', 'mooo','Fork','Class API','meh',':)'] def GetRandomColorHexStr(): random.shuffle(HEX) # Order is random now # print(HEX) hexstr = '' for item in range(0,6): random.shuffle(HEX) # Twice for doubles and good luck :) # print(HEX[item]) hexstr = hexstr + str(HEX[item]) return '#%s'%hexstr class TestPanel(wx.Panel): def __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1) self.btn1 = wx.Button(self, -1, "Click me for a RichToolTip!", pos=(50,50)) self.btn2 = wx.Button(self, -1, "RightClick me for a RichToolTip!", pos=(50,100)) self.btn3 = wx.Button(self, -1, "MiddleClick me for a RichToolTip!", pos=(50,150)) self.btn4 = wx.Button(self, -1, "Click me for a RichToolTip!", pos=(50,200)) self.btn5 = wx.Button(self, -1, "Click me for a Gradient RichToolTip!", pos=(50,250)) self.btn6 = wx.Button(self, -1, "Click me for a Random RichToolTip!", pos=(50,300)) #Note: DONT use wx.EVT_LEFT_UP, it is crashy with RichToolTip self.btn1.Bind(wx.EVT_BUTTON, self.OnButton1) self.btn2.Bind(wx.EVT_RIGHT_UP, self.OnButton2) self.btn3.Bind(wx.EVT_MIDDLE_UP, self.OnButton3) self.btn4.Bind(wx.EVT_BUTTON, self.OnButton4) self.btn5.Bind(wx.EVT_BUTTON, self.OnButton5) self.btn6.Bind(wx.EVT_BUTTON, self.OnButton6) def OnButton1(self, event): tip = wx.adv.RichToolTip("Smile :)","Have you brushed your teeth today?") tip.SetIcon(images.Smiles.GetIcon()) tip.ShowFor(self.btn1) def OnButton2(self, event): tip = wx.adv.RichToolTip("WARNING!","bla bla bla\nmeh\n*cough*\nmwaHaHaHa camelCase") tip.SetIcon(wx.ICON_WARNING) tip.SetBackgroundColour(wx.RED) tip.ShowFor(self.btn2) def OnButton3(self, event): tip = wx.adv.RichToolTip("White","maybe the most overused color...") tip.SetIcon(wx.ICON_INFORMATION) tip.SetBackgroundColour(col='#000000', colEnd='#FFFFFF') tip.SetTipKind(wx.adv.TipKind_TopRight) tip.ShowFor(self.btn3) def OnButton4(self, event): tip = wx.adv.RichToolTip("OK","Are you ...?") tip.SetIcon(wx.Icon('bitmaps/sttbutton.png')) tip.SetTipKind(wx.adv.TipKind_Bottom) font = wx.Font(48, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) tip.SetTitleFont(font) tip.SetBackgroundColour(wx.Colour(0,80,135)) tip.SetTimeout(millisecondsTimeout=5000, millisecondsDelay=2) tip.ShowFor(self.btn4) def OnButton5(self, event): tip = wx.adv.RichToolTip("Ooooh","Nice Curves") tip.SetIcon(wx.Icon('bitmaps/view2.png')) tip.SetTipKind(wx.adv.TipKind_Top) tip.SetBackgroundColour(wx.Colour('#FFFFFF'),wx.Colour('#FF8000')) tip.ShowFor(self.btn5) def OnButton6(self, event): randint = random.randint(0,7) random.shuffle(randBmps) random.shuffle(randStrs) tip = wx.adv.RichToolTip("Randomly RichToolTip",randStrs[randint]) tip.SetIcon(wx.Icon("bitmaps/%s" %randBmps[randint])) tip.SetTipKind(randint) tip.SetBackgroundColour(GetRandomColorHexStr()) tip.ShowFor(self.btn6) # def OnChangeTipKind(self, event): def runTest(frame, nb, log): win = TestPanel(nb, log) return win #--------------------------------------------------------------------------- overview = """\ Allows to show a tool tip with more customizations than ToolTip. Currently this class has generic implementation that can be used with any window and implements all the functionality but doesn't exactly match the appearance of the native tooltips (even though it makes some efforts to use the style most appropriate for the current platform) and a native MSW version which can be only used with text controls and doesn't provide as much in the way of customization. Because of this, it's inadvisable to customize the tooltips unnecessarily as doing this turns off auto-detection of the native style in the generic version and may prevent the native MSW version from being used at all. """ if __name__ == '__main__': import sys,os import run run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) \ No newline at end of file +#!/usr/bin/env python # -*- coding: utf-8 -*- import random from collections import OrderedDict import wx import wx.adv import images TipKindDict = OrderedDict([ (0, ["TipKind_None", "Don't show any tip, the tooltip will be (roughly) rectangular."]), (1, ["TipKind_TopLeft", "Show a right triangle tip in the top left corner of the tooltip."]), (2, ["TipKind_Top", "Show an equilateral triangle tip in the middle of the tooltip top side."]), (3, ["TipKind_TopRight", "Show a right triangle tip in the top right corner of the tooltip."]), (4, ["TipKind_BottomLeft", "Show a right triangle tip in the bottom left corner of the tooltip."]), (5, ["TipKind_Bottom", "Show an equilateral triangle tip in the middle of the tooltip bottom side."]), (6, ["TipKind_BottomRight", "Show a right triangle tip in the bottom right corner of the tooltip."]), (7, ["TipKind_Auto", "Choose the appropriate tip shape and position automatically."]), ]) HEX = ['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'] randBmps = ['phoenix_title.png','new_folder.png','lbroll.png','lbnews.png', 'filesave.png','canada.gif','toucan.png','sttbutton.png'] randStrs = ['wxPython Rocks!', 'Python is the best', 'IOIOI\nOIOIO\n'*3, 'Test', 'mooo','Fork','Class API','meh',':)'] def GetRandomColorHexStr(): random.shuffle(HEX) # Order is random now # print(HEX) hexstr = '' for item in range(0,6): random.shuffle(HEX) # Twice for doubles and good luck :) # print(HEX[item]) hexstr = hexstr + str(HEX[item]) return '#%s'%hexstr class TestPanel(wx.Panel): def __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1) self.btn1 = wx.Button(self, -1, "Click me for a RichToolTip!", pos=(50,50)) self.btn2 = wx.Button(self, -1, "RightClick me for a RichToolTip!", pos=(50,100)) self.btn3 = wx.Button(self, -1, "MiddleClick me for a RichToolTip!", pos=(50,150)) self.btn4 = wx.Button(self, -1, "Click me for a RichToolTip!", pos=(50,200)) self.btn5 = wx.Button(self, -1, "Click me for a Gradient RichToolTip!", pos=(50,250)) self.btn6 = wx.Button(self, -1, "Click me for a Random RichToolTip!", pos=(50,300)) #Note: DONT use wx.EVT_LEFT_UP, it is crashy with RichToolTip self.btn1.Bind(wx.EVT_BUTTON, self.OnButton1) self.btn2.Bind(wx.EVT_RIGHT_UP, self.OnButton2) self.btn3.Bind(wx.EVT_MIDDLE_UP, self.OnButton3) self.btn4.Bind(wx.EVT_BUTTON, self.OnButton4) self.btn5.Bind(wx.EVT_BUTTON, self.OnButton5) self.btn6.Bind(wx.EVT_BUTTON, self.OnButton6) def OnButton1(self, event): tip = wx.adv.RichToolTip("Smile :)","Have you brushed your teeth today?") tip.SetIcon(images.Smiles.GetIcon()) tip.ShowFor(self.btn1) def OnButton2(self, event): tip = wx.adv.RichToolTip("WARNING!","bla bla bla\nmeh\n*cough*\nmwaHaHaHa camelCase") tip.SetIcon(wx.ICON_WARNING) tip.SetBackgroundColour(wx.RED) tip.ShowFor(self.btn2) def OnButton3(self, event): tip = wx.adv.RichToolTip("White","maybe the most overused color...") tip.SetIcon(wx.ICON_INFORMATION) tip.SetBackgroundColour(col='#000000', colEnd='#FFFFFF') tip.SetTipKind(wx.adv.TipKind_TopRight) tip.ShowFor(self.btn3) def OnButton4(self, event): tip = wx.adv.RichToolTip("OK","Are you ...?") tip.SetIcon(wx.Icon('bitmaps/sttbutton.png')) tip.SetTipKind(wx.adv.TipKind_Bottom) font = wx.Font(48, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD) tip.SetTitleFont(font) tip.SetBackgroundColour(wx.Colour(0,80,135)) tip.SetTimeout(millisecondsTimeout=5000, millisecondsDelay=2) tip.ShowFor(self.btn4) def OnButton5(self, event): tip = wx.adv.RichToolTip("Ooooh","Nice Curves") tip.SetIcon(wx.Icon('bitmaps/view2.png')) tip.SetTipKind(wx.adv.TipKind_Top) tip.SetBackgroundColour(wx.WHITE, wx.Colour('#FF8000')) tip.ShowFor(self.btn5) def OnButton6(self, event): randint = random.randint(0,7) random.shuffle(randBmps) random.shuffle(randStrs) tip = wx.adv.RichToolTip("Randomly RichToolTip",randStrs[randint]) tip.SetIcon(wx.Icon("bitmaps/%s" %randBmps[randint])) tip.SetTipKind(randint) tip.SetBackgroundColour(GetRandomColorHexStr()) tip.ShowFor(self.btn6) # def OnChangeTipKind(self, event): def runTest(frame, nb, log): win = TestPanel(nb, log) return win #--------------------------------------------------------------------------- overview = """\ Allows to show a tool tip with more customizations than ToolTip. Currently this class has generic implementation that can be used with any window and implements all the functionality but doesn't exactly match the appearance of the native tooltips (even though it makes some efforts to use the style most appropriate for the current platform) and a native MSW version which can be only used with text controls and doesn't provide as much in the way of customization. Because of this, it's inadvisable to customize the tooltips unnecessarily as doing this turns off auto-detection of the native style in the generic version and may prevent the native MSW version from being used at all. """ if __name__ == '__main__': import sys,os import run run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) \ No newline at end of file diff --git a/demo/SashWindow.py b/demo/SashWindow.py index 67af3e4f..24f0cf30 100644 --- a/demo/SashWindow.py +++ b/demo/SashWindow.py @@ -23,7 +23,7 @@ class TestSashWindow(wx.Panel): topwin.SetDefaultSize((1000, 30)) topwin.SetOrientation(wx.adv.LAYOUT_HORIZONTAL) topwin.SetAlignment(wx.adv.LAYOUT_TOP) - topwin.SetBackgroundColour(wx.Colour(255, 0, 0)) + topwin.SetBackgroundColour(wx.RED) topwin.SetSashVisible(wx.adv.SASH_BOTTOM, True) self.topWindow = topwin @@ -38,7 +38,7 @@ class TestSashWindow(wx.Panel): bottomwin.SetDefaultSize((1000, 30)) bottomwin.SetOrientation(wx.adv.LAYOUT_HORIZONTAL) bottomwin.SetAlignment(wx.adv.LAYOUT_BOTTOM) - bottomwin.SetBackgroundColour(wx.Colour(0, 0, 255)) + bottomwin.SetBackgroundColour(wx.BLUE) bottomwin.SetSashVisible(wx.adv.SASH_TOP, True) self.bottomWindow = bottomwin @@ -53,7 +53,7 @@ class TestSashWindow(wx.Panel): leftwin1.SetDefaultSize((120, 1000)) leftwin1.SetOrientation(wx.adv.LAYOUT_VERTICAL) leftwin1.SetAlignment(wx.adv.LAYOUT_LEFT) - leftwin1.SetBackgroundColour(wx.Colour(0, 255, 0)) + leftwin1.SetBackgroundColour(wx.GREEN) leftwin1.SetSashVisible(wx.adv.SASH_RIGHT, True) leftwin1.SetExtraBorderSize(10) textWindow = wx.TextCtrl( @@ -76,7 +76,7 @@ class TestSashWindow(wx.Panel): leftwin2.SetDefaultSize((120, 1000)) leftwin2.SetOrientation(wx.adv.LAYOUT_VERTICAL) leftwin2.SetAlignment(wx.adv.LAYOUT_LEFT) - leftwin2.SetBackgroundColour(wx.Colour(0, 255, 255)) + leftwin2.SetBackgroundColour(wx.CYAN) leftwin2.SetSashVisible(wx.adv.SASH_RIGHT, True) self.leftWindow2 = leftwin2 diff --git a/demo/agw/FlatMenu.py b/demo/agw/FlatMenu.py index 739883bb..c059ad75 100644 --- a/demo/agw/FlatMenu.py +++ b/demo/agw/FlatMenu.py @@ -84,7 +84,7 @@ def CreateBackgroundBitmap(): mem_dc.Clear() # colour the menu face with background colour - top = wx.Colour("blue") + top = wx.BLUE bottom = wx.Colour("light blue") filRect = wx.Rect(0, 0, 200, 300) mem_dc.GradientFillConcentric(filRect, top, bottom, wx.Point(100, 150)) diff --git a/demo/agw/LabelBook.py b/demo/agw/LabelBook.py index 57f4e853..98461fc8 100644 --- a/demo/agw/LabelBook.py +++ b/demo/agw/LabelBook.py @@ -36,7 +36,7 @@ class SamplePane(wx.Panel): def __init__(self, parent, colour, label): wx.Panel.__init__(self, parent, style=0)#wx.BORDER_SUNKEN) - self.SetBackgroundColour(wx.Colour(255,255,255)) + self.SetBackgroundColour(wx.WHITE) label = label + "\nEnjoy the LabelBook && FlatImageBook demo!" static = wx.StaticText(self, -1, label, pos=(10, 10)) @@ -87,7 +87,7 @@ class LabelBookDemo(wx.Frame): self.background = csel.ColourSelect(self.leftpanel, -1, "Choose...", wx.Colour(132, 164, 213), size=(-1, 20)) self.activetab = csel.ColourSelect(self.leftpanel, -1, "Choose...", - wx.Colour(255, 255, 255), size=(-1, 20)) + wx.WHITE, size=(-1, 20)) self.tabsborder = csel.ColourSelect(self.leftpanel, -1, "Choose...", wx.Colour(0, 0, 204), size=(-1, 20)) self.textcolour = csel.ColourSelect(self.leftpanel, -1, "Choose...", diff --git a/demo/agw/PieCtrl.py b/demo/agw/PieCtrl.py index 410c05cd..634bb5c3 100644 --- a/demo/agw/PieCtrl.py +++ b/demo/agw/PieCtrl.py @@ -108,7 +108,7 @@ class PieCtrlDemo(wx.Panel): wx.Size(180, 200), wx.SIMPLE_BORDER) self._progresspie.SetBackColour(wx.Colour(150, 200, 255)) - self._progresspie.SetFilledColour(wx.Colour(255, 0, 0)) + self._progresspie.SetFilledColour(wx.RED) self._progresspie.SetUnfilledColour(wx.WHITE) self._progresspie.SetHeight(20) diff --git a/demo/agw/ShapedButton.py b/demo/agw/ShapedButton.py index f3c109f6..80cf7a92 100644 --- a/demo/agw/ShapedButton.py +++ b/demo/agw/ShapedButton.py @@ -213,7 +213,7 @@ class ShapedButtonDemo(wx.Frame): wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, "Tahoma"), fnt, wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, True, "Verdana")] - lcolours = [None, wx.WHITE, wx.Colour("Yellow"), wx.WHITE, + lcolours = [None, wx.WHITE, wx.YELLOW, wx.WHITE, None, None, wx.BLUE, wx.WHITE, wx.WHITE] bsizer = wx.FlexGridSizer(3, 3, 5, 5) @@ -266,7 +266,7 @@ class ShapedButtonDemo(wx.Frame): btn2.Bind(wx.EVT_BUTTON, self.OnTogglePlayStop) btn3 = SButton(self.panel, -1, "Rotated") - btn3.SetButtonColour(wx.Colour("Cyan")) + btn3.SetButtonColour(wx.CYAN) btn3.SetLabelColour(wx.WHITE) btn3.SetFont(wx.Font(8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False)) btn3.SetAngleOfRotation(90) diff --git a/demo/agw/SpeedMeter.py b/demo/agw/SpeedMeter.py index 2297aa80..9f0fdebb 100644 --- a/demo/agw/SpeedMeter.py +++ b/demo/agw/SpeedMeter.py @@ -187,7 +187,7 @@ class SpeedMeterDemo(wx.Panel): self.SpeedWindow3.SetTicks(ticks) self.SpeedWindow3.SetTicksColour(wx.WHITE) - self.SpeedWindow3.SetHandColour(wx.Colour(255, 255, 0)) + self.SpeedWindow3.SetHandColour(wx.YELLOW) # Define The Icon We Want icon = _getAndScaleIcon( @@ -229,7 +229,7 @@ class SpeedMeterDemo(wx.Panel): self.SpeedWindow4.SetIntervals(intervals) colours = [wx.BLUE]*5 - colours.extend([wx.Colour(255, 255, 0)]*2) + colours.extend([wx.YELLOW]*2) colours.append(wx.RED) self.SpeedWindow4.SetIntervalColours(colours) @@ -238,7 +238,7 @@ class SpeedMeterDemo(wx.Panel): self.SpeedWindow4.SetTicksColour(wx.BLACK) self.SpeedWindow4.SetTicksFont(wx.Font(7, wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD)) - self.SpeedWindow4.SetHandColour(wx.Colour(0, 0, 255)) + self.SpeedWindow4.SetHandColour(wx.BLUE) self.SpeedWindow4.SetSpeedBackground(wx.SystemSettings.GetColour(0)) @@ -285,7 +285,7 @@ class SpeedMeterDemo(wx.Panel): self.SpeedWindow5.SetIntervals(intervals) colours = [wx.BLACK]*6 - colours.append(wx.Colour(255, 255, 0)) + colours.append(wx.YELLOW) colours.append(wx.RED) self.SpeedWindow5.SetIntervalColours(colours) diff --git a/demo/agw/UltimateReportDemo.py b/demo/agw/UltimateReportDemo.py index 79deef0f..40f49cb8 100644 --- a/demo/agw/UltimateReportDemo.py +++ b/demo/agw/UltimateReportDemo.py @@ -659,7 +659,7 @@ class UltimateListCtrlPanel(wx.Panel, listmix.ColumnSorterMixin): fontMask = ULC.ULC_MASK_FONTCOLOUR|ULC.ULC_MASK_FONT fullMask = fontMask|ULC.ULC_MASK_BACKCOLOUR - customRow, customCol, colours = [0, 3], [2, 1], [wx.RED, wx.Colour("Yellow")] + customRow, customCol, colours = [0, 3], [2, 1], [wx.RED, wx.YELLOW] for row, col, colour in zip(customRow, customCol, colours): item = self.list.GetItem(row, col) diff --git a/demo/agw/UltimateVirtualDemo.py b/demo/agw/UltimateVirtualDemo.py index 1918b37a..29aeefca 100644 --- a/demo/agw/UltimateVirtualDemo.py +++ b/demo/agw/UltimateVirtualDemo.py @@ -70,7 +70,7 @@ class TestUltimateListCtrl(ULC.UltimateListCtrl): self.SetItemCount(1000000) self.attr1 = ULC.UltimateListItemAttr() - self.attr1.SetBackgroundColour(wx.Colour("yellow")) + self.attr1.SetBackgroundColour(wx.YELLOW) self.attr2 = ULC.UltimateListItemAttr() self.attr2.SetBackgroundColour(wx.Colour("light blue")) @@ -120,11 +120,11 @@ class TestUltimateListCtrl(ULC.UltimateListCtrl): def OnGetItemTextColour(self, item, col): if item == 0 and col == 0: - return wx.Colour(255,0,0) + return wx.RED elif item == 0 and col == 1: - return wx.Colour(0,255,0) + return wx.GREEN elif item == 0 and col == 2: - return wx.Colour(0,0,255) + return wx.BLUE else: return None diff --git a/wx/lib/agw/aquabutton.py b/wx/lib/agw/aquabutton.py index 9e82eddc..0bee3f8a 100644 --- a/wx/lib/agw/aquabutton.py +++ b/wx/lib/agw/aquabutton.py @@ -322,7 +322,7 @@ class AquaButton(wx.Control): path3 = self.GetPath(gc, rc3, 10) br3 = gc.CreateLinearGradientBrush(rc3.x, rc3.y, rc3.x, rc3.y+rc3.height, - wx.Colour(255, 255, 255, 255), wx.Colour(255, 255, 255, 0)) + wx.WHITE, wx.TransparentColour) # draw shapes gc.SetBrush(br2) @@ -1067,7 +1067,7 @@ class __ToggleMixin(object): path3 = self.GetPath(gc, rc3, 10) br3 = gc.CreateLinearGradientBrush(rc3.x, rc3.y, rc3.x, rc3.y+rc3.height, - wx.Colour(255, 255, 255, 255), wx.Colour(255, 255, 255, 0)) + wx.WHITE, wx.TransparentColour) # draw shapes gc.SetBrush(br2) diff --git a/wx/lib/agw/aui/aui_constants.py b/wx/lib/agw/aui/aui_constants.py index 5121a21e..8ad6c64e 100644 --- a/wx/lib/agw/aui/aui_constants.py +++ b/wx/lib/agw/aui/aui_constants.py @@ -2570,7 +2570,7 @@ colourTargetBorder = wx.Colour(180, 180, 180) colourTargetShade = wx.Colour(206, 206, 206) colourTargetBackground = wx.Colour(224, 224, 224) colourIconBorder = wx.Colour(82, 65, 156) -colourIconBackground = wx.Colour(255, 255, 255) +colourIconBackground = wx.WHITE colourIconDockingPart1 = wx.Colour(215, 228, 243) colourIconDockingPart2 = wx.Colour(180, 201, 225) colourIconShadow = wx.Colour(198, 198, 198) diff --git a/wx/lib/agw/balloontip.py b/wx/lib/agw/balloontip.py index 70a43f8b..b4155d74 100644 --- a/wx/lib/agw/balloontip.py +++ b/wx/lib/agw/balloontip.py @@ -385,9 +385,9 @@ class BalloonFrame(wx.Frame): bmp = wx.Bitmap(size.x,size.y) dc = wx.BufferedDC(None, bmp) - dc.SetBackground(wx.Brush(wx.Colour(0,0,0))) + dc.SetBackground(wx.BLACK_BRUSH) dc.Clear() - dc.SetPen(wx.Pen(wx.Colour(0,0,0), 1, wx.PENSTYLE_TRANSPARENT)) + dc.SetPen(wx.Pen(wx.BLACK, 1, wx.PENSTYLE_TRANSPARENT)) if self._shape == BT_ROUNDED: dc.DrawRoundedRectangle(0, 20, boxwidth, boxheight-20, 12) @@ -407,7 +407,7 @@ class BalloonFrame(wx.Frame): else: dc.DrawPolygon(((20, boxheight), (20, boxheight+20), (40, boxheight))) - r = wx.Region(bmp, wx.Colour(0, 0, 0)) + r = wx.Region(bmp, wx.BLACK) self.hasShape = self.SetShape(r) if self._tipstyle == BT_BUTTON: diff --git a/wx/lib/agw/buttonpanel.py b/wx/lib/agw/buttonpanel.py index 7dbacbb1..a087ef7f 100644 --- a/wx/lib/agw/buttonpanel.py +++ b/wx/lib/agw/buttonpanel.py @@ -354,7 +354,7 @@ class BPArt(object): self._gradient_type = BP_GRADIENT_NONE self._buttontext_inactive_colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_GRAYTEXT) - self._selection_brush = wx.Brush(wx.Colour(225, 225, 255)) + self._selection_brush = wx.WHITE_BRUSH self._selection_pen = wx.Pen(wx.SystemSettings.GetColour(wx.SYS_COLOUR_ACTIVECAPTION)) sysfont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) diff --git a/wx/lib/agw/cubecolourdialog.py b/wx/lib/agw/cubecolourdialog.py index 0933a687..f001d1f4 100644 --- a/wx/lib/agw/cubecolourdialog.py +++ b/wx/lib/agw/cubecolourdialog.py @@ -1641,7 +1641,7 @@ class BasePyControl(wx.Control): self.SetDoubleBuffered(True) self._bitmap = bitmap - mask = wx.Mask(self._bitmap, wx.Colour(192, 192, 192)) + mask = wx.Mask(self._bitmap, wx.LIGHT_GREY) self._bitmap.SetMask(mask) self._mainDialog = wx.GetTopLevelParent(self) @@ -2672,7 +2672,7 @@ class CustomPanel(wx.Control): if c.IsOk(): self._customColours[i] = self._colourData.GetCustomColour(i) else: - self._customColours[i] = wx.Colour(255, 255, 255) + self._customColours[i] = wx.WHITE if c == curr: self._colourSelection = i diff --git a/wx/lib/agw/flatmenu.py b/wx/lib/agw/flatmenu.py index 956fbcaa..4d63d5ce 100644 --- a/wx/lib/agw/flatmenu.py +++ b/wx/lib/agw/flatmenu.py @@ -1192,8 +1192,8 @@ class FMRenderer(object): memDc.SetTextForeground(textColour) # Fill the bitmap with the masking colour - memDc.SetPen(wx.Pen(wx.Colour(255, 0, 0)) ) - memDc.SetBrush(wx.Brush(wx.Colour(255, 0, 0)) ) + memDc.SetPen(wx.RED_PEN) + memDc.SetBrush(wx.RED_BRUSH) memDc.DrawRectangle(0, 0, rect.width, rect.height) memDc.SetFont(fnt) @@ -1250,7 +1250,7 @@ class FMRenderer(object): if not menubar._isLCD: memDc.SelectObject(wx.NullBitmap) # Set masking colour to the bitmap - bmp.SetMask(wx.Mask(bmp, wx.Colour(255, 0, 0))) + bmp.SetMask(wx.Mask(bmp, wx.RED)) if selected: item.SetSelectedTextBitmap(bmp) else: diff --git a/wx/lib/agw/hyperlink.py b/wx/lib/agw/hyperlink.py index 2215827f..c6506503 100644 --- a/wx/lib/agw/hyperlink.py +++ b/wx/lib/agw/hyperlink.py @@ -443,8 +443,8 @@ class HyperLinkCtrl(StaticText): wx.MessageBox(ErrorMessage, "HyperLinks Error", wx.OK | wx.CENTRE | wx.ICON_ERROR) - def SetColours(self, link=wx.Colour(0, 0, 255), visited=wx.Colour(79, 47, 79), - rollover=wx.Colour(0, 0, 255)): + def SetColours(self, link=wx.BLUE, visited=wx.Colour(79, 47, 79), + rollover=wx.BLUE): """ Sets the colours for the link, the visited link and the mouse rollover. diff --git a/wx/lib/agw/labelbook.py b/wx/lib/agw/labelbook.py index 8f527bf1..b669afa3 100644 --- a/wx/lib/agw/labelbook.py +++ b/wx/lib/agw/labelbook.py @@ -1044,7 +1044,7 @@ class ImageContainerBase(wx.Panel): elif self._nPinButtonStatus == INB_PIN_PRESSED: dc.SetBrush(wx.TRANSPARENT_BRUSH) - dc.SetPen(wx.Pen(wx.Colour("LIGHT GREY"))) + dc.SetPen(wx.LIGHT_GREY_PEN) dc.DrawRectangle(xx, rect.y, 16, 16) # Draw upper and left border with grey colour diff --git a/wx/lib/agw/peakmeter.py b/wx/lib/agw/peakmeter.py index 7f1f6f00..055dbef8 100644 --- a/wx/lib/agw/peakmeter.py +++ b/wx/lib/agw/peakmeter.py @@ -329,9 +329,9 @@ class PeakMeterCtrl(wx.Control): def InitData(self): """ Initializes the control. """ - colLime = wx.Colour(0, 255, 0) - colRed = wx.Colour(255, 0, 0) - colYellow = wx.Colour(255, 255, 0) + colLime = wx.GREEN + colRed = wx.RED + colYellow = wx.YELLOW self._showGrid = False self._showFalloff = True diff --git a/wx/lib/agw/piectrl.py b/wx/lib/agw/piectrl.py index f135fb4d..199a9a75 100644 --- a/wx/lib/agw/piectrl.py +++ b/wx/lib/agw/piectrl.py @@ -88,7 +88,7 @@ Usage example:: wx.Size(180, 200), wx.SIMPLE_BORDER) progress_pie.SetBackColour(wx.Colour(150, 200, 255)) - progress_pie.SetFilledColour(wx.Colour(255, 0, 0)) + progress_pie.SetFilledColour(wx.RED) progress_pie.SetUnfilledColour(wx.WHITE) progress_pie.SetHeight(20) @@ -193,7 +193,7 @@ class PieCtrlLegend(wx.Window): self._titlecolour = wx.Colour(0, 0, 127) self._labelcolour = wx.BLACK self._labelfont = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) - self._backcolour = wx.Colour(255, 255, 0) + self._backcolour = wx.YELLOW self._backgroundDC = wx.MemoryDC() self._parent = parent @@ -1028,7 +1028,7 @@ if __name__ == '__main__': wx.Size(180, 200), wx.SIMPLE_BORDER) progress_pie.SetBackColour(wx.Colour(150, 200, 255)) - progress_pie.SetFilledColour(wx.Colour(255, 0, 0)) + progress_pie.SetFilledColour(wx.RED) progress_pie.SetUnfilledColour(wx.WHITE) progress_pie.SetHeight(20) diff --git a/wx/lib/agw/pybusyinfo.py b/wx/lib/agw/pybusyinfo.py index b051613d..355a5742 100644 --- a/wx/lib/agw/pybusyinfo.py +++ b/wx/lib/agw/pybusyinfo.py @@ -178,11 +178,11 @@ class PyInfoFrame(wx.Frame): size = self.GetSize() bmp = wx.Bitmap(size.x, size.y) dc = wx.BufferedDC(None, bmp) - dc.SetBackground(wx.Brush(wx.Colour(0, 0, 0))) + dc.SetBackground(wx.BLACK_BRUSH) dc.Clear() - dc.SetPen(wx.Pen(wx.Colour(0, 0, 0), 1)) + dc.SetPen(wx.BLACK_PEN) dc.DrawRoundedRectangle(0, 0, size.x, size.y, 12) - r = wx.Region(bmp, wx.Colour(0, 0, 0)) + r = wx.Region(bmp, wx.BLACK) # Store the non-rectangular region self.reg = r diff --git a/wx/lib/agw/ribbon/art_msw.py b/wx/lib/agw/ribbon/art_msw.py index df061a14..f7e32544 100644 --- a/wx/lib/agw/ribbon/art_msw.py +++ b/wx/lib/agw/ribbon/art_msw.py @@ -95,7 +95,7 @@ class RibbonMSWArtProvider(object): self._panel_extension_bitmap = [wx.NullBitmap for i in range(2)] if set_colour_scheme: - self.SetColourScheme(wx.Colour(194, 216, 241), wx.Colour(255, 223, 114), wx.Colour(0, 0, 0)) + self.SetColourScheme(wx.Colour(194, 216, 241), wx.Colour(255, 223, 114), wx.BLACK) self._cached_tab_separator_visibility = -10.0 # valid visibilities are in range [0, 1] self._tab_separation_size = 3 @@ -650,7 +650,7 @@ class RibbonMSWArtProvider(object): elif id == RIBBON_ART_TAB_SEPARATOR_GRADIENT_COLOUR: return self._tab_separator_gradient_colour elif id in [RIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_COLOUR, RIBBON_ART_TAB_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR]: - return wx.Colour(0, 0, 0) + return wx.BLACK elif id == RIBBON_ART_TAB_ACTIVE_BACKGROUND_COLOUR: return self._tab_active_background_colour elif id == RIBBON_ART_TAB_ACTIVE_BACKGROUND_GRADIENT_COLOUR: diff --git a/wx/lib/agw/supertooltip.py b/wx/lib/agw/supertooltip.py index c9f6cbc1..99b8e416 100644 --- a/wx/lib/agw/supertooltip.py +++ b/wx/lib/agw/supertooltip.py @@ -155,48 +155,50 @@ if wx.Platform == "__WXMSW__": # Define a bunch of predefined colour schemes... -_colourSchemes = {"Beige": (wx.Colour(255,255,255), wx.Colour(242,242,223), wx.Colour(198,195,160), wx.Colour(0,0,0)), - "Blue": (wx.Colour(255,255,255), wx.Colour(202,220,246), wx.Colour(150,180,222), wx.Colour(0,0,0)), - "Blue 2": (wx.Colour(255,255,255), wx.Colour(228,236,248), wx.Colour(198,214,235), wx.Colour(0,0,0)), - "Blue 3": (wx.Colour(255,255,255), wx.Colour(213,233,243), wx.Colour(151,195,216), wx.Colour(0,0,0)), - "Blue 4": (wx.Colour(255,255,255), wx.Colour(227,235,255), wx.Colour(102,153,255), wx.Colour(0,0,0)), - "Blue Glass": (wx.Colour(182,226,253), wx.Colour(137,185,232), wx.Colour(188,244,253), wx.Colour(0,0,0)), - "Blue Glass 2": (wx.Colour(192,236,255), wx.Colour(147,195,242), wx.Colour(198,254,255), wx.Colour(0,0,0)), - "Blue Glass 3": (wx.Colour(212,255,255), wx.Colour(167,215,255), wx.Colour(218,255,255), wx.Colour(0,0,0)), - "Blue Inverted": (wx.Colour(117,160,222), wx.Colour(167,210,240), wx.Colour(233,243,255), wx.Colour(0,0,0)), - "Blue Shift": (wx.Colour(124,178,190), wx.Colour(13,122,153), wx.Colour(0,89,116), wx.Colour(255,255,255)), - "CodeProject": (wx.Colour(255,250,172), wx.Colour(255,207,157), wx.Colour(255,153,0), wx.Colour(0,0,0)), - "Dark Gray": (wx.Colour(195,195,195), wx.Colour(168,168,168), wx.Colour(134,134,134), wx.Colour(255,255,255)), - "Deep Purple": (wx.Colour(131,128,164), wx.Colour(112,110,143), wx.Colour(90,88,117), wx.Colour(255,255,255)), - "Electric Blue": (wx.Colour(224,233,255), wx.Colour(135,146,251), wx.Colour(99,109,233), wx.Colour(0,0,0)), - "Firefox": (wx.Colour(255,254,207), wx.Colour(254,248,125), wx.Colour(225,119,24), wx.Colour(0,0,0)), - "Gold": (wx.Colour(255,202,0), wx.Colour(255,202,0), wx.Colour(255,202,0), wx.Colour(0,0,0)), - "Gold Shift": (wx.Colour(178,170,107), wx.Colour(202,180,32), wx.Colour(162,139,1), wx.Colour(255,255,255)), - "Gray": (wx.Colour(255,255,255), wx.Colour(228,228,228), wx.Colour(194,194,194), wx.Colour(0,0,0)), - "Green": (wx.Colour(234,241,223), wx.Colour(211,224,180), wx.Colour(182,200,150), wx.Colour(0,0,0)), - "Green Shift": (wx.Colour(129,184,129), wx.Colour(13,185,15), wx.Colour(1,125,1), wx.Colour(255,255,255)), - "Light Green": (wx.Colour(174,251,171), wx.Colour(145,221,146), wx.Colour(90,176,89), wx.Colour(0,0,0)), - "NASA Blue": (wx.Colour(0,91,134), wx.Colour(0,100,150), wx.Colour(0,105,160), wx.Colour(255,255,255)), - "Office 2007 Blue": (wx.Colour(255,255,255), wx.Colour(242,246,251), wx.Colour(202,218,239), wx.Colour(76,76,76)), - "Orange Shift": (wx.Colour(179,120,80), wx.Colour(183,92,19), wx.Colour(157,73,1), wx.Colour(255,255,255)), - "Outlook Green": (wx.Colour(236,242,208), wx.Colour(219,230,187), wx.Colour(195,210,155), wx.Colour(0,0,0)), - "Pale Green": (wx.Colour(249,255,248), wx.Colour(206,246,209), wx.Colour(148,225,155), wx.Colour(0,0,0)), - "Pink Blush": (wx.Colour(255,254,255), wx.Colour(255,231,242), wx.Colour(255,213,233), wx.Colour(0,0,0)), - "Pink Shift": (wx.Colour(202,135,188), wx.Colour(186,8,158), wx.Colour(146,2,116), wx.Colour(255,255,255)), - "Pretty Pink": (wx.Colour(255,240,249), wx.Colour(253,205,217), wx.Colour(255,150,177), wx.Colour(0,0,0)), - "Red": (wx.Colour(255,183,176), wx.Colour(253,157,143), wx.Colour(206,88,78), wx.Colour(0,0,0)), - "Red Shift": (wx.Colour(186,102,102), wx.Colour(229,23,9), wx.Colour(182,11,1), wx.Colour(255,255,255)), - "Silver": (wx.Colour(255,255,255), wx.Colour(242,242,246), wx.Colour(212,212,224), wx.Colour(0,0,0)), - "Silver 2": (wx.Colour(255,255,255), wx.Colour(242,242,248), wx.Colour(222,222,228), wx.Colour(0,0,0)), - "Silver Glass": (wx.Colour(158,158,158), wx.Colour(255,255,255), wx.Colour(105,105,105), wx.Colour(0,0,0)), - "Silver Inverted": (wx.Colour(161,160,186), wx.Colour(199,201,213), wx.Colour(255,255,255), wx.Colour(0,0,0)), - "Silver Inverted 2": (wx.Colour(181,180,206), wx.Colour(219,221,233), wx.Colour(255,255,255), wx.Colour(0,0,0)), - "Soylent Green": (wx.Colour(134,211,131), wx.Colour(105,181,106), wx.Colour(50,136,49), wx.Colour(255,255,255)), - "Spring Green": (wx.Colour(154,231,151), wx.Colour(125,201,126), wx.Colour(70,156,69), wx.Colour(255,255,255)), - "Too Blue": (wx.Colour(255,255,255), wx.Colour(225,235,244), wx.Colour(188,209,226), wx.Colour(0,0,0)), - "Totally Green": (wx.Colour(190,230,160), wx.Colour(190,230,160), wx.Colour(190,230,160), wx.Colour(0,0,0)), - "XP Blue": (wx.Colour(119,185,236), wx.Colour(81,144,223), wx.Colour(36,76,171), wx.Colour(255,255,255)), - "Yellow": (wx.Colour(255,255,220), wx.Colour(255,231,161), wx.Colour(254,218,108), wx.Colour(0,0,0))} +_colourSchemes = { + "Beige": (wx.WHITE, wx.Colour(242, 242, 223), wx.Colour(198, 195, 160), wx.BLACK), + "Blue": (wx.WHITE, wx.Colour(202, 220, 246), wx.Colour(150, 180, 222), wx.BLACK), + "Blue 2": (wx.WHITE, wx.Colour(228, 236, 248), wx.Colour(198, 214, 235), wx.BLACK), + "Blue 3": (wx.WHITE, wx.Colour(213, 233, 243), wx.Colour(151, 195, 216), wx.BLACK), + "Blue 4": (wx.WHITE, wx.Colour(227, 235, 255), wx.Colour(102, 153, 255), wx.BLACK), + "Blue Glass": (wx.Colour(182, 226, 253), wx.Colour(137, 185, 232), wx.Colour(188, 244, 253), wx.BLACK), + "Blue Glass 2": (wx.Colour(192, 236, 255), wx.Colour(147, 195, 242), wx.Colour(198, 254, 255), wx.BLACK), + "Blue Glass 3": (wx.Colour(212, 255, 255), wx.Colour(167, 215, 255), wx.Colour(218, 255, 255), wx.BLACK), + "Blue Inverted": (wx.Colour(117, 160, 222), wx.Colour(167, 210, 240), wx.Colour(233, 243, 255), wx.BLACK), + "Blue Shift": (wx.Colour(124, 178, 190), wx.Colour(13, 122, 153), wx.Colour(0, 89, 116), wx.WHITE), + "CodeProject": (wx.Colour(255, 250, 172), wx.Colour(255, 207, 157), wx.Colour(255, 153, 0), wx.BLACK), + "Dark Gray": (wx.Colour(195, 195, 195), wx.Colour(168, 168, 168), wx.Colour(134, 134, 134), wx.WHITE), + "Deep Purple": (wx.Colour(131, 128, 164), wx.Colour(112, 110, 143), wx.Colour(90, 88, 117), wx.WHITE), + "Electric Blue": (wx.Colour(224, 233, 255), wx.Colour(135, 146, 251), wx.Colour(99, 109, 233), wx.BLACK), + "Firefox": (wx.Colour(255, 254, 207), wx.Colour(254, 248, 125), wx.Colour(225, 119, 24), wx.BLACK), + "Gold": (wx.Colour(255, 202, 0), wx.Colour(255, 202, 0), wx.Colour(255, 202, 0), wx.BLACK), + "Gold Shift": (wx.Colour(178, 170, 107), wx.Colour(202, 180, 32), wx.Colour(162, 139, 1), wx.WHITE), + "Gray": (wx.WHITE, wx.Colour(228, 228, 228), wx.Colour(194, 194, 194), wx.BLACK), + "Green": (wx.Colour(234, 241, 223), wx.Colour(211, 224, 180), wx.Colour(182, 200, 150), wx.BLACK), + "Green Shift": (wx.Colour(129, 184, 129), wx.Colour(13, 185, 15), wx.Colour(1, 125, 1), wx.WHITE), + "Light Green": (wx.Colour(174, 251, 171), wx.Colour(145, 221, 146), wx.Colour(90, 176, 89), wx.BLACK), + "NASA Blue": (wx.Colour(0, 91, 134), wx.Colour(0, 100, 150), wx.Colour(0, 105, 160), wx.WHITE), + "Office 2007 Blue": (wx.WHITE, wx.Colour(242, 246, 251), wx.Colour(202, 218, 239), wx.Colour(76, 76, 76)), + "Orange Shift": (wx.Colour(179, 120, 80), wx.Colour(183, 92, 19), wx.Colour(157, 73, 1), wx.WHITE), + "Outlook Green": (wx.Colour(236, 242, 208), wx.Colour(219, 230, 187), wx.Colour(195, 210, 155), wx.BLACK), + "Pale Green": (wx.Colour(249, 255, 248), wx.Colour(206, 246, 209), wx.Colour(148, 225, 155), wx.BLACK), + "Pink Blush": (wx.Colour(255, 254, 255), wx.Colour(255, 231, 242), wx.Colour(255, 213, 233), wx.BLACK), + "Pink Shift": (wx.Colour(202, 135, 188), wx.Colour(186, 8, 158), wx.Colour(146, 2, 116), wx.WHITE), + "Pretty Pink": (wx.Colour(255, 240, 249), wx.Colour(253, 205, 217), wx.Colour(255, 150, 177), wx.BLACK), + "Red": (wx.Colour(255, 183, 176), wx.Colour(253, 157, 143), wx.Colour(206, 88, 78), wx.BLACK), + "Red Shift": (wx.Colour(186, 102, 102), wx.Colour(229, 23, 9), wx.Colour(182, 11, 1), wx.WHITE), + "Silver": (wx.WHITE, wx.Colour(242, 242, 246), wx.Colour(212, 212, 224), wx.BLACK), + "Silver 2": (wx.WHITE, wx.Colour(242, 242, 248), wx.Colour(222, 222, 228), wx.BLACK), + "Silver Glass": (wx.Colour(158, 158, 158), wx.WHITE, wx.Colour(105, 105, 105), wx.BLACK), + "Silver Inverted": (wx.Colour(161, 160, 186), wx.Colour(199, 201, 213), wx.WHITE, wx.BLACK), + "Silver Inverted 2": (wx.Colour(181, 180, 206), wx.Colour(219, 221, 233), wx.WHITE, wx.BLACK), + "Soylent Green": (wx.Colour(134, 211, 131), wx.Colour(105, 181, 106), wx.Colour(50, 136, 49), wx.WHITE), + "Spring Green": (wx.Colour(154, 231, 151), wx.Colour(125, 201, 126), wx.Colour(70, 156, 69), wx.WHITE), + "Too Blue": (wx.WHITE, wx.Colour(225, 235, 244), wx.Colour(188, 209, 226), wx.BLACK), + "Totally Green": (wx.Colour(190, 230, 160), wx.Colour(190, 230, 160), wx.Colour(190, 230, 160), wx.BLACK), + "XP Blue": (wx.Colour(119, 185, 236), wx.Colour(81, 144, 223), wx.Colour(36, 76, 171), wx.WHITE), + "Yellow": (wx.Colour(255, 255, 220), wx.Colour(255, 231, 161), wx.Colour(254, 218, 108), wx.BLACK) + } def GetStyleKeys(): diff --git a/wx/lib/agw/ultimatelistctrl.py b/wx/lib/agw/ultimatelistctrl.py index 509ca455..14e7327f 100644 --- a/wx/lib/agw/ultimatelistctrl.py +++ b/wx/lib/agw/ultimatelistctrl.py @@ -2085,7 +2085,7 @@ class UltimateListItem(wx.Object): self._format = ULC_FORMAT_CENTRE self._width = 0 - self._colour = wx.Colour(0, 0, 0) + self._colour = wx.BLACK self._font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT) self._kind = 0 @@ -2950,7 +2950,7 @@ class UltimateListItemData(object): # user data associated with the item self._data = 0 self._pyData = None - self._colour = wx.Colour(0, 0, 0) + self._colour = wx.BLACK self._hasColour = False self._hasFont = False self._hasBackColour = False diff --git a/wx/lib/colourchooser/pycolourchooser.py b/wx/lib/colourchooser/pycolourchooser.py index 24a1a8a4..61dbc02d 100644 --- a/wx/lib/colourchooser/pycolourchooser.py +++ b/wx/lib/colourchooser/pycolourchooser.py @@ -120,7 +120,7 @@ class PyColourChooser(wx.Panel): # Generate the custom colours. These colours are shared across # all instances of the colour chooser NO_CUSTOM_COLOURS = 16 - custom_colours = [ (wx.Colour(255, 255, 255), + custom_colours = [ (wx.WHITE, pycolourslider.PyColourSlider.HEIGHT / 2) ] * NO_CUSTOM_COLOURS last_custom = 0 diff --git a/wx/lib/colourchooser/pypalette.py b/wx/lib/colourchooser/pypalette.py index 06e6c703..ff1fb840 100644 --- a/wx/lib/colourchooser/pypalette.py +++ b/wx/lib/colourchooser/pypalette.py @@ -163,9 +163,8 @@ class PyPalette(canvas.Canvas): self.buffer.DrawBitmap(self.palette, 0, 0, 0) if self.point: - colour = wx.Colour(0, 0, 0) - self.buffer.SetPen(wx.Pen(colour, 1, wx.PENSTYLE_SOLID)) - self.buffer.SetBrush(wx.Brush(colour, wx.BRUSHSTYLE_TRANSPARENT)) + self.buffer.SetPen(wx.BLACK_PEN) + self.buffer.SetBrush(wx.TRANSPARENT_BRUSH) self.buffer.DrawCircle(self.point[0], self.point[1], 3) def HighlightPoint(self, x, y): diff --git a/wx/lib/mixins/listctrl.py b/wx/lib/mixins/listctrl.py index 4fe525d4..19a41642 100644 --- a/wx/lib/mixins/listctrl.py +++ b/wx/lib/mixins/listctrl.py @@ -443,7 +443,7 @@ class TextEditMixin: """ editorBgColour = wx.Colour(255,255,175) # Yellow - editorFgColour = wx.Colour(0,0,0) # black + editorFgColour = wx.BLACK def __init__(self): #editor = wx.TextCtrl(self, -1, pos=(-1,-1), size=(-1,-1), diff --git a/wx/lib/multisash.py b/wx/lib/multisash.py index 3629b98e..487c8aab 100644 --- a/wx/lib/multisash.py +++ b/wx/lib/multisash.py @@ -405,7 +405,7 @@ class MultiClient(wx.Window): def Select(self): self.GetParent().multiView.UnSelect() self.selected = True - self.SetBackgroundColour(wx.Colour(255,255,0)) # Yellow + self.SetBackgroundColour(wx.YELLOW) self.Refresh() def CalcSize(self,parent): @@ -712,7 +712,7 @@ def DrawSash(win,x,y,direction): if ((i + j) & 1): bdc.DrawPoint(i,j) - brush = wx.Brush(wx.Colour(0,0,0)) + brush = wx.BLACK_BRUSH brush.SetStipple(bmp) dc.SetBrush(brush) diff --git a/wx/lib/ogl/basic.py b/wx/lib/ogl/basic.py index 0f68a94a..9801c276 100644 --- a/wx/lib/ogl/basic.py +++ b/wx/lib/ogl/basic.py @@ -1279,7 +1279,7 @@ class Shape(ShapeEvtHandler): self.GetCanvas().PrepareDC(dc) dc.SetLogicalFunction(OGLRBLF) - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) @@ -1316,7 +1316,7 @@ class Shape(ShapeEvtHandler): yy = y + DragOffsetY xx, yy = self._canvas.Snap(xx, yy) - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) @@ -2512,7 +2512,7 @@ class Shape(ShapeEvtHandler): self.GetCanvas().PrepareDC(dc) dc.SetLogicalFunction(OGLRBLF) - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) @@ -2618,7 +2618,7 @@ class Shape(ShapeEvtHandler): pt._controlPointDragStartWidth = bound_x pt._controlPointDragStartHeight = bound_y - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) @@ -3298,7 +3298,7 @@ class PolygonShape(Shape): self.GetCanvas().PrepareDC(dc) dc.SetLogicalFunction(OGLRBLF) - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) @@ -3328,7 +3328,7 @@ class PolygonShape(Shape): if pt._originalDistance == 0: pt._originalDistance = 0.0001 - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) diff --git a/wx/lib/ogl/composit.py b/wx/lib/ogl/composit.py index 2b27146c..e47e084e 100644 --- a/wx/lib/ogl/composit.py +++ b/wx/lib/ogl/composit.py @@ -470,7 +470,7 @@ class CompositeShape(RectangleShape): self.GetCanvas().PrepareDC(dc) dc.SetLogicalFunction(OGLRBLF) - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) @@ -487,7 +487,7 @@ class CompositeShape(RectangleShape): self.GetCanvas().PrepareDC(dc) dc.SetLogicalFunction(OGLRBLF) - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) self._canvas.CaptureMouse() diff --git a/wx/lib/ogl/diagram.py b/wx/lib/ogl/diagram.py index b3004ba4..be3865ad 100644 --- a/wx/lib/ogl/diagram.py +++ b/wx/lib/ogl/diagram.py @@ -113,7 +113,7 @@ class Diagram(object): :param `y2`: the y2 position """ - dc.SetPen(wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)) + dc.SetPen(wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT)) dc.SetBrush(wx.TRANSPARENT_BRUSH) dc.DrawLines([[x1, y1], [x2, y1], [x2, y2], [x1, y2], [x1, y1]]) diff --git a/wx/lib/ogl/divided.py b/wx/lib/ogl/divided.py index 0f5a0d62..0184c619 100644 --- a/wx/lib/ogl/divided.py +++ b/wx/lib/ogl/divided.py @@ -53,7 +53,7 @@ class DividedShapeControlPoint(ControlPoint): self.GetCanvas().PrepareDC(dc) dc.SetLogicalFunction(OGLRBLF) - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) @@ -72,7 +72,7 @@ class DividedShapeControlPoint(ControlPoint): self.GetCanvas().PrepareDC(dc) dc.SetLogicalFunction(OGLRBLF) - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) diff --git a/wx/lib/ogl/lines.py b/wx/lib/ogl/lines.py index f955443a..c680d06f 100644 --- a/wx/lib/ogl/lines.py +++ b/wx/lib/ogl/lines.py @@ -231,7 +231,7 @@ class LabelShape(RectangleShape): RectangleShape.__init__(self, w, h) self._lineShape = parent self._shapeRegion = region - self.SetPen(wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT)) + self.SetPen(wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT)) def OnDraw(self, dc): """The draw handler.""" @@ -1052,7 +1052,7 @@ class LineShape(Shape): old_pen = self._pen old_brush = self._brush - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) self.SetPen(dottedPen) self.SetBrush(wx.TRANSPARENT_BRUSH) @@ -1343,7 +1343,7 @@ class LineShape(Shape): self.GetCanvas().PrepareDC(dc) dc.SetLogicalFunction(OGLRBLF) - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) dc.SetPen(dottedPen) dc.SetBrush(wx.TRANSPARENT_BRUSH) @@ -1396,7 +1396,7 @@ class LineShape(Shape): old_pen = self.GetPen() old_brush = self.GetBrush() - dottedPen = wx.Pen(wx.Colour(0, 0, 0), 1, wx.PENSTYLE_DOT) + dottedPen = wx.Pen(wx.BLACK, 1, wx.PENSTYLE_DOT) self.SetPen(dottedPen) self.SetBrush(wx.TRANSPARENT_BRUSH) diff --git a/wx/lib/pdfviewer/buttonpanel.py b/wx/lib/pdfviewer/buttonpanel.py index 0f829849..762a7bf5 100644 --- a/wx/lib/pdfviewer/buttonpanel.py +++ b/wx/lib/pdfviewer/buttonpanel.py @@ -122,7 +122,7 @@ class pdfButtonPanel(bp.ButtonPanel): bpArt.SetColor(bp.BP_GRADIENT_COLOUR_FROM, wx.Colour(119, 136, 153)) #light slate bpArt.SetColor(bp.BP_GRADIENT_COLOUR_TO, wx.Colour(245, 245, 245)) # white smoke bpArt.SetColor(bp.BP_BORDER_COLOUR, wx.Colour(119, 136, 153)) - bpArt.SetColor(bp.BP_BUTTONTEXT_COLOUR, wx.Colour(0,0,0)) # not used + bpArt.SetColor(bp.BP_BUTTONTEXT_COLOUR, wx.BLACK) # not used bpArt.SetColor(bp.BP_SEPARATOR_COLOUR, bp.BrightenColour(wx.Colour(60, 11, 112), 0.85)) bpArt.SetColor(bp.BP_SELECTION_BRUSH_COLOUR, wx.Colour(225, 225, 255)) # used? diff --git a/wx/lib/pdfviewer/viewer.py b/wx/lib/pdfviewer/viewer.py index 2b6ad5a9..d291478d 100644 --- a/wx/lib/pdfviewer/viewer.py +++ b/wx/lib/pdfviewer/viewer.py @@ -1003,8 +1003,8 @@ class pdfState(object): self.lineDashArray = [] self.lineDashPhase = 0 self.miterLimit = None - self.strokeRGB = wx.Colour(0, 0, 0) - self.fillRGB = wx.Colour(0, 0, 0) # used for both shapes & text + self.strokeRGB = wx.BLACK + self.fillRGB = wx.BLACK # used for both shapes & text self.fillMode = None self.textMatrix = [1, 0, 0, 1, 0, 0]