/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/common.py
ViewVC logotype

Contents of /branches/WIP-pyshapelib-bramz/Thuban/UI/common.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1284 - (show annotations)
Mon Jun 23 10:30:38 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/UI/common.py
File MIME type: text/x-python
File size: 954 byte(s)
(ThubanBeginBusyCursor): Call wxSafeYield
        to make sure that we don't create reentrant possibilities with
        wxYield.

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()

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26