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
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#define target_width 24
|
|
2
|
+
#define target_height 24
|
|
3
|
+
static unsigned char target_bits[] = {
|
|
4
|
+
0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00,
|
|
5
|
+
0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
6
|
+
0x3e, 0xe0, 0x03, 0x3e, 0xe0, 0x03, 0x3e, 0xe0, 0x03, 0x00, 0x00, 0x00,
|
|
7
|
+
0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00,
|
|
8
|
+
0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
9
|
+
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
namespace eval Widget {}
|
|
2
|
+
proc Widget::_opt_defaults {{prio widgetDefault}} {
|
|
3
|
+
if {$::tcl_version >= 8.4} {
|
|
4
|
+
set plat [tk windowingsystem]
|
|
5
|
+
} else {
|
|
6
|
+
set plat $::tcl_platform(platform)
|
|
7
|
+
}
|
|
8
|
+
switch -exact $plat {
|
|
9
|
+
"aqua" {
|
|
10
|
+
}
|
|
11
|
+
"win32" -
|
|
12
|
+
"windows" {
|
|
13
|
+
#option add *Listbox.background SystemWindow $prio
|
|
14
|
+
option add *ListBox.background SystemWindow $prio
|
|
15
|
+
#option add *Button.padY 0 $prio
|
|
16
|
+
option add *ButtonBox.padY 0 $prio
|
|
17
|
+
option add *Dialog.padY 0 $prio
|
|
18
|
+
option add *Dialog.anchor e $prio
|
|
19
|
+
}
|
|
20
|
+
"x11" -
|
|
21
|
+
default {
|
|
22
|
+
option add *Scrollbar.width 12 $prio
|
|
23
|
+
option add *Scrollbar.borderWidth 1 $prio
|
|
24
|
+
option add *Dialog.separator 1 $prio
|
|
25
|
+
option add *MainFrame.relief raised $prio
|
|
26
|
+
option add *MainFrame.separator none $prio
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
Widget::_opt_defaults
|
|
31
|
+
|
|
32
|
+
option read [file join $::BWIDGET::LIBRARY "lang" "en.rc"]
|
|
33
|
+
|
|
34
|
+
## Add a TraverseIn binding to standard Tk widgets to handle some of
|
|
35
|
+
## the BWidget-specific things we do.
|
|
36
|
+
bind Entry <<TraverseIn>> { %W selection range 0 end; %W icursor end }
|
|
37
|
+
bind Spinbox <<TraverseIn>> { %W selection range 0 end; %W icursor end }
|
|
38
|
+
|
|
39
|
+
bind all <Key-Tab> { Widget::traverseTo [Widget::focusNext %W] }
|
|
40
|
+
bind all <<PrevWindow>> { Widget::traverseTo [Widget::focusPrev %W] }
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# ------------------------------------------------------------------------------
|
|
2
|
+
# label.tcl
|
|
3
|
+
# This file is part of Unifix BWidget Toolkit
|
|
4
|
+
# $Id: label.tcl,v 1.10 2003/10/20 21:23:52 damonc Exp $
|
|
5
|
+
# ------------------------------------------------------------------------------
|
|
6
|
+
# Index of commands:
|
|
7
|
+
# - Label::create
|
|
8
|
+
# - Label::configure
|
|
9
|
+
# - Label::cget
|
|
10
|
+
# - Label::setfocus
|
|
11
|
+
# - Label::_drag_cmd
|
|
12
|
+
# - Label::_drop_cmd
|
|
13
|
+
# - Label::_over_cmd
|
|
14
|
+
# ------------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+
namespace eval Label {
|
|
17
|
+
Widget::define Label label DragSite DropSite DynamicHelp
|
|
18
|
+
|
|
19
|
+
Widget::tkinclude Label label .l \
|
|
20
|
+
remove { -foreground -text -textvariable -underline }
|
|
21
|
+
|
|
22
|
+
Widget::declare Label {
|
|
23
|
+
{-name String "" 0}
|
|
24
|
+
{-text String "" 0}
|
|
25
|
+
{-textvariable String "" 0}
|
|
26
|
+
{-underline Int -1 0 "%d >= -1"}
|
|
27
|
+
{-focus String "" 0}
|
|
28
|
+
{-foreground TkResource "" 0 label}
|
|
29
|
+
{-disabledforeground TkResource "" 0 button}
|
|
30
|
+
{-state Enum normal 0 {normal disabled}}
|
|
31
|
+
|
|
32
|
+
{-fg Synonym -foreground}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
DynamicHelp::include Label balloon
|
|
36
|
+
DragSite::include Label "" 1
|
|
37
|
+
DropSite::include Label {
|
|
38
|
+
TEXT {move {}}
|
|
39
|
+
IMAGE {move {}}
|
|
40
|
+
BITMAP {move {}}
|
|
41
|
+
FGCOLOR {move {}}
|
|
42
|
+
BGCOLOR {move {}}
|
|
43
|
+
COLOR {move {}}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
Widget::syncoptions Label "" .l {-text {} -underline {}}
|
|
47
|
+
|
|
48
|
+
bind BwLabel <FocusIn> [list Label::setfocus %W]
|
|
49
|
+
bind BwLabel <Destroy> [list Label::_destroy %W]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# ------------------------------------------------------------------------------
|
|
54
|
+
# Command Label::create
|
|
55
|
+
# ------------------------------------------------------------------------------
|
|
56
|
+
proc Label::create { path args } {
|
|
57
|
+
array set maps [list Label {} .l {}]
|
|
58
|
+
array set maps [Widget::parseArgs Label $args]
|
|
59
|
+
frame $path -class Label -borderwidth 0 -highlightthickness 0 -relief flat
|
|
60
|
+
Widget::initFromODB Label $path $maps(Label)
|
|
61
|
+
|
|
62
|
+
eval [list label $path.l] $maps(.l)
|
|
63
|
+
|
|
64
|
+
if { [Widget::cget $path -state] == "normal" } {
|
|
65
|
+
set fg [Widget::cget $path -foreground]
|
|
66
|
+
} else {
|
|
67
|
+
set fg [Widget::cget $path -disabledforeground]
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
set var [Widget::cget $path -textvariable]
|
|
71
|
+
if { $var == "" &&
|
|
72
|
+
[Widget::cget $path -image] == "" &&
|
|
73
|
+
[Widget::cget $path -bitmap] == ""} {
|
|
74
|
+
set desc [BWidget::getname [Widget::cget $path -name]]
|
|
75
|
+
if { $desc != "" } {
|
|
76
|
+
set text [lindex $desc 0]
|
|
77
|
+
set under [lindex $desc 1]
|
|
78
|
+
} else {
|
|
79
|
+
set text [Widget::cget $path -text]
|
|
80
|
+
set under [Widget::cget $path -underline]
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
set under -1
|
|
84
|
+
set text ""
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
$path.l configure -text $text -textvariable $var \
|
|
88
|
+
-underline $under -foreground $fg
|
|
89
|
+
|
|
90
|
+
set accel [string tolower [string index $text $under]]
|
|
91
|
+
if { $accel != "" } {
|
|
92
|
+
bind [winfo toplevel $path] <Alt-$accel> "Label::setfocus $path"
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
bindtags $path [list BwLabel [winfo toplevel $path] all]
|
|
96
|
+
bindtags $path.l [list $path.l $path Label [winfo toplevel $path] all]
|
|
97
|
+
pack $path.l -expand yes -fill both
|
|
98
|
+
|
|
99
|
+
set dragendcmd [Widget::cget $path -dragendcmd]
|
|
100
|
+
DragSite::setdrag $path $path.l Label::_init_drag_cmd $dragendcmd 1
|
|
101
|
+
DropSite::setdrop $path $path.l Label::_over_cmd Label::_drop_cmd 1
|
|
102
|
+
DynamicHelp::sethelp $path $path.l 1
|
|
103
|
+
|
|
104
|
+
return [Widget::create Label $path]
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# ------------------------------------------------------------------------------
|
|
109
|
+
# Command Label::configure
|
|
110
|
+
# ------------------------------------------------------------------------------
|
|
111
|
+
proc Label::configure { path args } {
|
|
112
|
+
set oldunder [$path.l cget -underline]
|
|
113
|
+
if { $oldunder != -1 } {
|
|
114
|
+
set oldaccel [string tolower [string index [$path.l cget -text] $oldunder]]
|
|
115
|
+
} else {
|
|
116
|
+
set oldaccel ""
|
|
117
|
+
}
|
|
118
|
+
set res [Widget::configure $path $args]
|
|
119
|
+
|
|
120
|
+
set cfg [Widget::hasChanged $path -foreground fg]
|
|
121
|
+
set cdfg [Widget::hasChanged $path -disabledforeground dfg]
|
|
122
|
+
set cst [Widget::hasChanged $path -state state]
|
|
123
|
+
|
|
124
|
+
if { $cst || $cfg || $cdfg } {
|
|
125
|
+
if { $state == "normal" } {
|
|
126
|
+
$path.l configure -fg $fg
|
|
127
|
+
} else {
|
|
128
|
+
$path.l configure -fg $dfg
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
set cv [Widget::hasChanged $path -textvariable var]
|
|
133
|
+
set cb [Widget::hasChanged $path -image img]
|
|
134
|
+
set ci [Widget::hasChanged $path -bitmap bmp]
|
|
135
|
+
set cn [Widget::hasChanged $path -name name]
|
|
136
|
+
set ct [Widget::hasChanged $path -text text]
|
|
137
|
+
set cu [Widget::hasChanged $path -underline under]
|
|
138
|
+
|
|
139
|
+
if { $cv || $cb || $ci || $cn || $ct || $cu } {
|
|
140
|
+
if { $var == "" && $img == "" && $bmp == "" } {
|
|
141
|
+
set desc [BWidget::getname $name]
|
|
142
|
+
if { $desc != "" } {
|
|
143
|
+
set text [lindex $desc 0]
|
|
144
|
+
set under [lindex $desc 1]
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
set under -1
|
|
148
|
+
set text ""
|
|
149
|
+
}
|
|
150
|
+
set top [winfo toplevel $path]
|
|
151
|
+
if { $oldaccel != "" } {
|
|
152
|
+
bind $top <Alt-$oldaccel> {}
|
|
153
|
+
}
|
|
154
|
+
set accel [string tolower [string index $text $under]]
|
|
155
|
+
if { $accel != "" } {
|
|
156
|
+
bind $top <Alt-$accel> [list Label::setfocus $path]
|
|
157
|
+
}
|
|
158
|
+
$path.l configure -text $text -underline $under -textvariable $var
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
set force [Widget::hasChanged $path -dragendcmd dragend]
|
|
162
|
+
DragSite::setdrag $path $path.l Label::_init_drag_cmd $dragend $force
|
|
163
|
+
DropSite::setdrop $path $path.l Label::_over_cmd Label::_drop_cmd
|
|
164
|
+
DynamicHelp::sethelp $path $path.l
|
|
165
|
+
|
|
166
|
+
return $res
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
# ------------------------------------------------------------------------------
|
|
171
|
+
# Command Label::cget
|
|
172
|
+
# ------------------------------------------------------------------------------
|
|
173
|
+
proc Label::cget { path option } {
|
|
174
|
+
return [Widget::cget $path $option]
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
# ------------------------------------------------------------------------------
|
|
179
|
+
# Command Label::setfocus
|
|
180
|
+
# ------------------------------------------------------------------------------
|
|
181
|
+
proc Label::setfocus { path } {
|
|
182
|
+
if { [string equal [Widget::cget $path -state] "normal"] } {
|
|
183
|
+
set w [Widget::cget $path -focus]
|
|
184
|
+
if { [winfo exists $w] && [Widget::focusOK $w] } {
|
|
185
|
+
focus $w
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
# ------------------------------------------------------------------------------
|
|
192
|
+
# Command Label::_init_drag_cmd
|
|
193
|
+
# ------------------------------------------------------------------------------
|
|
194
|
+
proc Label::_init_drag_cmd { path X Y top } {
|
|
195
|
+
set path [winfo parent $path]
|
|
196
|
+
if { [set cmd [Widget::cget $path -draginitcmd]] != "" } {
|
|
197
|
+
return [uplevel \#0 $cmd [list $path $X $Y $top]]
|
|
198
|
+
}
|
|
199
|
+
if { [set data [$path.l cget -image]] != "" } {
|
|
200
|
+
set type "IMAGE"
|
|
201
|
+
pack [label $top.l -image $data]
|
|
202
|
+
} elseif { [set data [$path.l cget -bitmap]] != "" } {
|
|
203
|
+
set type "BITMAP"
|
|
204
|
+
pack [label $top.l -bitmap $data]
|
|
205
|
+
} else {
|
|
206
|
+
set data [$path.l cget -text]
|
|
207
|
+
set type "TEXT"
|
|
208
|
+
}
|
|
209
|
+
set usertype [Widget::getoption $path -dragtype]
|
|
210
|
+
if { $usertype != "" } {
|
|
211
|
+
set type $usertype
|
|
212
|
+
}
|
|
213
|
+
return [list $type {copy} $data]
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
# ------------------------------------------------------------------------------
|
|
218
|
+
# Command Label::_drop_cmd
|
|
219
|
+
# ------------------------------------------------------------------------------
|
|
220
|
+
proc Label::_drop_cmd { path source X Y op type data } {
|
|
221
|
+
set path [winfo parent $path]
|
|
222
|
+
if { [set cmd [Widget::cget $path -dropcmd]] != "" } {
|
|
223
|
+
return [uplevel \#0 $cmd [list $path $source $X $Y $op $type $data]]
|
|
224
|
+
}
|
|
225
|
+
if { $type == "COLOR" || $type == "FGCOLOR" } {
|
|
226
|
+
configure $path -foreground $data
|
|
227
|
+
} elseif { $type == "BGCOLOR" } {
|
|
228
|
+
configure $path -background $data
|
|
229
|
+
} else {
|
|
230
|
+
set text ""
|
|
231
|
+
set image ""
|
|
232
|
+
set bitmap ""
|
|
233
|
+
switch -- $type {
|
|
234
|
+
IMAGE {set image $data}
|
|
235
|
+
BITMAP {set bitmap $data}
|
|
236
|
+
default {
|
|
237
|
+
set text $data
|
|
238
|
+
if { [set var [$path.l cget -textvariable]] != "" } {
|
|
239
|
+
configure $path -image "" -bitmap ""
|
|
240
|
+
GlobalVar::setvar $var $data
|
|
241
|
+
return
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
configure $path -text $text -image $image -bitmap $bitmap
|
|
246
|
+
}
|
|
247
|
+
return 1
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
# ------------------------------------------------------------------------------
|
|
252
|
+
# Command Label::_over_cmd
|
|
253
|
+
# ------------------------------------------------------------------------------
|
|
254
|
+
proc Label::_over_cmd { path source event X Y op type data } {
|
|
255
|
+
set path [winfo parent $path]
|
|
256
|
+
if { [set cmd [Widget::cget $path -dropovercmd]] != "" } {
|
|
257
|
+
return [uplevel \#0 $cmd [list $path $source $event $X $Y $op $type $data]]
|
|
258
|
+
}
|
|
259
|
+
if { [Widget::getoption $path -state] == "normal" ||
|
|
260
|
+
$type == "COLOR" || $type == "FGCOLOR" || $type == "BGCOLOR" } {
|
|
261
|
+
DropSite::setcursor based_arrow_down
|
|
262
|
+
return 1
|
|
263
|
+
}
|
|
264
|
+
DropSite::setcursor dot
|
|
265
|
+
return 0
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
proc Label::_destroy { path } {
|
|
270
|
+
Widget::destroy $path
|
|
271
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# ------------------------------------------------------------------------------
|
|
2
|
+
# labelentry.tcl
|
|
3
|
+
# This file is part of Unifix BWidget Toolkit
|
|
4
|
+
# $Id: labelentry.tcl,v 1.6 2003/10/20 21:23:52 damonc Exp $
|
|
5
|
+
# ------------------------------------------------------------------------------
|
|
6
|
+
# Index of commands:
|
|
7
|
+
# - LabelEntry::create
|
|
8
|
+
# - LabelEntry::configure
|
|
9
|
+
# - LabelEntry::cget
|
|
10
|
+
# - LabelEntry::bind
|
|
11
|
+
# ------------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
namespace eval LabelEntry {
|
|
14
|
+
Widget::define LabelEntry labelentry Entry LabelFrame
|
|
15
|
+
|
|
16
|
+
Widget::bwinclude LabelEntry LabelFrame .labf \
|
|
17
|
+
remove {-relief -borderwidth -focus} \
|
|
18
|
+
rename {-text -label} \
|
|
19
|
+
prefix {label -justify -width -anchor -height -font -textvariable}
|
|
20
|
+
|
|
21
|
+
Widget::bwinclude LabelEntry Entry .e \
|
|
22
|
+
remove {-fg -bg} \
|
|
23
|
+
rename {-foreground -entryfg -background -entrybg}
|
|
24
|
+
|
|
25
|
+
Widget::addmap LabelEntry "" :cmd {-background {}}
|
|
26
|
+
|
|
27
|
+
Widget::syncoptions LabelEntry Entry .e {-text {}}
|
|
28
|
+
Widget::syncoptions LabelEntry LabelFrame .labf {-label -text -underline {}}
|
|
29
|
+
|
|
30
|
+
::bind BwLabelEntry <FocusIn> [list focus %W.labf]
|
|
31
|
+
::bind BwLabelEntry <Destroy> [list LabelEntry::_destroy %W]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# ------------------------------------------------------------------------------
|
|
36
|
+
# Command LabelEntry::create
|
|
37
|
+
# ------------------------------------------------------------------------------
|
|
38
|
+
proc LabelEntry::create { path args } {
|
|
39
|
+
array set maps [list LabelEntry {} :cmd {} .labf {} .e {}]
|
|
40
|
+
array set maps [Widget::parseArgs LabelEntry $args]
|
|
41
|
+
|
|
42
|
+
eval [list frame $path] $maps(:cmd) -class LabelEntry \
|
|
43
|
+
-relief flat -bd 0 -highlightthickness 0 -takefocus 0
|
|
44
|
+
Widget::initFromODB LabelEntry $path $maps(LabelEntry)
|
|
45
|
+
|
|
46
|
+
set labf [eval [list LabelFrame::create $path.labf] $maps(.labf) \
|
|
47
|
+
[list -relief flat -borderwidth 0 -focus $path.e]]
|
|
48
|
+
set subf [LabelFrame::getframe $labf]
|
|
49
|
+
set entry [eval [list Entry::create $path.e] $maps(.e)]
|
|
50
|
+
|
|
51
|
+
pack $entry -in $subf -fill both -expand yes
|
|
52
|
+
pack $labf -fill both -expand yes
|
|
53
|
+
|
|
54
|
+
bindtags $path [list $path BwLabelEntry [winfo toplevel $path] all]
|
|
55
|
+
|
|
56
|
+
return [Widget::create LabelEntry $path]
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
# ------------------------------------------------------------------------------
|
|
61
|
+
# Command LabelEntry::configure
|
|
62
|
+
# ------------------------------------------------------------------------------
|
|
63
|
+
proc LabelEntry::configure { path args } {
|
|
64
|
+
return [Widget::configure $path $args]
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# ------------------------------------------------------------------------------
|
|
69
|
+
# Command LabelEntry::cget
|
|
70
|
+
# ------------------------------------------------------------------------------
|
|
71
|
+
proc LabelEntry::cget { path option } {
|
|
72
|
+
return [Widget::cget $path $option]
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
# ------------------------------------------------------------------------------
|
|
77
|
+
# Command LabelEntry::bind
|
|
78
|
+
# ------------------------------------------------------------------------------
|
|
79
|
+
proc LabelEntry::bind { path args } {
|
|
80
|
+
return [eval [list ::bind $path.e] $args]
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
#------------------------------------------------------------------------------
|
|
85
|
+
# Command LabelEntry::_path_command
|
|
86
|
+
#------------------------------------------------------------------------------
|
|
87
|
+
proc LabelEntry::_path_command { path cmd larg } {
|
|
88
|
+
if { [string equal $cmd "configure"] ||
|
|
89
|
+
[string equal $cmd "cget"] ||
|
|
90
|
+
[string equal $cmd "bind"] } {
|
|
91
|
+
return [eval [list LabelEntry::$cmd $path] $larg]
|
|
92
|
+
} else {
|
|
93
|
+
return [eval [list $path.e:cmd $cmd] $larg]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
proc LabelEntry::_destroy { path } {
|
|
99
|
+
Widget::destroy $path
|
|
100
|
+
}
|