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, wxBeginBusyCursor, wxEndBusyCursor, wxYield |
10 |
|
11 |
def Color2wxColour(color): |
12 |
assert(color is not None) |
13 |
assert(isinstance(color, Color)) |
14 |
return wxColour(color.red * 255, |
15 |
color.green * 255, |
16 |
color.blue * 255) |
17 |
|
18 |
def wxColour2Color(colour): |
19 |
assert(colour is not None) |
20 |
# this doesn't work because colour is really a wxColourPtr! |
21 |
#assert(isinstance(colour, wxColour)) |
22 |
return Color(colour.Red() / 255.0, |
23 |
colour.Green() / 255.0, |
24 |
colour.Blue() / 255.0) |
25 |
|
26 |
def ThubanBeginBusyCursor(): |
27 |
wxBeginBusyCursor() |
28 |
wxYield() |
29 |
|
30 |
def ThubanEndBusyCursor(): |
31 |
wxEndBusyCursor() |