Solved

multi-level menu

Posted on 2000-03-23
7
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven archtype selection in eclipse 1 58
isEverywhere  challenge 19 85
My project did see openJDK that I installed. What could be the problem 7 161
mapAB Challlenge 35 173
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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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