/*
 * since the script is passed thru cpp, you can use all of the preprocessor 
 * goodies in your Xgen script.
NOTE: on most monochrome monitors the following color defines produce text 
that is unreadable
#define DarkFG  foreground:NavajoWhite
#define LightBG background:black
 
#define DarkBG  background:NavajoWhite	
#define LightFG foreground:black

 */
/*
 * this section is the global section, you can set a global foreground color
 * background color, font, fixed font, etc...
DarkBG
LightFG
 */
font:"*adobe*helv*r*normal*17*"

/*
 * beginning of the first environment...
 */
environment firstEnv
/* 
 * here you can define the shells that are popped up when this 
 * environment is made the current environment (by listing it 
 * first or later when a getenv is done).
 */
	initialshells:"Intro "
	initialshells:Xclock
/*
 * When entering an environment or a shell, all runforeground/
 * runbackground commands found will be executed.....
 * All of the resources used in running commands are available:
 *		captureoutput
 *		commandarg
 *		runbackground
 *		runforeground
 * 
 */
 /*captureoutput:editor
  runforeground:"ls" */
{
/* 
 * a paned commandboard shell....
 */
	commandboard Intro
		titlestring:"Main Menu"
		x:10 
		y:10 
		background:IndianRed
/*
 * When entering an environment or a shell, the set command can be used
 * The set procedure can also take its value from running a command.
 */
	(
                label "XGEN"
			x:0
			y:25
			alignment:center
			width:350
			background:IndianRed
			font:"*adobe*helv*r*normal*34*"
			;
		separator I1
		       separatortype:singleline
			x:0
			y:85
			width:350
                        ;
                label "A Rapid Interface"
			x:0
			y:105
			width:350
			alignment:center
			background:IndianRed
			font:"*adobe*helv*r*normal*24*"
			;
                label "Generator Program"
		       x:0
		       y:140
		       width:350
		       alignment:center
		       background:IndianRed
		       font:"*adobe*helv*r*normal*24*"
		       ;
          	separator I2
			separatortype:singleline
			x:0
			y:195
			width:350
			;
/* 
 * the max number of chars that would be displayed on a line, 
 * the message is parsed at word boundaries and will not 
 * exceed this number of characters per line of the message.
 */
		button "Program Description"
			x:0
			y:215
			alignment:center
			height:60
			width:350
			popup:Descript1
			;
		button "Lists" 
			x:0
			y:277
			alignment:center
			height:60
			width:350
			getenv:ListEnv ;
		button "Toggles and Output" 
			x:0
			y:339
			width:350
			alignment:center
			height:60
			getenv:ToggleEnv;
		button "Dynamic Menus" 
			x:0
			y:401
			width:350
			alignment:center
			height:60
			getenv:DynMenu ;
		button "Pulldown Menus"
			x:0
			y:463
			width:350
			alignment:center
			height:60
			popdown:Intro
			popup:Pulldowns
			;
		button "Sliders" 
			x:0
			y:525
			width:350
			alignment:center
			height:60
			popdown:Intro
			popup:PreSliderBoard
			popup:Sliders
			;
		button "Tables" 
			x:0
			y:587
			width:350
			alignment:center
			height:60
			getenv:TableEnv;
                button "Miscellaneous Extras"
			x:0
			y:649
			width:350
			alignment:center
			height:60
			getenv:Extras ;
                button "Interactive Commands"
			x:0
			y:711
			width:350
			alignment:center
			height:60
			getenv:Interact ;
		button "QUIT" 
			x:0
			y:773
			width:173
			alignment:center
			foreground:IndianRed
			height:60
			popdown:Intro
			exit:0 ;
		button "Help"
			x:185
			y:773
			width:173
			alignment:center
			height:60
			popup:Help
		;
	)

	commandboard Descript1
		x:350
		y:100
		background:LightSalmon
		pane:on    
	(
/* this should be all in one message but do to a limitation in Xm you have to break it up */
		message "     Xgen is designed for the rapid generation of interfaces to existing shell level programs.  There is no need to have previous programming knowledge or experience to use Xgen. A simple, "
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			columns:65
			;
		message "hierarchically-oriented language allows for the definition of a graphical user interface which is used to collect information from the user and execute shell level commands based on this information."
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			columns:65
			;
		message "Xgen integrates the UNIX operating system with its vast array of commands, the Motif Toolkit with its three-dimensional appearance, and the X Window System. "
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			columns:65
			;
		message " Xgen takes a script with an interface description as input.  The interface is then created and operated by Xgen.  It gathers information from the user, composes "
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			columns:65
			;
		message "command lines and runs executable programs with the information through the Bourne Shell."
			columns:65
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			;
		button "Press to Continue"
			alignment:center
			background:LightSalmon
			popdown:Descript1
			popup:Descript2
			;
	)
	commandboard Descript2
		x:350
		y:150
		background:LightSalmon
		pane:on
	(
		message "     Xgen is structured so the designer can logically divide his/her application into subdivisions with each part performing some task.  These major subdivisions are known as ENVIRONMENTS."
			columns:66
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			;
			message "  Each environment is divided into SHELLS which can gather the information needed to run one command or to control the flow of information in an environment or the application as a whole."
			columns:66
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			;
			message "  Shells are of two types: commandboards and menus.  Finally, each shell is made up of a set of INTERFACE OBJECTS which "
			columns:66
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			;
			message " he devices used to gather bits of information from the user.  Examples of interface objects include lists, toggles, buttons, tables, sliders, and labels."
			columns:66
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			;
		button "Return to Main Menu"
			alignment:center
			background:LightSalmon
			popdown:Descript2
			;
	)
	commandboard Help
		x:350
		y:150
		background:LightSalmon
		pane:on
	( 
		message "     Xgen is operated by clicking or dragging the left button of the mouse over the appropriate area of the window. "
			background:LightSalmon
			font:"*adobe*helv*med*r*norm*18*"
			columns:50
			;
		message "In some cases, the keyboard will be needed for input.  Remember that before a window can receive input, the pointer must be placed within the window and over the input area."
			background:LightSalmon
			font:"*adobe*helv*med*r*norm*18*"
			columns:50
			;
		separator a1
			separatortype:doubledashedline
			background:LightSalmon
			;
		message "     The first button in the main menu, Program Description, gives an introduction to Xgen.  The next six buttons provide graphic examples of interface objects that can be used in an Xgen script."
			background:LightSalmon
			font:"*adobe*helv*med*r*norm*18*"
			columns:50
			;
		button "Return to Main Menu"
			alignment:center
			background:LightSalmon
			popdown:Help
			; 
	)
/* 
 * a commandboard shell....all objects must be located with x and y
 * for now. Sometime I might try to do a logical layout but until then
 * just specify the position.
 */
        commandboard Pulldowns
                x:350
                y:150
                background:LightSalmon
        (
                message "Pulldown menus are used when many actions may be invoked from a single commandboard shell.  An object from the title heading must be selected with the mouse before the pulldown portion will appear."
                        font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
                        columns:29
                        ;
/* a pulldown object....
 * this object is sort of a shell, it has the same syntax
 * but it is an object.
 */
		pulldown Actions
		(
                button "Set Cosmic Background" 
			 runbackground:"xphoon"
			 ;
		button "Set Gnu Background"
			runbackground:"xsetroot -bitmap gnu.xbm"
			;
		button "Set Normal Backgroundd"
			runbackground:"xsetroot"
			;
			) ;
		pulldown  Exit 
		(
		    button "Return to Main Menu"
			    popdown:Pulldowns
			    popup:Intro  ;
        			) ;
        )
	commandboard PreSliderBoard 
		x:585
	 	y:160
		background:IndianRed
        (
		label "Enter slider minimum value"
			x:0
			y:0
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*"
			;
		textentry tes1 
			x:0 
			y:35
			width:220
			valuestring:0
			;
		label "Enter slider maximum value" 
			x:0 
			y:80
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*"
			;
		textentry tes2 
			x:0 
			y:105 
			width:220
			valuestring:1
			;
		label "Enter slider start value" 
			x:0 
			y:150
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*" 
			;
		textentry tes3 
			x:0 
			y:175 
			width:220
			valuestring:0
			;
		button Accept
			alignment:center
			setMIN:"[tes1]"
			setMAX:"[tes2]"
			setSTART:"[tes3]" 
			popdown:PreSliderBoard
			popup:SliderBoard 
			x:0 
			y:215
			width:220
			;
	)
	commandboard Sliders
		x:150
		y:160
		background:LightSalmon
		pane:on
        (
		message "Slider objects are useful for obtaining input in a relatively small numerical range.  They are made up of a label, scrolling region with a handle for changing  "
		x:0
		y:0
		columns:47
		background:LightSalmon
		font:"*adobe*helv*med*r*normal*18*"
		;
		message "the value of the slider, and a readout that will display the current value.  Sliders can have either a horizontal or a vertical orientation, and can have a decimal point position specified."
		columns:47
		background:LightSalmon
		font:"*adobe*helv*med*r*normal*18*"
		;
	)
	commandboard SliderBoard 
		x:583 
		y:255
		background:NavajoWhite
	(
		slider slider001
			titlestring:"Set Probability of Success"
			font:"*adobe*helv*med*r*normal*18*"
			x:10 
			y:10 
			foreground:black
			background:NavajoWhite
/* 
 * this sliderwidth, sliderheight stuff doesn't work in 
 * Motif.....it tries to size the slider to the title..
 */
			sliderwidth:300 
/* obvious ? */
			orientation:horizontal
/* 
 * the following resources describe the numerical range of the
 * slider. Since the max is 100 and the decimalpoints is 2 the 
 * maximum value would be 1.00, and the startvalue would be 0.50.
 */
			decimalpoints:2
/* 
 * variables can be used to make assignments to integer, real, or
 * boolean resources. They are evaluated at shell creation time.
 * Shells (not initialshell) are created when first popped up.
 */
			maximum:$MAX
			startvalue:$START
			minimum:$MIN ;
		button "Accept" 
			x:10
			y:100
			foreground:black
			background:IndianRed
			alignment:center
			width:225
			popdown:SliderBoard 
			popdown:Sliders
			popup:Intro
			;
	)
}

