arcadia 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,42 @@
|
|
|
1
|
+
|
|
2
|
+
namespace eval DemoDnd {
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
proc DemoDnd::create { nb } {
|
|
7
|
+
|
|
8
|
+
set frame [$nb insert end demoDnd -text "Drag and Drop"]
|
|
9
|
+
|
|
10
|
+
set titf1 [TitleFrame $frame.titf1 -text "Drag sources"]
|
|
11
|
+
set subf [$titf1 getframe]
|
|
12
|
+
|
|
13
|
+
set ent1 [LabelEntry $subf.e1 -label "Entry" -labelwidth 14 -dragenabled 1 -dragevent 3]
|
|
14
|
+
set labf1 [LabelFrame $subf.f1 -text "Label (text)" -width 14]
|
|
15
|
+
set f [$labf1 getframe]
|
|
16
|
+
set lab [Label $f.l -text "Drag this text" -dragenabled 1 -dragevent 3]
|
|
17
|
+
pack $lab
|
|
18
|
+
|
|
19
|
+
set labf2 [LabelFrame $subf.f2 -text "Label (bitmap)" -width 14]
|
|
20
|
+
set f [$labf2 getframe]
|
|
21
|
+
set lab [Label $f.l -bitmap info -dragenabled 1 -dragevent 3]
|
|
22
|
+
pack $lab
|
|
23
|
+
|
|
24
|
+
pack $ent1 $labf1 $labf2 -side top -fill x -pady 4
|
|
25
|
+
|
|
26
|
+
set titf2 [TitleFrame $frame.titf2 -text "Drop targets"]
|
|
27
|
+
set subf [$titf2 getframe]
|
|
28
|
+
|
|
29
|
+
set ent1 [LabelEntry $subf.e1 -label "Entry" -labelwidth 14 -dropenabled 1]
|
|
30
|
+
set labf1 [LabelFrame $subf.f1 -text "Label" -width 14]
|
|
31
|
+
set f [$labf1 getframe]
|
|
32
|
+
set lab [Label $f.l -dropenabled 1 -highlightthickness 1]
|
|
33
|
+
pack $lab -fill x
|
|
34
|
+
|
|
35
|
+
pack $ent1 $labf1 -side top -fill x -pady 4
|
|
36
|
+
|
|
37
|
+
pack $titf1 $titf2 -pady 4
|
|
38
|
+
|
|
39
|
+
return $frame
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
namespace eval DemoManager {
|
|
4
|
+
variable _progress 0
|
|
5
|
+
variable _afterid ""
|
|
6
|
+
variable _status "Compute in progress..."
|
|
7
|
+
variable _homogeneous 0
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
proc DemoManager::create { nb } {
|
|
12
|
+
set frame [$nb insert end demoManager -text "Manager"]
|
|
13
|
+
|
|
14
|
+
set topf [frame $frame.topf]
|
|
15
|
+
set titf1 [TitleFrame $topf.titf1 -text "MainFrame"]
|
|
16
|
+
set titf2 [TitleFrame $topf.titf2 -text "NoteBook"]
|
|
17
|
+
set titf3 [TitleFrame $frame.titf3 -text "Paned & ScrolledWindow"]
|
|
18
|
+
|
|
19
|
+
_mainframe [$titf1 getframe]
|
|
20
|
+
_notebook [$titf2 getframe]
|
|
21
|
+
_paned [$titf3 getframe]
|
|
22
|
+
|
|
23
|
+
pack $titf1 $titf2 -padx 4 -side left -fill both -expand yes
|
|
24
|
+
pack $topf -fill x -pady 2
|
|
25
|
+
pack $titf3 -pady 2 -padx 4 -fill both -expand yes
|
|
26
|
+
|
|
27
|
+
return $frame
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
proc DemoManager::_mainframe { parent } {
|
|
32
|
+
set labf1 [LabelFrame $parent.labf1 -text "Toolbar" -side top -anchor w \
|
|
33
|
+
-relief sunken -borderwidth 2]
|
|
34
|
+
set subf [$labf1 getframe]
|
|
35
|
+
checkbutton $subf.chk1 -text "View toolbar 1" -variable Demo::toolbar1 \
|
|
36
|
+
-command {$Demo::mainframe showtoolbar 0 $Demo::toolbar1}
|
|
37
|
+
checkbutton $subf.chk2 -text "View toolbar 2" -variable Demo::toolbar2 \
|
|
38
|
+
-command {$Demo::mainframe showtoolbar 1 $Demo::toolbar2}
|
|
39
|
+
pack $subf.chk1 $subf.chk2 -anchor w -fill x
|
|
40
|
+
pack $labf1 -fill both
|
|
41
|
+
|
|
42
|
+
set labf2 [LabelFrame $parent.labf2 -text "Status bar" -side top -anchor w \
|
|
43
|
+
-relief sunken -borderwidth 2]
|
|
44
|
+
set subf [$labf2 getframe]
|
|
45
|
+
checkbutton $subf.chk1 -text "Show Progress\nindicator" -justify left \
|
|
46
|
+
-variable DemoManager::_progress \
|
|
47
|
+
-command {DemoManager::_show_progress}
|
|
48
|
+
pack $subf.chk1 -anchor w -fill x
|
|
49
|
+
|
|
50
|
+
pack $labf1 $labf2 -side left -padx 4 -fill both
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
proc DemoManager::_notebook { parent } {
|
|
55
|
+
checkbutton $parent.chk1 -text "Homogeneous label" \
|
|
56
|
+
-variable DemoManager::_homogeneous \
|
|
57
|
+
-command {$Demo::notebook configure -homogeneous $DemoManager::_homogeneous}
|
|
58
|
+
pack $parent.chk1 -side left -anchor n -fill x
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
proc DemoManager::_paned { parent } {
|
|
64
|
+
set pw1 [PanedWindow $parent.pw -side top]
|
|
65
|
+
set pane [$pw1 add -minsize 100]
|
|
66
|
+
|
|
67
|
+
set pw2 [PanedWindow $pane.pw -side left]
|
|
68
|
+
set pane1 [$pw2 add -minsize 100]
|
|
69
|
+
set pane2 [$pw2 add -minsize 100]
|
|
70
|
+
set pane3 [$pw1 add -minsize 100]
|
|
71
|
+
|
|
72
|
+
foreach pane [list $pane1 $pane2] {
|
|
73
|
+
set sw [ScrolledWindow $pane.sw]
|
|
74
|
+
set lb [listbox $sw.lb -height 8 -width 20 -highlightthickness 0]
|
|
75
|
+
for {set i 1} {$i <= 8} {incr i} {
|
|
76
|
+
$lb insert end "Value $i"
|
|
77
|
+
}
|
|
78
|
+
$sw setwidget $lb
|
|
79
|
+
pack $sw -fill both -expand yes
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
set sw [ScrolledWindow $pane3.sw -relief sunken -borderwidth 2]
|
|
83
|
+
set sf [ScrollableFrame $sw.f]
|
|
84
|
+
$sw setwidget $sf
|
|
85
|
+
set subf [$sf getframe]
|
|
86
|
+
set lab [label $subf.lab -text "This is a ScrollableFrame"]
|
|
87
|
+
set chk [checkbutton $subf.chk -text "Constrained width" \
|
|
88
|
+
-variable DemoManager::_constw \
|
|
89
|
+
-command "$sf configure -constrainedwidth \$DemoManager::_constw"]
|
|
90
|
+
pack $lab
|
|
91
|
+
pack $chk -anchor w
|
|
92
|
+
bind $chk <FocusIn> "$sf see $chk"
|
|
93
|
+
for {set i 0} {$i <= 20} {incr i} {
|
|
94
|
+
pack [entry $subf.ent$i -width 50] -fill x -pady 4
|
|
95
|
+
bind $subf.ent$i <FocusIn> "$sf see $subf.ent$i"
|
|
96
|
+
$subf.ent$i insert end "Text field $i"
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
pack $sw $pw2 $pw1 -fill both -expand yes
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
proc DemoManager::_show_progress { } {
|
|
104
|
+
variable _progress
|
|
105
|
+
variable _afterid
|
|
106
|
+
variable _status
|
|
107
|
+
|
|
108
|
+
if { $_progress } {
|
|
109
|
+
set Demo::status "Compute in progress..."
|
|
110
|
+
set Demo::prgindic 0
|
|
111
|
+
$Demo::mainframe showstatusbar progression
|
|
112
|
+
if { $_afterid == "" } {
|
|
113
|
+
set _afterid [after 30 DemoManager::_update_progress]
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
set Demo::status ""
|
|
117
|
+
$Demo::mainframe showstatusbar status
|
|
118
|
+
set _afterid ""
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
proc DemoManager::_update_progress { } {
|
|
124
|
+
variable _progress
|
|
125
|
+
variable _afterid
|
|
126
|
+
|
|
127
|
+
if { $_progress } {
|
|
128
|
+
if { $Demo::prgindic < 100 } {
|
|
129
|
+
incr Demo::prgindic 5
|
|
130
|
+
set _afterid [after 30 DemoManager::_update_progress]
|
|
131
|
+
} else {
|
|
132
|
+
set _progress 0
|
|
133
|
+
$Demo::mainframe showstatusbar status
|
|
134
|
+
set Demo::status "Done"
|
|
135
|
+
set _afterid ""
|
|
136
|
+
after 500 {set Demo::status ""}
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
set _afterid ""
|
|
140
|
+
}
|
|
141
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
namespace eval DemoSelect {
|
|
2
|
+
variable var
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
proc DemoSelect::create { nb } {
|
|
7
|
+
set frame [$nb insert end demoSelect -text "Spin & Combo"]
|
|
8
|
+
|
|
9
|
+
set titf1 [TitleFrame $frame.titf1 -text SpinBox]
|
|
10
|
+
set subf [$titf1 getframe]
|
|
11
|
+
set spin [SpinBox $subf.spin \
|
|
12
|
+
-range {1 100 1} -textvariable DemoSelect::var(spin,var) \
|
|
13
|
+
-helptext "This is the SpinBox"]
|
|
14
|
+
set ent [LabelEntry $subf.ent -label "Linked var" -labelwidth 10 -labelanchor w \
|
|
15
|
+
-textvariable DemoSelect::var(spin,var) -editable 0 \
|
|
16
|
+
-helptext "This is an Entry reflecting\nthe linked var of SpinBox"]
|
|
17
|
+
set labf [LabelFrame $subf.options -text "Options" -side top -anchor w \
|
|
18
|
+
-relief sunken -borderwidth 1 \
|
|
19
|
+
-helptext "Modify some options of SpinBox"]
|
|
20
|
+
set subf [$labf getframe]
|
|
21
|
+
set chk1 [checkbutton $subf.chk1 -text "Non editable" \
|
|
22
|
+
-variable DemoSelect::var(spin,editable) -onvalue false -offvalue true \
|
|
23
|
+
-command "$spin configure -editable \$DemoSelect::var(spin,editable)"]
|
|
24
|
+
set chk2 [checkbutton $subf.chk2 -text "Disabled" \
|
|
25
|
+
-variable DemoSelect::var(spin,state) -onvalue disabled -offvalue normal \
|
|
26
|
+
-command "$spin configure -state \$DemoSelect::var(spin,state)"]
|
|
27
|
+
|
|
28
|
+
pack $chk1 $chk2 -side left -anchor w
|
|
29
|
+
pack $spin $ent $labf -pady 4 -fill x
|
|
30
|
+
pack $titf1
|
|
31
|
+
|
|
32
|
+
set titf2 [TitleFrame $frame.titf2 -text ComboBox]
|
|
33
|
+
set subf [$titf2 getframe]
|
|
34
|
+
set combo [ComboBox $subf.combo \
|
|
35
|
+
-textvariable DemoSelect::var(combo,var) \
|
|
36
|
+
-values {"first value" "second value" "third value" "fourth value" "fifth value"} \
|
|
37
|
+
-helptext "This is the ComboBox"]
|
|
38
|
+
set ent [LabelEntry $subf.ent -label "Linked var" -labelwidth 10 -labelanchor w \
|
|
39
|
+
-textvariable DemoSelect::var(combo,var) -editable 0 \
|
|
40
|
+
-helptext "This is an Entry reflecting\nthe linked var of ComboBox"]
|
|
41
|
+
set labf [LabelFrame $subf.options -text "Options" -side top -anchor w \
|
|
42
|
+
-relief sunken -borderwidth 1 \
|
|
43
|
+
-helptext "Modify some options of SpinBox"]
|
|
44
|
+
set subf [$labf getframe]
|
|
45
|
+
set chk1 [checkbutton $subf.chk1 -text "Non editable" \
|
|
46
|
+
-variable DemoSelect::var(combo,editable) -onvalue false -offvalue true \
|
|
47
|
+
-command "$combo configure -editable \$DemoSelect::var(combo,editable)"]
|
|
48
|
+
set chk2 [checkbutton $subf.chk2 -text "Disabled" \
|
|
49
|
+
-variable DemoSelect::var(combo,state) -onvalue disabled -offvalue normal \
|
|
50
|
+
-command "$combo configure -state \$DemoSelect::var(combo,state)"]
|
|
51
|
+
|
|
52
|
+
pack $chk1 $chk2 -side left -anchor w
|
|
53
|
+
pack $combo $ent $labf -pady 4 -fill x
|
|
54
|
+
|
|
55
|
+
pack $titf1 $titf2 -pady 4
|
|
56
|
+
|
|
57
|
+
return $frame
|
|
58
|
+
}
|
|
59
|
+
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
|
|
2
|
+
namespace eval DemoDlg {
|
|
3
|
+
variable tmpl
|
|
4
|
+
variable msg
|
|
5
|
+
variable progmsg
|
|
6
|
+
variable progval
|
|
7
|
+
variable resources "en"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
proc DemoDlg::create { nb } {
|
|
12
|
+
set frame [$nb insert end demoDlg -text "Dialog"]
|
|
13
|
+
|
|
14
|
+
set titf1 [TitleFrame $frame.titf1 -text "Resources"]
|
|
15
|
+
set titf2 [TitleFrame $frame.titf2 -text "Template Dialog"]
|
|
16
|
+
set titf3 [TitleFrame $frame.titf3 -text "Message Dialog"]
|
|
17
|
+
set titf4 [TitleFrame $frame.titf4 -text "Other dialog"]
|
|
18
|
+
|
|
19
|
+
set subf [$titf1 getframe]
|
|
20
|
+
set cmd {option read [file join $::BWIDGET::LIBRARY "lang" $DemoDlg::resources.rc]}
|
|
21
|
+
set rad1 [radiobutton $subf.rad1 -text "English" \
|
|
22
|
+
-variable DemoDlg::resources -value en \
|
|
23
|
+
-command $cmd]
|
|
24
|
+
set rad2 [radiobutton $subf.rad2 -text "French" \
|
|
25
|
+
-variable DemoDlg::resources -value fr \
|
|
26
|
+
-command $cmd]
|
|
27
|
+
set rad3 [radiobutton $subf.rad3 -text "German" \
|
|
28
|
+
-variable DemoDlg::resources -value de \
|
|
29
|
+
-command $cmd]
|
|
30
|
+
pack $rad1 $rad2 $rad3 -side left
|
|
31
|
+
|
|
32
|
+
_tmpldlg [$titf2 getframe]
|
|
33
|
+
_msgdlg [$titf3 getframe]
|
|
34
|
+
_stddlg [$titf4 getframe]
|
|
35
|
+
|
|
36
|
+
pack $titf1 -fill x -pady 2 -padx 2
|
|
37
|
+
pack $titf4 -side bottom -fill x -pady 2 -padx 2
|
|
38
|
+
pack $titf2 $titf3 -side left -padx 2 -fill both -expand yes
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
proc DemoDlg::_tmpldlg { parent } {
|
|
43
|
+
variable tmpl
|
|
44
|
+
|
|
45
|
+
set tmpl(side) bottom
|
|
46
|
+
set tmpl(anchor) c
|
|
47
|
+
|
|
48
|
+
set labf1 [LabelFrame $parent.labf1 -text "Button side" -side top \
|
|
49
|
+
-anchor w -relief sunken -borderwidth 1]
|
|
50
|
+
set subf [$labf1 getframe]
|
|
51
|
+
radiobutton $subf.rad1 -text "Bottom" \
|
|
52
|
+
-variable DemoDlg::tmpl(side) -value bottom -anchor w
|
|
53
|
+
radiobutton $subf.rad2 -text "Left" \
|
|
54
|
+
-variable DemoDlg::tmpl(side) -value left -anchor w
|
|
55
|
+
radiobutton $subf.rad3 -text "Right" \
|
|
56
|
+
-variable DemoDlg::tmpl(side) -value right -anchor w
|
|
57
|
+
radiobutton $subf.rad4 -text "Top" \
|
|
58
|
+
-variable DemoDlg::tmpl(side) -value top -anchor w
|
|
59
|
+
|
|
60
|
+
pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 -fill x -anchor w
|
|
61
|
+
|
|
62
|
+
set labf2 [LabelFrame $parent.labf2 -text "Button anchor" -side top \
|
|
63
|
+
-anchor w -relief sunken -borderwidth 1]
|
|
64
|
+
set subf [$labf2 getframe]
|
|
65
|
+
radiobutton $subf.rad1 -text "North" \
|
|
66
|
+
-variable DemoDlg::tmpl(anchor) -value n -anchor w
|
|
67
|
+
radiobutton $subf.rad2 -text "West" \
|
|
68
|
+
-variable DemoDlg::tmpl(anchor) -value w -anchor w
|
|
69
|
+
radiobutton $subf.rad3 -text "East" \
|
|
70
|
+
-variable DemoDlg::tmpl(anchor) -value e -anchor w
|
|
71
|
+
radiobutton $subf.rad4 -text "South" \
|
|
72
|
+
-variable DemoDlg::tmpl(anchor) -value s -anchor w
|
|
73
|
+
radiobutton $subf.rad5 -text "Center" \
|
|
74
|
+
-variable DemoDlg::tmpl(anchor) -value c -anchor w
|
|
75
|
+
|
|
76
|
+
pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 $subf.rad5 -fill x -anchor w
|
|
77
|
+
|
|
78
|
+
set sep [Separator $parent.sep -orient horizontal]
|
|
79
|
+
set button [button $parent.but -text "Show" -command DemoDlg::_show_tmpldlg]
|
|
80
|
+
|
|
81
|
+
pack $button -side bottom
|
|
82
|
+
pack $sep -side bottom -fill x -pady 10
|
|
83
|
+
pack $labf1 $labf2 -side left -padx 4 -anchor n
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
proc DemoDlg::_msgdlg { parent } {
|
|
88
|
+
variable msg
|
|
89
|
+
|
|
90
|
+
set msg(type) ok
|
|
91
|
+
set msg(icon) info
|
|
92
|
+
|
|
93
|
+
set labf1 [LabelFrame $parent.labf1 -text "Type" -side top \
|
|
94
|
+
-anchor w -relief sunken -borderwidth 1]
|
|
95
|
+
set subf [$labf1 getframe]
|
|
96
|
+
radiobutton $subf.rad1 -text "Ok" -variable DemoDlg::msg(type) -value ok -anchor w
|
|
97
|
+
radiobutton $subf.rad2 -text "Ok, Cancel" -variable DemoDlg::msg(type) -value okcancel -anchor w
|
|
98
|
+
radiobutton $subf.rad3 -text "Retry, Cancel" -variable DemoDlg::msg(type) -value retrycancel -anchor w
|
|
99
|
+
radiobutton $subf.rad4 -text "Yes, No" -variable DemoDlg::msg(type) -value yesno -anchor w
|
|
100
|
+
radiobutton $subf.rad5 -text "Yes, No, Cancel" -variable DemoDlg::msg(type) -value yesnocancel -anchor w
|
|
101
|
+
radiobutton $subf.rad6 -text "Abort, Retry, Ignore" -variable DemoDlg::msg(type) -value abortretryignore -anchor w
|
|
102
|
+
radiobutton $subf.rad7 -text "User" -variable DemoDlg::msg(type) -value user -anchor w
|
|
103
|
+
Entry $subf.user -textvariable DemoDlg::msg(buttons)
|
|
104
|
+
|
|
105
|
+
pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 $subf.rad5 $subf.rad6 -fill x -anchor w
|
|
106
|
+
pack $subf.rad7 $subf.user -side left
|
|
107
|
+
|
|
108
|
+
set labf2 [LabelFrame $parent.labf2 -text "Icon" -side top -anchor w -relief sunken -borderwidth 1]
|
|
109
|
+
set subf [$labf2 getframe]
|
|
110
|
+
radiobutton $subf.rad1 -text "Information" -variable DemoDlg::msg(icon) -value info -anchor w
|
|
111
|
+
radiobutton $subf.rad2 -text "Question" -variable DemoDlg::msg(icon) -value question -anchor w
|
|
112
|
+
radiobutton $subf.rad3 -text "Warning" -variable DemoDlg::msg(icon) -value warning -anchor w
|
|
113
|
+
radiobutton $subf.rad4 -text "Error" -variable DemoDlg::msg(icon) -value error -anchor w
|
|
114
|
+
pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 -fill x -anchor w
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
set sep [Separator $parent.sep -orient horizontal]
|
|
118
|
+
set button [button $parent.but -text "Show" -command DemoDlg::_show_msgdlg]
|
|
119
|
+
|
|
120
|
+
pack $button -side bottom
|
|
121
|
+
pack $sep -side bottom -fill x -pady 10
|
|
122
|
+
pack $labf1 $labf2 -side left -padx 4 -anchor n
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
proc DemoDlg::_stddlg { parent } {
|
|
127
|
+
set but0 [button $parent.but0 \
|
|
128
|
+
-text "Select a color " \
|
|
129
|
+
-command "DemoDlg::_show_color $parent.but0"]
|
|
130
|
+
set but1 [button $parent.but1 \
|
|
131
|
+
-text "Font selector dialog" \
|
|
132
|
+
-command DemoDlg::_show_fontdlg]
|
|
133
|
+
set but2 [button $parent.but2 \
|
|
134
|
+
-text "Progression dialog" \
|
|
135
|
+
-command DemoDlg::_show_progdlg]
|
|
136
|
+
set but3 [button $parent.but3 \
|
|
137
|
+
-text "Password dialog" \
|
|
138
|
+
-command DemoDlg::_show_passdlg]
|
|
139
|
+
|
|
140
|
+
pack $but0 $but1 $but2 $but3 -side left -padx 5 -anchor w
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
proc DemoDlg::_show_color {w} {
|
|
144
|
+
set color [SelectColor::menu $w.color [list below $w] \
|
|
145
|
+
-color [$w cget -background]]
|
|
146
|
+
if {[string length $color]} {
|
|
147
|
+
$w configure -background $color
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
proc DemoDlg::_show_tmpldlg { } {
|
|
152
|
+
variable tmpl
|
|
153
|
+
|
|
154
|
+
set dlg [Dialog .tmpldlg -parent . -modal local \
|
|
155
|
+
-separator 1 \
|
|
156
|
+
-title "Template dialog" \
|
|
157
|
+
-side $tmpl(side) \
|
|
158
|
+
-anchor $tmpl(anchor) \
|
|
159
|
+
-default 0 -cancel 1]
|
|
160
|
+
$dlg add -name ok
|
|
161
|
+
$dlg add -name cancel
|
|
162
|
+
set msg [message [$dlg getframe].msg -text "Template\nDialog" -justify center -anchor c]
|
|
163
|
+
pack $msg -fill both -expand yes -padx 100 -pady 100
|
|
164
|
+
$dlg draw
|
|
165
|
+
destroy $dlg
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
proc DemoDlg::_show_msgdlg { } {
|
|
170
|
+
variable msg
|
|
171
|
+
|
|
172
|
+
destroy .msgdlg
|
|
173
|
+
MessageDlg .msgdlg -parent . \
|
|
174
|
+
-message "Message for MessageBox" \
|
|
175
|
+
-type $msg(type) \
|
|
176
|
+
-icon $msg(icon) \
|
|
177
|
+
-buttons $msg(buttons)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
proc DemoDlg::_show_fontdlg { } {
|
|
182
|
+
set font [SelectFont .fontdlg -parent . -font $Demo::font]
|
|
183
|
+
if { $font != "" } {
|
|
184
|
+
Demo::update_font $font
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
proc DemoDlg::_show_progdlg { } {
|
|
190
|
+
set DemoDlg::progmsg "Compute in progress..."
|
|
191
|
+
set DemoDlg::progval 0
|
|
192
|
+
|
|
193
|
+
ProgressDlg .progress -parent . -title "Wait..." \
|
|
194
|
+
-type infinite \
|
|
195
|
+
-width 20 \
|
|
196
|
+
-textvariable DemoDlg::progmsg \
|
|
197
|
+
-variable DemoDlg::progval \
|
|
198
|
+
-stop "Stop" \
|
|
199
|
+
-command {destroy .progress}
|
|
200
|
+
_update_progdlg
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
proc DemoDlg::_update_progdlg { } {
|
|
205
|
+
if { [winfo exists .progress] } {
|
|
206
|
+
set DemoDlg::progval 2
|
|
207
|
+
after 20 DemoDlg::_update_progdlg
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
proc DemoDlg::_show_passdlg { } {
|
|
212
|
+
PasswdDlg .passwd -parent .
|
|
213
|
+
}
|
|
214
|
+
|