CreatePopupMenu problem
I have created a dynamically loaded subreport derived from TppSubReport and
added a menu item in the CreatePopupMenu method. This works fine when I only
add one subreport to a report. However, when I have two of these subreports
and select the right mouse menu on the second one, the event attached to my
new TMenuItem is fired through the first subreport ! In other words, self
refers to the first subreport, even though I selected the second subreport !
Is this supposed to be ? If yes, then how can I access my second subreport
in this menu item event ? If no, then how can I fix this problem ?
Thanks,
Samuel
added a menu item in the CreatePopupMenu method. This works fine when I only
add one subreport to a report. However, when I have two of these subreports
and select the right mouse menu on the second one, the event attached to my
new TMenuItem is fired through the first subreport ! In other words, self
refers to the first subreport, even though I selected the second subreport !
Is this supposed to be ? If yes, then how can I access my second subreport
in this menu item event ? If no, then how can I fix this problem ?
Thanks,
Samuel
This discussion has been closed.
Comments
You'll need to override PopupMenuClick as well, in order to assign the event
handlers to correct subreport object:
procedure PopupMenuClick(Sender: TObject); override;
ppSubRpt.pas has some decent example code in this method...
Cheers,
Tom Ollar
Digital Metaphors Corporation
http://www.digital-metaphors.com
info@digital-metaphors.com