reformat
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9805 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
6b48f1bdc5
commit
8ab7390901
@ -5,7 +5,7 @@
|
|||||||
#
|
#
|
||||||
# Author: Lorne White, Lorne.White@telusplanet.net
|
# Author: Lorne White, Lorne.White@telusplanet.net
|
||||||
#
|
#
|
||||||
# Created: Feb 25, 2001
|
# Created: Feb 25, 2001
|
||||||
# Licence: wxWindows license
|
# Licence: wxWindows license
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -21,11 +21,11 @@ class ColourSelect:
|
|||||||
self.win = parent
|
self.win = parent
|
||||||
if size is None:
|
if size is None:
|
||||||
size = wxSize(20, 20)
|
size = wxSize(20, 20)
|
||||||
|
|
||||||
mID = NewId()
|
mID = NewId()
|
||||||
self.b = b = wxButton(parent, mID, "", position, size)
|
self.b = b = wxButton(parent, mID, "", position, size)
|
||||||
EVT_BUTTON(parent, mID, self.OnClick)
|
EVT_BUTTON(parent, mID, self.OnClick)
|
||||||
|
|
||||||
self.set_colour_val = set_colour = wxColor(bcolour[0], bcolour[1], bcolour[2])
|
self.set_colour_val = set_colour = wxColor(bcolour[0], bcolour[1], bcolour[2])
|
||||||
b.SetBackgroundColour(set_colour)
|
b.SetBackgroundColour(set_colour)
|
||||||
b.SetForegroundColour(wxWHITE)
|
b.SetForegroundColour(wxWHITE)
|
||||||
@ -33,10 +33,10 @@ class ColourSelect:
|
|||||||
|
|
||||||
def SetColour(self, bcolour):
|
def SetColour(self, bcolour):
|
||||||
self.b.SetBackgroundColour(bcolour)
|
self.b.SetBackgroundColour(bcolour)
|
||||||
|
|
||||||
def GetColour(self):
|
def GetColour(self):
|
||||||
return self.set_colour
|
return self.set_colour
|
||||||
|
|
||||||
def OnClick(self, event):
|
def OnClick(self, event):
|
||||||
data = wxColourData()
|
data = wxColourData()
|
||||||
data.SetChooseFull(true)
|
data.SetChooseFull(true)
|
||||||
@ -44,7 +44,12 @@ class ColourSelect:
|
|||||||
dlg = wxColourDialog(self.win, data)
|
dlg = wxColourDialog(self.win, data)
|
||||||
if dlg.ShowModal() == wxID_OK:
|
if dlg.ShowModal() == wxID_OK:
|
||||||
data = dlg.GetColourData()
|
data = dlg.GetColourData()
|
||||||
self.set_colour = set = data.GetColour().Get()
|
self.set_colour = set = data.GetColour().Get()
|
||||||
self.set_colour_val = bcolour = wxColour(set[0],set[1],set[2])
|
self.set_colour_val = bcolour = wxColour(set[0],set[1],set[2])
|
||||||
self.b.SetBackgroundColour(bcolour)
|
self.b.SetBackgroundColour(bcolour)
|
||||||
dlg.Destroy()
|
dlg.Destroy()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user