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
 Object Property Defaults

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
egrobler Posted - Apr 08 2014 : 12:41:03
Hi Everyone,
If I create 2 lines:
with ImageEnVect1 do
begin
  ObjKind[-1] := iekLINE;
  ObjLeft[-1] := 0; ObjTop[-1] := 0;
  ObjWidth[-1] := 100; ObjHeight[-1] := 100;
  ObjPenColor[-1] := clRed;
  ObjPenWidth[-1] := 10;
  AddNewObject;
end;

with ImageEnVect1 do
begin
  ObjKind[-1] := iekLINE;
  ObjLeft[-1] := 0; ObjTop[-1] := 200;
  ObjWidth[-1] := 100; ObjHeight[-1] := 100;
  ObjPenColor[-1] := clBlue;
  //ObjPenWidth is still 10 from previous object
  AddNewObject;
end;

then the second line will also have a ObjPenWidth of 10.
So the lines will be different if I move the 2 blocks of code around (create blue line first).

How can I reset the TImageEnVect.fNewObj to it's initial/default values? (I am using ImageEn 5.0.6)

Regards
Eric
4   L A T E S T    R E P L I E S    (Newest First)
egrobler Posted - Apr 08 2014 : 17:11:02
Thank you Nigel
xequte Posted - Apr 08 2014 : 16:42:52
Hi Eric

Thanks for your suggestion. We'll probably look at doing this as a parameter to AddNewObject.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
egrobler Posted - Apr 08 2014 : 15:35:57
> Why don't you just set the ObjPenWidth[-1] := xx with the second line?

Because it is bad practice to have to deal with side effects.

ObjPenWidth is not enough, I also have to think about
PenStyle.

And if it is a ieBOX what about
BrushStyle
BoxHighlight
BoxHighlight
etc.

I assume your answer is that one cannot revert to the default values/settings?

My suggestion is that in the next version the initialization code inside the constructor is re-factored to a SetDefaultObjectProperties method.
constructor TImageEnVect.Create(Owner: TComponent);
begin
...
  with fNewObj do
  begin
    x1 := 0;
    y1 := 0;
    x2 := IEDEFWIDTH - 1;
    y2 := IEDEFHEIGHT - 1;
    a1 := 0;
    a2 := 2 * pi;
    PenColor := clWhite;
    PenStyle := psSolid;
    PenWidth := 1;
    ...
  end;
...
end;


Regards
Eric
w2m Posted - Apr 08 2014 : 15:01:14
Why don't you just set the ObjPenWidth[-1] := xx with the second line?

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