Actually I know how to get the top-left corner of the menu to appear
where I want it using clienttoscreen  which takes and returns a TPoint.  I
was hoping perhaps there was some all-inclusive means to handling width and
orientation to the selected point.  As it turns out the widest caption my
menu has to show brings the width to within just a few pixels of the
button's width that I click to show it, so it was merely a matter of padding
the caption!  And as for orientation, as long as one uses the popup method
that's taken care of automatically even when you do place it yourself!

from Robert Meek dba Tangentals Design


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Diego
Sent: Thursday, January 05, 2006 8:52 AM
To: Borland's Delphi Discussion List
Subject: Re: Manual placement of popup menus D2006 Win32

Button.ClientOrigin.X
Button.ClientOrigin.Y

These properties give you the top-left cordinates of the component on the
screen

You could do something like this:

PopUpMenu.PopUp( Button.ClientOrigin.X, Button.ClientOrigin.Y +
Button.Height );

That worked with me.

Hope I helped ya !



----- Original Message ----- 
From: "Robert Meek" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, January 04, 2006 8:28 PM
Subject: Manual placement of popup menus D2006 Win32


> I need some help on this one!  What I have is a bank of BitBtn's
> stacked vertically in a Panel so that it looks a lot like a groupbar.  And
> before you ask, I tried handling this using a real groupbar, however it
> couldn't provide for other needs I have of it.  And so I decided to throw
> one together  as I'm now doing.
> Anyway, these bitbtn's have a width of 116.  And what I need is for
> a popup menu to appear beneath it with it's left edge aligned to the left
> edge of the bitbtn, and having the same exact width as the bitbtn.
Provided
> there is enough room for the entire menu to be displayed when it pops up,
it
> will do so beneath the bitbtn with it's top edge no more than a pixel
lower
> than the bottom edge of the bitbtn.  And if there isn't enough room, then
I
> want it to appear above the bitbtn, with the same alignments.
> I know I can use the menu's OnPopUp event but how do I position and
> set the width properly...and how do I determine if the menu should be
> displayed above or below it's bitbtn?  Thanx in advance!
>
> from Robert Meek dba Tangentals Design
>
>
>
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to