Solved

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

Posted on 1997-03-10
1
288 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
1 Comment
 
LVL 3

Accepted Solution

by:
gaohong earned 100 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 Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now