123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- #!/usr/local/bin/tclsh
- # Undocumented program. Don't use it.
- #
- # Usage:
- #
- # tixmkpref option name.src > name.tcl
- #
- proc tixDefOption {classes specs {level \$tixOption(prioLevel)}} {
- global isFont tixOption
- foreach class $classes {
- foreach spec $specs {
- if [regexp (Font)|(font) $spec] {
- if {$isFont} {
- puts "option add *$class$spec $level"
- }
- } else {
- if {!$isFont} {
- set aspec [subst $spec]
- puts "option add *$class$spec $level"
- }
- }
- }
- }
- }
- proc option {classes specs {level \$tixOption(prioLevel)}} {
- tixDefOption $classes $specs $level
- }
- proc tixInitOptionDatabase {strictTK} {
- global tixOption isFont
- # general stuff, everything gets these defaults unless otherwise specified
- #-------------------------------------------------------------------------
- tixDefOption {""} {{Font $tixOption(font)}}
- tixDefOption {""} {{font $tixOption(font)}}
- tixDefOption {""} {{background $tixOption(bg)}} 10
- tixDefOption {""} {{Background $tixOption(bg)}}
- tixDefOption {""} {{background $tixOption(bg)}}
- tixDefOption {""} {{Foreground $tixOption(fg)}}
- tixDefOption {""} {{foreground $tixOption(fg)}}
- tixDefOption {""} {{activeBackground $tixOption(active_bg)}}
- tixDefOption {""} {{activeForeground $tixOption(active_fg)}}
- tixDefOption {""} {{HighlightBackground $tixOption(bg)}}
- tixDefOption {""} {{selectBackground $tixOption(select_bg)}}
- tixDefOption {""} {{selectForeground $tixOption(select_fg)}}
- tixDefOption {""} {{selectBorderWidth 0}}
- #----------------------------------------
- # Standard TK Widget Options
- #
- # We set up the options for the TK widgets only if
- # the strictTK option is not selected.
- #----------------------------------------
- tixDefOption {Menu TixMenu} {
- {.font $tixOption(menu_font)}
- {.selectColor $tixOption(selector)}
- }
- tixDefOption {Menubutton} {
- {.font $tixOption(menu_font)}
- {.padY 5}
- }
- tixDefOption {Button} {
- {.borderWidth 2}
- {.anchor c}
- }
- tixDefOption {Checkbutton Radiobutton} {
- {.selectColor $tixOption(selector)}
- }
- tixDefOption {Entry} {
- {.relief sunken}
- {.highlightBackground $tixOption(bg)}
- {.background $tixOption(input1_bg)}
- {.foreground black}
- {.insertBackground black}
- }
- tixDefOption {Label} {
- {.anchor w}
- {.borderWidth 0}
- {.font $tixOption(bold_font)}
- }
- tixDefOption {Listbox} {
- {.background $tixOption(light1_bg)}
- {.relief sunken}
- }
- tixDefOption {Scale} {
- {.foreground $tixOption(fg)}
- {.activeForeground $tixOption(bg)}
- {.background $tixOption(bg)}
- {.sliderForeground $tixOption(bg)}
- {.sliderBackground $tixOption(light1_bg)}
- {.font $tixOption(italic_font)}
- }
- tixDefOption {Scrollbar} {
- {.background $tixOption(bg)}
- {.troughColor $tixOption(light1_bg)}
- {.relief sunken}
- {.borderWidth 1}
- {.width 15}
- }
- tixDefOption {Text} {
- {.background $tixOption(input1_bg)}
- {.relief sunken}
- }
- #----------------------------------------------------------------------
- # TIX WIDGETS
- #----------------------------------------------------------------------
- tixDefOption {TixBalloon} {
- {*background #ffff60}
- {*foreground black}
- {.background black}
- {*Label.font $tixOption(font)}
- {*Label.anchor w}
- }
- tixDefOption {TixBitmapButton} {
- {*label.font $tixOption(font)}
- }
- tixDefOption {TixControl} {
- {*entry.highlightBackground $tixOption(bg)}
- {*entry.background $tixOption(input1_bg)}
- {*entry.foreground black}
- {*entry.insertBackground black}
- {*label.font $tixOption(bold_font)}
- }
- # DLG_BTNS
- #
- tixDefOption {TixStdButtonBox} {
- }
- # DIR_LIST
- #
- tixDefOption {TixDirTree TixDirList TixScrolledHList TixTree} {
- {*Scrollbar.background $tixOption(bg)}
- {*Scrollbar.troughColor $tixOption(light1_bg)}
- {*hlist.highlightBackground $tixOption(bg)}
- {*hlist.background $tixOption(light1_bg)}
- {*hlist.activeBackground $tixOption(light1_bg)}
- {*hlist.disabledBackground $tixOption(light1_bg)}
- {*f1.borderWidth 1}
- {*f1.relief sunken}
- }
- tixDefOption {TixFileEntry} {
- {*Entry.background $tixOption(input1_bg)}
- }
- tixDefOption {TixHList} {
- {.background $tixOption(light1_bg)}
- {.activeBackground $tixOption(light1_bg)}
- {.disabledBackground $tixOption(light1_bg)}
- }
- tixDefOption {TixLabelEntry} {
- {*entry.highlightBackground $tixOption(bg)}
- {*entry.background $tixOption(input1_bg)}
- {*entry.foreground black}
- {*entry.insertBackground black}
- {*label.font $tixOption(bold_font)}
- }
- tixDefOption {TixLabelFrame} {
- {*label.font $tixOption(bold_font)}
- }
- tixDefOption {TixMultiList} {
- {*Listbox.borderWidth 0}
- {*Listbox.highlightThickness 0}
- {*Scrollbar.background $tixOption(bg)}
- {*Scrollbar.troughColor $tixOption(light1_bg)}
- {*Scrollbar.relief sunken}
- {*Scrollbar.width 15}
- {*f1.borderWidth 2}
- {*f1.relief sunken}
- {*f1.highlightThickness 2}
- }
- # MwmClient
- #
- tixDefOption {TixMwmClient} {
- {*title.font $tixOption(menu_font)}
- }
- tixDefOption {TixMDIMenuBar} {
- {*menubar.relief raised}
- {*menubar.borderWidth 2}
- {*Menubutton.padY 2}
- }
- # NoteBook
- #
- tixDefOption {TixNoteBook} {
- {.Background $tixOption(bg)}
- {.nbframe.Background $tixOption(bg)}
- {.nbframe.font $tixOption(menu_font)}
- {.nbframe.backPageColor $tixOption(bg)}
- {.nbframe.inactiveBackground $tixOption(inactive_bg)}
- }
-
- # OPTION_MENU
- #
- tixDefOption {TixOptionMenu} {
- {*menubutton.font $tixOption(font)}
- }
- # PANED_WINDOW
- #
- tixDefOption {TixPanedWindow} {
- {.handleActiveBg $tixOption(active_bg)}
- {.seperatorBg $tixOption(bg)}
- {.handleBg $tixOption(dark1_bg)}
- }
- # POPUP MENU
- #
- tixDefOption {TixPopupMenu} {
- {*menubutton.background $tixOption(dark1_bg)}
- }
- # SCROLLED_HLIST
- #
- tixDefOption {TixScrolledHList} {
- {*Scrollbar.background $tixOption(bg)}
- {*Scrollbar.troughColor $tixOption(light1_bg)}
- {*hlist.highlightBackground $tixOption(bg)}
- {*hlist.background $tixOption(light1_bg)}
- }
- tixDefOption {TixScrolledTList} {
- {*Scrollbar.background $tixOption(bg)}
- {*Scrollbar.troughColor $tixOption(light1_bg)}
- {*tlist.highlightBackground $tixOption(bg)}
- {*tlist.background $tixOption(light1_bg)}
- }
- # SCROLLED_LISTBOX, .. ETC
- #
- tixDefOption {TixScrolledListBox} {
- {*Scrollbar.background $tixOption(bg)}
- {*Scrollbar.troughColor $tixOption(light1_bg)}
- {*listbox.highlightBackground $tixOption(bg)}
- {*listbox.background $tixOption(light1_bg)}
- }
- tixDefOption {TixScrolledText} {
- {*Scrollbar.background $tixOption(bg)}
- {*Scrollbar.troughColor $tixOption(light1_bg)}
- }
- # SCROLLED_WINDOW
- #
- tixDefOption {TixScrolledWindow} {
- {*Scrollbar.background $tixOption(bg)}
- {*Scrollbar.troughColor $tixOption(light1_bg)}
- {.frame.background $tixOption(light1_bg)}
- }
- # SELECT
- #
- tixDefOption {TixSelect} {
- }
- tixDefOption {TixTree} {
- {*Scrollbar.background $tixOption(bg)}
- {*Scrollbar.troughColor $tixOption(light1_bg)}
- {*hlist.highlightBackground $tixOption(bg)}
- {*hlist.background $tixOption(light1_bg)}
- {*hlist.borderWidth 1}
- }
- # NON ALPHABETICAL ORDER WIDGETS
- # Since TK's option database follows the order-of-declaration rule, not
- # specific-vs-general rule, the options of the widgets below depends on
- # the options of the widget above, so their options must be defined here
- # COMBOBOX
- tixDefOption {TixComboBox} {
- {*Entry.font $tixOption(font)}
- {*Entry.highlightBackground $tixOption(bg)}
- {*Entry.background $tixOption(input1_bg)}
- {*Entry.foreground black}
- {*Entry.insertBackground black}
- }
- # FILE_SELECT_BOX
- #
- tixDefOption {TixFileSelectBox} {
- {*Label.font $tixOption(bold_font)}
- }
- tixDefOption {TixExFileSelectBox} {
- }
- }
- #----------------------------------------------------------------------
- # The default fontset and schemes
- #
- #----------------------------------------------------------------------
- source ../DefSchm.tcl
- rename tixSetDefaultFontset tixSetFontset
- rename tixSetDefaultScheme-Color tixSetScheme-Color
- rename tixSetDefaultScheme-Mono tixSetScheme-Mono
- #----------------------------------------------------------------------
- # Action:
- #----------------------------------------------------------------------
- if [string match TK* [lindex $argv 1]] {
- set isTK 1
- } else {
- set isTK 0
- }
- set schemeName [lindex [split [lindex $argv 1] "."] 0]
- source [lindex $argv 1]
- tixSetFontset
- if {[lindex $argv 0] == "-font"} {
- set isFont 1
- # FontSets will be set in two steps.
- # (1) init fontsets
- # ... tix checks the validity of the fonts ...
- # (2) add the fontsets into the option database.
- #
- puts "proc tixPref:InitFontSet:$schemeName {} { "
- puts [info body tixSetFontset]
- puts "}"
- puts "proc tixPref:SetFontSet:$schemeName {} { "
- puts "global tixOption"
- if {! $isTK} {
- tixInitOptionDatabase 0
- }
- puts "}"
- } else {
- set isFont 0
- # Do the Color First
- #
- puts "proc tixPref:SetScheme-Color:$schemeName {} {"
- puts [info body tixSetScheme-Color]
- if {! $isTK} {
- tixSetScheme-Color
- tixInitOptionDatabase 0
- }
- puts "}"
- # Now Do the Mono
- #
- puts "proc tixPref:SetScheme-Mono:$schemeName {} {"
- puts [info body tixSetScheme-Mono]
- if {! $isTK} {
- tixSetScheme-Mono
- tixInitOptionDatabase 0
- }
- puts "}"
- }
|