environment ListEnv
	initialshells:"Lists ListMenu"
{
	commandboard Lists
		x:200
		y:220
		background:LightSalmon
		pane:on
  	(
		message "List are selectable objects that have no action.  They are optionally scrollable and useful for gathering command line arguments from the user or selections of files."
		background:LightSalmon
		columns:32
		font:"*adobe*helv*med*r*normal*18*"
		;
	)
	menu ListMenu
		x:500
		y:240
		background:IndianRed
	(
		button "Single List Example" 
			popup:SSList;
		button "Multiple List Example" 
			popup:MSList;
		button "Extended List Example" 
			popup:ESList;
		button "Browse List Example" 
			popup:BSList;
		button "Return" 
			foreground:IndianRed
			background:NavajoWhite
			popdown:ListMenu
			getenv:firstEnv ;
	)
	commandboard SSList
		x:625
		y:273
		background:IndianRed
	(
/*
 * lists are optionally scrollable lists of items (if visibleitems > 
 * the total number of items) that can be selected using one of 
 * 4 selection techniques (listtype's)
 */
		label "In Single Lists, only one option is"
			x:0
			y:140
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*"
			;
		label "selected at a time by clicking the"
			x:0
			y:170
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*"
			;
		label "mouse on the desired item.  Any"
			x:0
			y:200
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*"
			;
		label "previously selected item will"
			x:0
			y:230
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*"
			;
		label "be unselected."
			x:0
			y:260
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*"
			;
		list list1
			x:0 
			y:0
			listtype:single
			font:"*adobe*helv*r*normal*17*"
			visibleitems:6
			listelement:"   element1   "
			listelement:"   element2   "
			listelement:"   element3   "
			listelement:"   element4   "
			listelement:"   element5   "
			listelement:"   element6   "
			listelement:"   element7   "
			listelement:"   element8   "
			listelement:"   element9   "
			listelement:"   element10   "
			listelement:"   element11   "
			listelement:"   element12   " ;
		button "OK"
			x:190 
			y:25
			width:60
			alignment:center
			setITEM:"[list1]"
			popdown:SSList 
			popup:Selected ;
                button "Clear"
			x:190
			y:60
			width:60
			alignment:center
			clear:all
			;
		button "Return"
			x:190
			y:95
			width:60
			foreground:IndianRed
			alignment:center
			popdown:SSList
			;
	)
	commandboard MSList 
		x:625
		y:305
		background:IndianRed	
	(
		list list2
			x:0 y:0
			listtype:multiple
/* 
 * this listelement, valuestring combo means that if the item
 * "Long Listing" is selected the value of this object will be "l"
 */
		    listelement:"  Long Format Directory Listing"
		    valuestring:"l"
		    listelement:"  Directory Listing with Invisible Files  "
		    valuestring:"a"
		    listelement:"  Recursive Directory Listing"
		    valuestring:"R"
	       	    listelement:"  Time Directory Listing - Latest First  "
		    valuestring:"t" ;
		button "OK"
			x:60
                        y:110
                        width:60
			alignment:center
			captureoutput:editor
			runforeground:"ls -[list2]"
			popdown:MSList ;
		button "Clear"
			x:130
                        y:110
                        width:60
			alignment:center
			clear:all ;
		button "Return"
			x:200
			y:110
			width:60
			foreground:IndianRed
			popdown:MSList 
			;
		label "In Multiple Lists, any number of"
                        x:0
                        y:150
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
		label "options may be selected by clicking"
                        x:0
                        y:180
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
		label "the mouse on the desired items."
                        x:0
                        y:210
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
		label "Any previously selected item will"
                        x:0
                        y:240
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
		label "remain selected."
                        x:0
                        y:270
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
	)
	commandboard ESList
		x:625
		y:336
		background:IndianRed
	(
		list list3
			x:0
			y:0
		   listtype:extended
		   listelement:"   Long Format Directory Listing"
		   valuestring:"l"
		   listelement:"   Directory Listing with Invisible Files   "
		   valuestring:"a"
		   listelement:"   Recursive Directory Listing"
		   valuestring:"R"
		   listelement:"   Time Directory Listing - Latest First  "
		   valuestring:"t" ;
                button "OK"
                        x:350
                        y:0
                        width:60
                        alignment:center
                        captureoutput:editor
                        runforeground:"ls -[list3]"
                        popdown:ESList ;
                button "Clear"
                        x:350
                        y:40
                        width:60
                        alignment:center
                        clear:all ;
                button "Return"
                        x:350
                        y:70
                        width:60
                        foreground:IndianRed
                        popdown:ESList
                        ;
                label "In Extended Lists, options are selected"
                        x:0
                        y:120
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
                label "in contiguous ranges with one action."
                        x:0
                        y:150
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
                label "The selection process begins by depressing"
                        x:0
                        y:180
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
                label "the mouse button on the first item in the"
                        x:0
                        y:210
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
                label "range and dragging the ponter to the end"
                        x:0
                        y:240
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
                label "of the range.  Any number of items in a"
                        x:0
                        y:270
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
                label "contiguous range may be selected and any"
                        x:0
                        y:300
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
                label "previously selected item will be unselected."
                        x:0
                        y:330
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
			;
	)
	commandboard BSList 
		x:625 
		y:368
		background:IndianRed
	(
		list list4
			x:0
			y:0
			listtype:browse
			visibleitems:6
			listelement:"   element1   "
			listelement:"   element2   "
			listelement:"   element3   "
			listelement:"   element4   "
			listelement:"   element5   "
			listelement:"   element6   "
			listelement:"   element7   "
			listelement:"   element8   "
			listelement:"   element9   "
			listelement:"   element10   "
			listelement:"   element11   "
			listelement:"   element12   " ;
                button "OK"
                        x:190
                        y:25
                        width:60
                        alignment:center
			setITEM:"[list4]"
                        popdown:BSList 
			popup:Selected
			;
                button "Clear"
                        x:190
                        y:60
                        width:60
                        alignment:center
                        clear:all
                        ;
                button "Return"
                        x:190
                        y:95
                        width:60
                        foreground:IndianRed
                        alignment:center
                        popdown:BSList
                        ;
		label "Browse Lists are similar to Extended"
                        x:0
                        y:140
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
		label "Lists except only one option will be"
                        x:0
                        y:170
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
		label "selected as the pointer is moved across"
                        x:0
                        y:200
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
		label "the list items.  The item under the"
                        x:0
                        y:230
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
		label "pointer when the button is released"
                        x:0
                        y:260
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
		label "is selected."
                        x:0
                        y:290
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
	)
	menu Selected
		x:730
		y:290
		background:IndianRed
	(
		label selection
			titlestring:"You Selected: $ITEM"
			font:"*adobe*helv*r*normal*24*"
			;
		button "Return"
			alignment:center
			popdown:Selected
			;
	)
}
environment DynMenu
	initialshells:"Menus Dynamic"
{

/* dynamicmenu's must have the updatefrom resource... */
	commandboard Menus
		x:150
		y:146
		background:LightSalmon
		pane:on
	(
		message "Dynamic menus are fully described at runtime - each time a dynamic menu is popped up, it is updated.  They consist of buttons, one created for each element of the source, derived from one of three "
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:46
		;
                message "sources: contents of a directory, contents of a file, or the output of a commmand where an element is one line of textual output terminated by a new line.  The amount of visible items can "
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:46
		;
                message "be specified and a scrollbar added. The dynamic menu on the right is the result of the command:  `ls'  in the currrent directory."
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:46
		;
	)
        menu Dynamic
		x:580
		y:185 
                background:IndianRed
		updatefrom:"!ls" 
		visibleitems:10
	(

/* 
 * the button description having the name "dynamic" will be
 * expanded into however many buttons are indicated by the updatefrom
 * resource. The updatefrom can be a command (starts with !,the 
 * results will be the button labels), a file (the contents will be 
 * the buttons labels), or a directory (the contents will be the 
 * button labels).
 */
		label "Current Directory"
			background:IndianRed
			font:"*adobe*helv*r*normal*24*"
			;
		button "Return"
			foreground:IndianRed
			popdown:Dynamic
			popdown:Menus
			getenv:firstEnv	
			;
		button dynamic
/* 
 * buttonname on a set command means the button label of the 
 * button that was activated (also works in menu's).
 */
		setBUTTON:buttonname
		getenv:firstEnv ;

	)
}

