From d885238959da09235e9f2f73eb4d2357fc76a450 Mon Sep 17 00:00:00 2001 From: hobbs Date: Tue, 30 Oct 2007 01:57:54 +0000 Subject: * tests/listbox.test, tests/panedwindow.test, tests/scrollbar.test: * library/bgerror.tcl, library/dialog.tcl, library/listbox.tcl: * library/msgbox.tcl, library/optMenu.tcl, library/tclIndex: * library/tkfbox.tcl, library/demos/floor.tcl, library/demos/rmt: * library/demos/tcolor, library/demos/text.tcl: * library/demos/twind.tcl, library/demos/widget: Buh-bye Motif look * library/ttk/fonts.tcl: Update of Tk default look in 8.5 * macosx/tkMacOSXDefault.h: Trims border sizes, cleaner X11 look * unix/tkUnixDefault.h: with minor modifications for Win32/Aqua. * win/tkWinDefault.h: Uses Tk*Font definitions throughout for * win/tkWinFont.c: classic widgets. [Bug #1820344] * library/obsolete.tcl (::tk::classic::restore): This restores changes made to defaults in 8.5 using the 'option' command, segmented into logical groups. --- ChangeLog | 15 +++++ doc/listbox.n | 6 +- library/bgerror.tcl | 137 +++++++++++++++++----------------------- library/demos/floor.tcl | 28 ++++----- library/demos/rmt | 4 +- library/demos/tcolor | 17 ++--- library/demos/text.tcl | 6 +- library/demos/twind.tcl | 9 +-- library/demos/widget | 29 ++++----- library/dialog.tcl | 8 +-- library/listbox.tcl | 12 +++- library/msgbox.tcl | 13 ++-- library/obsolete.tcl | 159 ++++++++++++++++++++++++++++++++++++++++++++++- library/optMenu.tcl | 4 +- library/tclIndex | 1 + library/tkfbox.tcl | 9 ++- library/ttk/fonts.tcl | 4 +- macosx/tkMacOSXDefault.h | 47 +++++++------- tests/listbox.test | 14 ++--- tests/panedwindow.test | 18 +++--- tests/scrollbar.test | 4 +- unix/tkUnixDefault.h | 91 +++++++++++---------------- win/tkWinDefault.h | 45 +++++++------- win/tkWinFont.c | 17 ++--- 24 files changed, 405 insertions(+), 292 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c82304..e6a284c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 2007-10-29 Jeff Hobbs + * tests/listbox.test, tests/panedwindow.test, tests/scrollbar.test: + * library/bgerror.tcl, library/dialog.tcl, library/listbox.tcl: + * library/msgbox.tcl, library/optMenu.tcl, library/tclIndex: + * library/tkfbox.tcl, library/demos/floor.tcl, library/demos/rmt: + * library/demos/tcolor, library/demos/text.tcl: + * library/demos/twind.tcl, library/demos/widget: Buh-bye Motif look + * library/ttk/fonts.tcl: Update of Tk default look in 8.5 + * macosx/tkMacOSXDefault.h: Trims border sizes, cleaner X11 look + * unix/tkUnixDefault.h: with minor modifications for Win32/Aqua. + * win/tkWinDefault.h: Uses Tk*Font definitions throughout for + * win/tkWinFont.c: classic widgets. [Bug #1820344] + * library/obsolete.tcl (::tk::classic::restore): This restores + changes made to defaults in 8.5 using the 'option' command, + segmented into logical groups. + * tests/winfo.test: winfo-4.5 raise .t to above . for Windows * tests/unixWm.test: note TIP#142 results and remove unnecessary diff --git a/doc/listbox.n b/doc/listbox.n index 117245a..3441e44 100644 --- a/doc/listbox.n +++ b/doc/listbox.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: listbox.n,v 1.15 2007/10/29 16:04:13 dkf Exp $ +'\" RCS: @(#) $Id: listbox.n,v 1.16 2007/10/30 01:57:54 hobbs Exp $ '\" .so man.macros .TH listbox n 8.4 Tk "Tk Built-In Commands" @@ -420,6 +420,10 @@ In both modes, clicking button 1 on an element selects it and deselects any other selected item. In \fBbrowse\fR mode it is also possible to drag the selection with button 1. +.VS 8.5 +On button 1, the listbox will also take focus if it has a \fBnormal\fR +state and \fB\-takefocus\fR is true. +.VE 8.5 .PP If the selection mode is \fBmultiple\fR or \fBextended\fR, any number of elements may be selected at once, including discontiguous diff --git a/library/bgerror.tcl b/library/bgerror.tcl index 0879a71..06d707d 100644 --- a/library/bgerror.tcl +++ b/library/bgerror.tcl @@ -7,10 +7,10 @@ # Donal K. Fellows. # # Copyright (c) 1998-2000 by Ajuba Solutions. -# All rights reserved. -# -# RCS: @(#) $Id: bgerror.tcl,v 1.34 2007/05/30 06:34:18 das Exp $ -# $Id: bgerror.tcl,v 1.34 2007/05/30 06:34:18 das Exp $ +# Copyright (c) 2007 by ActiveState Software Inc. +# +# RCS: @(#) $Id: bgerror.tcl,v 1.35 2007/10/30 01:57:54 hobbs Exp $ +# $Id: bgerror.tcl,v 1.35 2007/10/30 01:57:54 hobbs Exp $ namespace eval ::tk::dialog::error { namespace import -force ::tk::msgcat::* @@ -18,6 +18,7 @@ namespace eval ::tk::dialog::error { option add *ErrorDialog.function.text [mc "Save To Log"] \ widgetDefault option add *ErrorDialog.function.command [namespace code SaveToLog] + option add *ErrorDialog*Label.font TkCaptionFont widgetDefault if {[tk windowingsystem] eq "aqua"} { option add *ErrorDialog*background systemAlertBackgroundActive \ widgetDefault @@ -42,7 +43,7 @@ proc ::tk::dialog::error::Details {} { if { ($caption eq "") || ($command eq "") } { grid forget $w.function } - lappend command [.bgerrorDialog.top.info.text get 1.0 end-1c] + lappend command [$w.top.info.text get 1.0 end-1c] $w.function configure -text $caption -command $command grid $w.top.info - -sticky nsew -padx 3m -pady 3m } @@ -96,18 +97,11 @@ proc ::tk::dialog::error::bgerror err { # we use the default dialog then : set windowingsystem [tk windowingsystem] if {$windowingsystem eq "aqua"} { - set ok [mc Ok] - set messageFont system - set textRelief flat - set textHilight 0 + set ok [mc Ok] } else { - set ok [mc OK] - set messageFont {Times -18} - set textRelief sunken - set textHilight 1 + set ok [mc OK] } - # Truncate the message if it is too wide (>maxLine characters) or # too tall (>4 lines). Truncation occurs at the first point at # which one of those conditions is met. @@ -128,47 +122,40 @@ proc ::tk::dialog::error::bgerror err { incr lines } - set w .bgerrorDialog set title [mc "Application Error"] set text [mc "Error: %1\$s" $displayedErr] set buttons [list ok $ok dismiss [mc "Skip Messages"] \ - function [mc "Details >>"]] + function [mc "Details >>"]] # 1. Create the top-level window and divide it into top # and bottom parts. - destroy .bgerrorDialog - toplevel .bgerrorDialog -class ErrorDialog - wm withdraw .bgerrorDialog - wm title .bgerrorDialog $title - wm iconname .bgerrorDialog ErrorDialog - wm protocol .bgerrorDialog WM_DELETE_WINDOW { } + set dlg .bgerrorDialog + destroy $dlg + toplevel $dlg -class ErrorDialog + wm withdraw $dlg + wm title $dlg $title + wm iconname $dlg ErrorDialog + wm protocol $dlg WM_DELETE_WINDOW { } if {$windowingsystem eq "aqua"} { - ::tk::unsupported::MacWindowStyle style .bgerrorDialog moveableAlert {} + ::tk::unsupported::MacWindowStyle style $dlg moveableAlert {} } - frame .bgerrorDialog.bot - frame .bgerrorDialog.top + frame $dlg.bot + frame $dlg.top if {$windowingsystem eq "x11"} { - .bgerrorDialog.bot configure -relief raised -bd 1 - .bgerrorDialog.top configure -relief raised -bd 1 + $dlg.bot configure -relief raised -bd 1 + $dlg.top configure -relief raised -bd 1 } - pack .bgerrorDialog.bot -side bottom -fill both - pack .bgerrorDialog.top -side top -fill both -expand 1 - - set W [frame $w.top.info] - text $W.text \ - -yscrollcommand [list $W.scroll set]\ - -setgrid true \ - -width 40 \ - -height 10 \ - -state normal \ - -relief $textRelief \ - -highlightthickness $textHilight \ - -wrap char - if {$windowingsystem eq "aqua"} { - $W.text configure -width 80 -background white + pack $dlg.bot -side bottom -fill both + pack $dlg.top -side top -fill both -expand 1 + + set W [frame $dlg.top.info] + text $W.text -setgrid true -height 10 -wrap char \ + -yscrollcommand [list $W.scroll set] + if {$windowingsystem ne "aqua"} { + $W.text configure -width 40 } scrollbar $W.scroll -command [list $W.text yview] @@ -182,80 +169,68 @@ proc ::tk::dialog::error::bgerror err { # 2. Fill the top part with bitmap and message # Max-width of message is the width of the screen... - set wrapwidth [winfo screenwidth .bgerrorDialog] + set wrapwidth [winfo screenwidth $dlg] # ...minus the width of the icon, padding and a fudge factor for # the window manager decorations and aesthetics. - set wrapwidth [expr {$wrapwidth-60-[winfo pixels .bgerrorDialog 9m]}] - label .bgerrorDialog.msg -justify left -text $text -font $messageFont \ - -wraplength $wrapwidth + set wrapwidth [expr {$wrapwidth-60-[winfo pixels $dlg 9m]}] + label $dlg.msg -justify left -text $text -wraplength $wrapwidth if {$windowingsystem eq "aqua"} { # On the Macintosh, use the stop bitmap - label .bgerrorDialog.bitmap -bitmap stop + label $dlg.bitmap -bitmap stop } else { # On other platforms, make the error icon - canvas .bgerrorDialog.bitmap -width 32 -height 32 -highlightthickness 0 - .bgerrorDialog.bitmap create oval 0 0 31 31 -fill red -outline black - .bgerrorDialog.bitmap create line 9 9 23 23 -fill white -width 4 - .bgerrorDialog.bitmap create line 9 23 23 9 -fill white -width 4 + canvas $dlg.bitmap -width 32 -height 32 -highlightthickness 0 + $dlg.bitmap create oval 0 0 31 31 -fill red -outline black + $dlg.bitmap create line 9 9 23 23 -fill white -width 4 + $dlg.bitmap create line 9 23 23 9 -fill white -width 4 } - grid .bgerrorDialog.bitmap .bgerrorDialog.msg \ - -in .bgerrorDialog.top \ - -row 0 \ - -padx 3m \ - -pady 3m - grid configure .bgerrorDialog.msg -sticky nsw -padx {0 3m} - grid rowconfigure .bgerrorDialog.top 1 -weight 1 - grid columnconfigure .bgerrorDialog.top 1 -weight 1 + grid $dlg.bitmap $dlg.msg -in $dlg.top -row 0 -padx 3m -pady 3m + grid configure $dlg.msg -sticky nsw -padx {0 3m} + grid rowconfigure $dlg.top 1 -weight 1 + grid columnconfigure $dlg.top 1 -weight 1 # 3. Create a row of buttons at the bottom of the dialog. set i 0 foreach {name caption} $buttons { - button .bgerrorDialog.$name \ - -text $caption \ - -default normal \ + button $dlg.$name -text $caption -default normal \ -command [namespace code [list set button $i]] - grid .bgerrorDialog.$name \ - -in .bgerrorDialog.bot \ - -column $i \ - -row 0 \ - -sticky ew \ - -padx 10 - grid columnconfigure .bgerrorDialog.bot $i -weight 1 + grid $dlg.$name -in $dlg.bot -column $i -row 0 -sticky ew -padx 10 + grid columnconfigure $dlg.bot $i -weight 1 # We boost the size of some Mac buttons for l&f if {$windowingsystem eq "aqua"} { if {($name eq "ok") || ($name eq "dismiss")} { - grid columnconfigure .bgerrorDialog.bot $i -minsize 90 + grid columnconfigure $dlg.bot $i -minsize 90 } - grid configure .bgerrorDialog.$name -pady 7 + grid configure $dlg.$name -pady 7 } incr i } # The "OK" button is the default for this dialog. - .bgerrorDialog.ok configure -default active + $dlg.ok configure -default active - bind .bgerrorDialog [namespace code Return] - bind .bgerrorDialog [namespace code [list Destroy %W]] - .bgerrorDialog.function configure -command [namespace code Details] + bind $dlg [namespace code Return] + bind $dlg [namespace code [list Destroy %W]] + $dlg.function configure -command [namespace code Details] # 6. Place the window (centered in the display) and deiconify it. - ::tk::PlaceWindow .bgerrorDialog + ::tk::PlaceWindow $dlg # 7. Ensure that we are topmost. - raise .bgerrorDialog + raise $dlg if {$tcl_platform(platform) eq "windows"} { # Place it topmost if we aren't at the top of the stacking # order to ensure that it's seen - if {[lindex [wm stackorder .] end] ne ".bgerrorDialog"} { - wm attributes .bgerrorDialog -topmost 1 + if {[lindex [wm stackorder .] end] ne "$dlg"} { + wm attributes $dlg -topmost 1 } } # 8. Set a grab and claim the focus too. - ::tk::SetFocusGrab .bgerrorDialog .bgerrorDialog.ok + ::tk::SetFocusGrab $dlg $dlg.ok # 9. Wait for the user to respond, then restore the focus and # return the index of the selected button. Restore the focus @@ -266,7 +241,7 @@ proc ::tk::dialog::error::bgerror err { vwait [namespace which -variable button] set copy $button; # Save a copy... - ::tk::RestoreFocusGrab .bgerrorDialog .bgerrorDialog.ok destroy + ::tk::RestoreFocusGrab $dlg $dlg.ok destroy if {$copy == 1} { return -code break diff --git a/library/demos/floor.tcl b/library/demos/floor.tcl index 5784db3..f1004b5 100644 --- a/library/demos/floor.tcl +++ b/library/demos/floor.tcl @@ -3,7 +3,7 @@ # This demonstration script creates a canvas widet that displays the # floorplan for DEC's Western Research Laboratory. # -# RCS: @(#) $Id: floor.tcl,v 1.6 2004/12/21 11:56:35 dkf Exp $ +# RCS: @(#) $Id: floor.tcl,v 1.7 2007/10/30 01:57:54 hobbs Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -1309,28 +1309,26 @@ pack $btns -side bottom -fill x set f [frame $w.frame] pack $f -side top -fill both -expand yes -set h [scrollbar $f.hscroll -highlightthickness 0 -orient horizontal] -set v [scrollbar $f.vscroll -highlightthickness 0 -orient vertical] -set f1 [frame $f.f1 -bd 2 -relief sunken] -set c [canvas $f1.c -width 900 -height 500 -borderwidth 0 \ - -highlightthickness 0 -xscrollcommand "$h set" -yscrollcommand "$v set"] +set h [scrollbar $f.hscroll -orient horizontal] +set v [scrollbar $f.vscroll -orient vertical] +set f1 [frame $f.f1 -borderwidth 2 -relief sunken] +set c [canvas $f1.c -width 900 -height 500 -highlightthickness 0 \ + -xscrollcommand [list $h set] \ + -yscrollcommand [list $v set]] pack $c -expand yes -fill both -grid $f1 -padx 1 -pady 1 \ - -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news -grid $v -padx 1 -pady 1 \ - -row 0 -column 1 -rowspan 1 -columnspan 1 -sticky news -grid $h -padx 1 -pady 1 \ - -row 1 -column 0 -rowspan 1 -columnspan 1 -sticky news +grid $f1 -padx 1 -pady 1 -row 0 -column 0 -rowspan 1 -columnspan 1 -sticky news +grid $v -padx 1 -pady 1 -row 0 -column 1 -rowspan 1 -columnspan 1 -sticky news +grid $h -padx 1 -pady 1 -row 1 -column 0 -rowspan 1 -columnspan 1 -sticky news grid rowconfig $f 0 -weight 1 -minsize 0 grid columnconfig $f 0 -weight 1 -minsize 0 pack $f -expand yes -fill both -padx 1 -pady 1 -$v config -command "$c yview" -$h config -command "$c xview" +$v configure -command [list $c yview] +$h configure -command [list $c xview] # Create an entry for displaying and typing in current room. -entry $c.entry -width 10 -relief sunken -bd 2 -textvariable currentRoom +entry $c.entry -width 10 -textvariable currentRoom # Choose colors, then fill in the floorplan. diff --git a/library/demos/rmt b/library/demos/rmt index 0e14cdb..026c35d 100644 --- a/library/demos/rmt +++ b/library/demos/rmt @@ -7,7 +7,7 @@ exec wish "$0" "$@" # Tk applications. It allows you to select an application and # then type commands to that application. # -# RCS: @(#) $Id: rmt,v 1.4 2003/09/30 14:54:30 dkf Exp $ +# RCS: @(#) $Id: rmt,v 1.5 2007/10/30 01:57:54 hobbs Exp $ package require Tcl 8.4 package require Tk @@ -45,7 +45,7 @@ menu .menu.file.apps -postcommand fillAppsMenu # Create text window and scrollbar. -text .t -relief sunken -bd 2 -yscrollcommand ".s set" -setgrid true +text .t -yscrollcommand ".s set" -setgrid true scrollbar .s -command ".t yview" grid .t .s -sticky nsew grid rowconfigure . 0 -weight 1 diff --git a/library/demos/tcolor b/library/demos/tcolor index c94d459..deb893d 100644 --- a/library/demos/tcolor +++ b/library/demos/tcolor @@ -7,7 +7,7 @@ exec wish "$0" "$@" # create colors using either the RGB, HSB, or CYM color spaces # and apply the color to existing applications. # -# RCS: @(#) $Id: tcolor,v 1.4 2003/09/30 14:54:30 dkf Exp $ +# RCS: @(#) $Id: tcolor,v 1.5 2007/10/30 01:57:55 hobbs Exp $ package require Tk 8.4 wm title . "Color Editor" @@ -42,10 +42,6 @@ set updating 0 set autoUpdate 1 set name "" -if {$tcl_platform(platform) eq "unix"} { - option add *Entry.background white -} - # Create the menu bar at the top of the window. . configure -menu [menu .menu] @@ -69,8 +65,7 @@ menu .menu.file # with the update button. labelframe .command -text "Command:" -padx {1m 0} -entry .command.e -relief sunken -borderwidth 2 -textvariable command \ - -font {Courier 12} +entry .command.e -textvariable command button .command.update -text Update -command doUpdate pack .command.update -side right -pady .1c -padx {.25c 0} pack .command.e -expand yes -fill x -ipadx 0.25c @@ -96,12 +91,11 @@ foreach i { grid .names -row 0 -column 0 -sticky nsew -padx .15c -pady .15c -rowspan 2 grid columnconfigure . 0 -weight 1 listbox .names.lb -width 20 -height 12 -yscrollcommand ".names.s set" \ - -relief sunken -borderwidth 2 -exportselection false + -exportselection false bind .names.lb { tc_loadNamedColor [.names.lb get [.names.lb curselection]] } - scrollbar .names.s -orient vertical -command ".names.lb yview" \ - -relief sunken -borderwidth 2 + scrollbar .names.s -orient vertical -command ".names.lb yview" pack .names.lb .names.s -side left -fill y -expand 1 while {[gets $f line] >= 0} { if {[regexp {^\s*\d+\s+\d+\s+\d+\s+(\S+)$} $line -> col]} { @@ -127,8 +121,7 @@ foreach i {1 2 3} { grid .adjust -row 0 -column 1 -sticky nsew -padx .15c -pady .15c labelframe .name -text "Name:" -padx 1m -pady 1m -entry .name.e -relief sunken -borderwidth 2 -textvariable name -width 10 \ - -font {Courier 12} +entry .name.e -textvariable name -width 10 pack .name.e -side right -expand 1 -fill x bind .name.e {tc_loadNamedColor $name} grid .name -column 1 -row 1 -sticky nsew -padx .15c -pady .15c diff --git a/library/demos/text.tcl b/library/demos/text.tcl index 4bb1155..96bda1d 100644 --- a/library/demos/text.tcl +++ b/library/demos/text.tcl @@ -3,7 +3,7 @@ # This demonstration script creates a text widget that describes # the basic editing functions. # -# RCS: @(#) $Id: text.tcl,v 1.6 2004/12/21 11:56:35 dkf Exp $ +# RCS: @(#) $Id: text.tcl,v 1.7 2007/10/30 01:57:55 hobbs Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -22,9 +22,9 @@ positionWindow $w set btns [addSeeDismiss $w.buttons $w] pack $btns -side bottom -fill x -text $w.text -relief sunken -bd 2 -yscrollcommand "$w.scroll set" -setgrid 1 \ +text $w.text -yscrollcommand [list $w.scroll set] -setgrid 1 \ -height 30 -undo 1 -autosep 1 -scrollbar $w.scroll -command "$w.text yview" +scrollbar $w.scroll -command [list $w.text yview] pack $w.scroll -side right -fill y pack $w.text -expand yes -fill both $w.text insert 0.0 \ diff --git a/library/demos/twind.tcl b/library/demos/twind.tcl index b2d35dd..b3a17d8 100644 --- a/library/demos/twind.tcl +++ b/library/demos/twind.tcl @@ -3,7 +3,7 @@ # This demonstration script creates a text widget with a bunch of # embedded windows. # -# RCS: @(#) $Id: twind.tcl,v 1.9 2007/10/15 21:06:17 dkf Exp $ +# RCS: @(#) $Id: twind.tcl,v 1.10 2007/10/30 01:57:55 hobbs Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -22,7 +22,7 @@ positionWindow $w set btns [addSeeDismiss $w.buttons $w] pack $btns -side bottom -fill x -frame $w.f -highlightthickness 2 -borderwidth 2 -relief sunken +frame $w.f -highlightthickness 1 -borderwidth 1 -relief sunken set t $w.f.text text $t -yscrollcommand "$w.scroll set" -setgrid true -font $font -width 70 \ -height 35 -wrap word -highlightthickness 0 -borderwidth 0 @@ -301,8 +301,9 @@ proc textMakePeer {parent} { while {[winfo exists .peer$n]} { incr n } set w [toplevel .peer$n] wm title $w "Text Peer #$n" - frame $w.f -highlightthickness 2 -borderwidth 2 -relief sunken - set t [$parent peer create $w.f.text -yscrollcommand "$w.scroll set"] + frame $w.f -highlightthickness 1 -borderwidth 1 -relief sunken + set t [$parent peer create $w.f.text -yscrollcommand "$w.scroll set" \ + -borderwidth 0 -highlightthickness 0] pack $t -expand yes -fill both scrollbar $w.scroll -command "$t yview" pack $w.scroll -side right -fill y diff --git a/library/demos/widget b/library/demos/widget index b6b633b..666bc95 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -10,7 +10,7 @@ exec wish "$0" "$@" # separate ".tcl" files is this directory, which are sourced by this script as # needed. # -# RCS: @(#) $Id: widget,v 1.40 2007/10/23 06:31:16 das Exp $ +# RCS: @(#) $Id: widget,v 1.41 2007/10/30 01:57:55 hobbs Exp $ package require Tcl 8.5 package require Tk 8.5 @@ -35,7 +35,7 @@ if {[tk windowingsystem] eq "x11"} { if {"defaultFont" ni [font names]} { # TIP #145 defines some standard named fonts if {"TkDefaultFont" in [font names] && "TkFixedFont" in [font names]} { - # FIX ME: the following tecnique of cloning the font to copy it works + # FIX ME: the following technique of cloning the font to copy it works # fine but means that if the system font is changed by Tk # cannot update the copied font. font alias might be useful # here -- or fix the app to use TkDefaultFont etc. @@ -145,19 +145,17 @@ if {[tk windowingsystem] ne "aqua"} { pack .statusBar -side bottom -fill x -pady 2 ttk::frame .textFrame -scrollbar .s -orient vertical -command {.t yview} -highlightthickness 0 \ - -takefocus 1 -bd 1 +scrollbar .s -orient vertical -command {.t yview} -takefocus 1 pack .s -in .textFrame -side right -fill y text .t -yscrollcommand {.s set} -wrap word -width 70 -height 30 \ -font mainFont -setgrid 1 -highlightthickness 0 \ - -padx 4 -pady 2 -takefocus 0 -bd 1 + -padx 4 -pady 2 -takefocus 0 pack .t -in .textFrame -expand y -fill both -padx 1 pack .textFrame -expand yes -fill both if {[tk windowingsystem] eq "aqua"} { pack configure .statusBar.lab -padx {10 18} -pady {4 6} pack configure .statusBar -pady 0 - .s configure -bd 0 - .t configure -padx 10 -pady 0 -bd 0 + .t configure -padx 10 -pady 0 } # Create a bunch of tags to use in the text widget, such as those for section @@ -263,7 +261,7 @@ proc addFormattedText {formattedText} { } demo { set description [lassign $values name] - .t insert end "[incr demoCount]. [mc $description]." \ + .t insert end "[incr demoCount]. [mc $description]" \ [list demo demo-$name] if {$new} { .t image create end -image ::img::new -padx 5 @@ -476,7 +474,7 @@ proc showVars {w args} { ttk::label $f.v$var -textvariable $var -anchor w grid $f.n$var $f.v$var -padx 2 -pady 2 -sticky w } - ttk::button $b.ok -width 8 -text [mc "OK"] \ + ttk::button $b.ok -text [mc "OK"] \ -command [list destroy $w] -default active bind $w [list $b.ok invoke] bind $w [list $b.ok invoke] @@ -514,7 +512,7 @@ proc invoke index { .t configure -cursor watch update set demo [string range [lindex $tags $i] 5 end] - uplevel [list source [file join $tk_demoDirectory $demo.tcl]] + uplevel 1 [list source [file join $tk_demoDirectory $demo.tcl]] update .t configure -cursor $cursor @@ -569,17 +567,12 @@ proc showCode w { toplevel $top set t [frame $top.f] - set text [text $t.text -font fixedFont -height 30 -wrap word -bd 1 \ + set text [text $t.text -font fixedFont -height 24 -wrap word \ -xscrollcommand [list $t.xscroll set] \ -yscrollcommand [list $t.yscroll set] \ -setgrid 1 -highlightthickness 0 -pady 2 -padx 3] - scrollbar $t.xscroll -command [list $t.text xview] \ - -highlightthickness 0 -orient horizontal -bd 1 - scrollbar $t.yscroll -command [list $t.text yview] \ - -highlightthickness 0 -orient vertical -bd 1 - if {[tk windowingsystem] eq "aqua"} { - foreach i [list $t.text $t.xscroll $t.yscroll] {$i configure -bd 0} - } + scrollbar $t.xscroll -command [list $t.text xview] -orient horizontal + scrollbar $t.yscroll -command [list $t.text yview] -orient vertical grid $t.text $t.yscroll -sticky news #grid $t.xscroll diff --git a/library/dialog.tcl b/library/dialog.tcl index 0623b89..29593a8 100644 --- a/library/dialog.tcl +++ b/library/dialog.tcl @@ -3,7 +3,7 @@ # This file defines the procedure tk_dialog, which creates a dialog # box containing a bitmap, a message, and one or more buttons. # -# RCS: @(#) $Id: dialog.tcl,v 1.22 2007/05/30 06:34:18 das Exp $ +# RCS: @(#) $Id: dialog.tcl,v 1.23 2007/10/30 01:57:54 hobbs Exp $ # # Copyright (c) 1992-1993 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. @@ -91,11 +91,7 @@ proc ::tk_dialog {w title text bitmap default args} { # overridden by the caller). option add *Dialog.msg.wrapLength 3i widgetDefault - if {$windowingsystem eq "aqua"} { - option add *Dialog.msg.font system widgetDefault - } else { - option add *Dialog.msg.font {Times 12} widgetDefault - } + option add *Dialog.msg.font TkCaptionFont widgetDefault label $w.msg -justify left -text $text pack $w.msg -in $w.top -side right -expand 1 -fill both -padx 3m -pady 3m diff --git a/library/listbox.tcl b/library/listbox.tcl index 27cb114..26f494e 100644 --- a/library/listbox.tcl +++ b/library/listbox.tcl @@ -3,7 +3,7 @@ # This file defines the default bindings for Tk listbox widgets # and provides procedures that help in implementing those bindings. # -# RCS: @(#) $Id: listbox.tcl,v 1.15 2005/09/10 14:53:20 das Exp $ +# RCS: @(#) $Id: listbox.tcl,v 1.16 2007/10/30 01:57:54 hobbs Exp $ # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994-1995 Sun Microsystems, Inc. @@ -35,7 +35,7 @@ bind Listbox <1> { if {[winfo exists %W]} { - tk::ListboxBeginSelect %W [%W index @%x,%y] + tk::ListboxBeginSelect %W [%W index @%x,%y] 1 } } @@ -227,7 +227,7 @@ if {"x11" eq [tk windowingsystem]} { # el - The element for the selection operation (typically the # one under the pointer). Must be in numerical form. -proc ::tk::ListboxBeginSelect {w el} { +proc ::tk::ListboxBeginSelect {w el {focus 1}} { variable ::tk::Priv if {[$w cget -selectmode] eq "multiple"} { if {[$w selection includes $el]} { @@ -243,6 +243,12 @@ proc ::tk::ListboxBeginSelect {w el} { set Priv(listboxPrev) $el } event generate $w <> + # check existence as ListboxSelect may destroy us + if {$focus && [winfo exists $w] + && [string is true -strict [$w cget -takefocus]] + && [$w cget -state] eq "normal"} { + focus $w + } } # ::tk::ListboxMotion -- diff --git a/library/msgbox.tcl b/library/msgbox.tcl index d2980d7..4bbfc92 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -3,7 +3,7 @@ # Implements messageboxes for platforms that do not have native # messagebox support. # -# RCS: @(#) $Id: msgbox.tcl,v 1.31 2007/05/30 06:34:18 das Exp $ +# RCS: @(#) $Id: msgbox.tcl,v 1.32 2007/10/30 01:57:54 hobbs Exp $ # # Copyright (c) 1994-1997 Sun Microsystems, Inc. # @@ -264,7 +264,7 @@ proc ::tk::MessageBox {args} { # if {[winfo viewable [winfo toplevel $data(-parent)]] } { wm transient $w $data(-parent) - } + } if {$windowingsystem eq "aqua"} { ::tk::unsupported::MacWindowStyle style $w moveableModal {} @@ -286,13 +286,8 @@ proc ::tk::MessageBox {args} { option add *Dialog.msg.wrapLength 3i widgetDefault option add *Dialog.dtl.wrapLength 3i widgetDefault - if {$windowingsystem eq "aqua"} { - option add *Dialog.msg.font system widgetDefault - option add *Dialog.dtl.font system widgetDefault - } else { - option add *Dialog.msg.font {Times 14} widgetDefault - option add *Dialog.dtl.font {Times 10} widgetDefault - } + option add *Dialog.msg.font TkCaptionFont widgetDefault + option add *Dialog.dtl.font TkDefaultFont widgetDefault label $w.msg -anchor nw -justify left -text $data(-message) \ -background $bg diff --git a/library/obsolete.tcl b/library/obsolete.tcl index 16a19a1..8c11ca6 100644 --- a/library/obsolete.tcl +++ b/library/obsolete.tcl @@ -3,7 +3,7 @@ # This file contains obsolete procedures that people really shouldn't # be using anymore, but which are kept around for backward compatibility. # -# RCS: @(#) $Id: obsolete.tcl,v 1.2 1998/09/14 18:23:24 stanton Exp $ +# RCS: @(#) $Id: obsolete.tcl,v 1.3 2007/10/30 01:57:54 hobbs Exp $ # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994 Sun Microsystems, Inc. @@ -19,3 +19,160 @@ proc tk_menuBar args {} proc tk_bindForTraversal args {} + +# ::tk::classic::restore -- +# +# Restore the pre-8.5 (Tk classic) look as the widget defaults for classic +# Tk widgets. +# +# The value following an 'option add' call is the new 8.5 value. +# +namespace eval ::tk::classic { + # This may need to be adjusted for some window managers that are + # more aggressive with their own Xdefaults (like KDE and CDE) + variable prio "widgetDefault" +} + +proc ::tk::classic::restore {args} { + # Restore classic (8.4) look to classic Tk widgets + variable prio + + if {[llength $args]} { + foreach what $args { + ::tk::classic::restore_$what + } + } else { + foreach cmd [info procs restore_*] { + $cmd + } + } +} + +proc ::tk::classic::restore_font {args} { + # Many widgets were adjusted from hard-coded defaults to using the + # TIP#145 fonts defined in fonts.tcl (eg TkDefaultFont, TkFixedFont, ...) + # For restoring compatibility, we only correct size and weighting changes, + # as the fonts themselves remained mostly the same. + if {[tk windowingsystem] eq "x11"} { + font configure TkDefaultFont -weight bold ; # normal + font configure TkFixedFont -size -12 ; # -10 + } + # Add these with prio 21 to override value in dialog/msgbox.tcl + if {[tk windowingsystem] eq "aqua"} { + option add *Dialog.msg.font system 21; # TkCaptionFont + option add *Dialog.dtl.font system 21; # TkCaptionFont + option add *ErrorDialog*Label.font system 21; # TkCaptionFont + } else { + option add *Dialog.msg.font {Times 12} 21; # TkCaptionFont + option add *Dialog.dtl.font {Times 10} 21; # TkCaptionFont + option add *ErrorDialog*Label.font {Times -18} 21; # TkCaptionFont + } +} + +proc ::tk::classic::restore_button {args} { + variable prio + if {[tk windowingsystem] eq "x11"} { + foreach cls {Button Radiobutton Checkbutton} { + option add *$cls.borderWidth 2 $prio; # 1 + } + } +} + +proc ::tk::classic::restore_entry {args} { + variable prio + # Entry and Spinbox share core defaults + foreach cls {Entry Spinbox} { + if {[tk windowingsystem] ne "aqua"} { + option add *$cls.borderWidth 2 $prio; # 1 + } + if {[tk windowingsystem] eq "x11"} { + option add *$cls.background "#d9d9d9" $prio; # "white" + option add *$cls.selectBorderWidth 1 $prio; # 0 + } + } +} + +proc ::tk::classic::restore_listbox {args} { + variable prio + if {[tk windowingsystem] ne "win32"} { + option add *Listbox.background "#d9d9d9" $prio; # "white" + option add *Listbox.activeStyle "underline" $prio; # "dotbox" + } + if {[tk windowingsystem] ne "aqua"} { + option add *Listbox.borderWidth 2 $prio; # 1 + } + if {[tk windowingsystem] eq "x11"} { + option add *Listbox.selectBorderWidth 1 $prio; # 0 + } + # Remove focus into Listbox added for 8.5 + bind Listbox <1> { + if {[winfo exists %W]} { + tk::ListboxBeginSelect %W [%W index @%x,%y] + } + } +} + +proc ::tk::classic::restore_menu {args} { + variable prio + if {[tk windowingsystem] eq "x11"} { + option add *Menu.activeBorderWidth 2 $prio; # 1 + option add *Menu.borderWidth 2 $prio; # 1 + } + if {[tk windowingsystem] ne "aqua"} { + option add *Menu.font "TkDefaultFont" $prio; # "TkMenuFont" + } +} + +proc ::tk::classic::restore_menubutton {args} { + variable prio + option add *Menubutton.borderWidth 2 $prio; # 1 +} + +proc ::tk::classic::restore_message {args} { + variable prio + option add *Message.borderWidth 2 $prio; # 1 +} + +proc ::tk::classic::restore_panedwindow {args} { + variable prio + option add *Panedwindow.borderWidth 2 $prio; # 1 + option add *Panedwindow.sashWidth 2 $prio; # 3 + option add *Panedwindow.sashPad 2 $prio; # 0 + option add *Panedwindow.sashRelief raised $prio; # flat + option add *Panedwindow.opaqueResize 0 $prio; # 1 + if {[tk windowingsystem] ne "win32"} { + option add *Panedwindow.showHandle 1 $prio; # 0 + } +} + +proc ::tk::classic::restore_scale {args} { + variable prio + option add *Scale.borderWidth 2 $prio; # 1 + if {[tk windowingsystem] eq "x11"} { + option add *Scale.troughColor "#c3c3c3" $prio; # "#b3b3b3" + } +} + +proc ::tk::classic::restore_scrollbar {args} { + variable prio + if {[tk windowingsystem] eq "x11"} { + option add *Scrollbar.borderWidth 2 $prio; # 1 + option add *Scrollbar.highlightThickness 1 $prio; # 0 + option add *Scrollbar.width 15 $prio; # 11 + option add *Scrollbar.troughColor "#c3c3c3" $prio; # "#b3b3b3" + } +} + +proc ::tk::classic::restore_text {args} { + variable prio + if {[tk windowingsystem] ne "aqua"} { + option add *Text.borderWidth 2 $prio; # 1 + } + if {[tk windowingsystem] eq "win32"} { + option add *Text.font "TkDefaultFont" $prio; # "TkFixedFont" + } + if {[tk windowingsystem] eq "x11"} { + option add *Text.background "#d9d9d9" $prio; # white + option add *Text.selectBorderWidth 1 $prio; # 0 + } +} diff --git a/library/optMenu.tcl b/library/optMenu.tcl index 05b3a45..e0818d9 100644 --- a/library/optMenu.tcl +++ b/library/optMenu.tcl @@ -3,7 +3,7 @@ # This file defines the procedure tk_optionMenu, which creates # an option button and its associated menu. # -# RCS: @(#) $Id: optMenu.tcl,v 1.4 2001/08/01 16:21:11 dgp Exp $ +# RCS: @(#) $Id: optMenu.tcl,v 1.5 2007/10/30 01:57:54 hobbs Exp $ # # Copyright (c) 1994 The Regents of the University of California. # Copyright (c) 1994 Sun Microsystems, Inc. @@ -34,7 +34,7 @@ proc ::tk_optionMenu {w varName firstValue args} { set var $firstValue } menubutton $w -textvariable $varName -indicatoron 1 -menu $w.menu \ - -relief raised -bd 2 -highlightthickness 2 -anchor c \ + -relief raised -highlightthickness 1 -anchor c \ -direction flush menu $w.menu -tearoff 0 $w.menu add radiobutton -label $firstValue -variable $varName diff --git a/library/tclIndex b/library/tclIndex index 2550b4e..e7f5b81 100644 --- a/library/tclIndex +++ b/library/tclIndex @@ -122,6 +122,7 @@ set auto_index(::tk::ensure_psenc_is_loaded) [list source [file join $dir mkpsen set auto_index(::tk::MessageBox) [list source [file join $dir msgbox.tcl]] set auto_index(tk_menuBar) [list source [file join $dir obsolete.tcl]] set auto_index(tk_bindForTraversal) [list source [file join $dir obsolete.tcl]] +set auto_index(::tk::classic::restore) [list source [file join $dir obsolete.tcl]] set auto_index(tk_optionMenu) [list source [file join $dir optMenu.tcl]] set auto_index(tk_setPalette) [list source [file join $dir palette.tcl]] set auto_index(::tk::RecolorTree) [list source [file join $dir palette.tcl]] diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index fe6eccd..bbd4dd9 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -11,7 +11,7 @@ # files by clicking on the file icons or by entering a filename # in the "Filename:" entry. # -# RCS: @(#) $Id: tkfbox.tcl,v 1.60 2007/10/25 21:44:22 hobbs Exp $ +# RCS: @(#) $Id: tkfbox.tcl,v 1.61 2007/10/30 01:57:54 hobbs Exp $ # # Copyright (c) 1994-1998 Sun Microsystems, Inc. # @@ -222,7 +222,7 @@ proc ::tk::IconList_Create {w} { frame $w set data(sbar) [scrollbar $w.sbar -orient horizontal -takefocus 0] catch {$data(sbar) configure -highlightthickness 0} - set data(canvas) [canvas $w.canvas -bd 2 -relief sunken \ + set data(canvas) [canvas $w.canvas -borderwidth 1 -relief sunken \ -width 400 -height 120 -takefocus 1] pack $data(sbar) -side bottom -fill x -padx 2 pack $data(canvas) -expand yes -fill both @@ -1088,7 +1088,7 @@ static char updir_bits[] = { # f2: the frame with the OK button, cancel button, "file name" field # and file types field. # - set f2 [frame $w.f2 -bd 0] + set f2 [frame $w.f2] bind [::tk::AmpWidget label $f2.lab -text $fNameCaption -anchor e -pady 0]\ <> [list focus $f2.ent] set data(ent) [entry $f2.ent] @@ -1104,8 +1104,7 @@ static char updir_bits[] = { set data(typeMenuBtn) [menubutton $f2.menu -indicatoron 1 \ -menu $f2.menu.m] set data(typeMenu) [menu $data(typeMenuBtn).m -tearoff 0] - $data(typeMenuBtn) configure -takefocus 1 -highlightthickness 2 \ - -relief raised -bd 2 -anchor w + $data(typeMenuBtn) configure -takefocus 1 -relief raised -anchor w bind $data(typeMenuLab) <> [list \ focus $data(typeMenuBtn)] } diff --git a/library/ttk/fonts.tcl b/library/ttk/fonts.tcl index a1c9267..f99aaf3 100644 --- a/library/ttk/fonts.tcl +++ b/library/ttk/fonts.tcl @@ -1,5 +1,5 @@ # -# $Id: fonts.tcl,v 1.7 2007/10/21 14:51:27 das Exp $ +# $Id: fonts.tcl,v 1.8 2007/10/30 01:57:55 hobbs Exp $ # # Font specifications. # @@ -122,7 +122,7 @@ switch -- [tk windowingsystem] { font configure TkFixedFont -family $F(fixed) -size $F(fixedsize) font configure TkIconFont -family $F(family) -size $F(size) font configure TkMenuFont -family $F(family) -size $F(menusize) - font configure TkSmallCaptionFont -family $F(family) -size $F(labelsize) + font configure TkSmallCaptionFont -family $F(family) -size $F(labelsize) } default - x11 { diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 0a997ec..6dca7a1 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXDefault.h,v 1.12 2007/04/23 21:24:33 das Exp $ + * RCS: @(#) $Id: tkMacOSXDefault.h,v 1.13 2007/10/30 01:57:55 hobbs Exp $ */ #ifndef _TKMACDEFAULT @@ -63,7 +63,7 @@ #define DEF_BUTTON_DISABLED_FG_MONO "" #define DEF_BUTTON_FG "systemButtonText" #define DEF_CHKRAD_FG DEF_BUTTON_FG -#define DEF_BUTTON_FONT "system" +#define DEF_BUTTON_FONT "TkDefaultFont" #define DEF_BUTTON_HEIGHT "0" #define DEF_BUTTON_HIGHLIGHT_BG_COLOR DEF_BUTTON_BG_COLOR #define DEF_BUTTON_HIGHLIGHT_BG_MONO DEF_BUTTON_BG_MONO @@ -159,7 +159,7 @@ #define DEF_ENTRY_DISABLED_BG_MONO WHITE #define DEF_ENTRY_DISABLED_FG DISABLED #define DEF_ENTRY_EXPORT_SELECTION "1" -#define DEF_ENTRY_FONT "Helvetica 12" +#define DEF_ENTRY_FONT "TkTextFont" #define DEF_ENTRY_FG BLACK #define DEF_ENTRY_HIGHLIGHT_BG NORMAL_BG #define DEF_ENTRY_HIGHLIGHT BLACK @@ -220,7 +220,7 @@ #define DEF_LABELFRAME_CLASS "Labelframe" #define DEF_LABELFRAME_RELIEF "groove" #define DEF_LABELFRAME_FG "systemButtonText" -#define DEF_LABELFRAME_FONT "system" +#define DEF_LABELFRAME_FONT "TkDefaultFont" #define DEF_LABELFRAME_TEXT "" #define DEF_LABELFRAME_LABELANCHOR "nw" @@ -228,14 +228,14 @@ * Defaults for listboxes: */ -#define DEF_LISTBOX_ACTIVE_STYLE "underline" -#define DEF_LISTBOX_BG_COLOR NORMAL_BG +#define DEF_LISTBOX_ACTIVE_STYLE "dotbox" +#define DEF_LISTBOX_BG_COLOR WHITE #define DEF_LISTBOX_BG_MONO WHITE #define DEF_LISTBOX_BORDER_WIDTH "1" #define DEF_LISTBOX_CURSOR "" #define DEF_LISTBOX_DISABLED_FG DISABLED #define DEF_LISTBOX_EXPORT_SELECTION "1" -#define DEF_LISTBOX_FONT "application" +#define DEF_LISTBOX_FONT "TkTextFont" #define DEF_LISTBOX_FG BLACK #define DEF_LISTBOX_HEIGHT "10" #define DEF_LISTBOX_HIGHLIGHT_BG NORMAL_BG @@ -299,7 +299,7 @@ #define DEF_MENU_CURSOR "arrow" #define DEF_MENU_DISABLED_FG_COLOR "systemMenuDisabled" #define DEF_MENU_DISABLED_FG_MONO "" -#define DEF_MENU_FONT "menu" +#define DEF_MENU_FONT "menu" /* special: see tkMacOSXMenu.c */ #define DEF_MENU_FG "systemMenuText" #define DEF_MENU_POST_COMMAND "" #define DEF_MENU_RELIEF "flat" @@ -328,12 +328,12 @@ #define DEF_MENUBUTTON_BG_COLOR NORMAL_BG #define DEF_MENUBUTTON_BG_MONO WHITE #define DEF_MENUBUTTON_BITMAP "" -#define DEF_MENUBUTTON_BORDER_WIDTH "2" +#define DEF_MENUBUTTON_BORDER_WIDTH "1" #define DEF_MENUBUTTON_CURSOR "" #define DEF_MENUBUTTON_DIRECTION "below" #define DEF_MENUBUTTON_DISABLED_FG_COLOR DISABLED #define DEF_MENUBUTTON_DISABLED_FG_MONO "" -#define DEF_MENUBUTTON_FONT "menu" +#define DEF_MENUBUTTON_FONT "TkDefaultFont" #define DEF_MENUBUTTON_FG BLACK #define DEF_MENUBUTTON_HEIGHT "0" #define DEF_MENUBUTTON_HIGHLIGHT_BG_COLOR DEF_MENUBUTTON_BG_COLOR @@ -364,10 +364,10 @@ #define DEF_MESSAGE_ASPECT "150" #define DEF_MESSAGE_BG_COLOR NORMAL_BG #define DEF_MESSAGE_BG_MONO WHITE -#define DEF_MESSAGE_BORDER_WIDTH "2" +#define DEF_MESSAGE_BORDER_WIDTH "1" #define DEF_MESSAGE_CURSOR "" #define DEF_MESSAGE_FG BLACK -#define DEF_MESSAGE_FONT "system" +#define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT BLACK #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" @@ -385,19 +385,19 @@ #define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG #define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "2" +#define DEF_PANEDWINDOW_BORDERWIDTH "1" #define DEF_PANEDWINDOW_CURSOR "" #define DEF_PANEDWINDOW_HANDLEPAD "8" #define DEF_PANEDWINDOW_HANDLESIZE "8" #define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "0" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "2" -#define DEF_PANEDWINDOW_SASHRELIEF "raised" -#define DEF_PANEDWINDOW_SASHWIDTH "2" -#define DEF_PANEDWINDOW_SHOWHANDLE "1" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" +#define DEF_PANEDWINDOW_SHOWHANDLE "0" #define DEF_PANEDWINDOW_WIDTH "" /* @@ -424,11 +424,11 @@ #define DEF_SCALE_BG_COLOR NORMAL_BG #define DEF_SCALE_BG_MONO WHITE #define DEF_SCALE_BIG_INCREMENT "0" -#define DEF_SCALE_BORDER_WIDTH "2" +#define DEF_SCALE_BORDER_WIDTH "1" #define DEF_SCALE_COMMAND "" #define DEF_SCALE_CURSOR "" #define DEF_SCALE_DIGITS "0" -#define DEF_SCALE_FONT "system" +#define DEF_SCALE_FONT "TkDefaultFont" #define DEF_SCALE_FG_COLOR BLACK #define DEF_SCALE_FG_MONO BLACK #define DEF_SCALE_FROM "0" @@ -464,18 +464,15 @@ #define DEF_SCROLLBAR_ACTIVE_RELIEF "raised" #define DEF_SCROLLBAR_BG_COLOR NORMAL_BG #define DEF_SCROLLBAR_BG_MONO WHITE -/* #define DEF_SCROLLBAR_BORDER_WIDTH "2" */ #define DEF_SCROLLBAR_BORDER_WIDTH "0" #define DEF_SCROLLBAR_COMMAND "" #define DEF_SCROLLBAR_CURSOR "" #define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1" #define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG #define DEF_SCROLLBAR_HIGHLIGHT BLACK -/* #define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "2" */ #define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0" #define DEF_SCROLLBAR_JUMP "0" #define DEF_SCROLLBAR_ORIENT "vertical" -/*#define DEF_SCROLLBAR_RELIEF "sunken" */ #define DEF_SCROLLBAR_RELIEF "flat" #define DEF_SCROLLBAR_REPEAT_DELAY "300" #define DEF_SCROLLBAR_REPEAT_INTERVAL "100" @@ -496,7 +493,7 @@ #define DEF_TEXT_CURSOR "xterm" #define DEF_TEXT_FG BLACK #define DEF_TEXT_EXPORT_SELECTION "1" -#define DEF_TEXT_FONT "Courier 12" +#define DEF_TEXT_FONT "TkFixedFont" #define DEF_TEXT_HEIGHT "24" #define DEF_TEXT_HIGHLIGHT_BG NORMAL_BG #define DEF_TEXT_HIGHLIGHT BLACK @@ -537,7 +534,7 @@ * Defaults for canvas text: */ -#define DEF_CANVTEXT_FONT "Helvetica 12" +#define DEF_CANVTEXT_FONT "TkDefaultFont" /* * Defaults for toplevels (most of the defaults for frames also apply diff --git a/tests/listbox.test b/tests/listbox.test index a3d43ea..eae761b 100644 --- a/tests/listbox.test +++ b/tests/listbox.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: listbox.test,v 1.26 2006/05/29 21:53:16 hobbs Exp $ +# RCS: @(#) $Id: listbox.test,v 1.27 2007/10/30 01:57:55 hobbs Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -2127,20 +2127,20 @@ test listbox-27.1 {widget deletion while active} { } 0 test listbox-28.1 {listbox -activestyle} { - catch {destroy .l} + destroy .l listbox .l -activ non .l cget -activestyle } none test listbox-28.2 {listbox -activestyle} { - catch {destroy .l} + destroy .l listbox .l .l cget -activestyle -} underline +} dotbox test listbox-28.3 {listbox -activestyle} { - catch {destroy .l} - listbox .l -activestyle dot + destroy .l + listbox .l -activestyle und .l cget -activestyle -} dotbox +} underline test listbox-29.1 {listbox selection behavior, -state disabled} { destroy .l diff --git a/tests/panedwindow.test b/tests/panedwindow.test index fc278c7..8fb581b 100644 --- a/tests/panedwindow.test +++ b/tests/panedwindow.test @@ -6,7 +6,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: panedwindow.test,v 1.20 2005/05/31 05:23:44 hobbs Exp $ +# RCS: @(#) $Id: panedwindow.test,v 1.21 2007/10/30 01:57:55 hobbs Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -1949,7 +1949,7 @@ test panedwindow-22.16 {ArrangePanes, last pane grows} { [winfo width .f4] [winfo width .p] } -cleanup {destroy .p .f1 .f2 .f3 .f4} - -result {50 150 1 1 222 50 150 1 78 300} + -result {50 150 1 1 211 50 150 1 89 300} } @@ -2282,7 +2282,7 @@ test panedwindow-24.29.1 {ConfigurePanes, -hide works} { [winfo width .f4] [winfo width .p] } -cleanup {destroy .p .f1 .f2 .f3 .f4} - -result {1 1 1 1 40 40 40 40 182 1 0 1 1 40 40 40 40 136} + -result {1 1 1 1 40 40 40 40 171 1 0 1 1 40 40 40 40 128} } test panedwindow-24.29.2 {ConfigurePanes, -hide works} { -body { @@ -2307,7 +2307,7 @@ test panedwindow-24.29.2 {ConfigurePanes, -hide works} { [winfo width .f4] [winfo width .p] } -cleanup {destroy .p .f1 .f2 .f3 .f4} - -result {1 1 1 0 28 40 40 1 130 1 0 1 1 40 40 40 34 130} + -result {1 1 1 0 39 40 40 1 130 1 0 1 1 40 40 40 42 130} } test panedwindow-24.29.3 {ConfigurePanes, -hide works, last pane stretches} { -body { @@ -2325,7 +2325,7 @@ test panedwindow-24.29.3 {ConfigurePanes, -hide works, last pane stretches} { lappend result [winfo width .f1] [winfo width .f2] [winfo width .f3] } -cleanup {destroy .p .f1 .f2 .f3} - -result {50 50 88 50 50 144} + -result {50 50 94 50 50 147} } test panedwindow-24.29.4 {ConfigurePanes, -hide works, last pane stretches} { -body { @@ -2344,7 +2344,7 @@ test panedwindow-24.29.4 {ConfigurePanes, -hide works, last pane stretches} { lappend result [winfo height .f1] [winfo height .f2] [winfo height .f3] } -cleanup {destroy .p .f1 .f2 .f3} - -result {50 50 88 50 50 144} + -result {50 50 94 50 50 147} } test panedwindow-24.30 {ConfigurePanes, -stretch first} { @@ -2366,7 +2366,7 @@ test panedwindow-24.30 {ConfigurePanes, -stretch first} { [winfo width .f4] } -cleanup {destroy .p .f1 .f2 .f3 .f4} - -result {40 40 40 40 86 40 40 40} + -result {51 40 40 40 94 40 40 40} } test panedwindow-24.31 {ConfigurePanes, -stretch middle} { -body { @@ -2387,7 +2387,7 @@ test panedwindow-24.31 {ConfigurePanes, -stretch middle} { [winfo width .f4] } -cleanup {destroy .p .f1 .f2 .f3 .f4} - -result {40 40 40 40 40 40 86 40} + -result {40 45 46 40 40 45 94 40} } test panedwindow-24.32 {ConfigurePanes, -stretch always} { -body { @@ -2408,7 +2408,7 @@ test panedwindow-24.32 {ConfigurePanes, -stretch always} { [winfo width .f4] } -cleanup {destroy .p .f1 .f2 .f3 .f4} - -result {40 40 40 40 55 40 55 56} + -result {42 43 43 43 58 43 58 58} } test panedwindow-24.33 {ConfigurePanes, -stretch never} { -body { diff --git a/tests/scrollbar.test b/tests/scrollbar.test index c88d15c..7e26a4a 100644 --- a/tests/scrollbar.test +++ b/tests/scrollbar.test @@ -7,7 +7,7 @@ # Copyright (c) 1998-1999 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: scrollbar.test,v 1.18 2006/04/23 21:51:38 vincentdarley Exp $ +# RCS: @(#) $Id: scrollbar.test,v 1.19 2007/10/30 01:57:57 hobbs Exp $ package require tcltest 2.1 eval tcltest::configure $argv @@ -177,7 +177,7 @@ test scrollbar-3.13 {ScrollbarWidgetCmd procedure, "cget" option} win { } {0 0} test scrollbar-3.14 {ScrollbarWidgetCmd procedure, "cget" option} {unix notAqua} { list [catch {.s2 cget -highlightthickness} msg] $msg -} {0 1} +} {0 0} test scrollbar-3.14.1 {ScrollbarWidgetCmd procedure, "cget" option} aqua { list [catch {.s2 cget -highlightthickness} msg] $msg } {0 0} diff --git a/unix/tkUnixDefault.h b/unix/tkUnixDefault.h index 7ea67f5..5fd7b63 100644 --- a/unix/tkUnixDefault.h +++ b/unix/tkUnixDefault.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixDefault.h,v 1.24 2006/09/06 22:39:28 hobbs Exp $ + * RCS: @(#) $Id: tkUnixDefault.h,v 1.25 2007/10/30 01:57:58 hobbs Exp $ */ #ifndef _TKUNIXDEFAULT @@ -32,29 +32,12 @@ #define NORMAL_BG "#d9d9d9" #define ACTIVE_BG "#ececec" #define SELECT_BG "#c3c3c3" -#define TROUGH "#c3c3c3" +#define TROUGH "#b3b3b3" #define CHECK_INDICATOR WHITE #define MENU_INDICATOR BLACK #define DISABLED "#a3a3a3" /* - * The definitions below provide symbolic names for the default fonts. - * NORMAL_FONT - Normal font - * BOLD_FONT - Bold font - * FIXED_FONT - Fixed-width font - */ - -#if HAVE_XFT -# define NORMAL_FONT "sans-serif -12" -# define BOLD_FONT "sans-serif -12 bold" -# define FIXED_FONT "monospace -12" -#else -# define NORMAL_FONT "Helvetica -12" -# define BOLD_FONT "Helvetica -12 bold" -# define FIXED_FONT "Courier -12" -#endif - -/* * Defaults for labels, buttons, checkbuttons, and radiobuttons: */ @@ -67,7 +50,7 @@ #define DEF_BUTTON_BG_COLOR NORMAL_BG #define DEF_BUTTON_BG_MONO WHITE #define DEF_BUTTON_BITMAP "" -#define DEF_BUTTON_BORDER_WIDTH "2" +#define DEF_BUTTON_BORDER_WIDTH "1" #define DEF_BUTTON_CURSOR "" #define DEF_BUTTON_COMPOUND "none" #define DEF_BUTTON_COMMAND "" @@ -76,7 +59,7 @@ #define DEF_BUTTON_DISABLED_FG_MONO "" #define DEF_BUTTON_FG BLACK #define DEF_CHKRAD_FG DEF_BUTTON_FG -#define DEF_BUTTON_FONT BOLD_FONT +#define DEF_BUTTON_FONT "TkDefaultFont" #define DEF_BUTTON_HEIGHT "0" #define DEF_BUTTON_HIGHLIGHT_BG_COLOR DEF_BUTTON_BG_COLOR #define DEF_BUTTON_HIGHLIGHT_BG_MONO DEF_BUTTON_BG_MONO @@ -152,15 +135,15 @@ * Defaults for entries: */ -#define DEF_ENTRY_BG_COLOR NORMAL_BG +#define DEF_ENTRY_BG_COLOR WHITE #define DEF_ENTRY_BG_MONO WHITE -#define DEF_ENTRY_BORDER_WIDTH "2" +#define DEF_ENTRY_BORDER_WIDTH "1" #define DEF_ENTRY_CURSOR "xterm" #define DEF_ENTRY_DISABLED_BG_COLOR NORMAL_BG #define DEF_ENTRY_DISABLED_BG_MONO WHITE #define DEF_ENTRY_DISABLED_FG DISABLED #define DEF_ENTRY_EXPORT_SELECTION "1" -#define DEF_ENTRY_FONT NORMAL_FONT +#define DEF_ENTRY_FONT "TkTextFont" #define DEF_ENTRY_FG BLACK #define DEF_ENTRY_HIGHLIGHT_BG NORMAL_BG #define DEF_ENTRY_HIGHLIGHT BLACK @@ -178,7 +161,7 @@ #define DEF_ENTRY_SCROLL_COMMAND "" #define DEF_ENTRY_SELECT_COLOR SELECT_BG #define DEF_ENTRY_SELECT_MONO BLACK -#define DEF_ENTRY_SELECT_BD_COLOR "1" +#define DEF_ENTRY_SELECT_BD_COLOR "0" #define DEF_ENTRY_SELECT_BD_MONO "0" #define DEF_ENTRY_SELECT_FG_COLOR BLACK #define DEF_ENTRY_SELECT_FG_MONO WHITE @@ -219,7 +202,7 @@ #define DEF_LABELFRAME_CLASS "Labelframe" #define DEF_LABELFRAME_RELIEF "groove" #define DEF_LABELFRAME_FG BLACK -#define DEF_LABELFRAME_FONT BOLD_FONT +#define DEF_LABELFRAME_FONT "TkDefaultFont" #define DEF_LABELFRAME_TEXT "" #define DEF_LABELFRAME_LABELANCHOR "nw" @@ -227,14 +210,14 @@ * Defaults for listboxes: */ -#define DEF_LISTBOX_ACTIVE_STYLE "underline" -#define DEF_LISTBOX_BG_COLOR NORMAL_BG +#define DEF_LISTBOX_ACTIVE_STYLE "dotbox" +#define DEF_LISTBOX_BG_COLOR WHITE #define DEF_LISTBOX_BG_MONO WHITE -#define DEF_LISTBOX_BORDER_WIDTH "2" +#define DEF_LISTBOX_BORDER_WIDTH "1" #define DEF_LISTBOX_CURSOR "" #define DEF_LISTBOX_DISABLED_FG DISABLED #define DEF_LISTBOX_EXPORT_SELECTION "1" -#define DEF_LISTBOX_FONT BOLD_FONT +#define DEF_LISTBOX_FONT "TkDefaultFont" #define DEF_LISTBOX_FG BLACK #define DEF_LISTBOX_HEIGHT "10" #define DEF_LISTBOX_HIGHLIGHT_BG NORMAL_BG @@ -245,7 +228,7 @@ #define DEF_LISTBOX_LIST_VARIABLE "" #define DEF_LISTBOX_SELECT_COLOR SELECT_BG #define DEF_LISTBOX_SELECT_MONO BLACK -#define DEF_LISTBOX_SELECT_BD "1" +#define DEF_LISTBOX_SELECT_BD "0" #define DEF_LISTBOX_SELECT_FG_COLOR BLACK #define DEF_LISTBOX_SELECT_FG_MONO WHITE #define DEF_LISTBOX_SELECT_MODE "browse" @@ -289,16 +272,16 @@ #define DEF_MENU_ACTIVE_BG_COLOR ACTIVE_BG #define DEF_MENU_ACTIVE_BG_MONO BLACK -#define DEF_MENU_ACTIVE_BORDER_WIDTH "2" +#define DEF_MENU_ACTIVE_BORDER_WIDTH "1" #define DEF_MENU_ACTIVE_FG_COLOR BLACK #define DEF_MENU_ACTIVE_FG_MONO WHITE #define DEF_MENU_BG_COLOR NORMAL_BG #define DEF_MENU_BG_MONO WHITE -#define DEF_MENU_BORDER_WIDTH "2" +#define DEF_MENU_BORDER_WIDTH "1" #define DEF_MENU_CURSOR "arrow" #define DEF_MENU_DISABLED_FG_COLOR DISABLED #define DEF_MENU_DISABLED_FG_MONO "" -#define DEF_MENU_FONT BOLD_FONT +#define DEF_MENU_FONT "TkMenuFont" #define DEF_MENU_FG BLACK #define DEF_MENU_POST_COMMAND "" #define DEF_MENU_RELIEF "raised" @@ -322,12 +305,12 @@ #define DEF_MENUBUTTON_BG_COLOR NORMAL_BG #define DEF_MENUBUTTON_BG_MONO WHITE #define DEF_MENUBUTTON_BITMAP "" -#define DEF_MENUBUTTON_BORDER_WIDTH "2" +#define DEF_MENUBUTTON_BORDER_WIDTH "1" #define DEF_MENUBUTTON_CURSOR "" #define DEF_MENUBUTTON_DIRECTION "below" #define DEF_MENUBUTTON_DISABLED_FG_COLOR DISABLED #define DEF_MENUBUTTON_DISABLED_FG_MONO "" -#define DEF_MENUBUTTON_FONT BOLD_FONT +#define DEF_MENUBUTTON_FONT "TkDefaultFont" #define DEF_MENUBUTTON_FG BLACK #define DEF_MENUBUTTON_HEIGHT "0" #define DEF_MENUBUTTON_HIGHLIGHT_BG_COLOR DEF_MENUBUTTON_BG_COLOR @@ -357,10 +340,10 @@ #define DEF_MESSAGE_ASPECT "150" #define DEF_MESSAGE_BG_COLOR NORMAL_BG #define DEF_MESSAGE_BG_MONO WHITE -#define DEF_MESSAGE_BORDER_WIDTH "2" +#define DEF_MESSAGE_BORDER_WIDTH "1" #define DEF_MESSAGE_CURSOR "" #define DEF_MESSAGE_FG BLACK -#define DEF_MESSAGE_FONT BOLD_FONT +#define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT BLACK #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" @@ -379,19 +362,19 @@ #define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG #define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "2" +#define DEF_PANEDWINDOW_BORDERWIDTH "1" #define DEF_PANEDWINDOW_CURSOR "" #define DEF_PANEDWINDOW_HANDLEPAD "8" #define DEF_PANEDWINDOW_HANDLESIZE "8" #define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "0" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "2" -#define DEF_PANEDWINDOW_SASHRELIEF "raised" -#define DEF_PANEDWINDOW_SASHWIDTH "2" -#define DEF_PANEDWINDOW_SHOWHANDLE "1" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" +#define DEF_PANEDWINDOW_SHOWHANDLE "0" #define DEF_PANEDWINDOW_WIDTH "" /* @@ -418,11 +401,11 @@ #define DEF_SCALE_BG_COLOR NORMAL_BG #define DEF_SCALE_BG_MONO WHITE #define DEF_SCALE_BIG_INCREMENT "0" -#define DEF_SCALE_BORDER_WIDTH "2" +#define DEF_SCALE_BORDER_WIDTH "1" #define DEF_SCALE_COMMAND "" #define DEF_SCALE_CURSOR "" #define DEF_SCALE_DIGITS "0" -#define DEF_SCALE_FONT BOLD_FONT +#define DEF_SCALE_FONT "TkDefaultFont" #define DEF_SCALE_FG_COLOR BLACK #define DEF_SCALE_FG_MONO BLACK #define DEF_SCALE_FROM "0" @@ -458,13 +441,13 @@ #define DEF_SCROLLBAR_ACTIVE_RELIEF "raised" #define DEF_SCROLLBAR_BG_COLOR NORMAL_BG #define DEF_SCROLLBAR_BG_MONO WHITE -#define DEF_SCROLLBAR_BORDER_WIDTH "2" +#define DEF_SCROLLBAR_BORDER_WIDTH "1" #define DEF_SCROLLBAR_COMMAND "" #define DEF_SCROLLBAR_CURSOR "" #define DEF_SCROLLBAR_EL_BORDER_WIDTH "-1" #define DEF_SCROLLBAR_HIGHLIGHT_BG NORMAL_BG #define DEF_SCROLLBAR_HIGHLIGHT BLACK -#define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "1" +#define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0" #define DEF_SCROLLBAR_JUMP "0" #define DEF_SCROLLBAR_ORIENT "vertical" #define DEF_SCROLLBAR_RELIEF "sunken" @@ -473,21 +456,21 @@ #define DEF_SCROLLBAR_TAKE_FOCUS (char *) NULL #define DEF_SCROLLBAR_TROUGH_COLOR TROUGH #define DEF_SCROLLBAR_TROUGH_MONO WHITE -#define DEF_SCROLLBAR_WIDTH "15" +#define DEF_SCROLLBAR_WIDTH "11" /* * Defaults for texts: */ #define DEF_TEXT_AUTO_SEPARATORS "1" -#define DEF_TEXT_BG_COLOR NORMAL_BG +#define DEF_TEXT_BG_COLOR WHITE #define DEF_TEXT_BG_MONO WHITE #define DEF_TEXT_BLOCK_CURSOR "0" -#define DEF_TEXT_BORDER_WIDTH "2" +#define DEF_TEXT_BORDER_WIDTH "1" #define DEF_TEXT_CURSOR "xterm" #define DEF_TEXT_FG BLACK #define DEF_TEXT_EXPORT_SELECTION "1" -#define DEF_TEXT_FONT FIXED_FONT +#define DEF_TEXT_FONT "TkFixedFont" #define DEF_TEXT_HEIGHT "24" #define DEF_TEXT_HIGHLIGHT_BG NORMAL_BG #define DEF_TEXT_HIGHLIGHT BLACK @@ -505,7 +488,7 @@ #define DEF_TEXT_INACTIVE_SELECT_COLOR SELECT_BG #define DEF_TEXT_SELECT_COLOR SELECT_BG #define DEF_TEXT_SELECT_MONO BLACK -#define DEF_TEXT_SELECT_BD_COLOR "1" +#define DEF_TEXT_SELECT_BD_COLOR "0" #define DEF_TEXT_SELECT_BD_MONO "0" #define DEF_TEXT_SELECT_FG_COLOR BLACK #define DEF_TEXT_SELECT_FG_MONO WHITE @@ -528,7 +511,7 @@ * Defaults for canvas text: */ -#define DEF_CANVTEXT_FONT NORMAL_FONT +#define DEF_CANVTEXT_FONT "TkDefaultFont" /* * Defaults for toplevels (most of the defaults for frames also apply diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h index f2267fa..03e5819 100644 --- a/win/tkWinDefault.h +++ b/win/tkWinDefault.h @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinDefault.h,v 1.22 2007/05/04 21:29:22 patthoyts Exp $ + * RCS: @(#) $Id: tkWinDefault.h,v 1.23 2007/10/30 01:57:58 hobbs Exp $ */ #ifndef _TKWINDEFAULT @@ -28,7 +28,6 @@ #define BLACK "Black" #define WHITE "White" -#define CTL_FONT "TkDefaultFont" /*"{MS Sans Serif} 8"*/ #define NORMAL_BG "SystemButtonFace" #define NORMAL_FG "SystemButtonText" #define ACTIVE_BG NORMAL_BG @@ -64,7 +63,7 @@ #define DEF_BUTTON_DISABLED_FG_MONO "" #define DEF_BUTTON_FG NORMAL_FG #define DEF_CHKRAD_FG TEXT_FG -#define DEF_BUTTON_FONT CTL_FONT +#define DEF_BUTTON_FONT "TkDefaultFont" #define DEF_BUTTON_HEIGHT "0" #define DEF_BUTTON_HIGHLIGHT_BG_COLOR DEF_BUTTON_BG_COLOR #define DEF_BUTTON_HIGHLIGHT_BG_MONO DEF_BUTTON_BG_MONO @@ -142,13 +141,13 @@ #define DEF_ENTRY_BG_COLOR "SystemWindow" #define DEF_ENTRY_BG_MONO WHITE -#define DEF_ENTRY_BORDER_WIDTH "2" +#define DEF_ENTRY_BORDER_WIDTH "1" #define DEF_ENTRY_CURSOR "xterm" #define DEF_ENTRY_DISABLED_BG_COLOR "SystemButtonFace" #define DEF_ENTRY_DISABLED_BG_MONO WHITE #define DEF_ENTRY_DISABLED_FG DISABLED #define DEF_ENTRY_EXPORT_SELECTION "1" -#define DEF_ENTRY_FONT CTL_FONT +#define DEF_ENTRY_FONT "TkTextFont" #define DEF_ENTRY_FG TEXT_FG #define DEF_ENTRY_HIGHLIGHT_BG NORMAL_BG #define DEF_ENTRY_HIGHLIGHT HIGHLIGHT @@ -206,7 +205,7 @@ #define DEF_LABELFRAME_CLASS "Labelframe" #define DEF_LABELFRAME_RELIEF "groove" #define DEF_LABELFRAME_FG NORMAL_FG -#define DEF_LABELFRAME_FONT CTL_FONT +#define DEF_LABELFRAME_FONT "TkDefaultFont" #define DEF_LABELFRAME_TEXT "" #define DEF_LABELFRAME_LABELANCHOR "nw" @@ -217,11 +216,11 @@ #define DEF_LISTBOX_ACTIVE_STYLE "underline" #define DEF_LISTBOX_BG_COLOR "SystemWindow" #define DEF_LISTBOX_BG_MONO WHITE -#define DEF_LISTBOX_BORDER_WIDTH "2" +#define DEF_LISTBOX_BORDER_WIDTH "1" #define DEF_LISTBOX_CURSOR "" #define DEF_LISTBOX_DISABLED_FG DISABLED #define DEF_LISTBOX_EXPORT_SELECTION "1" -#define DEF_LISTBOX_FONT CTL_FONT +#define DEF_LISTBOX_FONT "TkDefaultFont" #define DEF_LISTBOX_FG NORMAL_FG #define DEF_LISTBOX_HEIGHT "10" #define DEF_LISTBOX_HIGHLIGHT_BG NORMAL_BG @@ -285,7 +284,7 @@ #define DEF_MENU_CURSOR "arrow" #define DEF_MENU_DISABLED_FG_COLOR DISABLED #define DEF_MENU_DISABLED_FG_MONO "" -#define DEF_MENU_FONT "TkMenuFont" /* CTL_FONT */ +#define DEF_MENU_FONT "TkMenuFont" #define DEF_MENU_FG MENU_FG #define DEF_MENU_POST_COMMAND "" #define DEF_MENU_RELIEF "flat" @@ -309,12 +308,12 @@ #define DEF_MENUBUTTON_BG_COLOR NORMAL_BG #define DEF_MENUBUTTON_BG_MONO WHITE #define DEF_MENUBUTTON_BITMAP "" -#define DEF_MENUBUTTON_BORDER_WIDTH "2" +#define DEF_MENUBUTTON_BORDER_WIDTH "1" #define DEF_MENUBUTTON_CURSOR "" #define DEF_MENUBUTTON_DIRECTION "below" #define DEF_MENUBUTTON_DISABLED_FG_COLOR DISABLED #define DEF_MENUBUTTON_DISABLED_FG_MONO "" -#define DEF_MENUBUTTON_FONT CTL_FONT +#define DEF_MENUBUTTON_FONT "TkDefaultFont" #define DEF_MENUBUTTON_FG NORMAL_FG #define DEF_MENUBUTTON_HEIGHT "0" #define DEF_MENUBUTTON_HIGHLIGHT_BG_COLOR DEF_MENUBUTTON_BG_COLOR @@ -344,10 +343,10 @@ #define DEF_MESSAGE_ASPECT "150" #define DEF_MESSAGE_BG_COLOR NORMAL_BG #define DEF_MESSAGE_BG_MONO WHITE -#define DEF_MESSAGE_BORDER_WIDTH "2" +#define DEF_MESSAGE_BORDER_WIDTH "1" #define DEF_MESSAGE_CURSOR "" #define DEF_MESSAGE_FG NORMAL_FG -#define DEF_MESSAGE_FONT CTL_FONT +#define DEF_MESSAGE_FONT "TkDefaultFont" #define DEF_MESSAGE_HIGHLIGHT_BG NORMAL_BG #define DEF_MESSAGE_HIGHLIGHT HIGHLIGHT #define DEF_MESSAGE_HIGHLIGHT_WIDTH "0" @@ -366,18 +365,18 @@ #define DEF_PANEDWINDOW_BG_COLOR NORMAL_BG #define DEF_PANEDWINDOW_BG_MONO WHITE -#define DEF_PANEDWINDOW_BORDERWIDTH "2" +#define DEF_PANEDWINDOW_BORDERWIDTH "1" #define DEF_PANEDWINDOW_CURSOR "" #define DEF_PANEDWINDOW_HANDLEPAD "8" #define DEF_PANEDWINDOW_HANDLESIZE "8" #define DEF_PANEDWINDOW_HEIGHT "" -#define DEF_PANEDWINDOW_OPAQUERESIZE "0" +#define DEF_PANEDWINDOW_OPAQUERESIZE "1" #define DEF_PANEDWINDOW_ORIENT "horizontal" #define DEF_PANEDWINDOW_RELIEF "flat" #define DEF_PANEDWINDOW_SASHCURSOR "" -#define DEF_PANEDWINDOW_SASHPAD "2" -#define DEF_PANEDWINDOW_SASHRELIEF "raised" -#define DEF_PANEDWINDOW_SASHWIDTH "2" +#define DEF_PANEDWINDOW_SASHPAD "0" +#define DEF_PANEDWINDOW_SASHRELIEF "flat" +#define DEF_PANEDWINDOW_SASHWIDTH "3" #define DEF_PANEDWINDOW_SHOWHANDLE "0" #define DEF_PANEDWINDOW_WIDTH "" @@ -405,11 +404,11 @@ #define DEF_SCALE_BG_COLOR NORMAL_BG #define DEF_SCALE_BG_MONO WHITE #define DEF_SCALE_BIG_INCREMENT "0" -#define DEF_SCALE_BORDER_WIDTH "2" +#define DEF_SCALE_BORDER_WIDTH "1" #define DEF_SCALE_COMMAND "" #define DEF_SCALE_CURSOR "" #define DEF_SCALE_DIGITS "0" -#define DEF_SCALE_FONT CTL_FONT +#define DEF_SCALE_FONT "TkDefaultFont" #define DEF_SCALE_FG_COLOR NORMAL_FG #define DEF_SCALE_FG_MONO BLACK #define DEF_SCALE_FROM "0" @@ -470,11 +469,11 @@ #define DEF_TEXT_BG_COLOR "SystemWindow" #define DEF_TEXT_BG_MONO WHITE #define DEF_TEXT_BLOCK_CURSOR "0" -#define DEF_TEXT_BORDER_WIDTH "2" +#define DEF_TEXT_BORDER_WIDTH "1" #define DEF_TEXT_CURSOR "xterm" #define DEF_TEXT_FG TEXT_FG #define DEF_TEXT_EXPORT_SELECTION "1" -#define DEF_TEXT_FONT CTL_FONT +#define DEF_TEXT_FONT "TkFixedFont" #define DEF_TEXT_HEIGHT "24" #define DEF_TEXT_HIGHLIGHT_BG NORMAL_BG #define DEF_TEXT_HIGHLIGHT HIGHLIGHT @@ -515,7 +514,7 @@ * Defaults for canvas text: */ -#define DEF_CANVTEXT_FONT CTL_FONT +#define DEF_CANVTEXT_FONT "TkDefaultFont" /* * Defaults for toplevels (most of the defaults for frames also apply diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 89b98a7..671bbcc 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinFont.c,v 1.34 2007/10/23 09:23:54 patthoyts Exp $ + * RCS: @(#) $Id: tkWinFont.c,v 1.35 2007/10/30 01:57:58 hobbs Exp $ */ #include "tkWinInt.h" @@ -397,18 +397,19 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr) NONCLIENTMETRICS ncMetrics; ICONMETRICS iconMetrics; HFONT hFont; - + interp = (Tcl_Interp *) mainPtr->interp; tkwin = (Tk_Window) mainPtr->winPtr; - + /* force this for now */ - if (((TkWindow *) tkwin)->mainPtr == NULL) + if (((TkWindow *) tkwin)->mainPtr == NULL) { ((TkWindow *) tkwin)->mainPtr = mainPtr; - + } + ncMetrics.cbSize = sizeof(ncMetrics); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncMetrics), &ncMetrics, 0); - + CreateNamedSystemLogFont(interp, tkwin, "TkDefaultFont", &ncMetrics.lfMessageFont); CreateNamedSystemLogFont(interp, tkwin, "TkHeadingFont", @@ -429,10 +430,10 @@ TkWinSetupSystemFonts(TkMainInfo *mainPtr) &iconMetrics, 0); CreateNamedSystemLogFont(interp, tkwin, "TkIconFont", &iconMetrics.lfFont); - + hFont = (HFONT)GetStockObject(ANSI_FIXED_FONT); CreateNamedSystemFont(interp, tkwin, "TkFixedFont", hFont); - + /* * Setup the remaining standard Tk font names as named fonts. */ -- cgit v0.12