! SCCS_data: @(#) TopLevels 1.1 92/12/08 14:42:06
!
! Multiple top level shells
!

Mri.wcPopups:	Main1 Main2 Main3 Main4
Mri.wcChildren:	rc

*rc.wcCreate:		XmRowColumn
*rc.orientation:	horizontal
*rc.wcChildren:		m1 m2 m3 m4

*rc*wcCreate:		XmPushButton

*rc.m1.labelString:		Open\nMain1
*rc.m1.activateCallback:	WcPopup(*Main1)

*rc.m2.labelString:		Open\nMain2
*rc.m2.activateCallback:	WcPopup(*Main2)

*rc.m3.labelString:		Open\nMain3
*rc.m3.activateCallback:	WcPopup(*Main3)

*rc.m4.labelString:		Open\nMain4
*rc.m4.activateCallback:	WcPopup(*Main4)

*Main1.wcCreate:	TopLevelShell
*Main1.wcChildren:	main

*Main2.wcCreate:	TopLevelShell
*Main2.wcChildren:	main

*Main3.wcCreate:	TopLevelShell
*Main3.wcChildren:	main

*Main4.wcCreate:	TopLevelShell
*Main4.wcChildren:	main

*main.wcCreate:		XmCreateMainWindow
*main.wcChildren:	menuBar msg

*msg.wcCreate:	XmLabel
*msg.labelString:	\
This demo shows how you can use the Motif Menubar\n\
widget, along with accelerators for menu items.\n\
\n\
To raise menu from the keyboard, press the "menu"\n\
button (this can have various key caps) and either\n\
"f" or "h" to post the file or help menu respectively.\n\
\n\
Once any menu is posted, you can select any visible\n\
selection by simply pressing the appropriate key.\n\
This even works to bring up other menus, including\n\
cascading menus.

!----------------------------------------------------------------------
! Menu bar with two buttons, each of which will have a pulldown menu
!
*menuBar.wcCreate:		XmCreateMenuBar
*menuBar.wcPopups:		fileMenu helpMenu
*menuBar.wcChildren:		file help
*menuBar.wcAfterChildren:	WcSetValue( this.menuHelpWidget: this.help )

!----------------------------------------------------------------------
! file and help buttons on the menuBar: created after the pulldown menus,
! so the menus can be named directly in the subMenuId resources.  We use
! relative naming as an application migh have several helpMenus.
!
! Note: mnemonics require "Meta" if a menu is not yet displayed, but
! only the mnemonic once the menu is displayed.
!
*file.wcCreate:		XmCascadeButton
*file.subMenuId:	^*fileMenu
*file.mnemonic:		f

*help.wcCreate:		XmCascadeButton
*help.subMenuId:	^*helpMenu
*help.mnemonic:		h

!----------------------------------------------------------------------
! Pulldown menu from the help button on the menu bar.
! A dialog provides the help message, and is used for all help.
!
*helpMenu.wcCreate:	XmCreatePulldownMenu
*helpMenu.wcPopups:	helpDialog
*helpMenu.wcChildren:	mbHelp, cpHelp, daHelp, tHelp

*mbHelp.wcCreate:		XmPushButton
*mbHelp.labelString:		on Menu Bar
*mbHelp.mnemonic:		M
*mbHelp.activateCallback:	WcSetValue( \
	~*helpDialog.messageString: The menu bar... )\
				WcManage( ~*helpDialog )

*cpHelp.wcCreate:	XmPushButton
*cpHelp.labelString:	on Control Panel
*cpHelp.mnemonic:	C
*cpHelp.activateCallback:	WcSetValue( \
	~*helpDialog.messageString: The control panel... )\
				WcManage( ~*helpDialog )

*daHelp.wcCreate:	XmPushButton
*daHelp.labelString:	on Drawing Area
*daHelp.mnemonic:	D
*daHelp.activateCallback:	WcSetValue( \
	~*helpDialog.messageString: The drawing area... )\
				WcManage( ~*helpDialog )

*tHelp.wcCreate:	XmPushButton
*tHelp.labelString:	on Text Area
*tHelp.mnemonic:	T
*tHelp.activateCallback:	WcSetValue( \
	~*helpDialog.messageString: The text area... )\
				WcManage( ~*helpDialog )

! Used for all help, OK and Cancel unmanage.
!
*helpDialog.wcCreate:		XmCreateMessageDialog
*helpDialog.helpCallback:	WcSetValue(	\
	~helpDialog.messageString: Sorry, no additional help is available. )

!----------------------------------------------------------------------
! Pulldown menu from the file button on the menu bar
!
*fileMenu.wcCreate:	XmCreatePulldownMenu
*fileMenu.wcPopups:	saveAsMenu
*fileMenu.wcChildren:	load, sep1, save, saveAs, sep2, quit

*load.wcCreate:		XmPushButton
*load.labelString:	Load ...
*load.mnemonic:		L

*sep1.wcCreate:		XmSeparator
*sep1.separatorType:	XmShadow_Etched_In

*save.wcCreate:		XmPushButton
*save.labelString:	Save
*save.mnemonic:		S

! The saveAsMenu has already been created. 
! It is specified at the bottom of this file.
!
*saveAs.wcCreate:	XmCascadeButton
*saveAs.labelString:	Save As
*saveAs.mnemonic:	A
*saveAs.subMenuId:	*saveAsMenu

*sep2.wcCreate:		XmSeparator
*sep2.separatorType:	XmDOUBLE_DASHED_LINE

!----------------------------------------------------------------------
!  Accelerators and Motif
!  ----------------------
! The quit button uses the accelerator resource to allow a control-C anywhere
! in the application to act as if Quit was selected from the fileMenu.  The
! acceleratorText resource shows the user that the button has an accelerator.
!
! Note that accelerators do NOT work on cascade buttons!
!
! Note that you CANNOT use XtInstallAccelerators or XtInstallAllAccelerators
! even as recently as Motif 1.1.3!
!
*quit.wcCreate:		XmPushButton
*quit.labelString:	Quit
*quit.mnemonic:		Q
*quit.activateCallback:	WcPopdown(/)
*quit.accelerator:	Ctrl<Key>C
*quit.acceleratorText:	Ctrl-C

!----------------------------------------------------------------------
!  Multiple Level Cascading Menus
!  ------------------------------
!
!  All of the nested menus in this example have two buttons:
!  go (labeled Go) and more (labeled More to come).  Since menu
!  panes are XmRowColumns, we can say that all XmRowColumn children
!  of the saveAsMenu's pop-up shell have children named go and more.

*popup_saveAsMenu*XmRowColumn.wcChildren:	go more

*go.wcCreate:			XmPushButton
*go.labelString:		Go
*go.mnemonic:			G

*more.wcCreate:			XmCascadeButton
*more.labelString:		More to come
*more.mnemonic:			M

*saveAsMenu.wcCreate:		XmCreatePulldownMenu
*saveAsMenu.wcPopups:		level3
*saveAsMenu.more.subMenuId:	*level3

*level3.wcConstructor:		XmCreatePulldownMenu
*level3.wcPopups:		level4
*level3.more.subMenuId:		*level4

*level4.wcConstructor:		XmCreatePulldownMenu
*level4.wcPopups:		level5
*level4.more.subMenuId:		*level5

*level5.wcConstructor:		XmCreatePulldownMenu
*level5.wcPopups:		level6
*level5.more.subMenuId:		*level6

*level6.wcConstructor:		XmCreatePulldownMenu
*level6.wcPopups:		level7
*level6.more.subMenuId:		*level7

*level7.wcConstructor:		XmCreatePulldownMenu
*level7.go.labelString:		You could go on forever like this...
*level7.more.labelString:	But please don't!
