note | For information on how to use the functions on the standard menu bar, run one of the graphical VDA Tools, such as WzPlot, and read about the menu bar in online help. |
bar = WoMenuBar(layout, tool_name, /Graphics, /Top, /Left, $
/Right)
wzpreview.ad - resources for the WzPreview menus
!
! Menus and menu items
!
! Edit items
!
*WzPreview*EditDefineHeader.labelString: Define Header...
*WzPreview*EditDefineHeader.mnemonic: H
*WzPreview*EditDefineHeader.acceleratorText: Ctrl+H
*WzPreview*EditDefineHeader.accelerator: Ctrl<Key>H
*WzPreview*EditDefineRecord.labelString: Define Record...
*WzPreview*EditDefineRecord.mnemonic: R
*WzPreview*EditDefineRecord.acceleratorText: Ctrl+R
*WzPreview*EditDefineRecord.accelerator: Ctrl<Key>R
*WzPreview*EditDefineField.labelString: Define Field...
*WzPreview*EditDefineField.mnemonic: F
*WzPreview*EditDefineField.acceleratorText: Ctrl+F
*WzPreview*EditDefineField.accelerator: Ctrl<Key>F
*WzPreview*EditSelectArea.labelString: Select Area
*WzPreview*EditSelectArea.mnemonic: S
*WzPreview*EditClear.labelString: Clear
*WzPreview*EditClear.mnemonic: C
*WzPreview*EditClear.acceleratorText: Ctrl+X
*WzPreview*EditClear.accelerator: Ctrl<Key>X
*WzPreview*EditClearAll.labelString: Clear All
*WzPreview*EditClearAll.mnemonic: A
*WzPreview*EditClearAll.acceleratorText: Ctrl+A
*WzPreview*EditClearAll.accelerator: Ctrl<Key>A
!
! Attributes items
!
*WzPreview*AttributesSetup.labelString: Setup...
*WzPreview*AttributesSetup.mnemonic: S
*WzPreview*AttributesVariable.labelString: Variable
*WzPreview*AttributesVariable.mnemonic: r
*WzPreview*AttributesVariable*NoVariable.labelString:
No variables
*WzPreview*AttributesFixedFormat.labelString: Fixed Format...
*WzPreview*AttributesFixedFormat.mnemonic: x
*WzPreview*AttributesFreeFormat.labelString: Free Format...
*WzPreview*AttributesFreeFormat.mnemonic: r
; Define the WzPreview menu bar structure (in the wzpreview.pro
; procedure).
wzpreview_menus = {, $
NAME: ['FileMenu','FileMenu'], $
MENUBUTTON: '', $
MENU: {,CALLBACK: 'WoGMBFileOpenCB', $
NAME: 'FileOpen', $
BUTTON: '', $
CALLBACK: 'WzPreviewFileSaveCB', $
NAME: 'FileSave', $
BUTTON: '', $
CALLBACK: 'WzPreviewFileSaveAsCB', $
NAME: 'FileSaveAs', $
BUTTON: '', $
CALLBACK: 'WoGMBFileSaveTemplateAsCB', $
NAME: 'FileSaveTemplateAs', $
BUTTON: '', $
SEPARATOR: 1, $
CALLBACK: 'WoGMBFileExportVariableCB', $
NAME: 'FileExportVariable', $
BUTTON: '', $
SEPARATOR: 1, $
NAME: 'FileGenerateCode', $
CALLBACK: 'WoGMBFileGenerateCodeCB', $
BUTTON: '', $
SEPARATOR: 1, $
CALLBACK: 'WoGMBFileCloseCB', $
NAME: 'FileClose', $
BUTTON: '' $
}, $
NAME: ['EditMenu', 'EditMenu'],$
MENUBUTTON: '',$
MENU:{,$
CALLBACK: 'WzPreviewEditCB', $
NAME: 'EditDefineHeader',$
BUTTON: '',$
NAME: 'EditDefineRecord',$
BUTTON: '',$
NAME: 'EditDefineField',$
BUTTON: '',$
SEPARATOR: 1, $
NAME: 'EditSelectArea',$
BUTTON: '',$
SEPARATOR: 1, $
NAME: 'EditClear',$
BUTTON: '',$
NAME: 'EditClearAll',$
BUTTON: '' $
}, $
NAME: ['AttributesMenu', 'AttributesMenu'],$
MENUBUTTON: '',$
MENU:{, $
CALLBACK: 'WzPreviewSetupCB', $
NAME: 'AttributesSetup', $
BUTTON: '', $
NAME: ['AttributesVariable', 'AttributesVariable'], $
MENUBUTTON: '', $
MENU:{, $
CALLBACK: 'WzPreviewAttributesVarCB', $
NAME: 'NoVariables', $
BUTTON: '' $
}, $
SEPARATOR: 1, $
CALLBACK:'WzPreviewFormatCB',$
NAME: 'AttributesFixedFormat',$
TOGGLE:'',$
NAME: 'AttributesFreeFormat',$
TOGGLE:''$
}, $
NAME: ['WindowMenu', 'WindowMenu'],$
MENUBUTTON: '',$
MENU:{,CALLBACK:'WoGMBWindowCB',$
NAME: 'Window_1',$
BUTTON: '' $
}, $
CALLBACK: 'WoGMBHelpCB', $
NAME: ['HelpMenu', 'HelpMenu'],$
MENUBUTTON: '',$
MENU:{,CALLBACK: 'WoGMBHelpOnWindowCB',$
NAME: 'HelpOnWindow',$
BUTTON: '', $
CALLBACK: 'WoGMBHelpIndexCB',$
NAME: 'HelpIndex',$
BUTTON: '', $
CALLBACK: 'WoGMBHelpOnHelpCB',$
NAME: 'HelpOnHelp',$
BUTTON: '', $
SEPARATOR: 1, $
CALLBACK: 'WoGMBHelpOnVersionCB',$
NAME: 'HelpOnVersion',$
BUTTON: '' $
} $
}
; Use the structure with customized menus, but include the
; Graphics keyword to include callbacks for graphics menu items.
bar = WoMenuBar(layout, tool_name, wzpreview_menus, $
/Graphics, /Top, /Left, /Right)
; If no filename or a bad file was specified, make all the
; filename-dependent menu items insensitive.
IF STRLEN(file) EQ 0 THEN BEGIN
panes = [1, $ ; File menu
1, $
1, $
1, $
1, $
2, $ ; Edit menu
2, $
2, $
2, $
2, $
2 $
]
items = [2, $ ; Save
3, $ ; Save As...
4, $ ; Save Template As...
6, $ ; Export Variable(s)
8, $ ; Generate Code
1, $ ; Select Header
2, $ ; Select Record
3, $ ; Select Field
5, $ ; Select Area
7, $ ; Clear
8 $ ; Clear All
]
WoMenuBarSetSensitivity, tool_name, panes, items, 0
ENDIF