File: components.html

package info (click to toggle)
pythoncard 0.8.1-8.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 5,352 kB
  • ctags: 4,594
  • sloc: python: 42,401; makefile: 55; sh: 22
file content (146 lines) | stat: -rw-r--r-- 5,485 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" href="../PythonCard.css" type="text/css" />
    <title>Framework Overview - Components</title>
  </head>
  <body>
<div id="banner">
<h1>Framework Overview - Components</h1>
</div>
<?php include "../sidebar.php" ?>
<div id="content">
<p>Updated: April 10, 2004 for release 0.7.3</p>

<p>
I'll try and outline the current state of the framework in order to foster
discussion. I'm going to break up the description into several sections. I'm
not going to describe every method and attribute since I would just end up
repeating what is in the source code. These descriptions can also serve as
documentation.</p>

<p>The following component types are currently supported. The are defined in
the PythonCardPrototype components directory. The wxPython control they are
based on is in parenthesis ():</p>

<pre>
  <a href="components/BitmapCanvas.html">BitmapCanvas</a>
    Provides a buffered bitmap. There is no direct equivelant in wxPython.
  <a href="components/Button.html">Button</a>          (wxButton)
  <a href="components/Calendar.html">Calendar</a>        (wxCalendar)
  <a href="components/CheckBox.html">CheckBox</a>        (wxCheckBox)
  <a href="components/Choice.html">Choice</a>          (wxChoice)
  CodeEditor      (wxStyledTextCtrl)
  <a href="components/ComboBox.html">ComboBox</a>        (wxComboBox)
  <a href="components/Gauge.html">Gauge</a>           (wxGauge)
  Grid            (wxGrid)
  <a href="components/HtmlWindow.html">HtmlWindow</a>      (wxHtmlWindow)
  IEHtmlWindow    (wxIEHtmlWin - Windows-only)
  <a href="components/Image.html">Image</a>           (wxStaticBitmap)
  <a href="components/ImageButton.html">ImageButton</a>     (wxBitmapButton)
  <a href="components/List.html">List</a>            (wxListBox)
  MultiColumnList (wxListCtrl)
  <a href="components/PasswordField.html">PasswordField</a>   (wxTextCtrl)
  <a href="components/RadioGroup.html">RadioGroup</a>      (wxRadioBox)
  <a href="components/Slider.html">Slider</a>          (wxSlider)
  <a href="components/Spinner.html">Spinner</a>         (wxSpinner)
  <a href="components/StaticBox.html">StaticBox</a>       (wxStaticBox)
  <a href="components/StaticLine.html">StaticLine</a>      (wxStaticLine)
  <a href="components/StaticText.html">StaticText</a>      (wxStaticText)
  <a href="components/TextArea.html">TextArea</a>        (wxTextCtrl)
  <a href="components/TextField.html">TextField</a>       (wxTextCtrl)
  Tree            (wxTreeCtrl)
</pre>

<p>The following events are automatically bound and available for each component:</p>

<pre>
  gainFocus
  loseFocus
  mouseContextDoubleClick
  mouseContextDown
  mouseContextUp
  mouseDoubleClick
  mouseDown
  mouseDrag
  mouseEnter
  mouseLeave
  mouseMiddleDoubleClick
  mouseMiddleDown
  mouseMiddleUp
  mouseMove
  mouseUp
  timer
</pre>

<p>There are additional events such as <code>mouseClick</code>, <code>closeField</code>, <code>keyPress</code>, etc. 
that are specific to particular components, which you'll find defined in the
individual component modules. The following attributes are available for each component.</p>

<pre>
    backgroundColor
        color: tuple (r, g, b), "named color", or hex color string "#FF00FF"
        color is always returned as an rgb tuple
    command
        string
    enabled
        boolean
    font
        Font
    foregroundColor
        color: tuple (r, g, b), "named color", or hex color string "#FF00FF"
        color is always returned as an rgb tuple
    name    (mandatory, read-only)
        string
    position
        tuple (x, y)
           specifying -1 for either x or y will use the default x or y position
    size
        tuple (width, height)
           specifying -1 for either width or height will use the default
           width or height
    toolTip
        string
    visible
        boolean
</pre>

<p>Additional attributes such as <code>label</code> are defined for some components. The
attributes can be defined in the resource file as well as in user code.
PythonCard uses dot notation for components, rather than get/set methods. Here
is an example:</p>

<pre>
  self.components.field1.text = 'bob'
  txt = self.components.field1.text
</pre>

<p>Helper classes for components:</p>

<pre>
  Bitmap         (wxBitmap) - defined in graphic.py
    supported formats:
    BMP, GIF, JPG/JPEG, PCX, PNG, PNM, TIF/TIFF, XBM, and XPM
    also supports translation to/from Python Imaging Library (PIL) format
  Font           (wxFont)   - defined in font.py
</pre>

<p>In some case, the helper classes and components provide extra functionality
over their wxPython counterparts. Automatic binding of events and simplifed
initialization are the most obvious.</p>

<hr>
| <a href="general_concepts_and_limitations.html">General Concepts and Limitations</a> 
| <a href="components.html">Components</a> 
| <a href="dialogs.html">Dialogs</a> 
| <a href="events_and_handlers.html">Events and Handlers</a> 
| <a href="menus.html">Menus</a> 
| <a href="resource_files.html">Resource Files</a> 
| <a href="runtime_tools.html">Runtime Tools</a> 
<hr>
    <?php include "../footer.php" ?>
    <p>$Revision: 1.2 $ : $Author: kasplat $ : Last updated $Date: 2004/08/14 21:05:15 $</p>
</div> <!-- end of content -->
</body>
</html>