title: Plots
item 1: Delete Current Plot (created in .rc file)
item 2: Seperater
item 3..n: plot names created by the user during program execution
I am adding menu items using the AppendMenu function, with the "idNewItem"
argument being the plot number. So, the 1st plot idNewItem is 1, 2nd plot
idNewItem is 2, and so on.
I would like a function that would return the menu item selected from
the "Plots" menu. So, if the user selects item n, I know what plot they
would like to display.
I have looked through the Petzold book but am unable to find any examples.
What is the best way to implement such a thing?
--
Kevin O'Malley
Programmer/Analyst
Transportation Research Institute
University of Michigan (UMTRI)
oma...@umich.edu
When you use AppendMenu(), you will give each one a number, i.e.
perhaps 1000+i (where i=0,1,2,3,4). When you get WM_COMMAND
message, it will tell you the menu id number. Simply subtract
1000 and you will get 'i'.
--
John A. Grant jag...@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
title: Plots
item 1: Delete Current Plot created in .rc file)
item 2: Seperater
item 3..n: plot names created by the user during program execution
I am adding menu items using the AppendMenu function, with the "idNewItem"
argument being the plot number. So, the 1st plot idNewItem is 1, 2nd plot
idNewItem is 2, and so on.
I would like a function that would return the menu item selected from
the "Plots" menu. So, if the user selects item n, I know what plot they
would like to display.
When you create the menu's, you need to maintain a table that maps item
id to the plot function. When a user selects a menu item, a WM_COMMAND
is sent to the window which owns the menu. wParam is the menu
id. Just use the id to look up which function to call.
--
.__o Ed McCreary "The Information Superhighway, sanitized
_-\ <,- Compaq Computers for your protection."
(*)/ (*) e...@twisto.compaq.com