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
 Label With Line - How to Edit Text

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
plumothy Posted - Apr 22 2014 : 06:13:00
I am using the Actions_Vect sample project...

The Action "Insert Label with Line" seems to do exactly the same as "Insert Line". I assumed that I would be able to enter some text for a label placed next to the line. I have been advised to use this code in the NewObject event:

procedure TMainForm.ImageEnVect1NewObject(Sender: TObject; hobj: Integer);
begin
 if ImageEnVect1.ObjKind[hobj] = iekLINELABEL then
   ImageEnVect1.ObjText[hobj] := ' ImageEn Rocks! ';
end;


Yes, this works - I now have some text, but it seems to be a rather incomplete solution.
"Insert label with line" implies to me that the user can draw a line and label it (which is exactly what I want). But, the text has to be entered programatically - I would like the user the user to enter it just like they do with a text box. Also, the user doesn't appear to have any way of editing the text at a later time (a regular text box - you can double-click it).

Any suggestions appreciated.

Also, how can I remove the box that is drawn around the text?

Steve Bailey,
ImageEn 5.1.0
Delphi XE4 Professional
Windows 7 Professional
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Apr 23 2014 : 18:20:39
Hi

Yes, Grouping is not yet supported. But it is on the to-do list.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
plumothy Posted - Apr 22 2014 : 12:54:46
Thank you. I shall definitely have a look at the book. I actually need a spot with an arrow pointing to it and text at the beginning of the arrow, so your demo sounds almost perfect already.

I presume from your response that ImageEn does not supporting grouping - something that would be a good enhancement in the future (as would being able to edit the text on a LineLabel object).

Thanks for the help - much appreciated!

Steve Bailey,
ImageEn 5.1.0
Delphi XE4 Professional
Windows 7 Professional
w2m Posted - Apr 22 2014 : 10:33:04
I think that the Text is a TLabel and not a TEdit so you can not edit the text; However you could put a TEdit component somewhere on your form and in the TEdit.OnChange event, change the linelabel text to match the TEdit.Text.

To make the labels border transparent then set ObjLabelBorder to ielNone:
procedure TMainForm.ImageEnVect1NewObject(Sender: TObject; hobj: Integer);
begin
 if ImageEnVect1.ObjKind[hobj] = iekLINELABEL then
 begin
   ImageEnVect1.ObjText[hobj] := ' ImageEn Rocks! ';
   ImageEnVect1.ObjLabelBorder[hobj] := ielNone;
   VtObjectSelect.Checked := True;
   ImageEnVect1.MouseInteractVt := [miObjectSelect];
 end;
end;

If you want a line object a with an associated editable text object it can be dome, but the task is not trivial and is somewhat complex to code. Far too much code than I am willing to post here.

My EBook has a demo called "Spots and Text"o that shows how to combine two objects to act as one... meaning when each object is dragged the other is dragged as well. The demo uses a iekEllipse object for the spot and a iekText object for the text, so in your case, all you have to do is change the iekEllipse object to a iekLine object and you will have what you are looking for.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development