Objective Chart : PART I User’s Guide : Chapter 12 Objective Chart and MFC : Predefined Menu Commands
Predefined Menu Commands
SRGraphView and SRGScrollView include command handlers for several predefined command IDs. The command IDs and their handlers are summarized in Table 20.
Table 20 – Predefined Menu Commands 
Command ID
Value
Handler
ID_GRAPH_EDIT
0xd101
OnGraphEdit
ID_GRAPH_ZOOMOUT
0xd102
OnGraphZoomout
ID_GRAPH_ZOOMOUTALL
0xd0fc
OnGraphZoomoutAll
ID_GRAPH_PAGESETUP
0xd103
OnGraphPagesetup
ID_GRAPH_PAGESETUP2
0xd144
OnGraphPagesetup2
ID_GRAPH_WIZARD
0xd104
OnGraphWizard
ID_FILE_SAVE_AS_DIB
0xd105
OnSaveAsDib
ID_FILE_SAVE_AS_JPEG
0xd106
OnSaveAsJpeg
ID_EDIT_COPY
 
OnEditCopy
OnGraphEdit() initiates the Chart Editor/Explorer.
OnGraphWizard() initiates the interactive Chart Wizard.
OnGraphZoomout() restores the previous zoom level after zoom-in operation.
OnGraphZoomoutAll() restores the original, unzoomed zoom level.
OnGraphPagesetup() displays a dialog box for specifying the size and location of the chart on the printer page.
OnGraphPagesetup2() displays an alternative dialog box for specifying the size and location of the chart on the printer page. In addition to several choices that are relative to the size of the printer page, arbitrary sizes can be specified -- in particular, chart sizes may be larger than the printer page.
OnSaveAsDib() and OnSaveAsJpeg() write the chart to a disk file in Device Independent Bitmap or JPEG format.
OnEditCopy() places the chart on the clipboard as a bitmap.
In most cases, especially if the application has been created with the Objective Chart AppWizard, these menu items already exist in the resources of the application and handlers have already been attached to them. If the view was not created by the AppWizard, it may be necessary to create menu items for them.
To create menu items for the predefined commands:
1. Create a menu in the desired place using the resource editor.
2. In the properties for that menu item, change the ID to use the numeric value shown above for the desired function. For example, an application may have a File|Page setup entry in its menus.
3. To attach the new menu item to the ready-made handler, modify the properties so that the ID of the menu item reads IDC_FILE_PAGESETUP=OxD103.
NOTE >> The second time that this property is reviewed, the numeric assignment will have disappeared. This is normal and the ID does not need to be modified further.