### Copyright (C) 1995 Jeppe Buk (buk@imada.sdu.dk)
### This program is free software; you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation; either version 2 of the License, or
### (at your option) any later version.
###
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
### GNU General Public License for more details.
###
### You should have received a copy of the GNU General Public License
### along with this program; if not, write to the Free Software
### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

proc activeColors {} {
  # Colors / Active windows
  Desc "The color of active windows"
  ShortDesc "Color of active windows"

  # Find the names of all the defined colors
  set names [getColors]
  
  if {$names != {}} {
    # The colors have been found
    ListBox for -text "Foreground" -entries $names -selectmode single \
	-help "This is the foreground color of active windows"
    ListBox bac -text "Background" -entries $names -selectmode single \
	-help "This is the background color of active windows"
  } else {
    error "Unable to execute 'showrgb' (comes with X11)"
  }

  Save {
    if {$for(name) != {}} {print "HiForeColor\t$for(name)"}
    if {$bac(name) != {}} {print "HiBackColor\t$bac(name)"}
  }
}

proc inactiveColors {} {
  # Colors / Inactive windows
  Desc "The color of inactive, non-sticky windows"
  ShortDesc "Color of inactive windows"

  # Find the names of all the defined colors
  set names [getColors]
  
  if {$names != {}} {
    # The colors have been found
    ListBox for -text "Foreground" -entries $names -selectmode single \
	-help "This is the foreground color of inactive windows"
    ListBox bac -text "Background" -entries $names -selectmode single \
	-help "This is the background color of inactive windows"
  }

  Save {
    if {$for(name) != {}} {print "StdForeColor\t$for(name)"}
    if {$bac(name) != {}} {print "StdBackColor\t$bac(name)"}
  }
}

proc stickyColors {} {
  # Colors / Sticky windows
  Desc "The color of inactive, sticky windows"
  ShortDesc "Color of inactive, sticky windows"

  # Find the names of all the defined colors
  set names [getColors]
  
  if {$names != {}} {
    # The colors have been found
    ListBox for -text "Foreground" -entries $names -selectmode single \
	-help "This is the foreground color of sticky windows"
    ListBox bac -text "Background" -entries $names -selectmode single \
	-help "This is the background color of sticky windows"
  }

  Save {
    if {$for(name) != {}} {print "StickyForeColor\t$for(name)"}
    if {$bac(name) != {}} {print "StickyBackColor\t$bac(name)"}
  }
}

proc pagerColors {} {
  # Colors / Pager colors
  Desc "The color of the internal pager"
  ShortDesc "Color of the pager"

  # Find the names of all the defined colors
  set names [getColors]
  
  if {$names != {}} {
    # The colors have been found
    ListBox for -text "Foreground" -entries $names -selectmode single \
	-help "This is the foreground color of the internal pager"
    ListBox bac -text "Background" -entries $names -selectmode single \
	-help "This is the background color of the internal pager"
  }

  Save {
    if {$for(name) != {}} {print "PagerForeColor\t$for(name)"}
    if {$bac(name) != {}} {print "PagerBackColor\t$bac(name)"}
  }
}

proc menuColors {} {
  # Colors / Menu colors
  Desc "The color of the menus"
  ShortDesc "Color of the menus"

  # Find the names of all the defined colors
  set names [getColors]
  
  if {$names != {}} {
    # The colors have been found
    ListBox for -text "Foreground" -entries $names -selectmode single \
	-help "This is the foreground color of items on the menu"
    ListBox bac -text "Background" -entries $names -selectmode single \
	-help "This is the background color of the menu"
    ListBox stp -text "Inactive" -entries $names -selectmode single \
	-help "This is the foreground color of disabled items on the menu"
  }

  Save {
    if {$for(name) != {}} {print "MenuForeColor\t$for(name)"}
    if {$bac(name) != {}} {print "MenuBackColor\t$bac(name)"}
    if {$stp(name) != {}} {print "MenuStippleColor\t$stp(name)"}
  }
}
