Bwidget Source Code
Check-in [f61e385b73]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:color declaration doesn't work for winxp64 - deleted!
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f61e385b734cfbad7fa3aff62f7d6e41ebdc002a
User & Date: oberdorfer 2009-09-09 19:35:04
Context
2009-09-10
19:00
*** BWidget revitalization to make usage of ttk *** * pkgIndex.tcl, updated to 1.9.1, themeutils.tcl added, requ. initialization sequence * themeutils.tcl, theme support file added * widget.tcl, various changes related to ttk added * init,tcl, BWidget::set_themedefaults "initialize" added * -- arrow.tcl, button.tcl, buttonbox.tcl, color.tcl, dialog.tcl, entry.tcl, font.tcl, label.tcl, labelframe.tcl, listbox.tcl, mainframe.tcl, messagedlg.tcl, pagesmgr.tcl, panedw.tcl, panelframe.tcl, passwddlg.tcl, progressbar.tcl, scrollframe.tcl, scrollview.tcl, scrollw.tcl, separator.tcl, spinbox.tcl, statusbar.tcl, titleframe.tcl, combobox.tcl, notebook.tcl -- theme related mod's done * utils.tcl, BWidget::bindMiddleMouseMovement added, * tree.tcl, BWidget::bindMiddleMouseMovement added),
-- open issues: Tk*Font as default font (like in dynhelp.tcl), tree.tcl _themechanged proc' not perfect for existing tree item colorization (expanding a branch after changing the style still shows the previous fill color !)
-- note: -- **** package ready for testing ***
check-in: 33b0bf7d88 user: oberdorfer tags: trunk
2009-09-09
19:35
color declaration doesn't work for winxp64 - deleted! check-in: f61e385b73 user: oberdorfer tags: trunk
19:29
sample ttk themes check-in: f071091370 user: oberdorfer tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to themeutils.tcl.

1
2
3
4
5
6
7
8
9
10
11
..
68
69
70
71
72
73
74











75
76
77
78
79
80
81
82
...
317
318
319
320
321
322
323


324
325
326
327
328
329
330
331
332
333
334
335
336


337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# ----------------------------------------------------------------------------
#  themeutils.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: themeutils.tcl,v 1.0 2009/09/05 21:01:07 oberdorfer Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - BWidget::usepackage
#     - BWidget::using
#     - BWidget::wrap
#     - BWidget::getcurrent_theme
#     - BWidget::read_ttkstylecolors
................................................................................

		set ctheme [getcurrent_theme]
		if { [lsearch [get_colordcls] $ctheme] == -1 } {
		    return -code error \
                        "color declarations for $ctheme missing!"
		}
                set_themedefaults











		Widget::theme 1
            }
	    default {
	        return -code error \
		  "[namespace curren] - invalid argument specified!"
	    }
        }
    }
................................................................................
}


proc BWidget::default_Color { } {
    variable colors
    set colors(style) "default"



    if {[string equal $::tcl_platform(platform) "windows"]} {
         array set colors {
            SystemWindow        SystemWindow
            SystemWindowFrame   SystemWindowFrame
            SystemWindowText    SystemWindowText
            SystemButtonFace    SystemButtonFace
            SystemButtonText    SystemButtonText
            SystemDisabledText  SystemDisabledText
            SystemHighlight     SystemHighlight
            SystemHighlightText SystemHighlightText
            SystemMenu          SystemMenu
            SystemMenuText      SystemMenuText
            SystemScrollbar     SystemScrollbar


         }
      } else {
         array set colors {
            SystemWindow        "White"
            SystemWindowFrame   "#d9d9d9"
            SystemWindowText    "Black"
            SystemButtonFace    "#d9d9d9"
            SystemButtonText    "Black"
            SystemDisabledText  "#a3a3a3"
            SystemHighlight     "#c3c3c3"
            SystemHighlightText "White"
            SystemMenu          "#d9d9d9"
            SystemMenuText      "Black"
            SystemScrollbar     "#d9d9d9"
         }
    }
}


proc BWidget::winxpblue_Color { } {
    variable colors
    set colors(style) "winxpblue"



|







 







>
>
>
>
>
>
>
>
>
>
>
|







 







>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
|
<
|











|
<







1
2
3
4
5
6
7
8
9
10
11
..
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
...
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352

353
354
355
356
357
358
359
360
361
362
363
364
365

366
367
368
369
370
371
372
# ----------------------------------------------------------------------------
#  themeutils.tcl
#  This file is part of Unifix BWidget Toolkit
#  $Id: themeutils.tcl,v 1.1 2009/09/09 19:35:04 oberdorfer Exp $
# ----------------------------------------------------------------------------
#  Index of commands:
#     - BWidget::usepackage
#     - BWidget::using
#     - BWidget::wrap
#     - BWidget::getcurrent_theme
#     - BWidget::read_ttkstylecolors
................................................................................

		set ctheme [getcurrent_theme]
		if { [lsearch [get_colordcls] $ctheme] == -1 } {
		    return -code error \
                        "color declarations for $ctheme missing!"
		}
                set_themedefaults

                # create a new element for each available theme...
                foreach themeName [ttk::style theme names] {
                    # temporarily sets the current theme to themeName,
                    # evaluate script, then restore the previous theme.
                    ttk::style theme settings $themeName {
                        ttk::style configure BWSlimCB.Toolbutton -relief flat -bd 2
                        ttk::style map BWSlimCB.Toolbutton \
	                               -relief [list {selected !disabled} sunken]
		    }
		}
  		Widget::theme 1
            }
	    default {
	        return -code error \
		  "[namespace curren] - invalid argument specified!"
	    }
        }
    }
................................................................................
}


proc BWidget::default_Color { } {
    variable colors
    set colors(style) "default"

    # !!! doesn't work on winxp64
    #     + starpacked executable from equi4
    # if {[string equal $::tcl_platform(platform) "---windows---"]} {
    #    array set colors {
    #      SystemWindow        SystemWindow
    #      SystemWindowFrame   SystemWindowFrame
    #      SystemWindowText    SystemWindowText
    #      SystemButtonFace    SystemButtonFace
    #      SystemButtonText    SystemButtonText
    #      SystemDisabledText  SystemDisabledText
    #      SystemHighlight     SystemHighlight
    #      SystemHighlightText SystemHighlightText
    #      SystemMenu          SystemMenu
    #      SystemMenuText      SystemMenuText
    #      SystemScrollbar     SystemScrollbar
    #    }
    # }


    array set colors {
            SystemWindow        "White"
            SystemWindowFrame   "#d9d9d9"
            SystemWindowText    "Black"
            SystemButtonFace    "#d9d9d9"
            SystemButtonText    "Black"
            SystemDisabledText  "#a3a3a3"
            SystemHighlight     "#c3c3c3"
            SystemHighlightText "White"
            SystemMenu          "#d9d9d9"
            SystemMenuText      "Black"
            SystemScrollbar     "#d9d9d9"
   }

}


proc BWidget::winxpblue_Color { } {
    variable colors
    set colors(style) "winxpblue"