Solved

multi-level menu

Posted on 2000-03-23
7
199 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 30

Expert Comment

by:Zoppo
Comment Utility
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
Comment Utility
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 30

Expert Comment

by:Zoppo
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 10

Expert Comment

by:RONSLOW
Comment Utility
good idea Zoppo
0
 

Author Comment

by:Mike2000
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

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

8 Experts available now in Live!

Get 1:1 Help Now