Skip to content

Commit 54581c8

Browse files
author
oberdorfer
committed
*** continous developement, some small improvements
1 parent 10371a0 commit 54581c8

12 files changed

+132
-94
lines changed

dialog.tcl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ----------------------------------------------------------------------------
22
# dialog.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: dialog.tcl,v 1.16 2009/09/06 21:09:39 oberdorfer Exp $
4+
# $Id: dialog.tcl,v 1.17 2009/10/25 20:54:54 oberdorfer Exp $
55
# ----------------------------------------------------------------------------
66
# Index of commands:
77
# - Dialog::create
@@ -120,11 +120,7 @@ proc Dialog::create { path args } {
120120
}
121121

122122
if { [set bitmap [Widget::getoption $path -image]] != "" } {
123-
if { [BWidget::using ttk] } {
124-
set label [ttk::label $path.label -image $bitmap]
125-
} else {
126-
set label [label $path.label -image $bitmap -background $bg]
127-
}
123+
set label [label $path.label -image $bitmap -background $bg]
128124
} elseif { [set bitmap [Widget::getoption $path -bitmap]] != "" } {
129125
set label [label $path.label -bitmap $bitmap -background $bg]
130126
}
@@ -195,7 +191,10 @@ proc Dialog::add { path args } {
195191

196192
set res [eval $cmd $args]
197193

198-
# a button box button - by default - is flat!
194+
# a button box button by default is flat, this isn't what we want
195+
# here for normal dialog box action buttons, so we need to
196+
# override the default:
197+
199198
if { [BWidget::using ttk] } {
200199
$res configure -style "TButton"
201200
}

init.tcl

Lines changed: 5 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ----------------------------------------------------------------------------
22
# init.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: init.tcl,v 1.91 2009/09/06 20:51:44 oberdorfer Exp $
4+
# $Id: init.tcl,v 1.92 2009/10/25 20:55:36 oberdorfer Exp $
55
# ----------------------------------------------------------------------------
66
#
77
namespace eval Widget {}
@@ -16,7 +16,6 @@ proc Widget::_opt_defaults {{prio widgetDefault}} {
1616
}
1717
"win32" -
1818
"windows" {
19-
#option add *Listbox.background SystemWindow $prio
2019
option add *ListBox.background SystemWindow $prio
2120
#option add *Button.padY 0 $prio
2221
option add *ButtonBox.padY 0 $prio
@@ -37,76 +36,14 @@ Widget::_opt_defaults
3736

3837
option read [file join $::BWIDGET::LIBRARY "lang" "en.rc"]
3938

40-
## Add a TraverseIn binding to standard Tk widgets to handle some of
41-
## the BWidget-specific things we do.
39+
# Add a TraverseIn binding to standard Tk widgets to handle some of
40+
# the BWidget-specific things we do.
4241
bind Entry <<TraverseIn>> { %W selection range 0 end; %W icursor end }
4342
bind Spinbox <<TraverseIn>> { %W selection range 0 end; %W icursor end }
4443

4544
bind all <Key-Tab> { Widget::traverseTo [Widget::focusNext %W] }
4645
bind all <<PrevWindow>> { Widget::traverseTo [Widget::focusPrev %W] }
4746

48-
namespace eval ::BWidget {
4947

50-
if {[lsearch -exact [font names] "TkTextFont"] < 0} {
51-
catch {font create TkTextFont}
52-
catch {font create TkDefaultFont}
53-
catch {font create TkHeadingFont}
54-
catch {font create TkCaptionFont}
55-
catch {font create TkTooltipFont}
56-
57-
switch -- [tk windowingsystem] {
58-
"win32" {
59-
if {$::tcl_platform(osVersion) >= 5.0} {
60-
variable family "Tahoma"
61-
} else {
62-
variable family "MS Sans Serif"
63-
}
64-
variable size 8
65-
66-
font configure TkDefaultFont -family $family -size $size
67-
font configure TkTextFont -family $family -size $size
68-
font configure TkHeadingFont -family $family -size $size
69-
font configure TkCaptionFont -family $family -size $size \
70-
-weight bold
71-
font configure TkTooltipFont -family $family -size $size
72-
}
73-
74-
"classic" - "aqua" {
75-
variable family "Lucida Grande"
76-
variable size 13
77-
variable viewsize 12
78-
variable smallsize 11
79-
80-
font configure TkDefaultFont -family $family -size $size
81-
font configure TkTextFont -family $family -size $size
82-
font configure TkHeadingFont -family $family -size $smallsize
83-
font configure TkCaptionFont -family $family -size $size \
84-
-weight bold
85-
font configure TkTooltipFont -family $family -size $viewsize
86-
}
87-
88-
"x11" {
89-
if {![catch {tk::pkgconfig get fontsystem} fs]
90-
&& [string equal $fs "xft"]} {
91-
variable family "sans-serif"
92-
} else {
93-
variable family "Helvetica"
94-
}
95-
variable size -12
96-
variable ttsize -10
97-
variable capsize -14
98-
99-
font configure TkDefaultFont -family $family -size $size
100-
font configure TkTextFont -family $family -size $size
101-
font configure TkHeadingFont -family $family -size $size \
102-
-weight bold
103-
font configure TkCaptionFont -family $family -size $capsize \
104-
-weight bold
105-
font configure TkTooltipFont -family $family -size $ttsize
106-
}
107-
}
108-
}
109-
} ; ## namespace eval ::BWidget
110-
111-
112-
BWidget::set_themedefaults "initialize"
48+
::BWidget::createSystemFonts
49+
::BWidget::set_themedefaults "default"

label.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ------------------------------------------------------------------------------
22
# label.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: label.tcl,v 1.11 2009/09/06 21:15:25 oberdorfer Exp $
4+
# $Id: label.tcl,v 1.12 2009/10/25 20:55:36 oberdorfer Exp $
55
# ------------------------------------------------------------------------------
66
# Index of commands:
77
# - Label::create
@@ -25,7 +25,7 @@ namespace eval Label {
2525
{-textvariable String "" 0}
2626
{-underline Int -1 0 "%d >= -1"}
2727
{-focus String "" 0}
28-
{-foreground Color "SystemWindow" 0}
28+
{-foreground Color "SystemWindowText" 0}
2929
{-background Color "SystemWindowFrame" 0}
3030
{-disabledforeground Color "SystemDisabledText" 0}
3131
{-state Enum normal 0 {normal disabled}}

mainframe.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ----------------------------------------------------------------------------
22
# mainframe.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: mainframe.tcl,v 1.25 2009/09/06 21:22:36 oberdorfer Exp $
4+
# $Id: mainframe.tcl,v 1.26 2009/10/25 20:55:36 oberdorfer Exp $
55
# ------------------------------------------------------------------------------
66
# Index of commands:
77
# - MainFrame::create
@@ -300,7 +300,7 @@ proc MainFrame::addtoolbar { path } {
300300
set bg [Widget::getoption $path -background]
301301
if { $tcl_platform(platform) == "unix" } {
302302
if { [BWidget::using ttk] } {
303-
ttk::frame $toolframe -padding 1
303+
ttk::frame $toolframe -padding 1 -relief raised -borderwidth 1
304304
} else {
305305
frame $toolframe -relief raised -borderwidth 1 \
306306
-takefocus 0 -highlightthickness 0 -background $bg

notebook.tcl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ---------------------------------------------------------------------------
22
# notebook.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: notebook.tcl,v 1.27 2009/09/08 20:50:46 oberdorfer Exp $
4+
# $Id: notebook.tcl,v 1.28 2009/10/25 20:55:36 oberdorfer Exp $
55
# ---------------------------------------------------------------------------
66
# Index of commands:
77
# - NoteBook::create
@@ -274,12 +274,14 @@ proc NoteBook::insert { path index page args } {
274274
frame $f \
275275
-relief flat \
276276
-background [Widget::cget $path -background] \
277-
-borderwidth [Widget::cget $path -internalborderwidth]
277+
-borderwidth [Widget::cget $path -internalborderwidth] \
278+
-highlightthickness 0
278279
set data($page,realized) 0
279280
} else {
280281
$f configure \
281282
-background [Widget::cget $path -background] \
282-
-borderwidth [Widget::cget $path -internalborderwidth]
283+
-borderwidth [Widget::cget $path -internalborderwidth] \
284+
-highlightthickness 0
283285
}
284286
_compute_height $path
285287
_compute_width $path

panedw.tcl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ----------------------------------------------------------------------------
22
# panedw.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: panedw.tcl,v 1.15 2009/09/06 21:29:34 oberdorfer Exp $
4+
# $Id: panedw.tcl,v 1.16 2009/10/25 20:55:36 oberdorfer Exp $
55
# ----------------------------------------------------------------------------
66
# Index of commands:
77
# - PanedWindow::create
@@ -61,7 +61,8 @@ proc PanedWindow::create { path args } {
6161

6262
Widget::init PanedWindow $path $args
6363
frame $path -background [Widget::cget $path -background] \
64-
-class PanedWindow
64+
-class PanedWindow \
65+
-highlightthickness 0
6566

6667
set _panedw($path,nbpanes) 0
6768
set _panedw($path,weights) ""

pkgIndex.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# ----------------------------------------------------------------------------
22
# pkgIndex.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: pkgIndex.tcl,v 1.20 2009/09/06 21:00:07 oberdorfer Exp $
4+
# $Id: pkgIndex.tcl,v 1.21 2009/10/25 20:55:36 oberdorfer Exp $
55
# ----------------------------------------------------------------------------
66

77
if {[catch {package require Tcl}]} return
88
package ifneeded BWidget 1.9.1 "\
99
package require Tk 8.1.1;\
1010
[list tclPkgSetup $dir BWidget 1.9.1 {
1111
{arrow.tcl source {ArrowButton ArrowButton::create ArrowButton::use}}
12+
{frame.tcl source {Frame Frame::create Frame::use}}
1213
{labelframe.tcl source {LabelFrame LabelFrame::create LabelFrame::use}}
1314
{labelentry.tcl source {LabelEntry LabelEntry::create LabelEntry::use}}
1415
{bitmap.tcl source {Bitmap::get Bitmap::use}}

scrollframe.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ----------------------------------------------------------------------------
22
# scrollframe.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: scrollframe.tcl,v 1.12 2009/09/06 21:38:51 oberdorfer Exp $
4+
# $Id: scrollframe.tcl,v 1.13 2009/10/25 20:55:36 oberdorfer Exp $
55
# ----------------------------------------------------------------------------
66
# Index of commands:
77
# - ScrollableFrame::create
@@ -19,7 +19,7 @@ namespace eval ScrollableFrame {
1919
Widget::define ScrollableFrame scrollframe
2020

2121
Widget::declare ScrollableFrame {
22-
{-background Color "SystemWindow" 0}
22+
{-background Color "SystemWindowFrame" 0}
2323
{-width Int 0 0 {}}
2424
{-height Int 0 0 {}}
2525
{-areawidth Int 0 0 {}}

scrollview.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ------------------------------------------------------------------------------
22
# scrollview.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: scrollview.tcl,v 1.71 2009/09/06 21:39:24 oberdorfer Exp $
4+
# $Id: scrollview.tcl,v 1.72 2009/10/25 20:55:36 oberdorfer Exp $
55
# ------------------------------------------------------------------------------
66
# Index of commands:
77
# - ScrolledWindow::create
@@ -25,7 +25,7 @@ namespace eval ScrollView {
2525
Widget::declare ScrollView {
2626
{-width TkResource 30 0 canvas}
2727
{-height TkResource 30 0 canvas}
28-
{-foreground Color "SystemWindow" 0}
28+
{-foreground Color "SystemWindowText" 0}
2929
{-background Color "SystemWindowFrame" 0}
3030
{-fill String "" 0}
3131
{-relief TkResource flat 0 canvas}

spinbox.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Copyright (c) 2000 by Ajuba Solutions
77
# All rights reserved.
88
#
9-
# RCS: @(#) $Id: spinbox.tcl,v 1.13 2009/09/06 21:41:25 oberdorfer Exp $
9+
# RCS: @(#) $Id: spinbox.tcl,v 1.14 2009/10/25 20:55:36 oberdorfer Exp $
1010
# -----------------------------------------------------------------------------
1111
# Index of commands:
1212
# - SpinBox::create
@@ -35,7 +35,7 @@ namespace eval SpinBox {
3535
{-modifycmd String "" 0}
3636
{-repeatdelay Int 400 0 {%d >= 0}}
3737
{-repeatinterval Int 100 0 {%d >= 0}}
38-
{-foreground Color "SystemWindow" 0}
38+
{-foreground Color "SystemWindowText" 0}
3939
}
4040

4141
Widget::addmap SpinBox "" :cmd {-background {}}

titleframe.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# ------------------------------------------------------------------------------
22
# titleframe.tcl
33
# This file is part of Unifix BWidget Toolkit
4-
# $Id: titleframe.tcl,v 1.51 2009/09/06 21:44:21 oberdorfer Exp $
4+
# $Id: titleframe.tcl,v 1.52 2009/10/25 20:55:36 oberdorfer Exp $
55
# ------------------------------------------------------------------------------
66
# Index of commands:
77
# - TitleFrame::create
@@ -18,7 +18,7 @@ namespace eval TitleFrame {
1818
{-relief TkResource groove 0 frame}
1919
{-borderwidth TkResource 2 0 frame}
2020
{-font TkResource "" 0 label}
21-
{-foreground Color "SystemWindow" 0}
21+
{-foreground Color "SystemWindowText" 0}
2222
{-background Color "SystemWindowFrame" 0}
2323
{-state TkResource "" 0 label}
2424
{-background TkResource "" 0 frame}

0 commit comments

Comments
 (0)