ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to read the thumbnail bottom text at Select?
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Jul 13 2020 :  10:06:14  Show Profile  Reply
How can I read access the thumbnail bottom text in a TImageEnMView when I select a thumbnail?

With the following code, ImageBottomText[idx] gives back an empty string:

procedure TForm1.ImageEnMView1ImageSelect(Sender: TObject; idx: Integer);
begin  
  ShowMessage(ImageEnMView1.ImageBottomText[idx]);
end;


The thumbnails have been added with these methods (all parameters assigned):

function AppendImage(const FileName: String;
                     LoadOnDemand : boolean;
                     DefaultTopText : TIEImageEnMViewDefaultText = iedtNone; // iedtCustom
                     DefaultInfoText : TIEImageEnMViewDefaultText = iedtNone;
                     DefaultBottomText : TIEImageEnMViewDefaultText = iedtFilename; // iedtCustom
                     bSelectIt : Boolean = true): integer;

procedure TForm1.ImageEnMView1GetText(Sender: TObject; Index: Integer; Position: TIEMTextPos; var Text: WideString);
begin
  case Position of
    iemtpTop:    Text := GetTopText(Index)
    iemtpBottom: Text := GetBottomText(Index);
  end;
end;

PeterPanino

933 Posts

Posted - Jul 13 2020 :  10:58:59  Show Profile  Reply
I now have discovered a strange feature - when adding a thumbnail by using ImageEnMView1.AppendImage (with the 6 parameters showed below) and then execute:

ImageEnMView1.ImageBottomText[idx] := GetMyBottomText(idx);


In this case, the thumbnail bottom text set with ImageBottomText is INVISIBLE (!), but it can be read in the ImageEnMView1Image.OnSelect event-handler (!).

This solves my problem, as with ImageBottomText (and ImageTopText, ImageInfoText) I can easily associate INVISIBLE strings to the thumbnails and access these strings when selecting the thumbnail!

Obviously, this is because ImageBottomText uses a different class than the thumbnail classes used by AppendImage.
Go to Top of Page

xequte

38610 Posts

Posted - Jul 16 2020 :  02:41:52  Show Profile  Reply
Hi Peter

Setting text in the OnGetText event only affects the *displayed* text. So you won't be able to read it later.

Set ImageEnMView1.ImageBottomText[idx] if you want text that you can read back later.

Note: If you set ImageEnMView1.ImageBottomText[idx] ensure that ImageEnMView1.DefaultBottomText is not iedtNone or it may not be visible. Use iedtCustom.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: