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
 disable polyline autoselect

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
ptavant Posted - Feb 14 2017 : 04:30:00
Hi,

I have a TImageEnVect in a form. If I draw a polyline with the mouse, it is automatically selected by the component at the end of the press of the mouse.

Is there a way to avoid self-selection for each polyline added?

Thank you
Michele


2   L A T E S T    R E P L I E S    (Newest First)
ptavant Posted - Feb 15 2017 : 04:28:22
Hi Bill,

Your solution is right for me

Thank you
Michele
w2m Posted - Feb 14 2017 : 10:23:11
This is the best way I could find to not select a polyline when it is created. This allows the user to select a polyline after it is created, and not select it when it is first created.

The WmAfterSelectObject procedure is required so that the added object is selected as it is not yet selected in the OnNewObject event.

const
  WM_AFTER_SELECTOBJECT = WM_USER + 400;

private
procedure WmAfterSelectObject(var Msg: TMessage); message WM_AFTER_SELECTOBJECT;

procedure TForm1.ImageEnVect1NewObject(Sender: TObject; hobj: Integer);
begin
  { Post the custom message WM_AFTER_SELECTOBJECT to our form }
  PostMessage(Self.Handle, WM_AFTER_SELECTOBJECT, 0, 0);
end;

procedure TForm1.WmAfterSelectObject(var Msg: TMessage);
var
  i: Integer;
  iHObj: Integer;
begin
  iHObj := -1;
  with ImageEnVect1 do
  begin
    for i := -1 to SelObjectsCount - 1 do
    begin
      if i >= 0 then
        iHObj := SelObjects[i];
      if iHObj <> -1 then
        if ObjKind[iHObj] = iekPOLYLINE then
          UnSelObject(iHObj);
    end;
  end;
end;

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development