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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to read the thumbnail bottom text at Select?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Jul 13 2020 : 10:06:14
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;
2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 16 2020 : 02:41:52
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
PeterPanino Posted - Jul 13 2020 : 10:58:59
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.