You can use the OnDrawCommandClick event to perform a task when an TppImage is clicked. The following would be similar to the way the HyperLink property works for text components.
uses ppUtils;
procedure TForm1.ppImage1DrawCommandClick(Sender, aDrawCommand: TObject); begin
Thanks for that. I can see that will work but i am loading the report from a template file and am using RAP where ppShellExec is not available to me. Do i have to create a pass through function or is there another solution.
The OnDrawClickCommand event for the image did not work when the report was saved to pdf and this was an essential requirement. I overcame the problem by having an image with no event and then placing overtop a label sized the same as the image with a hyperlink but no caption. This worked brilliantly when saved as a pdf.
Comments
You can use the OnDrawCommandClick event to perform a task when an
TppImage is clicked. The following would be similar to the way the
HyperLink property works for text components.
uses
ppUtils;
procedure TForm1.ppImage1DrawCommandClick(Sender, aDrawCommand: TObject);
begin
ppShellExec('http://www.google.com', '', '', SW_SHOWNORMAL);
end;
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks for that. I can see that will work but i am loading the report from
a template file and am using RAP where ppShellExec is not available to me.
Do i have to create a pass through function or is there another solution.
Regards
Tim
Yes a pass-thru function will be necessary in this case.
I will add hyperlinks for images as a possible enhancement for a later
release.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Thanks. An image hyperlink would be good particularly for use with Facebook
and Twitter links where the image is now ubiquitous.
Tim
The OnDrawClickCommand event for the image did not work when the report was
saved to pdf and this was an essential requirement. I overcame the problem
by having an image with no event and then placing overtop a label sized the
same as the image with a hyperlink but no caption. This worked brilliantly
when saved as a pdf.
Tim Murfitt
Yes, OnDrawCommandClick events are not transferred to file exports.
Great workaround!
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com