Index: BWman/BWidget.html
==================================================================
--- BWman/BWidget.html
+++ BWman/BWidget.html
@@ -172,14 +172,14 @@
path
w
h
?arg...?
-Used to position and resize the widget specified by
+Used to position and resise the widget specified by
path. w and h are used to specify the requested
width and height of the path widget for use by wm
-geometry (set to 0 to use current values). The placement of the widget relative to other widgets or
+geometry. The placement of the widget relative to other widgets or
the screen is controlled by additional arguments:
- at x y
- Place the widget specified by the path argument at screen
position x,y. See wm geometry for information about window
Index: ChangeLog
==================================================================
--- ChangeLog
+++ ChangeLog
@@ -1,36 +1,5 @@
-2009-09-05 Johann Oberdorfer
-
- **** BWidget 1.9.1 tagged ****
- BWidget revitalization to make usage of tile...
- ... updates to follow, pls. be patient for the moment ...
-
-2009-09-03 Harald Oehlmann
-
- * util.tcl(BWidget::place), BWidget.html Widget placed incorrectly,
- when bigger than current screen [Bug 2850031] by Thomas Grausgruber
- Possible incompatibility: BWidget::place w h -> w,h are reduced to
- screen width.
- * dynhelp.tcl Added part of last patch, for pre 8.5 tcl from BWidget
- branch [Patch 2835180].
-
-2009-08-12 Harald Oehlmann
-
- * dynhelp.tcl Use balloon help font TkTooltipFont
- [Patch 2835180] for Kevin Walzer
- * dynhelp.tcl(DynamicHelp::_show_help)Replaced aqua conditional code
- check by $Widget::_aqua
-
-2009-08-04 Harald Oehlmann
-
- * notebook.tcl (NoteBook::delete) Method delete destroyframe=1 and
- reinsertion -> raise failed - state variables were deleted.
- [Bug 2831785] by kjnash
- * tree.tcl (Tree::_keynav) Fire virtual event <> also on
- keyboard navigation [Patch 2828086] by Kevin Walzer
- * combobox.tcl Replaced aqua conditional code check by $Widget::_aqua
-
2009-07-24 Harald Oehlmann
**** BWidget 1.9.0 tagged ****
* pkgIndex.tcl, README.txt: updated to BWidget 1.9
DELETED demo/basic.tcl
Index: demo/basic.tcl
==================================================================
--- demo/basic.tcl
+++ /dev/null
@@ -1,199 +0,0 @@
-
-namespace eval DemoBasic {
- variable var
- variable count 0
- variable id ""
-}
-
-
-proc DemoBasic::create { nb } {
- set frame [$nb insert end demoBasic -text "Basic"]
-
- set topf [frame $frame.topf]
- set titf1 [TitleFrame $topf.titf1 -text "Label"]
- set titf2 [TitleFrame $topf.titf2 -text "Entry"]
- set titf3 [TitleFrame $frame.titf3 -text "Button and ArrowButton"]
-
- _label [$titf1 getframe]
- _entry [$titf2 getframe]
- _button [$titf3 getframe]
-
- pack $titf1 $titf2 -side left -fill both -padx 4 -expand yes
- pack $topf -pady 2 -fill x
- pack $titf3 -pady 2 -padx 4 -fill x
-
- return $frame
-}
-
-
-proc DemoBasic::_label { parent } {
- variable var
-
- set lab [Label $parent.label -text "This is a Label widget" \
- -helptext "Label widget"]
- set chk [checkbutton $parent.chk -text "Disabled" \
- -variable DemoBasic::var($lab,-state) \
- -onvalue disabled -offvalue normal \
- -command "$lab configure -state \$DemoBasic::var($lab,-state)"]
- pack $lab -anchor w -pady 4
- pack $chk -anchor w
-}
-
-
-proc DemoBasic::_entry { parent } {
- set ent [Entry $parent.entry -text "Press enter" \
- -command {set DemoBasic::var(entcmd) "-command called" ; after 500 {set DemoBasic::var(entcmd) ""}} \
- -helptext "Entry widget"]
- set chk1 [checkbutton $parent.chk1 -text "Disabled" \
- -variable DemoBasic::var($ent,state) \
- -onvalue disabled -offvalue normal \
- -command "$ent configure -state \$DemoBasic::var($ent,state)"]
- set chk2 [checkbutton $parent.chk2 -text "Non editable" \
- -variable DemoBasic::var($ent,editable) \
- -onvalue false -offvalue true \
- -command "$ent configure -editable \$DemoBasic::var($ent,editable)"]
- set lab [label $parent.cmd -textvariable DemoBasic::var(entcmd) -foreground red]
- pack $ent -pady 4 -anchor w
- pack $chk1 $chk2 -anchor w
- pack $lab -pady 4
-}
-
-
-proc DemoBasic::_button { parent } {
- variable var
-
- set frame [frame $parent.butfr]
- set but [Button $frame.but -text "Press me!" \
- -repeatdelay 300 \
- -command "DemoBasic::_butcmd command" \
- -helptext "This is a Button widget"]
- set sep1 [Separator $frame.sep1 -orient vertical]
- set arr1 [ArrowButton $frame.arr1 -type button \
- -width 25 -height 25 \
- -repeatdelay 300 \
- -command "DemoBasic::_butcmd command" \
- -helptext "This is an ArrowButton widget\nof type button"]
- set sep2 [Separator $frame.sep2 -orient vertical]
- set arr2 [ArrowButton $frame.arr2 -type arrow \
- -width 25 -height 25 -relief sunken -ipadx 0 -ipady 0 \
- -repeatdelay 300 \
- -command "DemoBasic::_butcmd command" \
- -helptext "This is an ArrowButton widget\nof type arrow"]
-
- pack $but -side left -padx 4
- pack $sep1 -side left -padx 4 -fill y
- pack $arr1 -side left -padx 4
- pack $sep2 -side left -padx 4 -fill y
- pack $arr2 -side left -padx 4
- pack $frame
-
- set sep3 [Separator $parent.sep3 -orient horizontal]
- pack $sep3 -fill x -pady 10
-
- set labf1 [LabelFrame $parent.labf1 -text "Command" -side top \
- -anchor w -relief sunken -borderwidth 1]
- set subf [$labf1 getframe]
- set chk1 [checkbutton $subf.chk1 -text "Disabled" \
- -variable DemoBasic::var(bstate) -onvalue disabled -offvalue normal \
- -command "DemoBasic::_bstate \$DemoBasic::var(bstate) $but $arr1 $arr2"]
- set chk2 [checkbutton $subf.chk2 -text "Use -armcommand/\n-disarmcommand" \
- -justify left \
- -variable DemoBasic::var(barmcmd) \
- -command "DemoBasic::_barmcmd \$DemoBasic::var(barmcmd) $but $arr1 $arr2"]
- pack $chk1 $chk2 -anchor w
-
- set label [label $parent.label -textvariable DemoBasic::var(butcmd) -foreground red]
- pack $label -side bottom -pady 4
-
- set labf2 [LabelFrame $parent.labf2 -text "Direction" -side top \
- -anchor w -relief sunken -borderwidth 1]
- set subf [$labf2 getframe]
- set var(bside) top
- foreach dir {top left bottom right} {
- set rad [radiobutton $subf.$dir -text "$dir arrow" \
- -variable DemoBasic::var(bside) -value $dir \
- -command "DemoBasic::_bside \$DemoBasic::var(bside) $arr1 $arr2"]
- pack $rad -anchor w
- }
-
- set labf3 [LabelFrame $parent.labf3 -text "Relief" -side top \
- -anchor w -relief sunken -borderwidth 1]
- set subf [$labf3 getframe]
- set var(brelief) raised
- foreach {f lrelief} {f1 {raised sunken ridge groove} f2 {flat solid link}} {
- set f [frame $subf.$f]
- foreach relief $lrelief {
- set rad [radiobutton $f.$relief -text $relief \
- -variable DemoBasic::var(brelief) -value $relief \
- -command "DemoBasic::_brelief \$DemoBasic::var(brelief) $but $arr1 $arr2"]
- pack $rad -anchor w
- }
- pack $f -side left -padx 2 -anchor n
- }
- pack $labf1 $labf2 $labf3 -side left -fill y -padx 4
-}
-
-
-proc DemoBasic::_bstate { state but arr1 arr2 } {
- foreach but [list $but $arr1 $arr2] {
- $but configure -state $state
- }
-}
-
-
-proc DemoBasic::_brelief { relief but arr1 arr2 } {
- $but configure -relief $relief
- if { $relief != "link" } {
- foreach arr [list $arr1 $arr2] {
- $arr configure -relief $relief
- }
- }
-}
-
-
-proc DemoBasic::_bside { side args } {
- foreach arr $args {
- $arr configure -dir $side
- }
-}
-
-
-proc DemoBasic::_barmcmd { value but arr1 arr2 } {
- if { $value } {
- $but configure \
- -armcommand "DemoBasic::_butcmd arm" \
- -disarmcommand "DemoBasic::_butcmd disarm" \
- -command {}
- foreach arr [list $arr1 $arr2] {
- $arr configure \
- -armcommand "DemoBasic::_butcmd arm" \
- -disarmcommand "DemoBasic::_butcmd disarm" \
- -command {}
- }
- } else {
- $but configure -armcommand {} -disarmcommand {} \
- -command "DemoBasic::_butcmd command"
- foreach arr [list $arr1 $arr2] {
- $arr configure -armcommand {} -disarmcommand {} \
- -command "DemoBasic::_butcmd command"
- }
- }
-}
-
-
-proc DemoBasic::_butcmd { reason } {
- variable count
- variable id
-
- catch {after cancel $id}
- if { $reason == "arm" } {
- incr count
- set DemoBasic::var(butcmd) "$reason command called ($count)"
- } else {
- set count 0
- set DemoBasic::var(butcmd) "$reason command called"
- }
- set id [after 500 {set DemoBasic::var(butcmd) ""}]
-}
-
-
DELETED demo/bwidget.xbm
Index: demo/bwidget.xbm
==================================================================
--- demo/bwidget.xbm
+++ /dev/null
@@ -1,46 +0,0 @@
-#define bwidget_width 76
-#define bwidget_height 64
-static char bwidget_bits[] = {
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xf0,0x00,0xb6,0x6d,0xdb,0x16,0x00,0x00,0x00,0x00,0xf0,
- 0x00,0xdb,0xb6,0x6d,0xab,0x00,0x00,0x00,0x00,0xf0,0x00,0x55,0x55,0x55,0x75,
- 0x01,0x00,0x00,0x00,0xf0,0x00,0x6d,0xdb,0xb6,0xad,0x02,0x00,0x00,0x00,0xf0,
- 0x00,0xb6,0x6d,0xdb,0xb6,0x05,0x00,0x00,0x00,0xf0,0x00,0x55,0x55,0x55,0x55,
- 0x05,0x00,0x00,0x00,0xf0,0x00,0xda,0xb6,0xad,0x6d,0x0b,0x00,0x00,0x00,0xf0,
- 0x00,0x6b,0x03,0xc0,0xb6,0x05,0x00,0x00,0x00,0xf0,0x00,0x56,0x05,0x00,0x55,
- 0x0d,0x00,0x00,0x00,0xf0,0x00,0xbb,0x05,0x80,0xdb,0x06,0x00,0x00,0x00,0xf0,
- 0x00,0xca,0x06,0x00,0x6c,0x0b,0x00,0x00,0x00,0xf0,0x00,0xb6,0x02,0x00,0xaa,
- 0x0a,0x00,0x00,0x00,0xf0,0x00,0xab,0x05,0x00,0x6c,0x0b,0x00,0x00,0x00,0xf0,
- 0x00,0xdd,0x06,0x00,0xb6,0x05,0x00,0x00,0x00,0xf0,0x00,0xaa,0x02,0x00,0x55,
- 0x05,0x00,0x00,0x00,0xf0,0x00,0xb7,0x05,0xc0,0xda,0x02,0x00,0x00,0x00,0xf0,
- 0x00,0xd9,0x06,0x50,0x6b,0x01,0x00,0x00,0x00,0xf0,0x00,0x56,0xb5,0xad,0xad,
- 0x00,0x00,0x00,0x00,0xf0,0x00,0xdb,0xd6,0x76,0x15,0x00,0x00,0x00,0x00,0xf0,
- 0x00,0x6a,0xab,0xaa,0x2d,0x00,0x00,0x00,0x00,0xf0,0x00,0x56,0x75,0xad,0xb6,
- 0x02,0x00,0x00,0x00,0xf0,0x00,0xbb,0xad,0xd6,0xaa,0x05,0x00,0x00,0x00,0xf0,
- 0x00,0xca,0xb6,0x6b,0xdb,0x2a,0x00,0x00,0x00,0xf0,0x00,0x77,0xd5,0x5c,0x6d,
- 0x2d,0x00,0x00,0x00,0xf0,0x00,0x99,0x05,0x00,0xaa,0x56,0x00,0x00,0x00,0xf0,
- 0x00,0xee,0x06,0x00,0x6c,0xbb,0x00,0x00,0x00,0xf0,0x00,0xaa,0x02,0x00,0xb0,
- 0x55,0x00,0x00,0x00,0xf0,0x00,0x55,0x05,0x00,0xa8,0xd6,0x00,0x00,0x00,0xf0,
- 0x00,0xee,0x06,0x00,0xd0,0x6a,0x00,0x00,0x00,0xf0,0x00,0x55,0x03,0x00,0x68,
- 0xb7,0xfc,0x00,0x7e,0xf0,0x00,0x6d,0x05,0x00,0xa8,0xaa,0xfc,0x80,0x7e,0xf0,
- 0x00,0xb6,0x05,0x00,0x50,0xbb,0xfe,0x01,0x7e,0xf0,0x00,0x55,0x05,0x00,0x78,
- 0xad,0xfe,0x81,0x1f,0xf0,0x00,0xb6,0x05,0x00,0xa4,0xb5,0xfe,0x81,0x1f,0xf0,
- 0x00,0x5b,0x05,0x80,0xba,0x56,0xfe,0x83,0x1f,0xf0,0x00,0xaa,0x6b,0x5b,0xd5,
- 0x5a,0xff,0x85,0x1f,0xf0,0x00,0xdb,0x5a,0xad,0x57,0x2b,0xff,0xc7,0x0f,0xf0,
- 0x00,0x6d,0xad,0xd5,0x6a,0x0d,0xff,0xc7,0x0f,0xf0,0x00,0xaa,0xd6,0xb6,0xba,
- 0x05,0xdf,0xc7,0x0f,0xf0,0x00,0xb7,0xb5,0x5a,0xab,0x8a,0xdf,0xcf,0x0f,0xf0,
- 0x00,0xd9,0x5a,0xab,0x6d,0x8f,0xcf,0xef,0x07,0xf0,0x00,0x56,0xad,0x75,0xb5,
- 0xaf,0x8f,0xef,0x07,0xf0,0x00,0xb5,0xeb,0x5a,0x00,0x9f,0xcf,0xef,0x07,0xf0,
- 0x00,0x00,0x00,0x00,0x00,0xff,0x8f,0xff,0x07,0xf0,0x00,0x00,0x00,0x00,0x00,
- 0xfe,0x87,0xff,0x03,0xf0,0x00,0x00,0x00,0x00,0x00,0xff,0x03,0xff,0x03,0xf0,
- 0x00,0x00,0x00,0x00,0x00,0xfe,0x03,0xff,0x03,0xf0,0x00,0x00,0x00,0x00,0x00,
- 0xfe,0x03,0xff,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,0xfc,0x01,0xff,0x03,0xf0,
- 0x00,0x00,0x00,0x00,0x00,0xfe,0x01,0xfe,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,
- 0xfc,0x01,0xfe,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0};
DELETED demo/demo.tcl
Index: demo/demo.tcl
==================================================================
--- demo/demo.tcl
+++ /dev/null
@@ -1,212 +0,0 @@
-#!/bin/sh
-# The next line is executed by /bin/sh, but not tcl \
-exec wish "$0" ${1+"$@"}
-
-namespace eval Demo {
- variable _wfont
-
- variable notebook
- variable mainframe
- variable status
- variable prgtext
- variable prgindic
- variable font
- variable font_name
- variable toolbar1 1
- variable toolbar2 1
-
- set pwd [pwd]
- cd [file dirname [info script]]
- variable DEMODIR [pwd]
- cd $pwd
-
- foreach script {
- manager.tcl basic.tcl select.tcl dnd.tcl tree.tcl tmpldlg.tcl
- } {
- namespace inscope :: source $DEMODIR/$script
- }
-}
-
-
-proc Demo::create { } {
- global tk_patchLevel
- variable _wfont
- variable notebook
- variable mainframe
- variable font
- variable prgtext
- variable prgindic
-
- set prgtext "Please wait while loading font..."
- set prgindic -1
- _create_intro
- update
- SelectFont::loadfont
-
- bind all { catch {console show} }
-
- # Menu description
- set descmenu {
- "&File" all file 0 {
- {command "E&xit" {} "Exit BWidget demo" {} -command exit}
- }
- "&Options" all options 0 {
- {checkbutton "Toolbar &1" {all option} "Show/hide toolbar 1" {}
- -variable Demo::toolbar1
- -command {$Demo::mainframe showtoolbar 0 $Demo::toolbar1}
- }
- {checkbutton "Toolbar &2" {all option} "Show/hide toolbar 2" {}
- -variable Demo::toolbar2
- -command {$Demo::mainframe showtoolbar 1 $Demo::toolbar2}
- }
- }
- }
-
- set prgtext "Creating MainFrame..."
- set prgindic 0
- set mainframe [MainFrame .mainframe \
- -menu $descmenu \
- -textvariable Demo::status \
- -progressvar Demo::prgindic]
-
- # toolbar 1 creation
- incr prgindic
- set tb1 [$mainframe addtoolbar]
- set bbox [ButtonBox $tb1.bbox1 -spacing 0 -padx 1 -pady 1]
- $bbox add -image [Bitmap::get new] \
- -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
- -helptext "Create a new file"
- $bbox add -image [Bitmap::get open] \
- -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
- -helptext "Open an existing file"
- $bbox add -image [Bitmap::get save] \
- -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
- -helptext "Save file"
- pack $bbox -side left -anchor w
-
- set sep [Separator $tb1.sep -orient vertical]
- pack $sep -side left -fill y -padx 4 -anchor w
-
- incr prgindic
- set bbox [ButtonBox $tb1.bbox2 -spacing 0 -padx 1 -pady 1]
- $bbox add -image [Bitmap::get cut] \
- -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
- -helptext "Cut selection"
- $bbox add -image [Bitmap::get copy] \
- -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
- -helptext "Copy selection"
- $bbox add -image [Bitmap::get paste] \
- -highlightthickness 0 -takefocus 0 -relief link -borderwidth 1 -padx 1 -pady 1 \
- -helptext "Paste selection"
- pack $bbox -side left -anchor w
-
- # toolbar 2 creation
- incr prgindic
- set tb2 [$mainframe addtoolbar]
- set _wfont [SelectFont $tb2.font -type toolbar \
- -command "Demo::update_font \[$tb2.font cget -font\]"]
- set font [$_wfont cget -font]
- pack $_wfont -side left -anchor w
-
- $mainframe addindicator -text "BWidget [package version BWidget]"
- $mainframe addindicator -textvariable tk_patchLevel
-
- # NoteBook creation
- set frame [$mainframe getframe]
- set notebook [NoteBook $frame.nb]
-
- set prgtext "Creating Manager..."
- incr prgindic
- set f0 [DemoManager::create $notebook]
- set prgtext "Creating Basic..."
- incr prgindic
- set f1 [DemoBasic::create $notebook]
- set prgtext "Creating Select..."
- incr prgindic
- set f2 [DemoSelect::create $notebook]
- set prgtext "Creating Dialog..."
- incr prgindic
- set f3b [DemoDlg::create $notebook]
- set prgtext "Creating Drag and Drop..."
- incr prgindic
- set f4 [DemoDnd::create $notebook]
- set prgtext "Creating Tree..."
- incr prgindic
- set f5 [DemoTree::create $notebook]
-
- set prgtext "Done"
- incr prgindic
- $notebook compute_size
- pack $notebook -fill both -expand yes -padx 4 -pady 4
- $notebook raise [$notebook page 0]
-
- pack $mainframe -fill both -expand yes
- update idletasks
- destroy .intro
-}
-
-
-proc Demo::update_font { newfont } {
- variable _wfont
- variable notebook
- variable font
- variable font_name
-
- . configure -cursor watch
- if { $font != $newfont } {
- $_wfont configure -font $newfont
- $notebook configure -font $newfont
- set font $newfont
- }
- . configure -cursor ""
-}
-
-
-proc Demo::_create_intro { } {
- variable DEMODIR
-
- set top [toplevel .intro -relief raised -borderwidth 2]
-
- wm withdraw $top
- wm overrideredirect $top 1
-
- set ximg [label $top.x -bitmap @$DEMODIR/x1.xbm \
- -foreground grey90 -background white]
- set bwimg [label $ximg.bw -bitmap @$DEMODIR/bwidget.xbm \
- -foreground grey90 -background white]
- set frame [frame $ximg.f -background white]
- set lab1 [label $frame.lab1 -text "Loading demo" \
- -background white -font {times 8}]
- set lab2 [label $frame.lab2 -textvariable Demo::prgtext \
- -background white -font {times 8} -width 35]
- set prg [ProgressBar $frame.prg -width 50 -height 10 -background white \
- -variable Demo::prgindic -maximum 10]
- pack $lab1 $lab2 $prg
- place $frame -x 0 -y 0 -anchor nw
- place $bwimg -relx 1 -rely 1 -anchor se
- pack $ximg
- BWidget::place $top 0 0 center
- wm deiconify $top
-}
-
-
-proc Demo::main {} {
- variable DEMODIR
-
- lappend ::auto_path [file dirname $DEMODIR]
- package require BWidget
-
- option add *TitleFrame.l.font {helvetica 11 bold italic}
-
- wm withdraw .
- wm title . "BWidget demo"
-
- Demo::create
- BWidget::place . 0 0 center
- wm deiconify .
- raise .
- focus -force .
-}
-
-Demo::main
-wm geom . [wm geom .]
DELETED demo/dnd.tcl
Index: demo/dnd.tcl
==================================================================
--- demo/dnd.tcl
+++ /dev/null
@@ -1,42 +0,0 @@
-
-namespace eval DemoDnd {
-}
-
-
-proc DemoDnd::create { nb } {
-
- set frame [$nb insert end demoDnd -text "Drag and Drop"]
-
- set titf1 [TitleFrame $frame.titf1 -text "Drag sources"]
- set subf [$titf1 getframe]
-
- set ent1 [LabelEntry $subf.e1 -label "Entry" -labelwidth 14 -dragenabled 1 -dragevent 3]
- set labf1 [LabelFrame $subf.f1 -text "Label (text)" -width 14]
- set f [$labf1 getframe]
- set lab [Label $f.l -text "Drag this text" -dragenabled 1 -dragevent 3]
- pack $lab
-
- set labf2 [LabelFrame $subf.f2 -text "Label (bitmap)" -width 14]
- set f [$labf2 getframe]
- set lab [Label $f.l -bitmap info -dragenabled 1 -dragevent 3]
- pack $lab
-
- pack $ent1 $labf1 $labf2 -side top -fill x -pady 4
-
- set titf2 [TitleFrame $frame.titf2 -text "Drop targets"]
- set subf [$titf2 getframe]
-
- set ent1 [LabelEntry $subf.e1 -label "Entry" -labelwidth 14 -dropenabled 1]
- set labf1 [LabelFrame $subf.f1 -text "Label" -width 14]
- set f [$labf1 getframe]
- set lab [Label $f.l -dropenabled 1 -highlightthickness 1]
- pack $lab -fill x
-
- pack $ent1 $labf1 -side top -fill x -pady 4
-
- pack $titf1 $titf2 -pady 4
-
- return $frame
-}
-
-
DELETED demo/manager.tcl
Index: demo/manager.tcl
==================================================================
--- demo/manager.tcl
+++ /dev/null
@@ -1,141 +0,0 @@
-
-
-namespace eval DemoManager {
- variable _progress 0
- variable _afterid ""
- variable _status "Compute in progress..."
- variable _homogeneous 0
-}
-
-
-proc DemoManager::create { nb } {
- set frame [$nb insert end demoManager -text "Manager"]
-
- set topf [frame $frame.topf]
- set titf1 [TitleFrame $topf.titf1 -text "MainFrame"]
- set titf2 [TitleFrame $topf.titf2 -text "NoteBook"]
- set titf3 [TitleFrame $frame.titf3 -text "Paned & ScrolledWindow"]
-
- _mainframe [$titf1 getframe]
- _notebook [$titf2 getframe]
- _paned [$titf3 getframe]
-
- pack $titf1 $titf2 -padx 4 -side left -fill both -expand yes
- pack $topf -fill x -pady 2
- pack $titf3 -pady 2 -padx 4 -fill both -expand yes
-
- return $frame
-}
-
-
-proc DemoManager::_mainframe { parent } {
- set labf1 [LabelFrame $parent.labf1 -text "Toolbar" -side top -anchor w \
- -relief sunken -borderwidth 2]
- set subf [$labf1 getframe]
- checkbutton $subf.chk1 -text "View toolbar 1" -variable Demo::toolbar1 \
- -command {$Demo::mainframe showtoolbar 0 $Demo::toolbar1}
- checkbutton $subf.chk2 -text "View toolbar 2" -variable Demo::toolbar2 \
- -command {$Demo::mainframe showtoolbar 1 $Demo::toolbar2}
- pack $subf.chk1 $subf.chk2 -anchor w -fill x
- pack $labf1 -fill both
-
- set labf2 [LabelFrame $parent.labf2 -text "Status bar" -side top -anchor w \
- -relief sunken -borderwidth 2]
- set subf [$labf2 getframe]
- checkbutton $subf.chk1 -text "Show Progress\nindicator" -justify left \
- -variable DemoManager::_progress \
- -command {DemoManager::_show_progress}
- pack $subf.chk1 -anchor w -fill x
-
- pack $labf1 $labf2 -side left -padx 4 -fill both
-}
-
-
-proc DemoManager::_notebook { parent } {
- checkbutton $parent.chk1 -text "Homogeneous label" \
- -variable DemoManager::_homogeneous \
- -command {$Demo::notebook configure -homogeneous $DemoManager::_homogeneous}
- pack $parent.chk1 -side left -anchor n -fill x
-}
-
-
-
-proc DemoManager::_paned { parent } {
- set pw1 [PanedWindow $parent.pw -side top]
- set pane [$pw1 add -minsize 100]
-
- set pw2 [PanedWindow $pane.pw -side left]
- set pane1 [$pw2 add -minsize 100]
- set pane2 [$pw2 add -minsize 100]
- set pane3 [$pw1 add -minsize 100]
-
- foreach pane [list $pane1 $pane2] {
- set sw [ScrolledWindow $pane.sw]
- set lb [listbox $sw.lb -height 8 -width 20 -highlightthickness 0]
- for {set i 1} {$i <= 8} {incr i} {
- $lb insert end "Value $i"
- }
- $sw setwidget $lb
- pack $sw -fill both -expand yes
- }
-
- set sw [ScrolledWindow $pane3.sw -relief sunken -borderwidth 2]
- set sf [ScrollableFrame $sw.f]
- $sw setwidget $sf
- set subf [$sf getframe]
- set lab [label $subf.lab -text "This is a ScrollableFrame"]
- set chk [checkbutton $subf.chk -text "Constrained width" \
- -variable DemoManager::_constw \
- -command "$sf configure -constrainedwidth \$DemoManager::_constw"]
- pack $lab
- pack $chk -anchor w
- bind $chk "$sf see $chk"
- for {set i 0} {$i <= 20} {incr i} {
- pack [entry $subf.ent$i -width 50] -fill x -pady 4
- bind $subf.ent$i "$sf see $subf.ent$i"
- $subf.ent$i insert end "Text field $i"
- }
-
- pack $sw $pw2 $pw1 -fill both -expand yes
-}
-
-
-proc DemoManager::_show_progress { } {
- variable _progress
- variable _afterid
- variable _status
-
- if { $_progress } {
- set Demo::status "Compute in progress..."
- set Demo::prgindic 0
- $Demo::mainframe showstatusbar progression
- if { $_afterid == "" } {
- set _afterid [after 30 DemoManager::_update_progress]
- }
- } else {
- set Demo::status ""
- $Demo::mainframe showstatusbar status
- set _afterid ""
- }
-}
-
-
-proc DemoManager::_update_progress { } {
- variable _progress
- variable _afterid
-
- if { $_progress } {
- if { $Demo::prgindic < 100 } {
- incr Demo::prgindic 5
- set _afterid [after 30 DemoManager::_update_progress]
- } else {
- set _progress 0
- $Demo::mainframe showstatusbar status
- set Demo::status "Done"
- set _afterid ""
- after 500 {set Demo::status ""}
- }
- } else {
- set _afterid ""
- }
-}
DELETED demo/select.tcl
Index: demo/select.tcl
==================================================================
--- demo/select.tcl
+++ /dev/null
@@ -1,59 +0,0 @@
-namespace eval DemoSelect {
- variable var
-}
-
-
-proc DemoSelect::create { nb } {
- set frame [$nb insert end demoSelect -text "Spin & Combo"]
-
- set titf1 [TitleFrame $frame.titf1 -text SpinBox]
- set subf [$titf1 getframe]
- set spin [SpinBox $subf.spin \
- -range {1 100 1} -textvariable DemoSelect::var(spin,var) \
- -helptext "This is the SpinBox"]
- set ent [LabelEntry $subf.ent -label "Linked var" -labelwidth 10 -labelanchor w \
- -textvariable DemoSelect::var(spin,var) -editable 0 \
- -helptext "This is an Entry reflecting\nthe linked var of SpinBox"]
- set labf [LabelFrame $subf.options -text "Options" -side top -anchor w \
- -relief sunken -borderwidth 1 \
- -helptext "Modify some options of SpinBox"]
- set subf [$labf getframe]
- set chk1 [checkbutton $subf.chk1 -text "Non editable" \
- -variable DemoSelect::var(spin,editable) -onvalue false -offvalue true \
- -command "$spin configure -editable \$DemoSelect::var(spin,editable)"]
- set chk2 [checkbutton $subf.chk2 -text "Disabled" \
- -variable DemoSelect::var(spin,state) -onvalue disabled -offvalue normal \
- -command "$spin configure -state \$DemoSelect::var(spin,state)"]
-
- pack $chk1 $chk2 -side left -anchor w
- pack $spin $ent $labf -pady 4 -fill x
- pack $titf1
-
- set titf2 [TitleFrame $frame.titf2 -text ComboBox]
- set subf [$titf2 getframe]
- set combo [ComboBox $subf.combo \
- -textvariable DemoSelect::var(combo,var) \
- -values {"first value" "second value" "third value" "fourth value" "fifth value"} \
- -helptext "This is the ComboBox"]
- set ent [LabelEntry $subf.ent -label "Linked var" -labelwidth 10 -labelanchor w \
- -textvariable DemoSelect::var(combo,var) -editable 0 \
- -helptext "This is an Entry reflecting\nthe linked var of ComboBox"]
- set labf [LabelFrame $subf.options -text "Options" -side top -anchor w \
- -relief sunken -borderwidth 1 \
- -helptext "Modify some options of SpinBox"]
- set subf [$labf getframe]
- set chk1 [checkbutton $subf.chk1 -text "Non editable" \
- -variable DemoSelect::var(combo,editable) -onvalue false -offvalue true \
- -command "$combo configure -editable \$DemoSelect::var(combo,editable)"]
- set chk2 [checkbutton $subf.chk2 -text "Disabled" \
- -variable DemoSelect::var(combo,state) -onvalue disabled -offvalue normal \
- -command "$combo configure -state \$DemoSelect::var(combo,state)"]
-
- pack $chk1 $chk2 -side left -anchor w
- pack $combo $ent $labf -pady 4 -fill x
-
- pack $titf1 $titf2 -pady 4
-
- return $frame
-}
-
DELETED demo/tmpldlg.tcl
Index: demo/tmpldlg.tcl
==================================================================
--- demo/tmpldlg.tcl
+++ /dev/null
@@ -1,214 +0,0 @@
-
-namespace eval DemoDlg {
- variable tmpl
- variable msg
- variable progmsg
- variable progval
- variable resources "en"
-}
-
-
-proc DemoDlg::create { nb } {
- set frame [$nb insert end demoDlg -text "Dialog"]
-
- set titf1 [TitleFrame $frame.titf1 -text "Resources"]
- set titf2 [TitleFrame $frame.titf2 -text "Template Dialog"]
- set titf3 [TitleFrame $frame.titf3 -text "Message Dialog"]
- set titf4 [TitleFrame $frame.titf4 -text "Other dialog"]
-
- set subf [$titf1 getframe]
- set cmd {option read [file join $::BWIDGET::LIBRARY "lang" $DemoDlg::resources.rc]}
- set rad1 [radiobutton $subf.rad1 -text "English" \
- -variable DemoDlg::resources -value en \
- -command $cmd]
- set rad2 [radiobutton $subf.rad2 -text "French" \
- -variable DemoDlg::resources -value fr \
- -command $cmd]
- set rad3 [radiobutton $subf.rad3 -text "German" \
- -variable DemoDlg::resources -value de \
- -command $cmd]
- pack $rad1 $rad2 $rad3 -side left
-
- _tmpldlg [$titf2 getframe]
- _msgdlg [$titf3 getframe]
- _stddlg [$titf4 getframe]
-
- pack $titf1 -fill x -pady 2 -padx 2
- pack $titf4 -side bottom -fill x -pady 2 -padx 2
- pack $titf2 $titf3 -side left -padx 2 -fill both -expand yes
-}
-
-
-proc DemoDlg::_tmpldlg { parent } {
- variable tmpl
-
- set tmpl(side) bottom
- set tmpl(anchor) c
-
- set labf1 [LabelFrame $parent.labf1 -text "Button side" -side top \
- -anchor w -relief sunken -borderwidth 1]
- set subf [$labf1 getframe]
- radiobutton $subf.rad1 -text "Bottom" \
- -variable DemoDlg::tmpl(side) -value bottom -anchor w
- radiobutton $subf.rad2 -text "Left" \
- -variable DemoDlg::tmpl(side) -value left -anchor w
- radiobutton $subf.rad3 -text "Right" \
- -variable DemoDlg::tmpl(side) -value right -anchor w
- radiobutton $subf.rad4 -text "Top" \
- -variable DemoDlg::tmpl(side) -value top -anchor w
-
- pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 -fill x -anchor w
-
- set labf2 [LabelFrame $parent.labf2 -text "Button anchor" -side top \
- -anchor w -relief sunken -borderwidth 1]
- set subf [$labf2 getframe]
- radiobutton $subf.rad1 -text "North" \
- -variable DemoDlg::tmpl(anchor) -value n -anchor w
- radiobutton $subf.rad2 -text "West" \
- -variable DemoDlg::tmpl(anchor) -value w -anchor w
- radiobutton $subf.rad3 -text "East" \
- -variable DemoDlg::tmpl(anchor) -value e -anchor w
- radiobutton $subf.rad4 -text "South" \
- -variable DemoDlg::tmpl(anchor) -value s -anchor w
- radiobutton $subf.rad5 -text "Center" \
- -variable DemoDlg::tmpl(anchor) -value c -anchor w
-
- pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 $subf.rad5 -fill x -anchor w
-
- set sep [Separator $parent.sep -orient horizontal]
- set button [button $parent.but -text "Show" -command DemoDlg::_show_tmpldlg]
-
- pack $button -side bottom
- pack $sep -side bottom -fill x -pady 10
- pack $labf1 $labf2 -side left -padx 4 -anchor n
-}
-
-
-proc DemoDlg::_msgdlg { parent } {
- variable msg
-
- set msg(type) ok
- set msg(icon) info
-
- set labf1 [LabelFrame $parent.labf1 -text "Type" -side top \
- -anchor w -relief sunken -borderwidth 1]
- set subf [$labf1 getframe]
- radiobutton $subf.rad1 -text "Ok" -variable DemoDlg::msg(type) -value ok -anchor w
- radiobutton $subf.rad2 -text "Ok, Cancel" -variable DemoDlg::msg(type) -value okcancel -anchor w
- radiobutton $subf.rad3 -text "Retry, Cancel" -variable DemoDlg::msg(type) -value retrycancel -anchor w
- radiobutton $subf.rad4 -text "Yes, No" -variable DemoDlg::msg(type) -value yesno -anchor w
- radiobutton $subf.rad5 -text "Yes, No, Cancel" -variable DemoDlg::msg(type) -value yesnocancel -anchor w
- radiobutton $subf.rad6 -text "Abort, Retry, Ignore" -variable DemoDlg::msg(type) -value abortretryignore -anchor w
- radiobutton $subf.rad7 -text "User" -variable DemoDlg::msg(type) -value user -anchor w
- Entry $subf.user -textvariable DemoDlg::msg(buttons)
-
- pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 $subf.rad5 $subf.rad6 -fill x -anchor w
- pack $subf.rad7 $subf.user -side left
-
- set labf2 [LabelFrame $parent.labf2 -text "Icon" -side top -anchor w -relief sunken -borderwidth 1]
- set subf [$labf2 getframe]
- radiobutton $subf.rad1 -text "Information" -variable DemoDlg::msg(icon) -value info -anchor w
- radiobutton $subf.rad2 -text "Question" -variable DemoDlg::msg(icon) -value question -anchor w
- radiobutton $subf.rad3 -text "Warning" -variable DemoDlg::msg(icon) -value warning -anchor w
- radiobutton $subf.rad4 -text "Error" -variable DemoDlg::msg(icon) -value error -anchor w
- pack $subf.rad1 $subf.rad2 $subf.rad3 $subf.rad4 -fill x -anchor w
-
-
- set sep [Separator $parent.sep -orient horizontal]
- set button [button $parent.but -text "Show" -command DemoDlg::_show_msgdlg]
-
- pack $button -side bottom
- pack $sep -side bottom -fill x -pady 10
- pack $labf1 $labf2 -side left -padx 4 -anchor n
-}
-
-
-proc DemoDlg::_stddlg { parent } {
- set but0 [button $parent.but0 \
- -text "Select a color " \
- -command "DemoDlg::_show_color $parent.but0"]
- set but1 [button $parent.but1 \
- -text "Font selector dialog" \
- -command DemoDlg::_show_fontdlg]
- set but2 [button $parent.but2 \
- -text "Progression dialog" \
- -command DemoDlg::_show_progdlg]
- set but3 [button $parent.but3 \
- -text "Password dialog" \
- -command DemoDlg::_show_passdlg]
-
- pack $but0 $but1 $but2 $but3 -side left -padx 5 -anchor w
-}
-
-proc DemoDlg::_show_color {w} {
- set color [SelectColor::menu $w.color [list below $w] \
- -color [$w cget -background]]
- if {[string length $color]} {
- $w configure -background $color
- }
-}
-
-proc DemoDlg::_show_tmpldlg { } {
- variable tmpl
-
- set dlg [Dialog .tmpldlg -parent . -modal local \
- -separator 1 \
- -title "Template dialog" \
- -side $tmpl(side) \
- -anchor $tmpl(anchor) \
- -default 0 -cancel 1]
- $dlg add -name ok
- $dlg add -name cancel
- set msg [message [$dlg getframe].msg -text "Template\nDialog" -justify center -anchor c]
- pack $msg -fill both -expand yes -padx 100 -pady 100
- $dlg draw
- destroy $dlg
-}
-
-
-proc DemoDlg::_show_msgdlg { } {
- variable msg
-
- destroy .msgdlg
- MessageDlg .msgdlg -parent . \
- -message "Message for MessageBox" \
- -type $msg(type) \
- -icon $msg(icon) \
- -buttons $msg(buttons)
-}
-
-
-proc DemoDlg::_show_fontdlg { } {
- set font [SelectFont .fontdlg -parent . -font $Demo::font]
- if { $font != "" } {
- Demo::update_font $font
- }
-}
-
-
-proc DemoDlg::_show_progdlg { } {
- set DemoDlg::progmsg "Compute in progress..."
- set DemoDlg::progval 0
-
- ProgressDlg .progress -parent . -title "Wait..." \
- -type infinite \
- -width 20 \
- -textvariable DemoDlg::progmsg \
- -variable DemoDlg::progval \
- -stop "Stop" \
- -command {destroy .progress}
- _update_progdlg
-}
-
-
-proc DemoDlg::_update_progdlg { } {
- if { [winfo exists .progress] } {
- set DemoDlg::progval 2
- after 20 DemoDlg::_update_progdlg
- }
-}
-
-proc DemoDlg::_show_passdlg { } {
- PasswdDlg .passwd -parent .
-}
-
DELETED demo/tree.tcl
Index: demo/tree.tcl
==================================================================
--- demo/tree.tcl
+++ /dev/null
@@ -1,260 +0,0 @@
-
-namespace eval DemoTree {
- variable count
- variable dblclick
-}
-
-
-proc DemoTree::create { nb } {
- set frame [$nb insert end demoTree -text "Tree"]
- set pw [PanedWindow $frame.pw -side top]
-
- set pane [$pw add -weight 1]
- set title [TitleFrame $pane.lf -text "Directory tree"]
- set sw [ScrolledWindow [$title getframe].sw \
- -relief sunken -borderwidth 2]
- set tree [Tree $sw.tree \
- -relief flat -borderwidth 0 -width 15 -highlightthickness 0\
- -redraw 0 -dropenabled 1 -dragenabled 1 \
- -dragevent 3 \
- -droptypes {
- TREE_NODE {copy {} move {} link {}}
- LISTBOX_ITEM {copy {} move {} link {}}
- } \
- -opencmd "DemoTree::moddir 1 $sw.tree" \
- -closecmd "DemoTree::moddir 0 $sw.tree"]
- $sw setwidget $tree
-
- pack $sw -side top -expand yes -fill both
- pack $title -fill both -expand yes
-
- set pane [$pw add -weight 2]
- set lf [TitleFrame $pane.lf -text "Content"]
- set sw [ScrolledWindow [$lf getframe].sw \
- -scrollbar horizontal -auto none -relief sunken -borderwidth 2]
- set list [ListBox::create $sw.lb \
- -relief flat -borderwidth 0 \
- -dragevent 3 \
- -dropenabled 1 -dragenabled 1 \
- -width 20 -highlightthickness 0 -multicolumn true \
- -redraw 0 -dragenabled 1 \
- -droptypes {
- TREE_NODE {copy {} move {} link {}}
- LISTBOX_ITEM {copy {} move {} link {}}}]
- $sw setwidget $list
-
- pack $sw $lf -fill both -expand yes
-
- pack $pw -fill both -expand yes
-
- $tree bindText "DemoTree::select tree 1 $tree $list"
- $tree bindText "DemoTree::select tree 2 $tree $list"
- $list bindText "DemoTree::select list 1 $tree $list"
- $list bindText "DemoTree::select list 2 $tree $list"
- $list bindImage "DemoTree::select list 2 $tree $list"
-
- $nb itemconfigure demoTree \
- -createcmd "DemoTree::init $tree $list" \
- -raisecmd {
- # on windows you can get 100x100+-200+200 [PT]
- regexp {[0-9]+x[0-9]+([+-]{1,2}[0-9]+)([+-]{1,2}[0-9]+)} \
- [wm geom .] global_foo global_w global_h
- # {}'s left off on purpose. [PT]
- BWidget::place .top 0 0 at [expr $global_w-[winfo screenwidth .]] $global_h
- wm deiconify .top
- bind . {wm withdraw .top}
- bind .