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 select an object from Listbox1.Items index on the ImageEnVect?

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
Jmich Posted - Feb 07 2024 : 16:05:33
Here's my code:
But this does not work!
Who has a solution or idea.



var
i: Integer;
begin
   if (listbox1.ItemIndex < > -1) and (listbox1.ItemIndex < ImageEnVect1.ObjectsCount) then
      begin
        for i: = 0 to ImageEnVect1.ObjectsCount - 1 do
         begin
           if (ImageEnVect1.ObjText [i] = '' + listbox1.Items [listbox1.ItemIndex] + '') then
            begin
              ImageEnVect1.SelObjects [i];
              Exit;
             end;
          end;
        end;
end;


jm
4   L A T E S T    R E P L I E S    (Newest First)
Jmich Posted - Feb 09 2024 : 10:53:44
Thanks for the help !
Works great !

best greetings
Jmich

jm
xequte Posted - Feb 08 2024 : 19:26:04
How about:

procedure TForm2.Listbox1Click(Sender: TObject);
var
  index: Integer;
begin
  ImageEnVect1.UnSelAllObjects();
  if Listbox1.ItemIndex > -1 then
  begin
    Index := Listbox1.ItemIndex;
    ImageEnVect1.AddSelObject( ImageEnVect1.GetObjFromIndex( index ));
    label1.Caption: = IntToStr( index );
  end;
end;

http://www.imageen.com/help/TImageEnVect.AddSelObject.html


Nigel
Xequte Software
www.imageen.com
Jmich Posted - Feb 08 2024 : 08:47:19
Is there any way to mark an object in the ImageENVect by code?

For example, I imagine:

procedure TForm2.Listbox1Click (broadcaster: TObject);
Var
  index: Integer;
begin
  ImageEnVect1. UnSelAllObjects;
  if Listbox1.ItemIndex < > -1 then
  begin
    Index: = Listbox1.ItemIndex;
    ImageEnVect1. SelObjects [index];
    label1. Caption: = IntToStr (index);
  end;
end;


jm
xequte Posted - Feb 07 2024 : 19:30:57
Hi

Firstly, if this is a new application, don't use TImageEnVect, use TIELayers instead:

https://www.imageen.com/help/TImageEnVect_vs_TIELayers.html


TImageEnVect does not use indexes but IDs for properties, so you need to pass the ID to ObjText[]. so you should use:

http://www.imageen.com/help/TImageEnVect.GetObjFromIndex.html

i.e.

if (ImageEnVect1.ObjText[ImageEnVect1.GetObjFromIndex( i )] = '' + listbox1.Items[listbox1.ItemIndex] + '') then
  ImageEnVect1.SelObjects [i];


Nigel
Xequte Software
www.imageen.com