[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 1997-03-10
1
Medium Priority
?
328 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

872 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