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

<*> 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