> Good. Popup menus usually appear during the OnMouseUp event, which is
> indeed after the OnMouseDown event.
i don't know why, but here it happends before OnMouseDown event.

> You can do things immediately before the menu appears by handling its
> OnPopup event. That event will fire no matter how the menu was
> triggered. So instead of using different menus, just use one menu, but
> hide and show different items. That's made a lot easier if you have
> actions associated with the menu items since you can have the hide and
> show themselves based on the actions' OnUpdate events.
yes, i used that somewhere else.My worse problem is i couldn't check
where the mouse is pressed, but that's related to the first point.

> That's not a very hard problem to solve considering that the OnMouseUp
> event already tells you those coordinates. Those coordinates are
> relative to the client area of the thing being clicked. Since the menu
> expects coordinates relative to the whole screen, you can call the
> control's ClientToScreen method to convert the coordinates.
My problem was to generate the correct X and Y for the Popup Method.
Really, i remember in an other application i saw i must give the X,Y for
the left-up point and it's not sure they are the same as
pressing-point-mouse.
But now, i'm seeing i used the same and it's correctly working; i mean the
popup is auto-moving to stay inside the screen. Maybe i wrongly remember
about my old application; i think maybe at that time i had the problem to
push the popop inside a control and not inside the screen.

----- Original Message -----
From: "Rob Kennedy" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, April 13, 2005 10:08 AM
Subject: Re: [delphi-en] Delay popup


>
> Mauro Russo wrote:
> > i'd like to popup the popupmenu AFTER having
> > OnMouseDown event.
>
> Good. Popup menus usually appear during the OnMouseUp event, which is
> indeed after the OnMouseDown event.
>
> > I have this problem on a TTreeView, becuase i want to set differents
> > popup-menu(s) according to the TreeNode selected.
> > I know i can use AutoPopup=false and to call Popup(X,Y) by myself,
>
> You can do things immediately before the menu appears by handling its
> OnPopup event. That event will fire no matter how the menu was
> triggered. So instead of using different menus, just use one menu, but
> hide and show different items. That's made a lot easier if you have
> actions associated with the menu items since you can have the hide and
> show themselves based on the actions' OnUpdate events.
>
> > but i'd like to don't have to solve the problem to set X,Y to show the
popup inside the screen.
>
> That's not a very hard problem to solve considering that the OnMouseUp
> event already tells you those coordinates. Those coordinates are
> relative to the client area of the thing being clicked. Since the menu
> expects coordinates relative to the whole screen, you can call the
> control's ClientToScreen method to convert the coordinates.
>
> --
> Rob
>
>
> -----------------------------------------------------
> Home page: http://groups.yahoo.com/group/delphi-en/
> To unsubscribe: [EMAIL PROTECTED]
> Yahoo! Groups Links
>
>
>
>
>
>
>
>



-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/delphi-en/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to