Board index » cppbuilder » Menu on right hand side of menu bar

Menu on right hand side of menu bar

Quote
Remy Lebeau wrote:
> The only way I've ever found is to place a bunch of empty menu items between
> the left-side menus and the right-side menu, so that the menu is pushed to
> the righ side as far as you need.

I'm afraid that won't work if the window is resized (either at design time or
run-time).

Quote

> Gambit

> "C Newell" <cnew...@mits.com.au> wrote in message
> news:3AB95E72.20AD81AA@mits.com.au...
> > How can I put a menu on the Right Hand side of the main menu bar?

Regards
Colin Newell
 

Re:Menu on right hand side of menu bar


Colin,

You might want to look at a third-party component. I have seen this
functionality so I know it exists.

HTH
--
Mark L. Bartlett
http://www.sound.net/~mbartlet
** Please don't send NG 'stuff' to my email account. **

Re:Menu on right hand side of menu bar


Quote
C Newell wrote:
> How can I put a menu on the Right Hand side of the main menu bar?

Try this in your form's constructor:

ModifyMenu(MainMenu1->Handle, MainMenu1->Items->Count -1,
                     MF_BYPOSITION | MF_HELP, 0, "&Help" );

Re:Menu on right hand side of menu bar


That's why I never write my programs to be resizable ;-)

Gambit

Quote
"C Newell" <cnew...@mits.com.au> wrote in message

news:3ABA8BA0.F832DF14@mits.com.au...
Quote
> I'm afraid that won't work if the window is resized (either at design time
or
> run-time).

Re:Menu on right hand side of menu bar


And, um, how exactly does that move the PHYSICAL location of the menu to the
right side of the window?  It doesn't, as far as I can tell all it does it
makes the choosen menu the right-most menu, but they'd all still be lined up
physically on the left side of the menu

From Newell's original description, it sounds to me like he's trying to
accomplish something like this:

[menu1] [menu2] [menu3] [menu4]                        [menu5]

Gambit

Quote
"Fishface" <fishf...@drift.net> wrote in message news:3ababb91$1_2@dnews...
> Try this in your form's constructor:

> ModifyMenu(MainMenu1->Handle, MainMenu1->Items->Count -1,
>                      MF_BYPOSITION | MF_HELP, 0, "&Help" );

Re:Menu on right hand side of menu bar


How can I put a menu on the Right Hand side of the main menu bar?

I have a help menu which I wish to put in that position, but I cannot
find any menu property which allows me to do this.

Colin Newell

Re:Menu on right hand side of menu bar


The only way I've ever found is to place a bunch of empty menu items between
the left-side menus and the right-side menu, so that the menu is pushed to
the righ side as far as you need.

Gambit

Quote
"C Newell" <cnew...@mits.com.au> wrote in message

news:3AB95E72.20AD81AA@mits.com.au...
Quote
> How can I put a menu on the Right Hand side of the main menu bar?

Re:Menu on right hand side of menu bar


Quote
Remy wrote:
> And, um, how exactly does that move the PHYSICAL location
> of the menu to the right side of the window?  It doesn't, as far as
> I can tell all it does it  makes the choosen menu the right-most
> menu, but they'd all still be lined up physically on the left side of the
> menu

> From Newell's original description, it sounds to me like he's trying to
> accomplish something like this:

> [menu1] [menu2] [menu3] [menu4]                        [menu5]

Um, yup.  Just try it...

Re:Menu on right hand side of menu bar


I just tried it and low-and-behold it does work. Could you explain this
a little bit.

TIA
--
Mark L. Bartlett
http://www.sound.net/~mbartlet
** Please don't send NG 'stuff' to my email account. **

Re:Menu on right hand side of menu bar


Quote
Mark L. Bartlett wrote:
> I just tried it and low-and-behold it does work. Could you explain this
> a little bit.

I knew it was possible from Petzold's coverage of Menu Templates.
The option "HELP" in the template means "This item and the following
items are right-justified."  Although the MF_HELP is not documented in
the help for ModifyMenu(), the other flags were an exact match.  I looked
in winuser.h, found the flag, and tried it.

Using ModifyMenu() is the easiest way to modify the MENUITEMINFO
struct, but GetMenuItemInfo() and SetMenuItemInfo() will work.  It is not
documented there either, but I later found it in a VB example on MSDN by
searching for MF_HELP.

To affect this change after the menu has been drawn, it is necessary to call
DrawMenuBar() or otherwise cause the menu to be redrawn.

Re:Menu on right hand side of menu bar


Thanks a bunch!
--
Mark L. Bartlett
http://www.sound.net/~mbartlet
Remove n-o-s-p-a-m- to send email.
******
** Please don't send NG 'stuff' to my email account. **
** I will not respond to NG email. **
******

Other Threads