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
 MultiView2 demo

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
John Posted - Feb 23 2016 : 22:07:54
Hello

In the MultiView2 demo, which utilizes an ImageEnMView component, when an image is dragged vertically, a red dotted line is drawn in the space where the image would be if dropped. This action is coded in the ImageEnMView.OnAfterEvent event. I have a scenario where I am drag and dropping an image in the new ImageEnFolderMView component which orients the images horizontally.

The OnAfterEvent code from the demo provides a horizontal line over the image in front of where the image to be dropped would be. Does anyone have an idea as to how to display the red dotted line vertically in the space between the two images where the drop would occure?

TIA

John

3   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Mar 01 2016 : 18:03:08
The current version of the ImageEn Developer manual is version 2. If you only have version 1 send me an email and I will send you the download link.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
John Posted - Mar 01 2016 : 17:42:39
William

With regard to the OnDragOver and OnDragDrop, the ImageEnMView and ImageEnFolderMView behave (in my experience) in a similar manner.

In my particular situation the ImageEnFolderMView.Align := Client. In this scenario, the images are aligned horizontally. The code you provided displays the red dotted line vertically which is what I needed. The code in my example displayed the red dotted line over the image in front of the location where the dragged image was to be dropped.

Thanks again for your efforts.

John

p.s. As an aside, did you ever publish a second edition to your ImageEn manual?

w2m Posted - Feb 24 2016 : 09:25:32
The MultiView2 demo uses a ImageEnMView with its alignment property (vertically aligned) set to alLeft with a GridWidth property set to 1 (one column). To display a horizontally aligned ImageEnMView set the ImageEnMView Align property to alTop or alBottom (horizontal) and the GridWidth property to 0 (one row).

// Accepts drag/drop. Draws a line to signal where to insert images
procedure TMainForm.ImageEnMView1DragOver(Sender, Source: TObject;
  X, Y: Integer; State: TDragState; var Accept: Boolean);
var
  im: Integer;
  imgX, imgY: Integer;
begin
  if Source = ImageEnMView1 then
  begin
    Accept := true;
    im := ImageEnMView1.InsertingPoint(X, Y);
    imgX := ImageEnMView1.ImageX[im];
    imgY := ImageEnMView1.ImageY[im];
    ImageEnMView1.Paint;
    with ImageEnMView1.GetCanvas do
    begin
      Pen.Color := clRed;
      Pen.Style := psDot; // display a dotted line
      Pen.Width := 1;  // a dotted line only works if pen width is 1 otherwise it will be a solid line
      // draw the line vertically at the insert point
      MoveTo(imgX, imgY);
      LineTo(imgX, imgY + ImageEnMView1.ThumbHeight - 10);
    end;
  end;
end;

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