### Copyright (C) 1995, 1996, 1997 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 FvwmIdent {} {
  # Modules / FvwmIdent
  Desc "Configuration of the FvwmIdent module"
  ShortDesc "FvwmIdent"

  Header h -text "FvwmIdent" -frame:relief flat \
      -help "On this page you configure the FvwmIdent module. This"\
      "module is used for identifying windows. By using this you can"\
      "find the name to use whenever Fvwm2 or a module wants you to"\
      "enter a window name."
  Line l
  CheckBox spawn -text "Spawn this module when Fvwm2 starts" \
      -help "There's no sense in spawning this module, because it will"\
      "exit after identifying one window. Put it in a menu or bind it to"\
      "a key or mouse instead."
  Init {Disable spawn}

  Line globL

  CheckBox fcB -text "Specify foreground color" \
      -help "Check this option if you want to change the foreground"\
      "(text) color of the window popped up by FvwmIdent."
  Command fc \
      -default [list "black" 0] \
      -setvalue {
	$widget configure -bg [lindex $fc 0] -text "      "} \
      -invoke {ColorWidget $colorList [lindex $fc 0] \
		   [lindex $fc 1]} \
      -disable {$widget configure -relief flat } \
      -enable {$widget configure -relief raised } \
      -help "In this widget you configure the color of the text in"\
      "FvwmIdent."
  Frame fcF -entries fcB fc
  Change {
    if {$changeElm == "fcB"} {if {$fcB == 1} {Enable fc} else {Disable fc}}
  }
  Save {if {$fcB == 1} {print "*FvwmIdentFore\t[hash2rgb [lindex $fc 0]]"}}

  CheckBox bcB -text "Specify background color" \
      -help "Check this option if you want to change the background"\
      "color of the window popped up by FvwmIdent."
  Command bc \
      -default [list "white" 0] \
      -setvalue {
	$widget configure -bg [lindex $bc 0] -text "      "} \
      -invoke {ColorWidget $colorList [lindex $bc 0] \
		   [lindex $bc 1]} \
      -disable {$widget configure -relief flat } \
      -enable {$widget configure -relief raised } \
      -help "In this widget you configure the color of the background in"\
      "FvwmIdent."
  Frame bcF -entries bcB bc
  Change {
    if {$changeElm == "bcB"} {if {$bcB == 1} {Enable bc} else {Disable bc}}
  }
  Save {if {$bcB == 1} {print "*FvwmIdentBack\t[hash2rgb [lindex $bc 0]]"}}

  CheckBox fnB -text "Specify font used" \
      -help "Here you can select a font to use in the identification"\
      "window. All text will be written using this font."
  Command fn \
      -default "fixed" \
      -setvalue {buttonSetText $widget $fn} \
      -invoke {FontWidget $fn 0} \
      -disable {$widget configure -text "Not set"
	$widget configure -font fixed} \
      -enable {buttonSetText $widget $fn} \
      -help "In this widget you configure the font to use in FvwmIdent."
  Frame fnF -entries fnB fn
  Change {
    if {$changeElm == "fnB"} {if {$fnB == 1} {Enable fn} else {Disable fn}}
  }
  Save {if {$fnB == 1} {print "*FvwmIdentFont\t$fn"}}
}