environment ToggleEnv
	initialshells:"Toggles ToggleMenu"
{
	commandboard Toggles
		x:150
		y:135
		background:LightSalmon
		pane:on
	(
		message "Toggle objects are similar to List objects in that they are useful for gathering selections of files or command line arguments.  However, they are used when there is a small possible items to select"
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:46
		;
                message " Selections are made by clicking the mouse on the item or on the tiny button next to the item, and when selected, the button will appear depressed."
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:46
		;
	)

	menu ToggleMenu
		x:600
		y:240
		background:IndianRed
	(
		label "Examples:"
			font:"*adobe*helv*r*normal*18*"
			background:IndianRed
			;
		button "Regular Toggle List"
			width:200
			popup:ONgoing
			popup:ToggleList;
		button "Radiobox List"
			popup:ONgoing
			popup:Radiobox ;
		button "Return"
			alignment:center
			foreground:IndianRed
			popdown:ToggleList
			getenv:firstEnv ;
	)
	commandboard ONgoing
		x:150
		y:135
		background:LightSalmon
		pane:on
	(
	message "Output from any command can be dealt with in one of Five ways:" 
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:62
		;
	message "A: it can be turned into a dynamic menu(see Dynamic Menus)"
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:62
		;
	message "B: The output of each command can be put into it's own text widget"
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:62
		;
	message "C: The output of each command can be put into one window "
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:62
		;
	message "D: The output of a command can be put into a file. "
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:62
		;
	message "E: Or the output can be displayed in the window xgen was fired up in( this is the default )"
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:62
		;
	message "The Run, buttons fore each toggle example each deal with the output of the ls command in a different way. For example hit each one of the run buttons to see what happens."
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:62
		;
	message "When you are done you will notice that the output text widgets areindependant. This means that the user will have to Dismiss them before they go away."
		font:"*adobe*helv*med*r*normal*18*"
		background:LightSalmon
		columns:62
		;
	)
	commandboard ToggleList 
		x:700
		y:305
		background:IndianRed
	(
/*
 * toggle's act much like list objects.
 */
		label "The regular toggle type, with a square"
			x:0
			y:0
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*" ;
		label "button, indicates a N-of-many selection."
			x:0
			y:40
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*" ;
		label "More than one item may be chosen."
			x:0
			y:70
			background:IndianRed
			font:"*adobe*helv*med*r*normal*18*" ;
		toggle tog1
			x:0 
			y:110
			font:"*adobe*helv*r*normal*17*"
			listelement:"Long Format Directory Listing"
			valuestring:"-l"
			listelement:"Directory Listing with Invisible Files"
			valuestring:"-a"
			listelement:"Recursive Directory Listing"
			valuestring:"-R"
			listelement:"Time Directory Listing Latest First"
			valuestring:"-t"
			;
		button "Run ls with output going into it's own text widget"
			y:263
			alignment:center
			captureoutput:editor
			runforeground:"ls [tog1]";
		button "Run ls with output going into common text widget"
			y:288
			alignment:center
			captureoutput:"append"
			runforeground:"ls [tog1]";
		button "Run ls with output going into file called /tmp/Xgenfoo"
			y:313
			alignment:center
			captureoutput:"/tmp/Xgenfoo"
			runforeground:"ls [tog1]";
		button "Run ls with output going into window xgen was run in"
			y:338
			alignment:center
			runforeground:"ls [tog1]";
		button "Clear"
			x:130 
			y:235
			width:60
			alignment:center
			clear:all ;
		button "Return"
			x:200
			y:235
			width:60
			runforeground:"/bin/rm -f /tmp/Xgenfoo"
			popdown:ONgoing
			popdown:ToggleList  ;
	)

	commandboard Radiobox 
		x:700 
		y:335
		background:IndianRed
	(
		label "The Radiobox toggle, with a diamond"
                        x:0
                        y:0
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*" ;
		label "button, indicates a 1-of-many selection."
                        x:0
                        y:40
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*" ;
		label "Only one item may be chosen."
                        x:0
                        y:70
                        background:IndianRed
                        font:"*adobe*helv*med*r*normal*18*" ;
		toggle tog2
			x:0 
			y:110
                        font:"*adobe*helv*r*normal*17*"
/* obvious ? */
			toggletype:radio
			listelement:"Long Format Directory Listing"
			valuestring:"-l"
			listelement:"Directory Listing with Invisible Files"
			valuestring:"-a"
			listelement:"Recursive Directory Listing"
			valuestring:"-R"
			listelement:"Time Directory Listing - Latest First"
			valuestring:"-t"
		;
                button "Run ls with output going into it's own text widget"
                        y:263
                        alignment:center
                        captureoutput:editor
                        runforeground:"ls [tog2]";
                button "Run ls with output going into common text widget"
                        y:288
                        alignment:center
                        captureoutput:"append"
                        runforeground:"ls [tog2]";
                button "Run ls with output going into file called /tmp/Xgenfoo"
                        y:313
                        alignment:center
                        captureoutput:"/tmp/Xgenfoo"
                        runforeground:"ls [tog2]";
                button "Run ls with output going into window xgen was run in"
                        y:338
                        alignment:center
                        runforeground:"ls [tog2]";
                button "Clear"
                        x:130
                        y:235
                        width:60
                        alignment:center
                        clear:all ;
                button "Return"
                        x:200
                        y:235
                        width:60
			runforeground:"/bin/rm -f /tmp/Xgenfoo"
			popdown:ONgoing
                        popdown:Radiobox  ;
	)

}

