58 lines
1.4 KiB
Plaintext
58 lines
1.4 KiB
Plaintext
unit uMain;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,
|
|
hyieutils, iexBitmaps, hyiedefs, iesettings, imageenview, ievect, ieview, iexLayers, iexRulers;
|
|
|
|
type
|
|
TMainForm = class(TForm)
|
|
ImageEnVect1: TImageEnVect;
|
|
ListBox1: TListBox;
|
|
Label2: TLabel;
|
|
Label3: TLabel;
|
|
procedure ImageEnVect1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
|
|
procedure ImageEnVect1DragDrop(Sender, Source: TObject; X, Y: Integer);
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
MainForm: TMainForm;
|
|
|
|
implementation
|
|
|
|
{$R *.DFM}
|
|
{$R WindowsTheme.res}
|
|
|
|
procedure TMainForm.ImageEnVect1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
|
|
begin
|
|
if Source is TListBox then
|
|
Accept := True;
|
|
end;
|
|
|
|
procedure TMainForm.ImageEnVect1DragDrop(Sender, Source: TObject; X, Y: Integer);
|
|
var
|
|
sText: string;
|
|
begin
|
|
With (Source as TListBox) do
|
|
sText := Items[ ItemIndex ];
|
|
if sText <> '' then
|
|
with ImageEnVect1 do
|
|
begin
|
|
ObjKind[ IEV_NEXT_INSERTED_OBJECT ] := iekTEXT;
|
|
ObjLeft[ IEV_NEXT_INSERTED_OBJECT ] := X;
|
|
ObjTop [ IEV_NEXT_INSERTED_OBJECT ] := Y;
|
|
objText[ IEV_NEXT_INSERTED_OBJECT ] := sText;
|
|
AddNewObject;
|
|
|
|
// Now resize it to fit text
|
|
StretchTextRect( IEV_PREVIOUS_INSERTED_OBJECT );
|
|
end;
|
|
end;
|
|
|
|
end.
|