### Copyright (C) 1996 Rasmus Ingemann Hansen
### 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 optionmenu {} {
    # Menues / Option menu
    Desc "Configurably options from within Elm"
    ShortDesc "Options at O)ptions menu"

    ## set to choose from: ##
    set optionMenuItems { 
	"-- Blank line --" "bla"
        "[a] Arrow cursor" "p"
	"[b] Border on copy" ""
        "[d] Display mail using" ""
	"[e] Primary editor" ""
        "[f] Folder directory" ""
	"[h] Hold sent message" ""
	"[j] Reply editor" ""
	"[k] Pause after pager" ""
	"[l] Alias sorting" ""
        "[m] Menu display" ""
        "[n] Names only" ""
        "[o] Outboard mail saved" ""
        "[p] Print mail using" ""
	"[r] Reply copies msg" ""
        "[s] Sorting criteria" ""
	"[t] Text editor (~e)" ""
        "[u] User level" ""
        "[v] Visual editor" ""
        "[y] Your full name" ""
	"[w] Want Cc: prompt" ""
	"[z] Signature dashes" ""
    }

    Header head1 -text "Select items for Options menu"\
	    -background gray\
	    -help "These items can all appear on the O) menu. This menu is where you from inside of Elm can modify attributes for each option. Order of apperance is as shown here. Blanks is kept for neather look when used to group the options. Authors advice is not to spend time here and use Dotgen instead."

    ComboBox optionMenuComboBox \
	-text "Option item" \
	-entryhelp $optionMenuItems \
	-noedit 1 \
	-count 5 \
	-width 30

    ### default settings ###
    ExtEntry optionMenuEntry \
	-text "Accessable options from the OptionsMenu" \
	-entries {optionMenuComboBox} \
	-noscissor 0 \
	-count 5


    ### Precautions ###
    Header head4 -text "Help and precautions"\
	-background gray

    Label label1 -text "Beware: It's fully legal to select the same item twice!\n(too many items easyly exceed heigth of your menu, though)\nAuthors advice is not to spend time here and use\nthe other modulepages instead." \
	-help ""


  ################################ Help ################################
    Help optionMenuEntry "RASSO IS HERE"


  ############################## Init / Save ##############################

    Init {
    }

    Save {
	set temp ""

	forevery optionMenuEntry {
                if {$optionMenuComboBox == "-- Blank line --"} {
                   append temp "_"
                }
                if {$optionMenuComboBox == "\[a] Arrow cursor"} {
                   append temp "a"
                }
		if {$optionMenuComboBox == "\[b] Border on copy"} {
			append temp "b"
                }
		if {$optionMenuComboBox == "\[d] Display mail using"} {
			append temp "d"
                }
		if {$optionMenuComboBox == "\[e] Primary editor"} {
			append temp "e"
                }
		if {$optionMenuComboBox == "\[f] Folder directory"} {
			append temp "f"
                }
		if {$optionMenuComboBox == "\[h] Hold sent message"} {
			append temp "h"
                }
		if {$optionMenuComboBox == "\[j] Reply editor"} {
			append temp "j"
                }
		if {$optionMenuComboBox == "\[k] Pause after pager"} {
			append temp "k"
                }
		if {$optionMenuComboBox == "\[l] Alias sorting"} {
			append temp "l"
                }
		if {$optionMenuComboBox == "\[m] Menu display"} {
			append temp "m"
                }
		if {$optionMenuComboBox == "\[n] Names only"} {
			append temp "n"
                }
		if {$optionMenuComboBox == "\[o] Outboard mail saved"} {
			append temp "o"
                }
		if {$optionMenuComboBox == "\[p] Print mail using"} {
			append temp "p"
                }
		if {$optionMenuComboBox == "\[r] Reply copies msg"} {
			append temp "r"
                }
		if {$optionMenuComboBox == "\[s] Sorting criteria"} {
			append temp "s"
                }
		if {$optionMenuComboBox == "\[t] Text editor (e)"} {
			append temp "t"
                }
		if {$optionMenuComboBox == "\[u] User level"} {
			append temp "u"
                }
		if {$optionMenuComboBox == "\[v] Visual editor"} {
			append temp "v"
                }
		if {$optionMenuComboBox == "\[y] Your full name"} {
			append temp "y"
                }
		if {$optionMenuComboBox == "\[w] Want Cc: prompt"} {
			append temp "w"
                }
		if {$optionMenuComboBox == "\[z] Signature dashes"} {
			append temp "z"
                }
		if {$optionMenuComboBox == ""} {
			append temp "SHIT"
                }
	}





###        if {$EditorOpt==1} {
###            append temp "e"
###        }

        if {$temp!=""} {
            print "configoptions = ^$temp"
        } else {
            print "###configoptions = ^_defsopyv_am_un"
	}

    }
}


