### 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 FvwmAuto {} {
  # Modules / FvwmAuto
  Desc "Configuration of the FvwmAuto module"
  ShortDesc "FvwmAuto"

  Header h -text "FvwmAuto" -frame:relief flat \
      -help "On this page you configure the FvwmAuto module. This"\
      "module is used for auto-raising windows having the input focus."
  Line l
  CheckBox spawn -text "Spawn this module when Fvwm2 starts" \
      -help "If you check this option the module will be spawned from"\
      "the two functions 'InitFunction' and 'RestartFunction'. You will"\
      "not have to insert them yourself then."
  Int delay -text "Delay in milliseconds before raising" -help "Here"\
      "you specify the number of miliseconds a window must retain the"\
      "keyboard focus before it is raised."

  Change {
    if {$changeElm == "spawn"} {
      if {$spawn == 1} {Enable delay} else {Disable delay}
    }
  }

  PageEnd {
    if {$spawn == 1 && $delay == ""} {
      error "You must specify a delay in milliseconds if you spawn FvwmAuto"
    }
  }

  Save {
    if {$spawn == 1} {
      print "AddToFunc InitFunction \"I\" Module FvwmAuto $delay"
      print "AddToFunc RestartFunction \"I\" Module FvwmAuto $delay"
    }
  }
}
