1 |
# Copyright (c) 2001 by Intevation GmbH |
2 |
# Authors: |
3 |
# Jonathan Coles <[email protected]> |
4 |
# |
5 |
# This program is free software under the GPL (>=v2) |
6 |
# Read the file COPYING coming with Thuban for details. |
7 |
|
8 |
from Thuban.Model.color import Color |
9 |
from wxPython.wx import wxColour, \ |
10 |
wxBeginBusyCursor, wxEndBusyCursor, wxSafeYield |
11 |
|
12 |
def Color2wxColour(color): |
13 |
assert(color is not None) |
14 |
assert(isinstance(color, Color)) |
15 |
return wxColour(color.red * 255, |
16 |
color.green * 255, |
17 |
color.blue * 255) |
18 |
|
19 |
def wxColour2Color(colour): |
20 |
assert(colour is not None) |
21 |
# this doesn't work because colour is really a wxColourPtr! |
22 |
#assert(isinstance(colour, wxColour)) |
23 |
return Color(colour.Red() / 255.0, |
24 |
colour.Green() / 255.0, |
25 |
colour.Blue() / 255.0) |
26 |
|
27 |
def ThubanBeginBusyCursor(): |
28 |
wxBeginBusyCursor() |
29 |
wxSafeYield() |
30 |
|
31 |
def ThubanEndBusyCursor(): |
32 |
wxEndBusyCursor() |