### 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 miscellaneous {} {
  # Look-and-Feel / Miscellaneous
  Desc "Miscellaneous settings"
  ShortDesc "Miscellaneous"

  Header miscH -text "Miscellaneous Settings" -frame:relief flat
  Line miscL

  #######################################################################
  # ClickTime
  #
  CheckBox clickTime -text "Change delay for double clicks to"
  Int clickDelay -textafter "milli seconds"
  Frame clickDelayF -entries { clickTime clickDelay }

  Help clickTime \
      "Use this to change the click time for double clicks. This is" \
      "very useful if you're having trouble double clicking."
  Help clickDelay \
      "Here you can specify the maximum time interval (in milli seconds)" \
      "allowed between two clicks to make it a double click. The default" \
      "used by FVWM is 150 milli seconds."

  Change {
    if { $changeElm == "clickTime" } {
      if { $clickTime == 1 } { Enable clickDelay } else { Disable clickDelay }
    }
  }

  PageEnd {
    if { $clickTime == 1 } {
      if { $clickDelay == "" } {
	error "No value given for double click delay"
      }
    }
  }
  
  Save {if { $clickTime == 1 } { print "ClickTime\t$clickDelay" }}
  #
  #######################################################################

  #######################################################################
  # ColormapFocus
  #
  CheckBox cmf -text "Install the colormap for the window\nwhich has the\
 keyboard focus" \
      -justify left

  Help cmf \
      "Normally FVWM installs the colormap for the window the mouse is" \
      "in, but by setting this option you change that behavior so the" \
      "window currently having keyboard focus determines the colormap."

  Save {if {$cmf == 1} {print "ColormapFocus\tFollowsFocus"}}
  #
  #######################################################################

  #######################################################################
  # OpaqueMove
  #
  CheckBox opmB -text "Set the maximum window size for opaque move to:"
  Int opmE -text "     " -textafter "% of the physical screen"

  set opmHelp [concat \
      "By default FVWM only moves windows smaller than 5% of the" \
      "physical screen size opaquely (with their contents). If you" \
      "have a fast server you may like to set this value higher, so" \
      "larger windows will be moved opaquely too." ]
  Help opmB $opmHelp
  Help opmE $opmHelp

  Change {
    if { $changeElm == "opmB" } {
      if { $opmB == 1 } { Enable opmE } else { Disable opmE }
    }
  }

  PageEnd {
    if { $opmB == 1 && ( $opmE == "" || $opmE > 100 || $opmE < 0 ) } {
      error "Invalid opaque move value"
    }
  }

  Save { if { $opmB == 1 } { print "OpaqueMoveSize\t$opmE" } }
  #
  #######################################################################

  #######################################################################
  # XORvalue
  #
  CheckBox xorB -text "Change the XOR value to"
  Int xorV
  Frame xor -entries { xorB xorV }

  Help xorB "This value is used for XOR'ing bits when doing rubber-band"\
      "window moving or resizing (i.e. the windows is drawn as a"\
      "ghostly outline while moving/resizing). Therefore the value"\
      "influences the visibility of these rubber-bands. There is no"\
      "easy way of telling which values are 'good' or 'bad', so you'll"\
      "just have to try out a number of values."
  Help xorV \
      "Here you enter the XOR value to use."

  Change {
    if { $changeElm == "xorB" } {
      if { $xorB == 1 } { Enable xorV } else { Disable xorV }
    }
  }

  PageEnd {
    if { $xorB == 1 && $xorV == "" } {
      error "Invalid XOR value given."
    }
  }

  Save { if { $xorB == 1 } { print "XORvalue\t$xorV" } }
  #
  #######################################################################
}
