Solved

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

Posted on 1997-03-10
1
289 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
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 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.
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.

863 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

25 Experts available now in Live!

Get 1:1 Help Now