Board index » cppbuilder » TPopupMenu and Close Event
Brian
![]() CBuilder Developer |
Brian
![]() CBuilder Developer |
TPopupMenu and Close Event2005-12-09 02:20:17 AM cppbuilder74 Is there any way to capture/create an OnClose event for a TPopupMenu? I am highlighting a series of images based on the mouse's right-click and want to remove the highlight after the popup menu closes. Thanks for your help. |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2005-12-09 06:14:18 AM
Re:TPopupMenu and Close Event
"Brian" < XXXX@XXXXX.COM >wrote in message
QuoteIs there any way to capture/create an OnClose event actually displays the menu, and does not return until the menu is closed. For example: class TMyPopupMenu : public TPopupMenu { private: TNotifyEvent FOnClose; protected: virtual void __fastcall DoClose(void); public: __fastcall TMyPopupMenu(TComponent *Owner); virtual void __fastcall Popup(int X, int Y); __published: __property TNotifyEvent OnPopupClose = {read=FOnClose, write=FOnClose}; }; __fastcall TMyPopupMenu::TMyPopupMenu(TComponent *Owner) : TPopupMenu(Owner) { } void __fastcall TMyPopupMenu::DoClose(void) { if( FOnClose ) FOnClose(this); } void __fastcall TMyPopupMenu::Popup(int X, int Y) { TPopupMenu::Popup(X, Y); DoClose(); } Gambit |