options.tcl 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. ############################################################################
  2. #
  3. # LIBRARY: options.tcl gui options
  4. # AUTHOR(S): Cedric Shock (cedricgrass AT shockfamily.net)
  5. # PURPOSE: Default options and load user options
  6. # COPYRIGHT: (C) 2006 GRASS Development Team
  7. #
  8. # This program is free software under the GNU General Public
  9. # License (>=v2). Read the file COPYING that comes with GRASS
  10. # for details.
  11. #
  12. ############################################################################
  13. lappend auto_path $env(GISBASE)/bwidget
  14. package require -exact BWidget 1.2.1
  15. # set background color and help font
  16. # These globals are still used in a few places by things in gis.m
  17. set bgcolor HoneyDew2
  18. ##############################################################################
  19. # Create fonts
  20. proc fontcreate {font args} {
  21. if {[lsearch [font names] $font] == -1} {
  22. eval font create $font $args
  23. } else {
  24. eval font configure $font $args
  25. }
  26. }
  27. fontcreate balloon-help -family Helvetica -size -12
  28. fontcreate default -family Helvetica -size -12
  29. fontcreate textfont -family Courier -size -12
  30. fontcreate bolddefault -family Helvetica -size 12 -weight bold
  31. fontcreate introfont -family Helvetica -size 14 -weight bold
  32. global bolddefault
  33. global introfont
  34. global textfont
  35. global default
  36. ##############################################################################
  37. # Configure balloon help:
  38. DynamicHelp::configure -font balloon-help -fg black -bg "#FFFF77"
  39. ##############################################################################
  40. # Configure almost everything using the options database
  41. # Font to use everywhere
  42. option add *font default
  43. # Font in labelframes of labels in bwidgets is prefixed with label:
  44. option add *labelfont default
  45. # Various background colors
  46. option add *background #dddddd
  47. option add *activeBackground #dddddd
  48. option add *highlightBackground #dddddd
  49. option add *ButtonBox.background HoneyDew2
  50. option add *ButtonBox*add.highlightBackground HoneyDew2
  51. option add *MainFrame.background HoneyDew2
  52. option add *PanedWindow.background HoneyDew2
  53. option add *Menu.background HoneyDew2
  54. option add *listbox.background white
  55. option add *addindicator.background white
  56. # Things that are selected:
  57. option add *selectBackground #ffff9b
  58. option add *selectForeground black
  59. # Menus use active instead of selected
  60. option add *Menu.activeBackground #ffff9b
  61. option add *Menu.activeForeground black
  62. # Scrollbar trough color
  63. option add *troughColor HoneyDew3
  64. # Entry widgets and text widgets should have a white background
  65. option add *Entry.background white
  66. option add *entry.background white
  67. option add *Entry.highlightbackground #dddddd
  68. option add *entrybg white
  69. option add *Text.background white
  70. option add *Entry.font textfont
  71. option add *Text.font textfont
  72. # Options for map canvases
  73. option add *mapcanvas.background #eeeeee
  74. option add *mapcanvas.insertbackground black
  75. option add *mapcanvas.selectbackground #c4c4c4
  76. option add *mapcanvas.selectforeground black
  77. ##############################################################################
  78. # Platform specific default settings:
  79. # keycontrol is control key used in copy-paste bindings
  80. set keycontrol "Control"
  81. if {[info exists env(osxaqua)]} {
  82. set osxaqua $env(osxaqua)
  83. } else {
  84. set osxaqua "0"
  85. }
  86. if { $osxaqua == "1"} {
  87. set keycontrol "Command"
  88. }
  89. if {[info exists env(OS)] && $env(OS) == "Windows_NT"} {
  90. set mingw "1"
  91. } else {
  92. set mingw "0"
  93. }