blob: 5ccd797c6430fa5764e58ea23daa888ae5180225 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
import wx
import waxyobject
from font import Font
class ColourDialog(wx.ColourDialog, waxyobject.WaxyObject):
def __init__(self, parent):
wx.ColourDialog.__init__(self, parent)
# Ensure the full colour dialog is displayed,
# not the abbreviated version.
self.GetColourData().SetChooseFull(True)
def ShowModal(self):
""" Simplified ShowModal(), returning strings 'ok' or 'cancel'. """
result = wx.ColourDialog.ShowModal(self)
if result == wx.ID_OK:
return 'ok'
else:
return 'cancel'
def GetChosenColour(self):
""" Shorthand... """
data = self.GetColourData()
color = data.GetColour().Get()
return color
class ColorDialog(ColourDialog):
def GetChosenColor(self):
""" Shorthand... """
data = self.GetColourData()
color = data.GetColour().Get()
return color
|