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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2700 - (hide annotations)
Mon Sep 18 14:27:02 2006 UTC (18 years, 5 months ago) by dpinte
Original Path: trunk/thuban/Thuban/UI/common.py
File MIME type: text/x-python
File size: 1643 byte(s)
2006-09-18 Didrik Pinte <dpinte@itae.be>
    
        * wxPython 2.6 update : wx 2.4 syntax has been updated to 2.6


1 bh 1541 # Copyright (c) 2001, 2003 by Intevation GmbH
2 jonathan 438 # 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 bh 1541 """Miscellaneous UI related functions"""
9    
10     __version__ = "$Revision$"
11     # $Source$
12     # $Id$
13    
14    
15 jonathan 438 from Thuban.Model.color import Color
16 dpinte 2700 import wx
17 jonathan 438
18     def Color2wxColour(color):
19 bh 1541 """Return a wxColor object for the Thuban color object color"""
20 dpinte 2700 return wx.Colour(int(round(color.red * 255)),
21 bh 1936 int(round(color.green * 255)),
22     int(round(color.blue * 255)))
23 jonathan 438
24     def wxColour2Color(colour):
25 bh 1541 """Return a Thuban color object for the wxColor object color"""
26 jonathan 438 assert(colour is not None)
27     # this doesn't work because colour is really a wxColourPtr!
28     #assert(isinstance(colour, wxColour))
29     return Color(colour.Red() / 255.0,
30     colour.Green() / 255.0,
31     colour.Blue() / 255.0)
32    
33 jonathan 1275 def ThubanBeginBusyCursor():
34 bh 1541 """Thuban wrapper for wxBeginBusyCursor
35    
36     In addition to calling wxBeginBusyCursor this function also calls
37     wxSafeYield to make sure that the cursor change takes effect. wxGTK
38     2.4 at least doesn't do that automatically.
39    
40     This function and the corresponding ThubanEndBusyCursor function are
41     the functions to use in Thuban to set a busy cursor.
42     """
43 dpinte 2700 wx.BeginBusyCursor()
44     wx.SafeYield()
45 jonathan 1275
46     def ThubanEndBusyCursor():
47 bh 1541 """Thuban wrapper for wxEndBusyCursor
48    
49     This function doesn't do anything more than calling wxEndBusyCursor
50     yet, but please use this whereever you use ThubanBeginBusyCursor.
51     """
52 dpinte 2700 wx.EndBusyCursor()

Properties

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26