Common subdirectories: ./CVS and ../mclistbox_submit/CVS Only in .: changes.txt diff -c ./example.tcl ../mclistbox_submit/example.tcl *** ./example.tcl Tue Aug 3 16:24:22 1999 --- ../mclistbox_submit/example.tcl Wed Jul 24 12:03:21 2002 *************** *** 28,50 **** # we will purposefully make the width less than the sum of the # columns so that the scrollbars will be functional right off # the bat. mclistbox .listbox \ -bd 0 \ -height 10 \ -width 60 \ -columnrelief flat \ -labelanchor w \ -columnborderwidth 0 \ -selectcommand "showSelection" \ ! -selectmode extended \ -labelborderwidth 2 \ -fillcolumn name \ -xscrollcommand [list .hsb set] \ ! -yscrollcommand [list .vsb set] # add the columns we want to see .listbox column add name -label "Name" -width 40 ! .listbox column add size -label "Size" -width 12 .listbox column add mod -label "Last Modified" -width 18 # set up bindings to sort the columns. --- 28,54 ---- # we will purposefully make the width less than the sum of the # columns so that the scrollbars will be functional right off # the bat. + set sample_font [font create Fixed -family Courier -size 10 -weight normal -slant roman] mclistbox .listbox \ -bd 0 \ -height 10 \ + -font $sample_font \ -width 60 \ -columnrelief flat \ -labelanchor w \ + -selectcolumn 1 \ -columnborderwidth 0 \ -selectcommand "showSelection" \ ! -selectmode single \ -labelborderwidth 2 \ -fillcolumn name \ -xscrollcommand [list .hsb set] \ ! -yscrollcommand [list .vsb set] \ ! -usecolumnxscroll 1 # add the columns we want to see .listbox column add name -label "Name" -width 40 ! .listbox column add size -label "Size" -width 12 .listbox column add mod -label "Last Modified" -width 18 # set up bindings to sort the columns. diff -c ./mclistbox.html ../mclistbox_submit/mclistbox.html *** ./mclistbox.html Tue May 30 19:46:13 2000 --- ../mclistbox_submit/mclistbox.html Tue Jul 23 15:31:46 2002 *************** *** 235,240 **** --- 235,251 ---- A boolean value which determines whether column labels are shown or not.
+ Command-Line Name: -selectcolumn command
+ Database Name: selectColumn
+ Database Class: SelectColumn
+
+
+
+ Specifies behavior of selection. If -selectcolumn is set to 1 and -selectmode is set to single, + then only one cell instead of hole line is highlighted upon click. Default value is 0. + + +
Command-Line Name: -selectcommand command
Database Name: selectCommand
Database Class: Command
***************
*** 269,274 ****
--- 280,300 ----
of the option may be arbitrary, but the default bindings expect it to be
either single, browse, multiple, or extended; the default value is browse.
+
+
+ Command-Line Name: -usecolumnxscroll
+ Database Name: usecolumnXscroll
+ Database Class: UseColumnXscroll
+
+
+
+ Specifies whether xscrollbars appear on bottom of columns. + If set to 1, then xscrollbars are added to the bottom of each column. + An xscrollbar of a column is visible if corresponding column option -usexscroll is set to 1 + (default value), otherwise it is invisible. Default is 0. + + +
*************** *** 415,420 **** --- 441,452 ---- the desired width for the window is made just large enough to hold all the elements in the listbox. +
+ Specifies whether corresponding xscrollbar is visible. + This option works only if -usecolumnxscroll is set to 1. If the value is 1, + it makes corresponding xscrollbar visible. Default value is 1. +
*************** *** 454,464 **** --- 486,506 ---- to fill all of the columns, blank values will be used to fill in the missing columns. +
+ Allows one to configure any given cell of a mclistbox. The arguments index and column specify a cell to be configures. + list argument is a set of option-value pairs as in the listbox command itemconfigure. +
This command associates command with a column label such that whenever the event sequence given by sequence occurs over the label for the column named name the command will be invoked. This widget command is similar to the bind command except that it operates on column labels rather than the entire widget. See the bind manual entry for complete details on the syntax of sequence and the substitutions performed on command before invoking it. + +
+ This command adjusts widths of columns according to set fonts of all mclistboxes in active an application. This function is supposed to be called after any font change. +
diff -c ./mclistbox.tcl ../mclistbox_submit/mclistbox.tcl
*** ./mclistbox.tcl Fri Sep 7 12:59:48 2001
--- ../mclistbox_submit/mclistbox.tcl Thu Jul 25 15:33:16 2002
***************
*** 47,52 ****
--- 47,55 ----
variable widgetCommands
variable columnCommands
variable labelCommands
+
+ # this is a list of existed listboxes
+ variable listboxesList
}
# ::mclistbox::Init --
***************
*** 111,116 ****
--- 114,120 ----
-resizablecolumns {resizableColumns ResizableColumns} \
-selectbackground {selectBackground Foreground} \
-selectborderwidth {selectBorderWidth BorderWidth} \
+ -selectcolumn {selectColumn SelectColumn} \
-selectcommand {selectCommand Command} \
-selectforeground {selectForeground Background} \
-selectmode {selectMode SelectMode} \
***************
*** 120,125 ****
--- 124,130 ----
-width {width Width} \
-xscrollcommand {xScrollCommand ScrollCommand} \
-yscrollcommand {yScrollCommand ScrollCommand} \
+ -usecolumnxscroll {usecolumnXscroll UseColumnXscroll} \
-iseditableindexcommand \
{isEditableIndexCommand IsEditableIndexCommand} \
]
***************
*** 155,160 ****
--- 160,166 ----
-editable {editable Editable} \
-editcommand {editcommand Editcommand} \
-listvar {listvar Listvar} \
+ -usexscroll {usexscroll UseXscroll} \
]
# this defines the valid widget commands. It's important to
***************
*** 164,170 ****
activate bbox cget column configure \
curselection delete edit editcombo get index \
insert label nearest scan see \
! selection size xview yview
]
set columnCommands [list add cget configure delete names nearest x]
--- 170,176 ----
activate bbox cget column configure \
curselection delete edit editcombo get index \
insert label nearest scan see \
! selection size xview yview itemconfigure
]
set columnCommands [list add cget configure delete names nearest x]
***************
*** 235,240 ****
--- 241,248 ----
option add *Mclistbox.fillcolumn {} widgetDefault
option add *Mclistbox.iseditableindexcommand {} widgetDefault
option add *Mclistbox.state normal widgetDefault
+ option add *Mclistbox.usecolumnXscroll 0 widgetDefault
+ option add *Mclistbox.selectColumn 0 widgetDefault
# Bwidget stuff
option add *Mclistbox.dragEndCmd {} widgetDefault
***************
*** 260,265 ****
--- 268,274 ----
0 widgetDefault
option add *Mclistbox*MclistboxColumn.editcommand \
"" widgetDefault
+ option add *Mclistbox*MclistboxColumn.usexscroll 1 widgetDefault
}
######################################################################
***************
*** 290,295 ****
--- 299,305 ----
proc ::mclistbox::mclistbox {args} {
variable widgetOptions
+ variable listboxesList
# perform a one time initialization
if {![info exists widgetOptions]} {
***************
*** 314,319 ****
--- 324,331 ----
# build it...
set w [eval Build $args]
+ # register the widget in the listboxes list
+ lappend listboxesList $w
# set some bindings...
SetBindings $w
***************
*** 748,753 ****
--- 760,770 ----
-class MclistboxColumn \
-background $options(-background) \
]
+ scrollbar $frame.xscroll -orient horizontal
+ set misc(columnxscroll_args) [ list -elementborderwidth -relief -highlightbackground -highlightcolor -activebackground ]
+ foreach name $misc(columnxscroll_args) {
+ set misc(columnxscroll,$name) [ $frame.xscroll cget $name ]
+ }
set label \
[label $frame.label \
***************
*** 819,831 ****
# geometry propagation must be off so we can control the size
# of the listbox by setting the size of the containing frame
pack propagate $frame off
!
pack $label -side top -fill x -expand n
pack $listbox -side top -fill both -expand y -pady 2
# any events that happen in the listbox gets handled by the class
# bindings. This has the unfortunate side effect
! bindtags $listbox [list $w Mclistbox all]
# Make the listbox a bwidget drag and drop site, if we have bwidgets
if { $::mclistbox::bwidget } {
if { $options(-dragenabled) } {
--- 836,851 ----
# geometry propagation must be off so we can control the size
# of the listbox by setting the size of the containing frame
pack propagate $frame off
! if { $options(-usecolumnxscroll) } {
! pack $frame.xscroll -side bottom -fill x -expand 0 -anchor s
! }
pack $label -side top -fill x -expand n
pack $listbox -side top -fill both -expand y -pady 2
# any events that happen in the listbox gets handled by the class
# bindings. This has the unfortunate side effect
! bind $listbox