environment TableEnv
	initialshells:"Tables Table.1"
{
	commandboard Tables
		x:50
		y:80
		background:LightSalmon
	(
		message " Table objects are useful for displaying or editing tabular data for input or output to database commands.  They are made up of rows and columns. "
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			columns:46
			;
                message "The values for the table can either be hardcoded in the xgen script, be row values from a file, or be the result of a command string whose standard output will generate the appropriate output."
			font:"*adobe*helv*med*r*normal*18*"
			background:LightSalmon
			columns:46
			;
	)
	commandboard Table.1 
		x:100 
		y:360 
		background:IndianRed
	(
/*
 * table's are pretty neat, in my opinion.
 */
		table T1
			x:10 
			y:10 
/*
 * the headings on the columns or rows of the table, and the title.
 * if left out there are none.
 * Note that the headings are comma separated (don't try to 
 * crash this,because you WILL succeed at this point).
 */

			font:"*adobe*helv*med*r*normal*18*"
			entryfont:"*adobe*helv*med*r*normal*12*"
		columnheadings:"Name,Street Address,City,State,Zip,Phone"
			rowheadings:"1,2,3,4,5,6,7"
			titlestring:"Address Information"
/* obvious ? */
			columns:6
			columnsdisplayed:6 
			columnwidth:10
			rows:7
			tablevalue:"./address.list" 
			rowsdisplayed:4
			separator:","
/* 
 * rowvalue will supply initial values for the table, the same 
 * comment is applicable here
 */
			;
		button "Accept" 
			x:0
			y:250
	        	width:250
/*
 * Elements of the table are accessible by the following 
 * specifications: 
 *
 *         tablename -> the whole table
 *         tablename(N) -> the Nth row of the table
 *         tablename(N,M) -> the Nth row and Mth column entry
 */
			setTABLE:"[T1]"
			setROW:"[T1(1)]"
			setCELL:"[T1(1,2)]"
			;
		button "Clear All" 
			x:0
			y:285
			width:250
			clear:T1 ;
		button "Clear Row 1" 
			x:0
			y:320
			width:250
			clear:"T1(1)" ;
		button "Clear Element Row 1 Column 2" 
			x:0
			y:355
			width:250
			clear:"T1(,2)" ;
		button "Return" 
			x:10
			y:390
			width:250
			popdown:Table.1
			popdown:Tables
			getenv:firstEnv ;
	)
}

