Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: Apple Draniel
  Where is Apple Draniel?
 Bucharest
 Romania
 Apple Draniel
 Tags
Subject: RE: Menu inside toolbar
Thread ID: 50947 Message ID: 50964 # Views: 2 # Ratings: 0
Version: Visual FoxPro 8 Category: Menus
Date: Tuesday, September 07, 2004 1:31:16 PM         
   


> Hi all !
>
> It possible to put menu inside of toolbar class ? I saw in other applications, menu inside toolbar; this toolbar can be docked.
>
> Thank's.

it is possible... Kind of that is.

First of all create a toolbar with a button on it.
In the click event of the button comes the code
 do MyPopupmenu.mpr


Next step is to generate a popupmenu
The generated code might look a bit like this:
DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW()+1,MCOL()-1
DEFINE BAR 1 OF shortcut PROMPT "\<Pop"
DEFINE BAR 2 OF shortcut PROMPT "P\<opper"

ACTIVATE POPUP shortcut


The modification I made is on the first line of code.
I added a small counter to the mrow() and mcol() just to position the popupmenu a bit better.
This is only very basic code that can be improved in many ways.
Eg, one could use mousemove event of the button to calculate the exact position of the menu.
Be aware that the _screen.scalemode is in pixels and mcol(),mrow() are in foxels.
1 foxel = 8 pixels.

The buttons in the toolbar can have captions as you are used to have.

One question remains though. About the User Interface.
How often did you see a user place the menu, let's say, at the bottom of the screen, or at one of the sides...
With that in mind consider how much it would be worth to make a point of that.
The basic menu, with the only add-in of genmenuX possibilities is good enough for me.


Boudewijn LutgeĀ®ink
There are 10 types of people: Those that do understand binary calculations and those that do not.

ENTIRE THREAD

Menu inside toolbar Posted by Apple Draniel @ 9/7/2004 11:06:06 AM
RE: Menu inside toolbar Posted by Boudewijn Lutgerink @ 9/7/2004 1:31:16 PM
RE: Menu inside toolbar Posted by Luis Navas @ 9/8/2004 12:52:15 AM
RE: Menu inside toolbar Posted by Apple Draniel @ 9/13/2004 7:38:23 AM
RE: Menu inside toolbar Posted by Boudewijn Lutgerink @ 9/13/2004 7:50:53 AM
RE: Menu inside toolbar Posted by Apple Draniel @ 9/13/2004 10:15:29 AM
RE: Menu inside toolbar Posted by Boudewijn Lutgerink @ 9/14/2004 11:28:14 AM