arcadia 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +126 -123
- data/arcadia.rb +770 -756
- data/base/a-contracts.rb +130 -93
- data/base/a-ext.rb +280 -280
- data/base/a-libs.rb +5 -11
- data/base/a-utils.rb +235 -44
- data/conf/arcadia.conf +20 -16
- data/conf/arcadia.init.rb +0 -0
- data/conf/arcadia.res.rb +74 -0
- data/ext/ae-complete-code/ae-complete-code.conf +0 -0
- data/ext/ae-complete-code/ae-complete-code.rb +80 -79
- data/ext/ae-debug/ae-debug.conf +0 -0
- data/ext/ae-debug/ae-debug.rb +2 -6
- data/ext/ae-debug/debug1.57.rb +0 -0
- data/ext/ae-doc-code/ae-doc-code.conf +15 -0
- data/ext/ae-doc-code/ae-doc-code.rb +289 -0
- data/ext/ae-editor/ae-editor.conf +17 -8
- data/ext/ae-editor/ae-editor.rb +738 -396
- data/ext/ae-event-log/ae-event-log.conf +0 -0
- data/ext/ae-event-log/ae-event-log.rb +0 -0
- data/ext/ae-file-history/ae-file-history.conf +2 -2
- data/ext/ae-file-history/ae-file-history.rb +286 -290
- data/ext/ae-inspector/ae-inspector.conf +0 -0
- data/ext/ae-inspector/ae-inspector.rb +0 -0
- data/ext/ae-output-event/ae-output-event.conf +2 -2
- data/ext/ae-output/ae-output.conf +2 -2
- data/ext/ae-output/ae-output.rb +173 -178
- data/ext/ae-palette/ae-palette.conf +0 -0
- data/ext/ae-palette/ae-palette.rb +0 -0
- data/ext/ae-shell/ae-shell.conf +0 -0
- data/ext/ae-shell/ae-shell.rb +54 -54
- data/lib/tk/al-tk.rb +3076 -3082
- data/lib/tk/al-tk.res.rb +0 -0
- data/lib/tk/al-tkarcadia.rb +0 -0
- data/lib/tk/al-tkcustom.rb +0 -0
- data/lib/tkext/al-bwidget.rb +0 -0
- data/lib/tkext/al-iwidgets.rb +0 -0
- data/lib/tkext/al-tile.rb +0 -0
- data/lib/tkext/al-tktable.rb +0 -0
- data/tcl/BWidget-1.8.0/BWman/ArrowButton.html +276 -0
- data/tcl/BWidget-1.8.0/BWman/BWidget.html +228 -0
- data/tcl/BWidget-1.8.0/BWman/Button.html +273 -0
- data/tcl/BWidget-1.8.0/BWman/ButtonBox.html +264 -0
- data/tcl/BWidget-1.8.0/BWman/ComboBox.html +402 -0
- data/tcl/BWidget-1.8.0/BWman/Dialog.html +314 -0
- data/tcl/BWidget-1.8.0/BWman/DragSite.html +139 -0
- data/tcl/BWidget-1.8.0/BWman/DropSite.html +254 -0
- data/tcl/BWidget-1.8.0/BWman/DynamicHelp.html +248 -0
- data/tcl/BWidget-1.8.0/BWman/Entry.html +341 -0
- data/tcl/BWidget-1.8.0/BWman/Label.html +331 -0
- data/tcl/BWidget-1.8.0/BWman/LabelEntry.html +194 -0
- data/tcl/BWidget-1.8.0/BWman/LabelFrame.html +144 -0
- data/tcl/BWidget-1.8.0/BWman/ListBox.html +678 -0
- data/tcl/BWidget-1.8.0/BWman/MainFrame.html +283 -0
- data/tcl/BWidget-1.8.0/BWman/MessageDlg.html +218 -0
- data/tcl/BWidget-1.8.0/BWman/NoteBook.html +374 -0
- data/tcl/BWidget-1.8.0/BWman/PagesManager.html +180 -0
- data/tcl/BWidget-1.8.0/BWman/PanedWindow.html +142 -0
- data/tcl/BWidget-1.8.0/BWman/PanelFrame.html +153 -0
- data/tcl/BWidget-1.8.0/BWman/PasswdDlg.html +214 -0
- data/tcl/BWidget-1.8.0/BWman/ProgressBar.html +152 -0
- data/tcl/BWidget-1.8.0/BWman/ProgressDlg.html +145 -0
- data/tcl/BWidget-1.8.0/BWman/ScrollView.html +130 -0
- data/tcl/BWidget-1.8.0/BWman/ScrollableFrame.html +191 -0
- data/tcl/BWidget-1.8.0/BWman/ScrolledWindow.html +116 -0
- data/tcl/BWidget-1.8.0/BWman/SelectColor.html +164 -0
- data/tcl/BWidget-1.8.0/BWman/SelectFont.html +152 -0
- data/tcl/BWidget-1.8.0/BWman/Separator.html +77 -0
- data/tcl/BWidget-1.8.0/BWman/SpinBox.html +250 -0
- data/tcl/BWidget-1.8.0/BWman/StatusBar.html +147 -0
- data/tcl/BWidget-1.8.0/BWman/TitleFrame.html +107 -0
- data/tcl/BWidget-1.8.0/BWman/Tree.html +947 -0
- data/tcl/BWidget-1.8.0/BWman/Widget.html +502 -0
- data/tcl/BWidget-1.8.0/BWman/contents.html +84 -0
- data/tcl/BWidget-1.8.0/BWman/index.html +7 -0
- data/tcl/BWidget-1.8.0/BWman/navtree.html +41 -0
- data/tcl/BWidget-1.8.0/BWman/options.htm +458 -0
- data/tcl/BWidget-1.8.0/CHANGES.txt +266 -0
- data/tcl/BWidget-1.8.0/ChangeLog +1641 -0
- data/tcl/BWidget-1.8.0/LICENSE.txt +41 -0
- data/tcl/BWidget-1.8.0/README.txt +127 -0
- data/tcl/BWidget-1.8.0/arrow.tcl +551 -0
- data/tcl/BWidget-1.8.0/bitmap.tcl +94 -0
- data/tcl/BWidget-1.8.0/button.tcl +324 -0
- data/tcl/BWidget-1.8.0/buttonbox.tcl +403 -0
- data/tcl/BWidget-1.8.0/color.tcl +493 -0
- data/tcl/BWidget-1.8.0/combobox.tcl +809 -0
- data/tcl/BWidget-1.8.0/demo/basic.tcl +199 -0
- data/tcl/BWidget-1.8.0/demo/bwidget.xbm +46 -0
- data/tcl/BWidget-1.8.0/demo/demo.tcl +212 -0
- data/tcl/BWidget-1.8.0/demo/dnd.tcl +42 -0
- data/tcl/BWidget-1.8.0/demo/manager.tcl +141 -0
- data/tcl/BWidget-1.8.0/demo/select.tcl +59 -0
- data/tcl/BWidget-1.8.0/demo/tmpldlg.tcl +214 -0
- data/tcl/BWidget-1.8.0/demo/tree.tcl +260 -0
- data/tcl/BWidget-1.8.0/demo/x1.xbm +2258 -0
- data/tcl/BWidget-1.8.0/dialog.tcl +345 -0
- data/tcl/BWidget-1.8.0/dragsite.tcl +197 -0
- data/tcl/BWidget-1.8.0/dropsite.tcl +455 -0
- data/tcl/BWidget-1.8.0/dynhelp.tcl +625 -0
- data/tcl/BWidget-1.8.0/entry.tcl +469 -0
- data/tcl/BWidget-1.8.0/font.tcl +566 -0
- data/tcl/BWidget-1.8.0/images/bold.gif +0 -0
- data/tcl/BWidget-1.8.0/images/copy.gif +0 -0
- data/tcl/BWidget-1.8.0/images/cut.gif +0 -0
- data/tcl/BWidget-1.8.0/images/dragfile.gif +0 -0
- data/tcl/BWidget-1.8.0/images/dragicon.gif +0 -0
- data/tcl/BWidget-1.8.0/images/error.gif +0 -0
- data/tcl/BWidget-1.8.0/images/file.gif +0 -0
- data/tcl/BWidget-1.8.0/images/folder.gif +0 -0
- data/tcl/BWidget-1.8.0/images/hourglass.gif +0 -0
- data/tcl/BWidget-1.8.0/images/info.gif +0 -0
- data/tcl/BWidget-1.8.0/images/italic.gif +0 -0
- data/tcl/BWidget-1.8.0/images/minus.xbm +5 -0
- data/tcl/BWidget-1.8.0/images/new.gif +0 -0
- data/tcl/BWidget-1.8.0/images/opcopy.xbm +5 -0
- data/tcl/BWidget-1.8.0/images/open.gif +0 -0
- data/tcl/BWidget-1.8.0/images/openfold.gif +0 -0
- data/tcl/BWidget-1.8.0/images/oplink.xbm +5 -0
- data/tcl/BWidget-1.8.0/images/opmove.xbm +5 -0
- data/tcl/BWidget-1.8.0/images/overstrike.gif +0 -0
- data/tcl/BWidget-1.8.0/images/palette.gif +0 -0
- data/tcl/BWidget-1.8.0/images/passwd.gif +0 -0
- data/tcl/BWidget-1.8.0/images/paste.gif +0 -0
- data/tcl/BWidget-1.8.0/images/plus.xbm +5 -0
- data/tcl/BWidget-1.8.0/images/print.gif +0 -0
- data/tcl/BWidget-1.8.0/images/question.gif +0 -0
- data/tcl/BWidget-1.8.0/images/redo.gif +0 -0
- data/tcl/BWidget-1.8.0/images/save.gif +0 -0
- data/tcl/BWidget-1.8.0/images/target.xbm +9 -0
- data/tcl/BWidget-1.8.0/images/underline.gif +0 -0
- data/tcl/BWidget-1.8.0/images/undo.gif +0 -0
- data/tcl/BWidget-1.8.0/images/warning.gif +0 -0
- data/tcl/BWidget-1.8.0/init.tcl +40 -0
- data/tcl/BWidget-1.8.0/label.tcl +271 -0
- data/tcl/BWidget-1.8.0/labelentry.tcl +100 -0
- data/tcl/BWidget-1.8.0/labelframe.tcl +160 -0
- data/tcl/BWidget-1.8.0/lang/da.rc +52 -0
- data/tcl/BWidget-1.8.0/lang/de.rc +52 -0
- data/tcl/BWidget-1.8.0/lang/en.rc +52 -0
- data/tcl/BWidget-1.8.0/lang/es.rc +53 -0
- data/tcl/BWidget-1.8.0/lang/fr.rc +52 -0
- data/tcl/BWidget-1.8.0/listbox.tcl +1638 -0
- data/tcl/BWidget-1.8.0/mainframe.tcl +711 -0
- data/tcl/BWidget-1.8.0/messagedlg.tcl +128 -0
- data/tcl/BWidget-1.8.0/notebook.tcl +1164 -0
- data/tcl/BWidget-1.8.0/pagesmgr.tcl +294 -0
- data/tcl/BWidget-1.8.0/panedw.tcl +381 -0
- data/tcl/BWidget-1.8.0/panelframe.tcl +246 -0
- data/tcl/BWidget-1.8.0/passwddlg.tcl +178 -0
- data/tcl/BWidget-1.8.0/pkgIndex.tcl +47 -0
- data/tcl/BWidget-1.8.0/progressbar.tcl +208 -0
- data/tcl/BWidget-1.8.0/progressdlg.tcl +87 -0
- data/tcl/BWidget-1.8.0/scrollframe.tcl +226 -0
- data/tcl/BWidget-1.8.0/scrollview.tcl +254 -0
- data/tcl/BWidget-1.8.0/scrollw.tcl +280 -0
- data/tcl/BWidget-1.8.0/separator.tcl +75 -0
- data/tcl/BWidget-1.8.0/spinbox.tcl +331 -0
- data/tcl/BWidget-1.8.0/statusbar.tcl +422 -0
- data/tcl/BWidget-1.8.0/tests/entry.test +173 -0
- data/tcl/BWidget-1.8.0/titleframe.tcl +170 -0
- data/tcl/BWidget-1.8.0/tree.tcl +2228 -0
- data/tcl/BWidget-1.8.0/utils.tcl +645 -0
- data/tcl/BWidget-1.8.0/widget.tcl +1576 -0
- data/tcl/BWidget-1.8.0/wizard.tcl +1028 -0
- data/tcl/BWidget-1.8.0/xpm2image.tcl +115 -0
- metadata +141 -5
@@ -0,0 +1,208 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# progressbar.tcl
|
3
|
+
# This file is part of Unifix BWidget Toolkit
|
4
|
+
# ----------------------------------------------------------------------------
|
5
|
+
# Index of commands:
|
6
|
+
# - ProgressBar::create
|
7
|
+
# - ProgressBar::configure
|
8
|
+
# - ProgressBar::cget
|
9
|
+
# - ProgressBar::_destroy
|
10
|
+
# - ProgressBar::_modify
|
11
|
+
# ----------------------------------------------------------------------------
|
12
|
+
|
13
|
+
namespace eval ProgressBar {
|
14
|
+
Widget::define ProgressBar progressbar
|
15
|
+
|
16
|
+
Widget::declare ProgressBar {
|
17
|
+
{-type Enum normal 0
|
18
|
+
{normal incremental infinite nonincremental_infinite}}
|
19
|
+
{-maximum Int 100 0 "%d > 0"}
|
20
|
+
{-background TkResource "" 0 frame}
|
21
|
+
{-foreground TkResource "blue" 0 label}
|
22
|
+
{-borderwidth TkResource 2 0 frame}
|
23
|
+
{-troughcolor TkResource "" 0 scrollbar}
|
24
|
+
{-relief TkResource sunken 0 label}
|
25
|
+
{-orient Enum horizontal 1 {horizontal vertical}}
|
26
|
+
{-variable String "" 0}
|
27
|
+
{-idle Boolean 0 0}
|
28
|
+
{-width TkResource 100 0 frame}
|
29
|
+
{-height TkResource 4m 0 frame}
|
30
|
+
{-bg Synonym -background}
|
31
|
+
{-fg Synonym -foreground}
|
32
|
+
{-bd Synonym -borderwidth}
|
33
|
+
}
|
34
|
+
|
35
|
+
Widget::addmap ProgressBar "" :cmd {-background {} -width {} -height {}}
|
36
|
+
Widget::addmap ProgressBar "" .bar {
|
37
|
+
-troughcolor -background -borderwidth {} -relief {}
|
38
|
+
}
|
39
|
+
|
40
|
+
variable _widget
|
41
|
+
}
|
42
|
+
|
43
|
+
|
44
|
+
# ----------------------------------------------------------------------------
|
45
|
+
# Command ProgressBar::create
|
46
|
+
# ----------------------------------------------------------------------------
|
47
|
+
proc ProgressBar::create { path args } {
|
48
|
+
variable _widget
|
49
|
+
|
50
|
+
array set maps [list ProgressBar {} :cmd {} .bar {}]
|
51
|
+
array set maps [Widget::parseArgs ProgressBar $args]
|
52
|
+
eval frame $path $maps(:cmd) -class ProgressBar -bd 0 \
|
53
|
+
-highlightthickness 0 -relief flat
|
54
|
+
Widget::initFromODB ProgressBar $path $maps(ProgressBar)
|
55
|
+
|
56
|
+
set c [eval [list canvas $path.bar] $maps(.bar) -highlightthickness 0]
|
57
|
+
set fg [Widget::cget $path -foreground]
|
58
|
+
if { [string equal [Widget::cget $path -orient] "horizontal"] } {
|
59
|
+
$path.bar create rectangle -1 0 0 0 -fill $fg -outline $fg -tags rect
|
60
|
+
} else {
|
61
|
+
$path.bar create rectangle 0 1 0 0 -fill $fg -outline $fg -tags rect
|
62
|
+
}
|
63
|
+
|
64
|
+
set _widget($path,val) 0
|
65
|
+
set _widget($path,dir) 1
|
66
|
+
set _widget($path,var) [Widget::cget $path -variable]
|
67
|
+
if {$_widget($path,var) != ""} {
|
68
|
+
GlobalVar::tracevar variable $_widget($path,var) w \
|
69
|
+
[list ProgressBar::_modify $path]
|
70
|
+
set _widget($path,afterid) \
|
71
|
+
[after idle [list ProgressBar::_modify $path]]
|
72
|
+
}
|
73
|
+
|
74
|
+
bind $path.bar <Destroy> [list ProgressBar::_destroy $path]
|
75
|
+
bind $path.bar <Configure> [list ProgressBar::_modify $path]
|
76
|
+
|
77
|
+
return [Widget::create ProgressBar $path]
|
78
|
+
}
|
79
|
+
|
80
|
+
|
81
|
+
# ----------------------------------------------------------------------------
|
82
|
+
# Command ProgressBar::configure
|
83
|
+
# ----------------------------------------------------------------------------
|
84
|
+
proc ProgressBar::configure { path args } {
|
85
|
+
variable _widget
|
86
|
+
|
87
|
+
set res [Widget::configure $path $args]
|
88
|
+
|
89
|
+
if { [Widget::hasChangedX $path -variable] } {
|
90
|
+
set newv [Widget::cget $path -variable]
|
91
|
+
if { $_widget($path,var) != "" } {
|
92
|
+
GlobalVar::tracevar vdelete $_widget($path,var) w \
|
93
|
+
[list ProgressBar::_modify $path]
|
94
|
+
}
|
95
|
+
if { $newv != "" } {
|
96
|
+
set _widget($path,var) $newv
|
97
|
+
GlobalVar::tracevar variable $newv w \
|
98
|
+
[list ProgressBar::_modify $path]
|
99
|
+
if {![info exists _widget($path,afterid)]} {
|
100
|
+
set _widget($path,afterid) \
|
101
|
+
[after idle [list ProgressBar::_modify $path]]
|
102
|
+
}
|
103
|
+
} else {
|
104
|
+
set _widget($path,var) ""
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
foreach {cbd cor cma} [Widget::hasChangedX $path -borderwidth \
|
109
|
+
-orient -maximum] break
|
110
|
+
|
111
|
+
if { $cbd || $cor || $cma } {
|
112
|
+
if {![info exists _widget($path,afterid)]} {
|
113
|
+
set _widget($path,afterid) \
|
114
|
+
[after idle [list ProgressBar::_modify $path]]
|
115
|
+
}
|
116
|
+
}
|
117
|
+
if { [Widget::hasChangedX $path -foreground] } {
|
118
|
+
set fg [Widget::cget $path -foreground]
|
119
|
+
$path.bar itemconfigure rect -fill $fg -outline $fg
|
120
|
+
}
|
121
|
+
return $res
|
122
|
+
}
|
123
|
+
|
124
|
+
|
125
|
+
# ----------------------------------------------------------------------------
|
126
|
+
# Command ProgressBar::cget
|
127
|
+
# ----------------------------------------------------------------------------
|
128
|
+
proc ProgressBar::cget { path option } {
|
129
|
+
return [Widget::cget $path $option]
|
130
|
+
}
|
131
|
+
|
132
|
+
|
133
|
+
# ----------------------------------------------------------------------------
|
134
|
+
# Command ProgressBar::_modify
|
135
|
+
# ----------------------------------------------------------------------------
|
136
|
+
proc ProgressBar::_modify { path args } {
|
137
|
+
variable _widget
|
138
|
+
|
139
|
+
catch {unset _widget($path,afterid)}
|
140
|
+
if { ![GlobalVar::exists $_widget($path,var)] ||
|
141
|
+
[set val [GlobalVar::getvar $_widget($path,var)]] < 0 } {
|
142
|
+
catch {place forget $path.bar}
|
143
|
+
} else {
|
144
|
+
place $path.bar -relx 0 -rely 0 -relwidth 1 -relheight 1
|
145
|
+
set type [Widget::getoption $path -type]
|
146
|
+
if { $val != 0 && $type != "normal" && \
|
147
|
+
$type != "nonincremental_infinite"} {
|
148
|
+
set val [expr {$val+$_widget($path,val)}]
|
149
|
+
}
|
150
|
+
set _widget($path,val) $val
|
151
|
+
set max [Widget::getoption $path -maximum]
|
152
|
+
set bd [expr {2*[$path.bar cget -bd]}]
|
153
|
+
set w [winfo width $path.bar]
|
154
|
+
set h [winfo height $path.bar]
|
155
|
+
if {$type == "infinite" || $type == "nonincremental_infinite"} {
|
156
|
+
# JDC: New infinite behaviour
|
157
|
+
set tval [expr {$val % $max}]
|
158
|
+
if { $tval < ($max / 2.0) } {
|
159
|
+
set x0 [expr {double($tval) / double($max) * 1.5}]
|
160
|
+
} else {
|
161
|
+
set x0 [expr {(1.0-(double($tval) / double($max))) * 1.5}]
|
162
|
+
}
|
163
|
+
set x1 [expr {$x0 + 0.25}]
|
164
|
+
# convert coords to ints to prevent triggering canvas refresh
|
165
|
+
# bug related to fractional coords
|
166
|
+
if {[Widget::getoption $path -orient] == "horizontal"} {
|
167
|
+
$path.bar coords rect [expr {int($x0*$w)}] 0 \
|
168
|
+
[expr {int($x1*$w)}] $h
|
169
|
+
} else {
|
170
|
+
$path.bar coords rect 0 [expr {int($h-$x0*$h)}] $w \
|
171
|
+
[expr {int($x1*$h)}]
|
172
|
+
}
|
173
|
+
} else {
|
174
|
+
if { $val > $max } {set val $max}
|
175
|
+
if {[Widget::getoption $path -orient] == "horizontal"} {
|
176
|
+
$path.bar coords rect -1 0 [expr {int(double($val)*$w/$max)}] $h
|
177
|
+
} else {
|
178
|
+
$path.bar coords rect 0 [expr {$h+1}] $w \
|
179
|
+
[expr {int($h*(1.0 - double($val)/$max))}]
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}
|
183
|
+
if {![Widget::cget $path -idle]} {
|
184
|
+
update idletasks
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
|
189
|
+
# ----------------------------------------------------------------------------
|
190
|
+
# Command ProgressBar::_destroy
|
191
|
+
# ----------------------------------------------------------------------------
|
192
|
+
proc ProgressBar::_destroy { path } {
|
193
|
+
variable _widget
|
194
|
+
|
195
|
+
if {[info exists _widget($path,afterid)]} {
|
196
|
+
after cancel $_widget($path,afterid)
|
197
|
+
unset _widget($path,afterid)
|
198
|
+
}
|
199
|
+
if {[info exists _widget($path,var)]} {
|
200
|
+
if {$_widget($path,var) != ""} {
|
201
|
+
GlobalVar::tracevar vdelete $_widget($path,var) w \
|
202
|
+
[list ProgressBar::_modify $path]
|
203
|
+
}
|
204
|
+
unset _widget($path,var)
|
205
|
+
}
|
206
|
+
unset _widget($path,dir)
|
207
|
+
Widget::destroy $path
|
208
|
+
}
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# progressdlg.tcl
|
3
|
+
# This file is part of Unifix BWidget Toolkit
|
4
|
+
# ----------------------------------------------------------------------------
|
5
|
+
# Index of commands:
|
6
|
+
# - ProgressDlg::create
|
7
|
+
# ----------------------------------------------------------------------------
|
8
|
+
|
9
|
+
namespace eval ProgressDlg {
|
10
|
+
Widget::define ProgressDlg progressdlg Dialog ProgressBar
|
11
|
+
|
12
|
+
Widget::bwinclude ProgressDlg Dialog :cmd \
|
13
|
+
remove {
|
14
|
+
-modal -image -bitmap -side -anchor -cancel -default
|
15
|
+
-homogeneous -padx -pady -spacing
|
16
|
+
}
|
17
|
+
|
18
|
+
Widget::bwinclude ProgressDlg ProgressBar .frame.pb \
|
19
|
+
remove {-orient -width -height}
|
20
|
+
|
21
|
+
Widget::declare ProgressDlg {
|
22
|
+
{-width TkResource 25 0 label}
|
23
|
+
{-height TkResource 2 0 label}
|
24
|
+
{-textvariable TkResource "" 0 label}
|
25
|
+
{-font TkResource "" 0 label}
|
26
|
+
{-stop String "" 0}
|
27
|
+
{-command String "" 0}
|
28
|
+
}
|
29
|
+
|
30
|
+
Widget::addmap ProgressDlg :cmd .frame.msg \
|
31
|
+
{-width {} -height {} -textvariable {} -font {} -background {}}
|
32
|
+
}
|
33
|
+
|
34
|
+
|
35
|
+
# ----------------------------------------------------------------------------
|
36
|
+
# Command ProgressDlg::create
|
37
|
+
# ----------------------------------------------------------------------------
|
38
|
+
proc ProgressDlg::create { path args } {
|
39
|
+
array set maps [list ProgressDlg {} :cmd {} .frame.msg {} .frame.pb {}]
|
40
|
+
array set maps [Widget::parseArgs ProgressDlg $args]
|
41
|
+
|
42
|
+
eval [list Dialog::create] $path $maps(:cmd) \
|
43
|
+
[list -image [Bitmap::get hourglass] \
|
44
|
+
-modal none -side bottom -anchor e -class ProgressDlg]
|
45
|
+
|
46
|
+
Widget::initFromODB ProgressDlg "$path#ProgressDlg" $maps(ProgressDlg)
|
47
|
+
|
48
|
+
wm protocol $path WM_DELETE_WINDOW {;}
|
49
|
+
|
50
|
+
set frame [Dialog::getframe $path]
|
51
|
+
bind $frame <Destroy> [list Widget::destroy $path\#ProgressDlg]
|
52
|
+
$frame configure -cursor watch
|
53
|
+
|
54
|
+
eval [list label $frame.msg] $maps(.frame.msg) \
|
55
|
+
-relief flat -borderwidth 0 \
|
56
|
+
-highlightthickness 0 -anchor w -justify left
|
57
|
+
pack $frame.msg -side top -pady 3m -anchor nw -fill x -expand yes
|
58
|
+
|
59
|
+
eval [list ProgressBar::create] $frame.pb $maps(.frame.pb) -width 100
|
60
|
+
pack $frame.pb -side bottom -anchor w -fill x -expand yes
|
61
|
+
|
62
|
+
set stop [Widget::cget "$path#ProgressDlg" -stop]
|
63
|
+
set cmd [Widget::cget "$path#ProgressDlg" -command]
|
64
|
+
if { $stop != "" && $cmd != "" } {
|
65
|
+
Dialog::add $path -text $stop -name $stop -command $cmd
|
66
|
+
}
|
67
|
+
Dialog::draw $path
|
68
|
+
BWidget::grab local $path
|
69
|
+
|
70
|
+
return [Widget::create ProgressDlg $path 0]
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
# ----------------------------------------------------------------------------
|
75
|
+
# Command ProgressDlg::configure
|
76
|
+
# ----------------------------------------------------------------------------
|
77
|
+
proc ProgressDlg::configure { path args } {
|
78
|
+
return [Widget::configure "$path#ProgressDlg" $args]
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
# ----------------------------------------------------------------------------
|
83
|
+
# Command ProgressDlg::cget
|
84
|
+
# ----------------------------------------------------------------------------
|
85
|
+
proc ProgressDlg::cget { path option } {
|
86
|
+
return [Widget::cget "$path#ProgressDlg" $option]
|
87
|
+
}
|
@@ -0,0 +1,226 @@
|
|
1
|
+
# ----------------------------------------------------------------------------
|
2
|
+
# scrollframe.tcl
|
3
|
+
# This file is part of Unifix BWidget Toolkit
|
4
|
+
# $Id: scrollframe.tcl,v 1.7 2005/07/28 00:40:42 hobbs Exp $
|
5
|
+
# ----------------------------------------------------------------------------
|
6
|
+
# Index of commands:
|
7
|
+
# - ScrollableFrame::create
|
8
|
+
# - ScrollableFrame::configure
|
9
|
+
# - ScrollableFrame::cget
|
10
|
+
# - ScrollableFrame::getframe
|
11
|
+
# - ScrollableFrame::see
|
12
|
+
# - ScrollableFrame::xview
|
13
|
+
# - ScrollableFrame::yview
|
14
|
+
# - ScrollableFrame::_resize
|
15
|
+
# ----------------------------------------------------------------------------
|
16
|
+
|
17
|
+
namespace eval ScrollableFrame {
|
18
|
+
Widget::define ScrollableFrame scrollframe
|
19
|
+
|
20
|
+
Widget::declare ScrollableFrame {
|
21
|
+
{-background TkResource "" 0 frame}
|
22
|
+
{-width Int 0 0 {}}
|
23
|
+
{-height Int 0 0 {}}
|
24
|
+
{-areawidth Int 0 0 {}}
|
25
|
+
{-areaheight Int 0 0 {}}
|
26
|
+
{-constrainedwidth Boolean 0 0}
|
27
|
+
{-constrainedheight Boolean 0 0}
|
28
|
+
{-xscrollcommand TkResource "" 0 canvas}
|
29
|
+
{-yscrollcommand TkResource "" 0 canvas}
|
30
|
+
{-xscrollincrement TkResource "" 0 canvas}
|
31
|
+
{-yscrollincrement TkResource "" 0 canvas}
|
32
|
+
{-bg Synonym -background}
|
33
|
+
}
|
34
|
+
|
35
|
+
Widget::addmap ScrollableFrame "" :cmd {
|
36
|
+
-background {} -width {} -height {}
|
37
|
+
-xscrollcommand {} -yscrollcommand {}
|
38
|
+
-xscrollincrement {} -yscrollincrement {}
|
39
|
+
}
|
40
|
+
Widget::addmap ScrollableFrame "" .frame {-background {}}
|
41
|
+
|
42
|
+
variable _widget
|
43
|
+
|
44
|
+
bind BwScrollableFrame <Configure> [list ScrollableFrame::_resize %W]
|
45
|
+
bind BwScrollableFrame <Destroy> [list Widget::destroy %W]
|
46
|
+
}
|
47
|
+
|
48
|
+
|
49
|
+
# ----------------------------------------------------------------------------
|
50
|
+
# Command ScrollableFrame::create
|
51
|
+
# ----------------------------------------------------------------------------
|
52
|
+
proc ScrollableFrame::create { path args } {
|
53
|
+
Widget::init ScrollableFrame $path $args
|
54
|
+
|
55
|
+
set canvas [eval [list canvas $path] [Widget::subcget $path :cmd] \
|
56
|
+
-highlightthickness 0 -borderwidth 0 -relief flat]
|
57
|
+
|
58
|
+
if {[Widget::theme]} {
|
59
|
+
set frame [eval [list ttk::frame $path.frame] \
|
60
|
+
[Widget::subcget $path .frame]]
|
61
|
+
} else {
|
62
|
+
set frame [eval [list frame $path.frame] \
|
63
|
+
[Widget::subcget $path .frame] \
|
64
|
+
-highlightthickness 0 -borderwidth 0 -relief flat]
|
65
|
+
}
|
66
|
+
|
67
|
+
$canvas create window 0 0 -anchor nw -window $frame -tags win \
|
68
|
+
-width [Widget::cget $path -areawidth] \
|
69
|
+
-height [Widget::cget $path -areaheight]
|
70
|
+
|
71
|
+
bind $frame <Configure> \
|
72
|
+
[list ScrollableFrame::_frameConfigure $canvas $frame %w %h]
|
73
|
+
bindtags $path [list $path BwScrollableFrame [winfo toplevel $path] all]
|
74
|
+
|
75
|
+
return [Widget::create ScrollableFrame $path]
|
76
|
+
}
|
77
|
+
|
78
|
+
|
79
|
+
# ----------------------------------------------------------------------------
|
80
|
+
# Command ScrollableFrame::configure
|
81
|
+
# ----------------------------------------------------------------------------
|
82
|
+
proc ScrollableFrame::configure { path args } {
|
83
|
+
set res [Widget::configure $path $args]
|
84
|
+
set upd 0
|
85
|
+
|
86
|
+
set modcw [Widget::hasChanged $path -constrainedwidth cw]
|
87
|
+
set modw [Widget::hasChanged $path -areawidth w]
|
88
|
+
if { $modcw || (!$cw && $modw) } {
|
89
|
+
if { $cw } {
|
90
|
+
set w [winfo width $path]
|
91
|
+
}
|
92
|
+
set upd 1
|
93
|
+
}
|
94
|
+
|
95
|
+
set modch [Widget::hasChanged $path -constrainedheight ch]
|
96
|
+
set modh [Widget::hasChanged $path -areaheight h]
|
97
|
+
if { $modch || (!$ch && $modh) } {
|
98
|
+
if { $ch } {
|
99
|
+
set h [winfo height $path]
|
100
|
+
}
|
101
|
+
set upd 1
|
102
|
+
}
|
103
|
+
|
104
|
+
if { $upd } {
|
105
|
+
$path:cmd itemconfigure win -width $w -height $h
|
106
|
+
}
|
107
|
+
return $res
|
108
|
+
}
|
109
|
+
|
110
|
+
|
111
|
+
# ----------------------------------------------------------------------------
|
112
|
+
# Command ScrollableFrame::cget
|
113
|
+
# ----------------------------------------------------------------------------
|
114
|
+
proc ScrollableFrame::cget { path option } {
|
115
|
+
return [Widget::cget $path $option]
|
116
|
+
}
|
117
|
+
|
118
|
+
|
119
|
+
# ----------------------------------------------------------------------------
|
120
|
+
# Command ScrollableFrame::getframe
|
121
|
+
# ----------------------------------------------------------------------------
|
122
|
+
proc ScrollableFrame::getframe { path } {
|
123
|
+
return $path.frame
|
124
|
+
}
|
125
|
+
|
126
|
+
# ----------------------------------------------------------------------------
|
127
|
+
# Command ScrollableFrame::see
|
128
|
+
# ----------------------------------------------------------------------------
|
129
|
+
proc ScrollableFrame::see { path widget {vert top} {horz left} {xOffset 0} {yOffset 0}} {
|
130
|
+
set x0 [winfo x $widget]
|
131
|
+
set y0 [winfo y $widget]
|
132
|
+
set x1 [expr {$x0+[winfo width $widget]}]
|
133
|
+
set y1 [expr {$y0+[winfo height $widget]}]
|
134
|
+
set xb0 [$path:cmd canvasx 0]
|
135
|
+
set yb0 [$path:cmd canvasy 0]
|
136
|
+
set xb1 [$path:cmd canvasx [winfo width $path]]
|
137
|
+
set yb1 [$path:cmd canvasy [winfo height $path]]
|
138
|
+
set dx 0
|
139
|
+
set dy 0
|
140
|
+
|
141
|
+
if { [string equal $horz "left"] } {
|
142
|
+
if { $x1 > $xb1 } {
|
143
|
+
set dx [expr {$x1-$xb1}]
|
144
|
+
}
|
145
|
+
if { $x0 < $xb0+$dx } {
|
146
|
+
set dx [expr {$x0-$xb0}]
|
147
|
+
}
|
148
|
+
} elseif { [string equal $horz "right"] } {
|
149
|
+
if { $x0 < $xb0 } {
|
150
|
+
set dx [expr {$x0-$xb0}]
|
151
|
+
}
|
152
|
+
if { $x1 > $xb1+$dx } {
|
153
|
+
set dx [expr {$x1-$xb1}]
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
if { [string equal $vert "top"] } {
|
158
|
+
if { $y1 > $yb1 } {
|
159
|
+
set dy [expr {$y1-$yb1}]
|
160
|
+
}
|
161
|
+
if { $y0 < $yb0+$dy } {
|
162
|
+
set dy [expr {$y0-$yb0}]
|
163
|
+
}
|
164
|
+
} elseif { [string equal $vert "bottom"] } {
|
165
|
+
if { $y0 < $yb0 } {
|
166
|
+
set dy [expr {$y0-$yb0}]
|
167
|
+
}
|
168
|
+
if { $y1 > $yb1+$dy } {
|
169
|
+
set dy [expr {$y1-$yb1}]
|
170
|
+
}
|
171
|
+
}
|
172
|
+
|
173
|
+
if {($dx + $xOffset) != 0} {
|
174
|
+
set x [expr {($xb0+$dx+$xOffset)/[winfo width $path.frame]}]
|
175
|
+
$path:cmd xview moveto $x
|
176
|
+
}
|
177
|
+
if {($dy + $yOffset) != 0} {
|
178
|
+
set y [expr {($yb0+$dy+$yOffset)/[winfo height $path.frame]}]
|
179
|
+
$path:cmd yview moveto $y
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
|
184
|
+
# ----------------------------------------------------------------------------
|
185
|
+
# Command ScrollableFrame::xview
|
186
|
+
# ----------------------------------------------------------------------------
|
187
|
+
proc ScrollableFrame::xview { path args } {
|
188
|
+
return [eval [list $path:cmd xview] $args]
|
189
|
+
}
|
190
|
+
|
191
|
+
|
192
|
+
# ----------------------------------------------------------------------------
|
193
|
+
# Command ScrollableFrame::yview
|
194
|
+
# ----------------------------------------------------------------------------
|
195
|
+
proc ScrollableFrame::yview { path args } {
|
196
|
+
return [eval [list $path:cmd yview] $args]
|
197
|
+
}
|
198
|
+
|
199
|
+
|
200
|
+
# ----------------------------------------------------------------------------
|
201
|
+
# Command ScrollableFrame::_resize
|
202
|
+
# ----------------------------------------------------------------------------
|
203
|
+
proc ScrollableFrame::_resize { path } {
|
204
|
+
if { [Widget::getoption $path -constrainedwidth] } {
|
205
|
+
$path:cmd itemconfigure win -width [winfo width $path]
|
206
|
+
}
|
207
|
+
if { [Widget::getoption $path -constrainedheight] } {
|
208
|
+
$path:cmd itemconfigure win -height [winfo height $path]
|
209
|
+
}
|
210
|
+
}
|
211
|
+
|
212
|
+
|
213
|
+
# ----------------------------------------------------------------------------
|
214
|
+
# Command ScrollableFrame::_frameConfigure
|
215
|
+
# ----------------------------------------------------------------------------
|
216
|
+
proc ScrollableFrame::_frameConfigure {canvas frame width height} {
|
217
|
+
# This ensures that we don't get funny scrollability in the frame
|
218
|
+
# when it is smaller than the canvas space
|
219
|
+
if {[winfo height $frame] < [winfo height $canvas]} {
|
220
|
+
set height [winfo height $canvas]
|
221
|
+
}
|
222
|
+
if {[winfo width $frame] < [winfo width $canvas]} {
|
223
|
+
set width [winfo width $canvas]
|
224
|
+
}
|
225
|
+
$canvas:cmd configure -scrollregion [list 0 0 $width $height]
|
226
|
+
}
|