! SCCS_data: @(#) PerTem 1.2 92/12/09 14:22:25
!
! A modification to Periodic which uses Templates
!
! This example is taken from the periodic demo which came with Motif 1.0
! and was developed by Michael K. Yee at OSF.  To quote the original
! README:
! 
! 	Periodic is a demo of the displayable widgets in 
!	Motif.  Periodic presents many Motif widgets for 
!	your visual and sensual enjoyment.
!

Mri.wclTemplateFiles: 	Mri/PT_ColumnLabel Mri/PT_DisplayBox

Mri.wclDynamicLibs:	Stuff/libStuff.so.2.7

Mri.wcChildren:		main
Mri.wcCallback:		WcSetValue(this.title: Periodic)


*background:		Turquoise
*fontList:		-adobe-helvetica-medium-r-normal--10-*


*main.wcCreate:		XmCreateMainWindow
*main.wcChildren:	menuBar, table

! If you want scrollbars, uncomment this line
!*main.scrollingPolicy:	AUTOMATIC


!#################################################################
! Minimal menu bar
!#################################################################


*menuBar.wcCreate:		XmCreateMenuBar
*menuBar.wcPopups:		fileMenu
*menuBar.wcChildren:		File, Edit, Help
*menuBar.wcAfterChildren:	WcSetValue( this.menuHelpWidget: this.Help )
*menuBar*WcCreate:		XmCascadeButton


*menuBar*fontList:		-*-helvetica-medium-o-normal-*-12-120-*


! Note we must make path more specific than `*menuBar*WcCreate:' so this
! resource spec is used instead of that one above.
*menuBar.fileMenu*wcCreate:	XmCreatePulldownMenu
*fileMenu.wcChildren:		Bang Pow Zip Zap Quit

*Bang.activateCallback:		WcDynamicCallback( -lStuff PrintCB(Bang!) )
*Pow.activateCallback:		WcDynamicCallback( Stuff/libStuff.so.2.7 PrintCB(Bang! Bang!) )
*Zip.activateCallback:		WcDynamicAction( -lStuff PrintACT(>:::Zip) )
*Zap.activateCallback:		-lStuff::PrintCB( Bang! Pow! Zip! Zappo!!)

*Quit.activateCallback:		WcExit


*File.subMenuId:		^*fileMenu


!#################################################################
! XmpTable Widget for Periodic Table
!#################################################################


*table.wcCreate:	XmpTable
*table.marginWidth:	20
*table.marginHeight:	0
*table.Spacing:		0
*table.wcChildren:	title, \
			It, 1, 2, 3, 4, 5, \
			IIt, 6, 7, 8, 9, \
			IIIt, 10, \
			IVt, 11, 12, 16, \
			Vt, 13, 14, 15, \
			dialogs
!				name	c r cs rs opt	
*table.layout:			title	1 0  4  1	;\
	It 0 0;	\
	1  0 1;	IIt 1 1;				Vt 4 1;\
	2  0 2;	6   1 2; IIIt 2 2;	IVt 3 2;	13 4 2;\
	3  0 3;	7   1 3; 10   2 3 1 3;	11  3 3;	14 4 3;\
	4  0 4;	8   1 4;		12  3 4;	15 4 4;\
	5  0 5;	9   1 5;		16  3 5 2 1;\
			dialogs 0 6 5 1;


*title.wcCreate:	XmCreateLabel
*title.labelString:	The Periodic Table Of Motif Widgets
*title.fontList:	-*-helvetica-bold-o-normal--24-240-*


! Labels above the columns.  We need to do this so the labels are
! right at the bottom of their XmpTable cell, immediately above the
! `Periodic Table' entries below them.
! Note that the template PT_ColumnLabel has no specification whatsoever
! for the label.labelString so it is very easy to set the label:

*It.wcTemplate:			PT_ColumnLabel
*It.label.labelString:		Ia


*IIt.wcTemplate:		PT_ColumnLabel
*IIt.label.labelString:		IIa


*IIIt.wcTemplate:		PT_ColumnLabel
*IIIt.label.labelString:	IIIb


*IVt.wcTemplate:		PT_ColumnLabel
*IVt.label.labelString:		IVa


*Vt.wcTemplate:			PT_ColumnLabel
*Vt.label.labelString:		Va


! These are the widget display boxes:
! Sometimes, like with *1.wcChildren, we are OVERRIDING template
! specifications.  A leading `Mri' (the application name) suffices 
! to override the template.

*1.wcTemplate:		PT_DisplayBox
Mri*1.wcChildren:		an sep1 sep2 sep3 sep4 sep5 sep6 n
Mri*1.layout:		an   5 0 hH ;\
			sep1 0 1 ; sep2 1 1 ; sep3 2 1 ; \
			sep4 3 1 ; sep5 4 1 ; sep6 5 1 ;\
			n 0 2 6 1 hH ;
Mri*1.rowSpacing:		5
*1.an.labelString:	1
*1*wcCreate:		XmSeparator
*1*XmSeparator.height:	40
*1*orientation:		XmVERTICAL
*1.sep1.separatorType:	XmSHADOW_ETCHED_IN
*1.sep2.separatorType:	XmSHADOW_ETCHED_OUT
*1.sep3.separatorType:	XmSINGLE_LINE
*1.sep4.separatorType:	XmDOUBLE_LINE
*1.sep5.separatorType:	XmSINGLE_DASHED_LINE
*1.sep6.separatorType:	XmDOUBLE_DASHED_LINE
*1.n.labelString:	XmSeparator

! Here is a hack: I want the arrow buttons spaced in a little from the
! edge of the PT_DisplayBox, so there is an empty column 0 and an empty
! except for spanning last column (column 3).  Then the arrow buttons
! are inset on the sides by the columnSpacing.
!
*2.wcTemplate:		PT_DisplayBox
Mri*2.Spacing:		5
Mri*2.layout:		an 2 0 2 1 hH ; \
			up 1 1 ; lt 2 1 ; \
			dn 1 2 ; rt 2 2 ; \
			n  0 3 4 1 hH
Mri*2.wcChildren:		an up,dn,lt,rt n
*2.an.labelString:	2
*2*wcCreate:		XmArrowButton
*2.up.arrowDirection:	ARROW_UP
*2.dn.arrowDirection:	ARROW_DOWN
*2.lt.arrowDirection:	ARROW_LEFT
*2.rt.arrowDirection:	ARROW_RIGHT
*2.n.labelString:	XmArrowButton


*3.wcTemplate:		PT_DisplayBox
*3.an.labelString:	3
*3.w.wcCreate:		XmPushButton
*3.w.labelString:	Format Disk
*3.w.wcPopups:		DiskSelBox, TrashDialog
*3.w.activateCallback:	WcManage( .*DiskSelBox )
*3.n.labelString:	XmPushButton


*3.w.DiskSelBox.wcCreate:		XmCreateSelectionDialog
*3.w*DiskSelBox*listItems:		/, /swap, /usr, /u
*3.w*DiskSelBox*listItemCount:		4
*3.w*DiskSelBox*itemLabelString:	File System
*3.w*DiskSelBox*okLabelString:		Format
*3.w*DiskSelBox*applyLabelString:	Un-format
*3.w*DiskSelBox*cancelLabelString:	Erase
*3.w*DiskSelBox*helpLabelString:	Crash Heads

*3.w*DiskSelBox*okCallback:		WcManage( ~^*TrashDialog )
*3.w*DiskSelBox*applyCallback:		WcManage( ~^*TrashDialog )
*3.w*DiskSelBox*cancelCallback:		WcManage( ~^*TrashDialog )
*3.w*DiskSelBox*helpCallback:		WcManage( ~^*TrashDialog )

*3.w.TrashDialog.wcCreate:		XmCreateWorkingDialog
*3.w.TrashDialog.title:			Trashing...
*3.w*TrashDialog*messageString:		Trashing Disk\nMay take awhile...
*3.w*TrashDialog*cancelLabelString:	Hurry
*3.w*TrashDialog*helpLabelString:	Faster!


*4.wcTemplate:		PT_DisplayBox
*4.an.labelString:	4
*4.w.wcCreate:		XmToggleButton
*4.w.labelString:	Lights
*4.n.labelString:	XmToggleButton


*5.wcTemplate:		PT_DisplayBox
*5.an.labelString:	5
*5.w.wcCreate:		XmLabel
*5.w.fontList:		-*-helvetica-bold-o-normal--24-*
*5.w.labelString:	Don't\nPanic
Mri*5.rowSpacing:		3
*5.n.labelString:	XmLabel


*6.wcTemplate:		PT_DisplayBox
*6.wcPopups:		colorOptions
*6.wcChildren:		an, w, n
*6.an.labelString:	6
*6.colorOptions.wcCreate:	XmCreatePulldownMenu
*6*colorOptions.wcChildren:	red, orange, yellow, green, blue, purple
*6*colorOptions.red.wcCreate:		XmPushButton
*6*colorOptions.orange.wcCreate:	XmPushButton
*6*colorOptions.yellow.wcCreate:	XmPushButton
*6*colorOptions.green.wcCreate:		XmPushButton
*6*colorOptions.blue.wcCreate:		XmPushButton
*6*colorOptions.purple.wcCreate:	XmPushButton
! ^	Note the asterisk needed here!!  colorOptions is actually
!	a child of a menu shell created by XmCreatePulldownMenu.
*6.w.wcCreate:		XmCreateOptionMenu
*6.w.labelString:	color
*6.w.subMenuId:		*6*colorOptions
*6.n.labelString:	XmOptionMenu


*7.wcTemplate:		PT_DisplayBox
Mri*7.Spacing:		0                                                      
*7.an.labelString:	7
*7.w.wcCreate:		XmScale
*7.w.wcChildren:		min, |, max
*7.w.XmLabel.fontList:		-*-helvetica-medium-r-normal--8-*
*7.w.decimalPoints:		1
*7.w.maximum:			50
*7.w.orientation:		HORIZONTAL
*7.w.processingDirection:	MAX_ON_RIGHT
*7.w.showValue:			True
*7.w.titleString:		Warp Factor
*7.w.min.wcCreate:		XmLabel
*7.w.min.labelString:		0
*7.w.|.wcCreate:		XmLabel
*7.w.max.wcCreate:		XmLabel
*7.w.max.labelString:		5
*7.n.labelString:	XmScale


*8.wcTemplate:		PT_DisplayBox
*8.an.labelString:	8
*8.w.wcCreate:		XmCreateRadioBox
*8.w.wcChildren:	KWST, WCRP, WHKY, KUMU
*8.w.numColumns:	2
*8.w.packing:		PACK_COLUMN
*8.w.KWST.wcCreate:	XmToggleButtonGadget
*8.w.WCRP.wcCreate:	XmToggleButtonGadget
*8.w.WHKY.wcCreate:	XmToggleButtonGadget
*8.w.KUMU.wcCreate:	XmToggleButtonGadget
*8.n.labelString:	XmRadioBox


*9.wcTemplate:		PT_DisplayBox
*9.an.labelString:	9
*9.w.wcCreate:		XmText
*9.w.wcPopups:		fonts
*9.w.value:		Try pressing the\nmenu button on\nthe mouse...
*9.w.translations:	#augment \n <Btn3Down>: XmpPopup( this*fonts )
*9.w.fonts.wcCreate:	XmCreatePopupMenu
*9.w*fonts.wcChildren:	c,h,t
*9.w*fonts*wcCreate:	XmCreatePushButton
*9.w*fonts.c.labelString:	courier bold oblique 10
*9.w*fonts.c.fontList:		*courier-bold-o-*--10-*
*9.w*fonts.c.activateCallback:	WcSetValue( ~^fontList(FontList): \
						*courier-bold-o-*--10-* )
*9.w*fonts.h.labelString:	helvetica bold oblique 18
*9.w*fonts.h.fontList:		*helvetica-bold-o-*--18-*
*9.w*fonts.h.activateCallback:	WcSetValue( ~^fontList(FontList): \
						*helvetica-bold-o-*--18-* )
*9.w*fonts.t.labelString:	times bold italic 24
*9.w*fonts.t.fontList:		*times-bold-i-*--24-*
*9.w*fonts.t.activateCallback:	WcSetValue( ~^fontList(FontList): \
						*times-bold-i-*--24-* )
*9.n.labelString:	XmText


*10.wcTemplate:		PT_DisplayBox
Mri*10.Spacing:		0
*10.an.labelString:	10
*10.w.wcCreate:		XmFileSelectionBox
*10.w.dirMask:		*.c
*10.w.sb_listSW.height:	10
*10.n.labelString:	XmFileSelectionBox


*11.wcTemplate:		PT_DisplayBox
Mri*11.Spacing:		20
*11.an.labelString:	11
*11.w.wcCreate:		XmScrollBar
*11.w.orientation:	HORIZONTAL
*11.w.height:		20
*11.n.labelString:	XmScrollBar


! Remember that XmCreateScrolledList creates an intermediate
! parent named wSW, and that is the widget the table lays out.
!
*12.wcTemplate:		PT_DisplayBox
Mri*12.layout:		an 1 0 1 1 hH; wSW 0 1 2 1 ; n 0 2 2 1 hH;
*12.an.labelString:	12
*12.w.wcCreate:		XmCreateScrolledList
*12*w.items:		Foobar, Mumble, Glorp, Reggae, Rock, and, Roll Forever!
*12*w.itemCount:	7
*12*w.visibleItemCount:	3
*12*w.listMarginWidth:	3
*12.n.labelString:	XmScrolledList


! Note that the XmCascadeButton which pops-up the demoMenu
! MUST be a child of an XmRowColumn.  I used XmCreateMenuBar
! to create the row column, because that it usually what
! you will use when you've got pull-down menus.  If the
! cascade button is not a child of an XmRowColumn, you
! will get a core dump in Motif.  Sorry, I can't fix that here.
!
*13.wcTemplate:		PT_DisplayBox
*13.an.labelString:	13
*13.n.labelString:	XmPulldownMenu
*13.w.wcCreate:		XmCreateMenuBar
*13.w.wcPopups:		demoMenu
*13.w.wcChildren:	menuButton
*13.w.menuButton.wcCreate:	XmCascadeButton
*13.w.menuButton.labelString:	Press For Menu
*13.w.menuButton.subMenuId:	*13.w*demoMenu
*13.w.demoMenu.wcCreate:	XmCreatePulldownMenu
*13.w*demoMenu.wcChildren:	title, Black, Blue, Coral, LimeGreen, \
				Cyan, Goldenrod, Magenta, Pink
*13.w*demoMenu.title.wcCreate:	XmCreateLabel
*13.w*demoMenu.title.labelString:	Choose Color of XmDrawingArea:
*13.w*demoMenu.title.fontList:	-*-times-bold-i-normal-*-12-*
*13.w*demoMenu*FontList:	-*-times-medium-i-normal-*-12-*
!    ^	Note the asterisk needed here!!  demoMenu is actually
!	a child of a menu shell created by XmCreatePulldownMenu.




*13*Black.wcCreate:		XmCascadeButton
*13*Blue.wcCreate:		XmCascadeButton
*13*Coral.wcCreate:		XmCascadeButton
*13*LimeGreen.wcCreate:		XmCascadeButton
*13*Cyan.wcCreate:		XmCascadeButton
*13*Goldenrod.wcCreate:		XmCascadeButton
*13*Magenta.wcCreate:		XmCascadeButton
*13*Pink.wcCreate:		XmCascadeButton


*13*Black.activateCallback:	WcSetValue(*14.w.background: Black)
*13*Blue.activateCallback:	WcSetValue(*14.w.background: Blue)
*13*Coral.activateCallback:	WcSetValue(*14.w.background: Coral)
*13*LimeGreen.activateCallback:	WcSetValue(*14.w.background: LimeGreen)
*13*Cyan.activateCallback:	WcSetValue(*14.w.background: Cyan)
*13*Goldenrod.activateCallback:	WcSetValue(*14.w.background: Goldenrod)
*13*Magenta.activateCallback:	WcSetValue(*14.w.background: Magenta)
*13*Pink.activateCallback:	WcSetValue(*14.w.background: Pink)


*14.wcTemplate:		PT_DisplayBox
*14.an.labelString:	14
*14.w.wcCreate:		XmDrawingArea
*14.w.background:	Magenta
*14.n.labelString:	XmDrawingArea


*15.wcTemplate:		PT_DisplayBox
*15.an.labelString:	15
*15.w.wcCreate:		XmDrawnButton
*15.n.labelString:	XmDrawnButton


*16.wcTemplate:		PT_DisplayBox
Mri*16.Spacing:		0
*16.an.labelString:	16
*16.w.wcCreate:		XmPanedWindow
*16.w.wcChildren:	text1, text2
*16.w*fontList:		*-times-bold-i-normal--10-*
*16.w.text1.wcCreate:	XmText
*16.w.text1.value:	Motif Resource Interpreter
*16.w.text2.wcCreate:	XmText
*16.w.text2.value:	Version 2.7
*16.n.labelString:	XmPanedWindow


*dialogs.wcCreate:	XmpTable
*dialogs.wcChildren:	error, info, question, warn, work
*dialogs.borderWidth:	0
*dialogs.layout:	error 0 0; info 1 0; question 2 0; warn 3 0; work 4 0;
*dialogs.columnSpacing:	10
*dialogs.marginHeight:	10
*dialogs.marginWidth:	0


*dialogs.XmMessageBox.borderWidth: 	1
*dialogs.XmMessageBox.marginHeight:	1
*dialogs.XmMessageBox.marginWidth:	1
*dialogs.XmMessageBox*buttonFontList:	-*-helvetica-medium-r-normal--8-*


*error.wcCreate:		XmMessageBox
*error.dialogType:		DIALOG_ERROR
*error.messageString:		Error Dialog


*info.wcCreate:			XmMessageBox
*info.dialogType:		DIALOG_INFORMATION
*info.messageString:		Information Dialog


*message.wcCreate:		XmMessageBox
*message.dialogType:		DIALOG_MESSAGE
*message.messageString:		Message Dialog


*question.wcCreate:		XmMessageBox
*question.dialogType:		DIALOG_QUESTION
*question.messageString:	Question Dialog


*warn.wcCreate:			XmMessageBox
*warn.dialogType:		DIALOG_WARNING
*warn.messageString:		Warning Dialog


*work.wcCreate:			XmMessageBox
*work.dialogType:		DIALOG_WORKING
*work.messageString:		Working Dialog
