head	1.4;
access;
symbols
	core-8-5-9:1.3
	core-8-5-8:1.3
	macosx-cocoa-merge:1.4
	macosx-cocoa-premerge:1.4
	macosx-carbon-freeze:1.4
	core-8-5-7:1.3
	core-8-5-6:1.3
	core-8-6-b1:1.4
	core-8-6-a3:1.3
	core-8-5-5:1.3
	core-8-6-a2:1.3
	core-8-5-4:1.3
	core-8-5-3:1.3
	core-8-6-a1:1.3
	core-8-5-branch:1.3.0.2
	core-8-5-2:1.3
	core-8-5-1:1.3
	core-8-5-0:1.3
	core-8-5-b3:1.2
	core-8-5-b2:1.2
	core-stabilizer-branch:1.2.0.2
	core-stabilizer-merge:1.3;
locks; strict;
comment	@# @;


1.4
date	2008.12.11.18.13.08;	author jenglish;	state Exp;
branches;
next	1.3;

1.3
date	2007.12.13.15.27.07;	author dgp;	state Exp;
branches;
next	1.2;

1.2
date	2007.10.23.06.31.16;	author das;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	2007.10.22.14.21.10;	author dkf;	state Exp;
branches;
next	;

1.2.2.1
date	2007.10.23.06.31.16;	author dgp;	state dead;
branches;
next	1.2.2.2;

1.2.2.2
date	2007.10.24.12.59.33;	author dgp;	state Exp;
branches;
next	;


desc
@@


1.4
log
@library/demos/*.tcl: Omit contraindicated [package require Ttk].
Remove logic that switches [ttk::scrollbar]s to [tk::scrollbar]s
based on [tk windowingsystem]; this is already handled in
library/ttk/scrollbar.tcl.
@
text
@# combo.tcl --
#
# This demonstration script creates several combobox widgets.
#
# RCS: @@(#) $Id: combo.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp $

if {![info exists widgetDemo]} {
    error "This script should be run from the \"widget\" demo."
}

package require Tk

set w .combo
catch {destroy $w}
toplevel $w
wm title $w "Combobox Demonstration"
wm iconname $w "combo"
positionWindow $w

ttk::label $w.msg -font $font -wraplength 5i -justify left -text "Three different\
	combo-boxes are displayed below. You can add characters to the first\
	one by pointing, clicking and typing, just as with an entry; pressing\
	Return will cause the current value to be added to the list that is\
	selectable from the drop-down list, and you can choose other values\
	by pressing the Down key, using the arrow keys to pick another one,\
	and pressing Return again. The second combo-box is fixed to a\
	particular value, and cannot be modified at all. The third one only\
	allows you to select values from its drop-down list of Australian\
	cities."
pack $w.msg -side top -fill x

## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w {firstValue secondValue ozCity}]
pack $btns -side bottom -fill x

ttk::frame $w.f
pack $w.f -fill both -expand 1
set w $w.f

set australianCities {
    Canberra Sydney Melbourne Perth Adelaide Brisbane
    Hobart Darwin "Alice Springs"
}
set secondValue unchangable
set ozCity Sydney

ttk::labelframe $w.c1 -text "Fully Editable"
ttk::combobox $w.c1.c -textvariable firstValue
ttk::labelframe $w.c2 -text Disabled
ttk::combobox $w.c2.c -textvariable secondValue -state disabled
ttk::labelframe $w.c3 -text "Defined List Only"
ttk::combobox $w.c3.c -textvariable ozCity -state readonly \
	-values $australianCities
bind $w.c1.c <Return> {
    if {[%W get] ni [%W cget -values]} {
	%W configure -values [concat [%W cget -values] [list [%W get]]]
    }
}

pack $w.c1 $w.c2 $w.c3 -side top -pady 5 -padx 10
pack $w.c1.c -pady 5 -padx 10
pack $w.c2.c -pady 5 -padx 10
pack $w.c3.c -pady 5 -padx 10
@


1.3
log
@merge stable branch onto HEAD
@
text
@d5 1
a5 1
# RCS: @@(#) $Id: combo.tcl,v 1.2.2.2 2007/10/24 12:59:33 dgp Exp $
a11 1
package require Ttk
@


1.2
log
@	* library/demos/combo.tcl:	Aqua GOOBE.
	* library/demos/toolbar.tcl:
	* library/demos/tree.tcl:
	* library/demos/ttknote.tcl:
	* library/demos/ttkprogress.tcl:
	* library/demos/widget:
@
text
@d5 1
a5 1
# RCS: @@(#) $Id: combo.tcl,v 1.1 2007/10/22 14:21:10 dkf Exp $
@


1.2.2.1
log
@file combo.tcl was added on branch core-stabilizer-branch on 2007-10-24 12:59:33 +0000
@
text
@d1 64
@


1.2.2.2
log
@merge updates from HEAD
@
text
@a0 64
# combo.tcl --
#
# This demonstration script creates several combobox widgets.
#
# RCS: @@(#) $Id: combo.tcl,v 1.2 2007/10/23 06:31:16 das Exp $

if {![info exists widgetDemo]} {
    error "This script should be run from the \"widget\" demo."
}

package require Tk
package require Ttk

set w .combo
catch {destroy $w}
toplevel $w
wm title $w "Combobox Demonstration"
wm iconname $w "combo"
positionWindow $w

ttk::label $w.msg -font $font -wraplength 5i -justify left -text "Three different\
	combo-boxes are displayed below. You can add characters to the first\
	one by pointing, clicking and typing, just as with an entry; pressing\
	Return will cause the current value to be added to the list that is\
	selectable from the drop-down list, and you can choose other values\
	by pressing the Down key, using the arrow keys to pick another one,\
	and pressing Return again. The second combo-box is fixed to a\
	particular value, and cannot be modified at all. The third one only\
	allows you to select values from its drop-down list of Australian\
	cities."
pack $w.msg -side top -fill x

## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w {firstValue secondValue ozCity}]
pack $btns -side bottom -fill x

ttk::frame $w.f
pack $w.f -fill both -expand 1
set w $w.f

set australianCities {
    Canberra Sydney Melbourne Perth Adelaide Brisbane
    Hobart Darwin "Alice Springs"
}
set secondValue unchangable
set ozCity Sydney

ttk::labelframe $w.c1 -text "Fully Editable"
ttk::combobox $w.c1.c -textvariable firstValue
ttk::labelframe $w.c2 -text Disabled
ttk::combobox $w.c2.c -textvariable secondValue -state disabled
ttk::labelframe $w.c3 -text "Defined List Only"
ttk::combobox $w.c3.c -textvariable ozCity -state readonly \
	-values $australianCities
bind $w.c1.c <Return> {
    if {[%W get] ni [%W cget -values]} {
	%W configure -values [concat [%W cget -values] [list [%W get]]]
    }
}

pack $w.c1 $w.c2 $w.c3 -side top -pady 5 -padx 10
pack $w.c1.c -pady 5 -padx 10
pack $w.c2.c -pady 5 -padx 10
pack $w.c3.c -pady 5 -padx 10
@


1.1
log
@More widget demos!
@
text
@d5 1
a5 1
# RCS: @@(#) $Id$
d21 1
a21 1
label $w.msg -font $font -wraplength 5i -justify left -text "Three different\
d31 1
a31 1
pack $w.msg -side top
d37 4
@