environment Interact
	initialshells:"WARNING NSL"
	setMACHINE:""
        captureoutput:editor
	/* if you do not have nslookup replace with: */
	/* interactive:"/bin/cat" */
        interactive:"/usr/etc/nslookup"
{
	commandboard WARNING
		x:230
		y:230
		pane:on
	(
		
		message "Xgen can provide an interface to interactive commands using one of two methods. The first method is with the 'interactive' environment resource. "
			columns:84
			;
		message "When you set interactive, xgen runs the specified command and all 'runforeground' and 'runbackground' are piped into the interactive command's standard input"
			columns:84
			;
		message "The other method is to use the commandshell resource. By default all commands are run as options to /bin/sh -c, you may change this by setting the commandshell resource. "
			columns:84
			;
		message "In this manner you could set command shell to be perl and then all your runfoeground and runbackground commands would be perl scripts."
			columns:84
			;
	)
        menu NSL
        (
                label b
                        alignment:center
                        titlestring:"X interface to NSLOOKUP";
                button "Text"
                        alignment:center
                        popup:entry ;
                button "Options"
                        alignment:center
                        popup:options ;
                button "Continue"
			/* note the use of the keyword KillInterActive to stop
			execution before continuation */
                        runforeground:"KillInterActive"
                        alignment:center
			popdown:NSL
			popdown:options
			popdown:entry
			popup:NSLb;

        )
        commandboard entry
                x:150
                y:100
        (
                textentry t1
                        y:0
                        width:200
                        valuestring:"sequent.com";

                button b1
                        y:50
                        titlestring:"Query"
                        width:200
                        runforeground:"[t1]";
        )
        commandboard options
                x:150
                y:200
        (
                label b
                        titlestring:"change nslookup settings";
                button a1
                        y:30
                        titlestring:"Set type to selection "
                        runforeground:"set type=[Tog1]";
                button a2
                        y:60
                        titlestring:"Set querytyp to selection "
                        runforeground:"set querytype=[Tog1]";

                toggle Tog1
                        y:90
                        listelement:"any"
                        valuestring:"any"
                        listelement:"cname"
                        valuestring:"cname"
                        listelement:"hinfo"
                        valuestring:"hinfo"
                        listelement:"mb"
                        valuestring:"mb"
                        listelement:"mg"
                        valuestring:"mg"
                        listelement:"minfo"
                        valuestring:"minfo"
                        listelement:"mr"
                        valuestring:"mr"
                        listelement:"mx"
                        valuestring:"mx";
                        )
        menu NSLb
		setMACHINEb:"sequent.com"
        (
                label b
                        alignment:center
                        titlestring:"X interface to NSLOOKUP";
                button "Run"
                        alignment:center
                        commandshell:"/usr/etc/nslookup"
                        runforeground:"$MACHINEb";
                button "Runbg"
                        alignment:center
                        commandshell:"/usr/etc/nslookup"
                        runbackground:"$MACHINEb";
                button "Run old fashioned fg"
                        alignment:center
                        runforeground:"/usr/etc/nslookup $MACHINEb";
                button "text"
                        alignment:center
                        popup:foob ;
                button "Return"
                        alignment:center
			popdown:NSLb
			getenv:firstEnv;
        )
        commandboard foob
        (
        textentry ct1
                valuestring:"$MACHINEb";
        button b4
                x:0 y:75
                titlestring:"OK"
                alignment:center
                setMACHINEb:"[ct1]"
		popdown:foob;
        )
}


