/[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 1275 - (show annotations)
Fri Jun 20 17:46:19 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: 939 byte(s)
(ThubanBeginBusyCursor, ThubanEndBusyCursor):
        New. Wrappers around the wxWindows functions that allow us to
        make additional calls such as wxYield which gives the native
        system a chance to update the cursor correctly.

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

Properties

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26