Solved

multi-level menu

Posted on 2000-03-23
7
201 Views
Last Modified: 2013-11-20
when i create a multi-level popup menu,
it returns only when i click the menu item which has a command ID,but i want it also can returns when i click the item which contains a submenu.

how can i do this? any suggestion is appreciated. thank you.

0
Comment
Question by:Mike2000
  • 4
  • 2
7 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 2652605
Hi Mike2000,

I don't understand.

>'but i want it also can returns when i click the item which contains a submenu'

how would you then be able to open the sub-menu???

ZOPPO
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2652730
Indeed .. what is the point of a submenu if the popup returns (and so disappears) when you click on that item.

Only thing I can think that you are trying to do is to have an item on the menu that LOOKS like a submenu, and when you click on it, you (say) generate the submenu andpop it up.

In this case, if you want to make a menu LOOK like it is a submenu, then you'll want to owner-draw your menu so that you draw the little triangle that indicates a submenu.  When first popped up, you'd make the pseudo-submenu itme a regular menu item with a command id.  When the user clicks on it, do whatever work you want, set that item to be a real submenu item and redisplay the menu.  Even this would probably be a bit 'clunky' nd ugly, but is all I can think of for you.

This would be tricky, because
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 2652954
Hi Mike2000,

if that (what RONSLOW sayd) is what you want then you can simply create an empty popup menu and handle the WM_INITMENUPOPUP message to dynamically create items for the popup menu.

ZOPPO
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 10

Expert Comment

by:RONSLOW
ID: 2653145
good idea Zoppo
0
 

Author Comment

by:Mike2000
ID: 2655872
i want it to be a normal menu item as well as a submenu item,when you click on it, it returns it's commamd ID,and when your mouse move over it,popup the submenu .the whole menu is dynamically
created.
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 100 total points
ID: 2656422
changing default behaviour like that is a bad idea .. it confuses the user.

How do you expect to click on it without hovering over it (unless you are really quick).

And clicking on a submenu item should pop up the submenu anyway, so your users are going to wonder what on earth is going on.

I'd reconsider my design / requirements if I were you.

0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2659196
I've got your code to compile and link.

I use <iostream> instead or <iostream.h>

AND I included "using namespace std;" in each .h file (after the #include of iostream, iomanip etc).

All works fine.

The problem was that you had both the std:ostream and ostream defined, and the compiler didn't know which one you meant.  Consistent usage of the namespace in the header files, and the use of <iostream> instead or <iostream.h> fixes all that.

Can I submit this as an aswer please???


0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

813 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

10 Experts available now in Live!

Get 1:1 Help Now