environment Extras
	initialshells:"Exmenus Exmenu" 
{
	commandboard Exmenus
		x:75
		y:100
		background:LightSalmon
	(
		message "An Xgen interface can be designed with a variety of colors, fonts and graphic objects.  Audio capabilities can also be incorporated depending on the computer hardware."
			x:0
			y:0
			columns:37
			background:LightSalmon
			font:"*adobe*helv*med*r*normal*18*"
			;
	)	
	menu Exmenu
		x:450
		y:175
		background:IndianRed
	(
		button "Colors"
			alignment:center
			popup:Colors
			;
		button "Fonts"
			alignment:center
			popup:Fonts
			;
		button "Bitmaps"
			alignment:center
			popup:Bitmaps
			popup:DP
			popup:Mtn
			popup:Gnu
			;
		button "Separators"
			alignment:center
			popup:Separators
			;

		button "Return to Main Menu"
			alignment:center
			foreground:IndianRed
			popdown:Exmenu
			popdown:Exmenus
			getenv:firstEnv
			;
	)		

	menu Fonts
		x:675
		y:125
		background:IndianRed
		visibleitems:15
	(
		label "Any X Window font can be used."
			font:"*adobe*helv*r*normal*18*"
			background:IndianRed
			;
		label "Some examples include:"
			background:IndianRed
			font:"*adobe*helv*r*normal*18*"
			;
		button "RETURN"
			popdown:Fonts
			alignment:center
			;
		button "adobe-courier-bold-o-normal-12"
			font:"*adobe*cour*bold*o*norm*12*"
			;
		button "adobe-courier-medium-r-normal-18"
			font:"*adobe*cour*med*r*norm*18*"
			;
		button "adobe-helvetica-bold-o-normal-10"
			font:"*adobe*helv*bo*o*nor*10*"
			;
		button "adobe-helvetica-medium-r-normal-17"
			font:"*adobe*helv*med*r*nor*17*"
			;
		button "adobe-new century schoolbook-bold-r-normal-14"
			font:"*adobe*new*bo*r*norm*14*"
			;
		button "adobe-new century schoolbook-med-o-normal-14"
			font:"*adobe*new*med*r*nor*14*"
			;
		button "adobe-times-bold-i-normal-24"
			font:"*adobe*tim*bo*i*norm*24*"
			;
		button "adobe-times-medium-r-normal-18"
			font:"*adobe*tim*med*r*norm*18*"
			;
		button "b&h-lucida-bold-i-normal-sans-12"
			font:"*b&h*luc*bo*i*norm*sans*12*"
			;
		button "b&h-lucida-med-r-normal-sans-20"
			font:"*b&h*luc*med*r*nor*sans*20*"
			;
		button "b&h-lucidabright-demibold-r-normal-14"
			font:"*b&h*luc*bri*demibold*r*nor*14*"
			;
		button "b&h-lucidabright-med-i-normal-17"
			font:"*b&h*luc*bri*med*i*nor*17*"
			;
		button "bitstream-charter-bold-r-normal-10"
			font:"*bit*char*bo*r*norm*10*"
			;
		button "bitstream-charter-med-i-normal-25"
			font:"*bit*char*med*i*nor*25*"
			;
		button "misc-fixed-bold-r-normal-15"
			font:"*misc*fix*bo*r*norm*15*"
			;
		button "misc-fixed-med-r-normal-20"
			font:"*misc*fix*med*r*norm*20*"
			;
		button "schumacher-clean-med-r-normal-16"
			font:"*schu*clean*med*r*norm*16*"
			;
		button "sony-fixed-med-r-normal-24"
			font:"*sony*fix*med*r*norm*24*"
			;
		button "RETURN"
			alignment:center
			popdown:Fonts
			;
	)
	menu Colors
		x:675
		y:125
		background:grey
		visibleitems:20
	(
        	label "Any X Window color can be used."
	        	font:"*adobe*helv*r*normal*18*"
			background:grey
	        	;
		label "Some examples include:"
			font:"*adobe*helv*r*normal*18*"
			background:grey
			;
		button "RETURN"
			background:white
			alignment:center
			popdown:Colors
			;
		button "WhiteSmoke"
			background:WhiteSmoke
			alignment:center
			;
		button "OldLace"
			background:OldLace
			alignment:center
			;
		button "PapayaWhip"
			background:PapayaWhip
			alignment:center
			;
		button "NavajoWhite"
			background:NavajoWhite
			alignment:center
			;
		button "LemonChiffon"
			background:LemonChiffon
			alignment:center
			;
		button "AliceBlue"
			background:AliceBlue
			alignment:center
			;
		button "LavenderBlush"
			background:LavenderBlush
			alignment:center
			;
		button "MistyRose"
			background:MistyRose
			alignment:center
			;
		button "DarkSlateGrey"
			background:DarkSlateGrey
			alignment:center
			;
		button "DimGrey"
			background:DimGrey
			alignment:center
			;
		button "SlateGrey"
			background:SlateGrey
			alignment:center
			;
		button "Grey"
			background:grey
			alignment:center
			;
		button "NavyBlue"
			background:NavyBlue
			alignment:center
			;
		button "CornflowerBlue"
			background:CornflowerBlue
			alignment:center
			;
		button "SlateBlue"
			background:SlateBlue
			alignment:center
			;
		button "MediumBlue"
			background:SlateBlue
			alignment:center
			;
		button "DodgerBlue"
			background:DodgerBlue
			alignment:center
			;
		button "SteelBlue"
			background:SteelBlue
			alignment:center
			;
		button "LightBlue"
			background:Lightblue
			alignment:center
			;
		button "MediumTurquoise"
			background:MediumTurquoise
			alignment:center
			;
		button "CadetBlue"
			background:CadetBlue
			alignment:center
			;
		button "MediumAquamarine"
			background:MediumAquaMarine
			alignment:center
			;
		button "DarkGreen"
			background:DarkGreen
			alignment:center
			;
		button "DarkOliveGreen"
			background:DarkOliveGreen
			alignment:center
			;
		button "MediumSeaGreen"
			background:MediumSeaGreen
			alignment:center
			;
		button "PaleGreen"
			background:PaleGreen
			alignment:center
			;
		button "SpringGreen"
			background:SpringGreen
			alignment:center
			;
		button "LawnGreen"
			background:LawnGreen
			alignment:center
			;
		button "YellowGreen"
			background:YellowGreen
			alignment:center
			;
		button "DarkKhaki"
			background:DarkKhaki
			alignment:center
			;
		button "PaleGoldenrod"
			background:PaleGoldenrod
			alignment:center
			;
		button "LightGoldenrod"
			background:LightGoldenrod
			alignment:center
			;
		button "RosyBrown"
			background:RosyBrown
			alignment:center
			;
		button "IndianRed"
			background:IndianRed
			alignment:center
			;
		button "SaddleBrown"
			background:SaddleBrown
			alignment:center
			;
		button "SandyBrown"
			background:SandyBrown
			alignment:center
			;
		button "DarkSalmon"
			background:DarkSalmon
			alignment:center
			;
		button "LightCoral"
			background:LightCoral
			alignment:center
			;
		button "Red"
			background:red
			alignment:center
			;
		button "HotPink"
			background:HotPink
			alignment:center
			;
		button "DeepPink"
			background:DeepPink
			alignment:center
			;
		button "PaleVioletRed"
			background:PaleVioletRed
			alignment:center
			;
		button "VioletRed"
			background:VioletRed
			alignment:center
			;
		button "MediumOrchid"
			background:MediumOrchid
			alignment:center
			;
		button "DarkViolet"
			background:DarkViolet
			alignment:center
			;
		button "MediumPurple"
			background:MediumPurple
			alignment:center
			;
		button "RETURN"
			alignment:center
			background:white
			popdown:Colors
			;
	)	
			
        commandboard Separators 
		x:650 
		y:100
		background:IndianRed
		pane:on
        (
		label  "Separators are linear objects used to"
                        background:NavajoWhite
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
		label  "visually divide the shell real estate."
                        background:NavajoWhite
                        font:"*adobe*helv*med*r*normal*18*"
                        ;
                label  "They can oriented vertically or horizontally."
			background:NavajoWhite
			font:"*adobe*helv*med*r*normal*18*"
			;
		separator sep
			separatortype:noline
			background:IndianRed
			;
		label "Single Line"
			background:IndianRed
			;
                separator se1
                        separatortype:singleline 
			background:IndianRed
			;
		label "Double Line"
			background:IndianRed
			;
                separator se2
                        separatortype:doubleline 
			background:IndianRed
			;
		label "Single Dashed Line"
			background:IndianRed
			;
                separator se3
                        separatortype:singledashedline 
			background:IndianRed
			;
		label "Double Dashed Line"
			background:IndianRed
			;
                separator se4
                        separatortype:doubledashedline 
			background:IndianRed
			;
		label "No Line"
			background:IndianRed
			;
                separator se5
                        separatortype:noline 
			background:IndianRed
			;
		label "Shadow Etched In"
			background:IndianRed
			;
                separator se6
                        separatortype:shadowetchedin 
			background:IndianRed
			;
		label "Shadow Etched Out"
			background:IndianRed
			;
                separator se7
                        separatortype:shadowetchedout 
			background:IndianRed
			;
                button "Return"
			alignment:center
			background:IndianRed
			foreground:NavajoWhite
                        popdown:Separators
			;
        )		
	commandboard Bitmaps
		x:675
		y:150
		background:LightSalmon
	(
		message "Iconic objects, or pixmaps, can be used within Xgen on either labels or buttons.  They can be aligned either to the left, center, or right on the button or label."
			font:"*adobe*helv*med*r*normal*18*"
			columns:40
			background:LightSalmon
			;
		button "Return"
			x:0
			y:145
			width:340
			alignment:center
			background:LightSalmon
			popdown:Bitmaps
			popdown:DP
			popdown:Gnu
			popdown:Mtn
			;
	)
        menu DP
		 x:650
		 y:350
		 background:red
        (
                button sdfgsdgf 
			labelpixmap:"./dp.xbm" 
			background:red
			popdown:DP ;
        )
	menu Gnu
		x:755
		y:580
		background:MediumAquamarine
	(
		label "Our Friend - The Gnu"
			font:"*adobe*helv*med*r*normal*18*"
			background:MediumAquamarine
			;
		label	qqwe
         		labelpixmap:"./gnu.xbm"
			background:MediumAquamarine
			alignment:center
			;
	)
	menu Mtn
		x:825
		y:450
		background:AliceBlue
	(
		button zxzx
			labelpixmap:"./mtn.xbm"
			background:AliceBlue
			popdown:Mtn  ;
	)
}
 

