]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wx/lib/analogclock/__init__.py
   1 __author__  
= "E. A. Tacao <e.a.tacao |at| estadao.com.br>" 
   2 __date__    
= "15 Fev 2006, 22:00 GMT-03:00" 
   5 AnalogClock - an analog clock. 
   7 This control creates an analog clock window. Its features include shadowing, 
   8 the ability to render numbers as well as any arbitrary polygon as tick marks, 
   9 resize marks and hands proportionally as the widget itself is resized, rotate 
  10 marks in a way the get aligned to the watch. It also has a dialog, accessed  
  11 via a context menu item, allowing one to change on the fly all of its settings. 
  16        AnalogClock(parent, id=-1, pos=wx.DefaultPosition, 
  17                    size=wx.DefaultSize, style=wx.NO_BORDER, name="AnalogClock", 
  18                    clockStyle=DEFAULT_CLOCK_STYLE, 
  19                    minutesStyle=TICKS_CIRCLE, hoursStyle=TICKS_POLY) 
  21 - parent, id, pos, size, style and name are used as in a wx.Window. Please 
  22   refer to the wx.Window docs for more details. 
  24 - clockStyle defines the clock style, according to the options below: 
  26     ====================  ================================ 
  27     SHOW_QUARTERS_TICKS   Show marks for hours 3, 6, 9, 12 
  28     SHOW_HOURS_TICKS      Show marks for all hours 
  29     SHOW_MINUTES_TICKS    Show marks for minutes 
  31     SHOW_HOURS_HAND       Show hours hand 
  32     SHOW_MINUTES_HAND     Show minutes hand 
  33     SHOW_SECONDS_HAND     Show seconds hand 
  35     SHOW_SHADOWS          Show hands and marks shadows 
  37     ROTATE_TICKS          Align tick marks to watch 
  38     OVERLAP_TICKS         Draw tick marks for minutes even 
  39                           when they match the hours marks. 
  41     DEFAULT_CLOCK_STYLE   The same as SHOW_HOURS_TICKS| 
  46                           SHOW_SHADOWS|ROTATE_TICKS 
  47     ====================  ================================ 
  49 - minutesStyle and hoursStyle define the the tick styles, according to the 
  52     =================   ====================================== 
  53     TICKS_NONE          Don't show tick marks. 
  54     TICKS_SQUARE        Use squares as tick marks. 
  55     TICKS_CIRCLE        Use circles as tick marks. 
  56     TICKS_POLY          Use a polygon as tick marks. A 
  57                         polygon can be passed using 
  58                         SetTickPolygon, otherwise the default 
  60     TICKS_DECIMAL       Use decimal numbers as tick marks. 
  61     TICKS_ROMAN         Use Roman numbers as tick marks. 
  62     TICKS_BINARY        Use binary numbers as tick marks. 
  63     TICKS_HEX           Use hexadecimal numbers as tick marks. 
  64     =================   ====================================== 
  69 The 'target' keyword that's present in various of the AnalogClock methods may 
  70 accept one (or more, combined using '|') of the following values: 
  72     =========  =========================================== 
  73     HOUR       The values passed/retrieved are related to 
  76     MINUTE     The values passed/retrieved are related to 
  77                the minutes hand/ticks 
  79     SECOND     The values passed/retrieved are related to 
  80                the seconds hand/ticks 
  82     ALL        The same as HOUR|MINUTE|SECOND, i. e., the 
  83                values passed/retrieved are related to all 
  84                of the hours hands/ticks. This is the 
  85                default value in all methods. 
  86     =========  =========================================== 
  88 It is legal to pass target=ALL to methods that don't handle seconds (tick 
  89 mark related methods). In such cases, ALL will be equivalent to HOUR|MINUTE. 
  91 All of the 'Get' AnalogClock methods that allow the 'target' keyword 
  92 will always return a tuple, e. g.: 
  94     =================================  ======================================== 
  95     GetHandSize(target=HOUR)           Returns a 1 element tuple, containing 
  96                                        the size of the hours hand. 
  98     GetHandSize(target=HOUR|MINUTE)    Returns a 2 element tuple, containing 
  99                                        the sizes of the hours and the minutes 
 102     GetHandSize(target=ALL)            Returns a 3 element tuple, containing 
 103          or                            the sizes of the hours, minutes and 
 104     GetHandSize()                      seconds hands, respectively. 
 105     =================================  ======================================== 
 110 Most of the ideas and part of the code of AnalogClock were based on the 
 111 original wxPython's AnalogClock module, which was created by several folks on 
 112 the wxPython-users list. 
 114 AnalogClock is distributed under the wxWidgets license. 
 116 This code should meet the wxPython Coding Guidelines  
 117 <http://www.wxpython.org/codeguidelines.php> and the wxPython Style Guide 
 118 <http://wiki.wxpython.org/index.cgi/wxPython_20Style_20Guide>. 
 120 For all kind of problems, requests, enhancements, bug reports, etc, 
 121 please drop me an e-mail. 
 123 For updates please visit <http://j.domaindlx.com/elements28/wxpython/>. 
 129 #   - Module/namespace rearranges; 
 130 #   - All '-1' occurrences meaning "use any id" were eliminated or replaced  
 132 #   - Better names to the methods triggered by the context menu events. 
 133 #   - Included small demo class code in analogclock.py. 
 137 #---------------------------------------------------------------------- 
 139 from analogclock 
import AnalogClock
, AnalogClockWindow