?
Solved

Menu in a TDialog object (Borland C++ v4.5)

Posted on 1997-03-10
1
Medium Priority
?
320 Views
Last Modified: 2008-03-10
I have with Borland C++ 4.5 Resource workshop defined a dialogbox and included a menu in the dialog.

From my TDialog object do I want to act on the menu selections (the menu is showed automatic)

How can in the TDialog object catch when a menu item is selected/activated.

What must the response tabel contain ?

Must I do more than define a response tabel ?
E.g. any init of the menu ? Or connecting the menu to the Dialog.


Now my response table contain this:

DEFINE_RESPONSE_TABLE1(T_DC_createDataDialog, TDialog)
  EV_COMMAND(IDM_EN_OPEN, SelectTDEfile),
// IDM_EN_OPEN = the menu item.
// SelectTDEfile = the function.
END_RESPONSE_TABLE;


I hope it makes sense.
0
Comment
Question by:tovergaard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
gaohong earned 200 total points
ID: 1162140
Hi,

Must I do more than define a response tabel ?  Yes
   
E.g. any init of the menu ? yes or no
yes. If you are not using OWL function to do what you want
for instance. To define a pop up menu for a particular window
you need construct  a TPopupMenu and appen your menu items.
Or connecting the menu to the Dialog.  

No. TDialog (TWindow) has done menu init for you.

So you only need to define your response table and command
handler in your dialog class like:


  DEFINE_RESPONSE_TABLE1(T_DC_createDataDialog, TDialog)
         EV_COMMAND(IDM_EN_OPEN, SelectTDEfile),
         EV_COMMAND_ENABLE(IDM_EN_OPEN, SelectTDEfileEnable),
         ...
  END_RESPONSE_TABLE;

Good luck

gaohong xie
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question