WmDefault.csc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
  2. #
  3. # $Id: WmDefault.csc,v 1.2 2001/12/09 05:03:09 idiscovery Exp $
  4. #
  5. #
  6. proc tixPref:SetScheme-Color:WmDefault {args} {
  7. global tixOption
  8. package require wm_default
  9. if {![info exists ::wm_default::wm]} {
  10. wm_default::setup
  11. wm_default::addoptions
  12. }
  13. set tixOption(bg) $::wm_default::background
  14. set tixOption(fg) $::wm_default::foreground
  15. # was "#808080"
  16. set tixOption(dark1_bg) $::wm_default::disabledbackground
  17. set tixOption(inactive_bg) $::wm_default::disabledbackground
  18. set tixOption(inactive_fg) black; # unused
  19. # light1 was used for listbox widgets and trough colors
  20. set tixOption(light1_bg) $::wm_default::scrollbars
  21. set tixOption(light1_fg) white; #unused
  22. # text is now used for listbox widgets
  23. set tixOption(list_bg) $::wm_default::textbackground
  24. set tixOption(active_bg) $::wm_default::activebackground
  25. set tixOption(active_fg) $::wm_default::activeforeground
  26. set tixOption(disabled_fg) $::wm_default::disabledforeground
  27. # new
  28. set tixOption(disabled_bg) $::wm_default::disabledtextbackground
  29. set tixOption(textbackground) $::wm_default::textbackground
  30. set tixOption(input1_fg) $::wm_default::textforeground
  31. set tixOption(select_fg) $::wm_default::selectforeground
  32. set tixOption(select_bg) $::wm_default::selectbackground
  33. set tixOption(selector) $::wm_default::selectcolor
  34. set pri $tixOption(prioLevel)
  35. # Try to give the subwidget (hlist) the highlightThickness
  36. foreach pref {*TixDirTree *TixDirList *TixTree \
  37. *TixScrolledListBox \
  38. *TixScrolledTList *TixScrolledText} {
  39. option add $pref.highlightThickness 0 $pri
  40. }
  41. # necessary:
  42. option add *TixBalloon*background white $pri
  43. option add *TixBalloon*foreground black $pri
  44. option add *TixBalloon.background black $pri
  45. # necessary: but should be restricted
  46. # was - option add *Label.anchor w $pri
  47. option add *TixBalloon*Label.anchor w $pri
  48. option add *TixComboBox*Label.anchor w $pri
  49. option add *TixFileEntry*Label.anchor w $pri
  50. option add *TixLabelEntry*Label.anchor w $pri
  51. option add *TixOptionMenu*Label.anchor w $pri
  52. option add *TixComboBox*background $tixOption(background) $pri
  53. option add *TixFileEntry*Entry.borderWidth 0 $pri
  54. option add *TixFileEntry.frame.background $tixOption(textbackground) $pri
  55. option add *TixFileEntry*Entry.highlightBackground $::wm_default::highlightbackground $pri
  56. option add *TixOptionMenu*menubutton.relief raised $pri
  57. option add *TixOptionMenu*menubutton.borderWidth $::wm_default::borderwidth $pri
  58. option add *TixResizeHandle*background $tixOption(disabledbackground) $pri
  59. option add *handleActiveBg $::wm_default::selectbackground $pri
  60. # These may already have been covered by wm_default
  61. option add *TixControl*entry.insertBackground $tixOption(textforeground) $pri
  62. option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $pri
  63. option add *TixDirTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
  64. option add *TixDirTree*f1.borderWidth $::wm_default::borderwidth $pri
  65. option add *TixDirTree*f1.relief sunken $pri
  66. option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $pri
  67. option add *TixDirList*hlist.disabledBackground $tixOption(disabled_bg) $pri
  68. option add *TixDirList*f1.borderWidth $::wm_default::borderwidth $pri
  69. option add *TixDirList*f1.relief sunken $pri
  70. option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $pri
  71. option add *TixScrolledHList*hlist.disabledBackground $tixOption(disabled_bg) $pri
  72. option add *TixScrolledHList*f1.borderWidth $::wm_default::borderwidth $pri
  73. option add *TixScrolledHList*f1.relief sunken $pri
  74. option add *TixTree*hlist.background $tixOption(textbackground) $pri
  75. option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $pri
  76. option add *TixTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
  77. option add *TixTree*f1.borderWidth $::wm_default::borderwidth $pri
  78. option add *TixTree*f1.relief sunken $pri
  79. option add *TixFileEntry.background $tixOption(background) $pri
  80. option add *TixHList.activeBackground $tixOption(light1_bg) $pri
  81. option add *TixHList.disabledBackground $tixOption(disabled_bg) $pri
  82. option add *TixLabelEntry*entry.background $tixOption(textbackground) $pri
  83. option add *TixLabelEntry*entry.foreground $tixOption(textforeground) $pri
  84. option add *TixLabelEntry*entry.insertBackground $tixOption(textforeground) $pri
  85. option add *TixMultiView*Listbox.borderWidth 0 $pri
  86. option add *TixMultiView*Listbox.highlightThickness 0 $pri
  87. option add *TixMultiView*Scrollbar.relief sunken $pri
  88. option add *TixMultiView*Scrollbar.width 15 $pri
  89. option add *TixMultiView*f1.borderWidth 2 $pri
  90. option add *TixMultiView*f1.relief sunken $pri
  91. option add *TixMultiView*f1.highlightThickness 2 $pri
  92. option add *TixNoteBook.Background $tixOption(background) $pri
  93. option add *TixNoteBook.nbframe.Background $tixOption(background) $pri
  94. option add *TixNoteBook.nbframe.backPageColor $tixOption(background) $pri
  95. option add *TixNoteBook.nbframe.inactiveBackground $tixOption(disabledbackground) $pri
  96. option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $pri
  97. # option add *TixPanedWindow.seperatorBg $tixOption(disabledbackground) $pri
  98. # option add *TixPanedWindow.handleBg $tixOption(disabledbackground) $pri
  99. option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $pri
  100. option add *TixScrolledTList*tlist.background $tixOption(textbackground) $pri
  101. option add *TixScrolledListBox*listbox.background $tixOption(textbackground) $pri
  102. option add *TixScrolledWindow.frame.background $tixOption(list_bg) $pri
  103. option add *TixTree*hlist.highlightBackground $tixOption(background) $pri
  104. option add *TixTree*hlist.background $tixOption(textbackground) $pri
  105. option add *TixTree*hlist.borderWidth $::wm_default::borderwidth $pri
  106. option add *TixComboBox*Entry.highlightBackground $tixOption(background) $pri
  107. option add *TixComboBox*Entry.background $tixOption(textbackground) $pri
  108. option add *TixComboBox*Entry.foreground $tixOption(textforeground) $pri
  109. option add *TixComboBox*Entry.insertBackground $tixOption(textforeground) $pri
  110. }
  111. proc tixPref:SetScheme-Mono:Gray {} {
  112. global tixOption
  113. package require wm_default
  114. if {![info exists ::wm_default::wm]} {
  115. wm_default::setup
  116. wm_default::addoptions
  117. }
  118. set tixOption(background) lightgray
  119. set tixOption(foreground) black
  120. set tixOption(dark1_bg) gray70
  121. set tixOption(inactive_bg) lightgray
  122. set tixOption(inactive_fg) black
  123. set tixOption(light1_bg) gray90
  124. set tixOption(light1_fg) white
  125. set tixOption(active_bg) gray90
  126. set tixOption(active_fg) $tixOption(foreground)
  127. set tixOption(disabled_fg) gray55
  128. set tixOption(textbackground) $tixOption(light1_bg)
  129. set tixOption(select_fg) white
  130. set tixOption(select_bg) black
  131. set tixOption(selector) black
  132. set pri $tixOption(prioLevel)
  133. # Override what you want with optional arguments to wm_default::adoptions
  134. # necessary:
  135. option add *TixBalloon*background white $pri
  136. option add *TixBalloon*foreground black $pri
  137. option add *TixBalloon.background black $pri
  138. # necessary: but should be restricted
  139. # was - option add *Label.anchor w $pri
  140. option add *TixBalloon*Label.anchor w $pri
  141. option add *TixComboBox*Label.anchor w $pri
  142. option add *TixFileEntry*Label.anchor w $pri
  143. option add *TixLabelEntry*Label.anchor w $pri
  144. # option add *TixDirTree*hlist.highlightBackground $tixOption(background) $pri
  145. # option add *TixDirTree*hlist.background $tixOption(light1_bg) $pri
  146. # option add *TixDirTree*hlist.activeBackground $tixOption(light1_bg) $pri
  147. # option add *TixDirTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
  148. # option add *TixDirTree*f1.borderWidth $::wm_default::borderwidth $pri
  149. option add *TixDirTree*f1.relief sunken $pri
  150. # option add *TixDirList*hlist.highlightBackground $tixOption(background) $pri
  151. # option add *TixDirList*hlist.background $tixOption(light1_bg) $pri
  152. # option add *TixDirList*hlist.activeBackground $tixOption(light1_bg) $pri
  153. # option add *TixDirList*hlist.disabledBackground $tixOption(disabled_bg) $pri
  154. # option add *TixDirList*f1.borderWidth $::wm_default::borderwidth $pri
  155. option add *TixDirList*f1.relief sunken $pri
  156. # option add *TixScrolledHList*hlist.highlightBackground $tixOption(background) $pri
  157. # option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $pri
  158. # option add *TixScrolledHList*hlist.activeBackground $tixOption(light1_bg) $pri
  159. # option add *TixScrolledHList*hlist.disabledBackground $tixOption(disabled_bg) $pri
  160. # option add *TixScrolledHList*f1.borderWidth $::wm_default::borderwidth $pri
  161. option add *TixScrolledHList*f1.relief sunken $pri
  162. # option add *TixTree*hlist.highlightBackground $tixOption(background) $pri
  163. # option add *TixTree*hlist.background $tixOption(light1_bg) $pri
  164. # option add *TixTree*hlist.activeBackground $tixOption(light1_bg) $pri
  165. # option add *TixTree*hlist.disabledBackground $tixOption(disabled_bg) $pri
  166. # option add *TixTree*f1.borderWidth $::wm_default::borderwidth $pri
  167. option add *TixTree*f1.relief sunken $pri
  168. # option add *TixHList.background $tixOption(light1_bg) $pri
  169. # option add *TixHList.activeBackground $tixOption(light1_bg) $pri
  170. # option add *TixHList.disabledBackground $tixOption(light1_bg) $pri
  171. # option add *TixMultiView*Listbox.borderWidth 0 $pri
  172. # option add *TixMultiView*Listbox.highlightThickness 0 $pri
  173. option add *TixMultiView*Scrollbar.relief sunken $pri
  174. # option add *TixMultiView*f1.borderWidth 2 $pri
  175. option add *TixMultiView*f1.relief sunken $pri
  176. # option add *TixMultiView*f1.highlightThickness 2 $pri
  177. # option add *TixMDIMenuBar*menubar.relief raised $pri
  178. # option add *TixMDIMenuBar*menubar.borderWidth 2 $pri
  179. # option add *TixMDIMenuBar*Menubutton.padY 2 $pri
  180. # option add *TixNoteBook.Background $tixOption(background) $pri
  181. # option add *TixNoteBook.nbframe.Background $tixOption(background) $pri
  182. # option add *TixNoteBook.nbframe.backPageColor $tixOption(background) $pri
  183. # option add *TixNoteBook.nbframe.inactiveBackground $tixOption(inactive_bg) $pri
  184. # option add *TixPanedWindow.handleActiveBg $tixOption(active_bg) $pri
  185. # option add *TixPanedWindow.seperatorBg $tixOption(disabledbackground) $pri
  186. # option add *TixPanedWindow.handleBg $tixOption(disabledbackground) $pri
  187. # option add *TixPopupMenu*menubutton.background $tixOption(dark1_bg) $pri
  188. # option add *TixScrolledHList*hlist.highlightBackground $tixOption(background) $pri
  189. # option add *TixScrolledHList*hlist.background $tixOption(light1_bg) $pri
  190. # option add *TixScrolledTList*tlist.highlightBackground $tixOption(background) $pri
  191. # option add *TixScrolledTList*tlist.background $tixOption(light1_bg) $pri
  192. # option add *TixScrolledListBox*listbox.highlightBackground $tixOption(background) $pri
  193. # option add *TixScrolledWindow.frame.background $tixOption(light1_bg) $pri
  194. # option add *TixTree*hlist.highlightBackground $tixOption(background) $pri
  195. # option add *TixTree*hlist.background $tixOption(light1_bg) $pri
  196. # option add *TixTree*hlist.borderWidth $::wm_default::borderwidth $pri
  197. # These were missing
  198. # option add *TixMenu*Menu.selectColor $NIMLook(foreground) $pri
  199. # option add *TixMDIMenuBar*Menubutton.padY 2 $pri
  200. # option add *TixMDIMenuBar*menubar.borderWidth 2 $pri
  201. # option add *TixMDIMenuBar*menubar.relief raised $pri
  202. # option add *TixMultiView*Listbox.borderWidth 0 $pri
  203. # option add *TixMultiView*Listbox.highlightThickness 0 $pri
  204. # option add *TixMultiView*Scrollbar.relief sunken $pri
  205. # option add *TixMultiView*f1.borderWidth 2 $pri
  206. # option add *TixMultiView*f1.highlightThickness 2 $pri
  207. option add *TixMultiView*f1.relief sunken $pri
  208. }
  209. # Leave the standard widgets alone
  210. if {0} {
  211. option add *Background $tixOption(background) $pri
  212. option add *background $tixOption(background) $pri
  213. option add *Foreground $tixOption(foreground) $pri
  214. option add *foreground $tixOption(foreground) $pri
  215. option add *activeBackground $tixOption(active_bg) $pri
  216. option add *activeForeground $tixOption(active_fg) $pri
  217. option add *HighlightBackground $tixOption(background) $pri
  218. option add *selectBackground $tixOption(select_bg) $pri
  219. option add *selectForeground $tixOption(select_fg) $pri
  220. option add *selectBorderWidth 0 $pri
  221. option add *Menu.selectColor $tixOption(foreground) $pri
  222. option add *TixMenu.selectColor $tixOption(foreground) $pri
  223. option add *Menubutton.padY 5 $pri
  224. option add *Button.borderWidth 2 $pri
  225. option add *Button.anchor c $pri
  226. option add *Checkbutton.selectColor $tixOption(selector) $pri
  227. option add *Radiobutton.selectColor $tixOption(selector) $pri
  228. option add *Entry.relief sunken $pri
  229. option add *Entry.highlightBackground $tixOption(background) $pri
  230. option add *Entry.background $tixOption(textbackground) $pri
  231. option add *Entry.foreground $tixOption(textforeground) $pri
  232. option add *Entry.insertBackground $tixOption(textforeground) $pri
  233. option add *Label.anchor w $pri
  234. option add *Label.borderWidth 0 $pri
  235. option add *Listbox.background $tixOption(textbackground) $pri
  236. option add *Listbox.relief sunken $pri
  237. option add *Scale.foreground $tixOption(foreground) $pri
  238. option add *Scale.activeForeground $tixOption(background) $pri
  239. option add *Scale.background $tixOption(background) $pri
  240. option add *Scale.sliderForeground $tixOption(background) $pri
  241. option add *Scale.sliderBackground $tixOption(light1_bg) $pri
  242. option add *Scrollbar.relief sunken $pri
  243. option add *Scrollbar.borderWidth $::wm_default::borderwidth $pri
  244. option add *Scrollbar.width 15 $pri
  245. option add *Text.background $tixOption(textbackground) $pri
  246. option add *Text.relief sunken $pri
  247. }