mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 05:59:25 +02:00
LCL: renamed OnFilesDrop event to OnDropFiles
git-svn-id: trunk@11369 -
This commit is contained in:
parent
87d2069122
commit
d7ae9d52d1
16
.gitattributes
vendored
16
.gitattributes
vendored
@ -1155,6 +1155,14 @@ examples/designerbaseclass/example/unit1.lfm svneol=native#text/plain
|
|||||||
examples/designerbaseclass/example/unit1.lrs svneol=native#text/plain
|
examples/designerbaseclass/example/unit1.lrs svneol=native#text/plain
|
||||||
examples/designerbaseclass/example/unit1.pas svneol=native#text/plain
|
examples/designerbaseclass/example/unit1.pas svneol=native#text/plain
|
||||||
examples/dlgform.pp svneol=native#text/pascal
|
examples/dlgform.pp svneol=native#text/pascal
|
||||||
|
examples/dropfiles/filesdrop.lpi svneol=native#text/plain
|
||||||
|
examples/dropfiles/filesdrop.lpr svneol=native#text/pascal
|
||||||
|
examples/dropfiles/unit1.lfm svneol=native#text/plain
|
||||||
|
examples/dropfiles/unit1.lrs svneol=native#text/plain
|
||||||
|
examples/dropfiles/unit1.pas svneol=native#text/pascal
|
||||||
|
examples/dropfiles/unit2.lfm svneol=native#text/plain
|
||||||
|
examples/dropfiles/unit2.lrs svneol=native#text/plain
|
||||||
|
examples/dropfiles/unit2.pas svneol=native#text/pascal
|
||||||
examples/easter/about.lfm svneol=native#text/plain
|
examples/easter/about.lfm svneol=native#text/plain
|
||||||
examples/easter/about.lrs svneol=native#text/pascal
|
examples/easter/about.lrs svneol=native#text/pascal
|
||||||
examples/easter/about.pas svneol=native#text/pascal
|
examples/easter/about.pas svneol=native#text/pascal
|
||||||
@ -1171,14 +1179,6 @@ examples/exploremenu/exploreidemenu.pas svneol=native#text/plain
|
|||||||
examples/exploremenu/frmexploremenu.lfm svneol=native#text/plain
|
examples/exploremenu/frmexploremenu.lfm svneol=native#text/plain
|
||||||
examples/exploremenu/frmexploremenu.lrs svneol=native#text/plain
|
examples/exploremenu/frmexploremenu.lrs svneol=native#text/plain
|
||||||
examples/exploremenu/frmexploremenu.pas svneol=native#text/plain
|
examples/exploremenu/frmexploremenu.pas svneol=native#text/plain
|
||||||
examples/filesdrop/filesdrop.lpi svneol=native#text/plain
|
|
||||||
examples/filesdrop/filesdrop.lpr svneol=native#text/pascal
|
|
||||||
examples/filesdrop/unit1.lfm svneol=native#text/plain
|
|
||||||
examples/filesdrop/unit1.lrs svneol=native#text/plain
|
|
||||||
examples/filesdrop/unit1.pas svneol=native#text/pascal
|
|
||||||
examples/filesdrop/unit2.lfm svneol=native#text/plain
|
|
||||||
examples/filesdrop/unit2.lrs svneol=native#text/plain
|
|
||||||
examples/filesdrop/unit2.pas svneol=native#text/pascal
|
|
||||||
examples/fontenum/fontenumeration.lpi svneol=native#text/plain
|
examples/fontenum/fontenumeration.lpi svneol=native#text/plain
|
||||||
examples/fontenum/fontenumeration.lpr svneol=native#text/pascal
|
examples/fontenum/fontenumeration.lpr svneol=native#text/pascal
|
||||||
examples/fontenum/mainunit.lfm svneol=native#text/plain
|
examples/fontenum/mainunit.lfm svneol=native#text/plain
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -258,11 +258,11 @@ examples/designerbaseclass/example/units
|
|||||||
examples/designerbaseclass/lib/*.bak
|
examples/designerbaseclass/lib/*.bak
|
||||||
examples/designerbaseclass/lib/units
|
examples/designerbaseclass/lib/units
|
||||||
examples/designerbaseclass/units
|
examples/designerbaseclass/units
|
||||||
|
examples/dropfiles/units[!!-~]*.bak
|
||||||
examples/easter/*.bak
|
examples/easter/*.bak
|
||||||
examples/easter/units
|
examples/easter/units
|
||||||
examples/exploremenu/*.bak
|
examples/exploremenu/*.bak
|
||||||
examples/exploremenu/units
|
examples/exploremenu/units
|
||||||
examples/filesdrop/units[!!-~]*.bak
|
|
||||||
examples/fontenum/*.bak
|
examples/fontenum/*.bak
|
||||||
examples/fontenum/units
|
examples/fontenum/units
|
||||||
examples/grid_semaphor/*.bak
|
examples/grid_semaphor/*.bak
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
<Version Value="5"/>
|
<Version Value="5"/>
|
||||||
<General>
|
<General>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
|
<IconPath Value="./"/>
|
||||||
<TargetFileExt Value=".exe"/>
|
<TargetFileExt Value=".exe"/>
|
||||||
<ActiveEditorIndexAtStart Value="0"/>
|
<ActiveEditorIndexAtStart Value="1"/>
|
||||||
</General>
|
</General>
|
||||||
<VersionInfo>
|
<VersionInfo>
|
||||||
<ProjectVersion Value=""/>
|
<ProjectVersion Value=""/>
|
||||||
@ -45,8 +46,8 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ResourceFilename Value="unit1.lrs"/>
|
<ResourceFilename Value="unit1.lrs"/>
|
||||||
<UnitName Value="Unit1"/>
|
<UnitName Value="Unit1"/>
|
||||||
<CursorPos X="82" Y="48"/>
|
<CursorPos X="41" Y="19"/>
|
||||||
<TopLine Value="24"/>
|
<TopLine Value="13"/>
|
||||||
<EditorIndex Value="0"/>
|
<EditorIndex Value="0"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="20"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
@ -64,26 +65,22 @@
|
|||||||
<IsPartOfProject Value="True"/>
|
<IsPartOfProject Value="True"/>
|
||||||
<ResourceFilename Value="unit2.lrs"/>
|
<ResourceFilename Value="unit2.lrs"/>
|
||||||
<UnitName Value="Unit2"/>
|
<UnitName Value="Unit2"/>
|
||||||
<CursorPos X="89" Y="37"/>
|
<CursorPos X="80" Y="16"/>
|
||||||
<TopLine Value="17"/>
|
<TopLine Value="4"/>
|
||||||
<EditorIndex Value="1"/>
|
<EditorIndex Value="1"/>
|
||||||
<UsageCount Value="20"/>
|
<UsageCount Value="20"/>
|
||||||
<Loaded Value="True"/>
|
<Loaded Value="True"/>
|
||||||
</Unit3>
|
</Unit3>
|
||||||
</Units>
|
</Units>
|
||||||
<JumpHistory Count="3" HistoryIndex="2">
|
<JumpHistory Count="2" HistoryIndex="1">
|
||||||
<Position1>
|
<Position1>
|
||||||
<Filename Value="unit1.pas"/>
|
<Filename Value="unit1.pas"/>
|
||||||
<Caret Line="43" Column="9" TopLine="17"/>
|
<Caret Line="20" Column="5" TopLine="18"/>
|
||||||
</Position1>
|
</Position1>
|
||||||
<Position2>
|
<Position2>
|
||||||
<Filename Value="unit2.pas"/>
|
<Filename Value="unit2.pas"/>
|
||||||
<Caret Line="28" Column="7" TopLine="13"/>
|
<Caret Line="17" Column="5" TopLine="16"/>
|
||||||
</Position2>
|
</Position2>
|
||||||
<Position3>
|
|
||||||
<Filename Value="unit1.pas"/>
|
|
||||||
<Caret Line="38" Column="70" TopLine="27"/>
|
|
||||||
</Position3>
|
|
||||||
</JumpHistory>
|
</JumpHistory>
|
||||||
</ProjectOptions>
|
</ProjectOptions>
|
||||||
<CompilerOptions>
|
<CompilerOptions>
|
@ -5,10 +5,11 @@ object Form1: TForm1
|
|||||||
Width = 701
|
Width = 701
|
||||||
HorzScrollBar.Page = 700
|
HorzScrollBar.Page = 700
|
||||||
VertScrollBar.Page = 352
|
VertScrollBar.Page = 352
|
||||||
|
ActiveControl = Memo1
|
||||||
Caption = 'On Files Drop event example'
|
Caption = 'On Files Drop event example'
|
||||||
ClientHeight = 353
|
ClientHeight = 353
|
||||||
ClientWidth = 701
|
ClientWidth = 701
|
||||||
OnFilesDrop = FormFilesDrop
|
OnDropFiles = FormDropFiles
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
Left = 13
|
Left = 13
|
||||||
Height = 14
|
Height = 14
|
||||||
@ -32,7 +33,7 @@ object Form1: TForm1
|
|||||||
HintPause = 500
|
HintPause = 500
|
||||||
HintShortCuts = True
|
HintShortCuts = True
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
OnFilesDrop = ApplicationProperties1FilesDrop
|
OnDropFiles = ApplicationProperties1DropFiles
|
||||||
left = 126
|
left = 126
|
||||||
top = 300
|
top = 300
|
||||||
end
|
end
|
16
examples/dropfiles/unit1.lrs
Normal file
16
examples/dropfiles/unit1.lrs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
{ This is an automatically generated lazarus resource file }
|
||||||
|
|
||||||
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'+'#1#6'Height'#3'a'#1#3'Top'#3#155#0#5'Wi'
|
||||||
|
+'dth'#3#189#2#18'HorzScrollBar.Page'#3#188#2#18'VertScrollBar.Page'#3'`'#1#13
|
||||||
|
+'ActiveControl'#7#5'Memo1'#7'Caption'#6#27'On Files Drop event example'#12'C'
|
||||||
|
+'lientHeight'#3'a'#1#11'ClientWidth'#3#189#2#11'OnDropFiles'#7#13'FormDropFi'
|
||||||
|
+'les'#0#6'TLabel'#6'Label1'#4'Left'#2#13#6'Height'#2#14#3'Top'#2#18#5'Width'
|
||||||
|
+#3'('#1#7'Caption'#6'>Drag and drop files on this form and see the results i'
|
||||||
|
+'n memo. '#11'ParentColor'#8#0#0#5'TMemo'#5'Memo1'#4'Left'#2#12#6'Height'#3
|
||||||
|
+#31#1#3'Top'#2'0'#5'Width'#3#154#2#10'ScrollBars'#7#10'ssVertical'#8'TabOrde'
|
||||||
|
+'r'#2#0#0#0#22'TApplicationProperties'#22'ApplicationProperties1'#17'Capture'
|
||||||
|
+'Exceptions'#9#9'HintColor'#7#8'clInfoBk'#13'HintHidePause'#3#196#9#9'HintPa'
|
||||||
|
+'use'#3#244#1#13'HintShortCuts'#9#8'ShowHint'#9#11'OnDropFiles'#7#31'Applica'
|
||||||
|
+'tionProperties1DropFiles'#4'left'#2'~'#3'top'#3','#1#0#0#0
|
||||||
|
]);
|
@ -15,9 +15,9 @@ type
|
|||||||
ApplicationProperties1: TApplicationProperties;
|
ApplicationProperties1: TApplicationProperties;
|
||||||
Label1: TLabel;
|
Label1: TLabel;
|
||||||
Memo1: TMemo;
|
Memo1: TMemo;
|
||||||
procedure ApplicationProperties1FilesDrop(Sender: TObject;
|
procedure ApplicationProperties1DropFiles(Sender: TObject;
|
||||||
const FileNames: array of String);
|
const FileNames: array of String);
|
||||||
procedure FormFilesDrop(Sender: TObject; const FileNames: array of String);
|
procedure FormDropFiles(Sender: TObject; const FileNames: array of String);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
public
|
public
|
||||||
@ -31,16 +31,7 @@ implementation
|
|||||||
|
|
||||||
{ TForm1 }
|
{ TForm1 }
|
||||||
|
|
||||||
procedure TForm1.FormFilesDrop(Sender: TObject; const FileNames: array of String);
|
procedure TForm1.ApplicationProperties1DropFiles(Sender: TObject;
|
||||||
var
|
|
||||||
I: Integer;
|
|
||||||
begin
|
|
||||||
Memo1.Lines.Add(IntToStr(Length(FileNames)) + ' file(s) dropped on ' + Name + ':');
|
|
||||||
for I := 0 to High(FileNames) do
|
|
||||||
Memo1.Lines.Add(FileNames[I]);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TForm1.ApplicationProperties1FilesDrop(Sender: TObject;
|
|
||||||
const FileNames: array of String);
|
const FileNames: array of String);
|
||||||
var
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
@ -50,6 +41,15 @@ begin
|
|||||||
Memo1.Lines.Add(FileNames[I]);
|
Memo1.Lines.Add(FileNames[I]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TForm1.FormDropFiles(Sender: TObject; const FileNames: array of String);
|
||||||
|
var
|
||||||
|
I: Integer;
|
||||||
|
begin
|
||||||
|
Memo1.Lines.Add(IntToStr(Length(FileNames)) + ' file(s) dropped on ' + Name + ':');
|
||||||
|
for I := 0 to High(FileNames) do
|
||||||
|
Memo1.Lines.Add(FileNames[I]);
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
{$I unit1.lrs}
|
{$I unit1.lrs}
|
||||||
|
|
@ -8,7 +8,7 @@ object Form2: TForm2
|
|||||||
Caption = 'Form2'
|
Caption = 'Form2'
|
||||||
ClientHeight = 56
|
ClientHeight = 56
|
||||||
ClientWidth = 473
|
ClientWidth = 473
|
||||||
OnFilesDrop = FormFilesDrop
|
OnDropFiles = FormDropFiles
|
||||||
object Label1: TLabel
|
object Label1: TLabel
|
||||||
Left = 13
|
Left = 13
|
||||||
Height = 14
|
Height = 14
|
@ -3,8 +3,8 @@
|
|||||||
LazarusResources.Add('TForm2','FORMDATA',[
|
LazarusResources.Add('TForm2','FORMDATA',[
|
||||||
'TPF0'#6'TForm2'#5'Form2'#4'Left'#3#166#1#6'Height'#2'8'#3'Top'#3'P'#2#5'Widt'
|
'TPF0'#6'TForm2'#5'Form2'#4'Left'#3#166#1#6'Height'#2'8'#3'Top'#3'P'#2#5'Widt'
|
||||||
+'h'#3#217#1#18'HorzScrollBar.Page'#3#216#1#18'VertScrollBar.Page'#2'7'#7'Cap'
|
+'h'#3#217#1#18'HorzScrollBar.Page'#3#216#1#18'VertScrollBar.Page'#2'7'#7'Cap'
|
||||||
+'tion'#6#5'Form2'#12'ClientHeight'#2'8'#11'ClientWidth'#3#217#1#11'OnFilesDr'
|
+'tion'#6#5'Form2'#12'ClientHeight'#2'8'#11'ClientWidth'#3#217#1#11'OnDropFil'
|
||||||
+'op'#7#13'FormFilesDrop'#0#6'TLabel'#6'Label1'#4'Left'#2#13#6'Height'#2#14#3
|
+'es'#7#13'FormDropFiles'#0#6'TLabel'#6'Label1'#4'Left'#2#13#6'Height'#2#14#3
|
||||||
+'Top'#2#18#5'Width'#3'('#1#7'Caption'#6'>Drag and drop files on this form an'
|
+'Top'#2#18#5'Width'#3'('#1#7'Caption'#6'>Drag and drop files on this form an'
|
||||||
+'d see the results in memo. '#11'ParentColor'#8#0#0#0
|
+'d see the results in memo. '#11'ParentColor'#8#0#0#0
|
||||||
]);
|
]);
|
@ -13,7 +13,7 @@ type
|
|||||||
|
|
||||||
TForm2 = class(TForm)
|
TForm2 = class(TForm)
|
||||||
Label1: TLabel;
|
Label1: TLabel;
|
||||||
procedure FormFilesDrop(Sender: TObject; const FileNames: array of String);
|
procedure FormDropFiles(Sender: TObject; const FileNames: array of String);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
public
|
public
|
||||||
@ -30,7 +30,7 @@ uses
|
|||||||
|
|
||||||
{ TForm2 }
|
{ TForm2 }
|
||||||
|
|
||||||
procedure TForm2.FormFilesDrop(Sender: TObject; const FileNames: array of String);
|
procedure TForm2.FormDropFiles(Sender: TObject; const FileNames: array of String);
|
||||||
var
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
begin
|
begin
|
@ -1,16 +0,0 @@
|
|||||||
{ This is an automatically generated lazarus resource file }
|
|
||||||
|
|
||||||
LazarusResources.Add('TForm1','FORMDATA',[
|
|
||||||
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'+'#1#6'Height'#3'a'#1#3'Top'#3#155#0#5'Wi'
|
|
||||||
+'dth'#3#189#2#18'HorzScrollBar.Page'#3#188#2#18'VertScrollBar.Page'#3'`'#1#7
|
|
||||||
+'Caption'#6#27'On Files Drop event example'#12'ClientHeight'#3'a'#1#11'Clien'
|
|
||||||
+'tWidth'#3#189#2#11'OnFilesDrop'#7#13'FormFilesDrop'#0#6'TLabel'#6'Label1'#4
|
|
||||||
+'Left'#2#13#6'Height'#2#14#3'Top'#2#18#5'Width'#3'('#1#7'Caption'#6'>Drag an'
|
|
||||||
+'d drop files on this form and see the results in memo. '#11'ParentColor'#8#0
|
|
||||||
+#0#5'TMemo'#5'Memo1'#4'Left'#2#12#6'Height'#3#31#1#3'Top'#2'0'#5'Width'#3#154
|
|
||||||
+#2#10'ScrollBars'#7#10'ssVertical'#8'TabOrder'#2#0#0#0#22'TApplicationProper'
|
|
||||||
+'ties'#22'ApplicationProperties1'#17'CaptureExceptions'#9#9'HintColor'#7#8'c'
|
|
||||||
+'lInfoBk'#13'HintHidePause'#3#196#9#9'HintPause'#3#244#1#13'HintShortCuts'#9
|
|
||||||
+#8'ShowHint'#9#11'OnFilesDrop'#7#31'ApplicationProperties1FilesDrop'#4'left'
|
|
||||||
+#2'~'#3'top'#3','#1#0#0#0
|
|
||||||
]);
|
|
22
lcl/forms.pp
22
lcl/forms.pp
@ -319,7 +319,7 @@ type
|
|||||||
THelpEvent = function(Command: Word; Data: Longint;
|
THelpEvent = function(Command: Word; Data: Longint;
|
||||||
var CallHelp: Boolean): Boolean of object;
|
var CallHelp: Boolean): Boolean of object;
|
||||||
|
|
||||||
TFilesDropEvent = procedure (Sender: TObject; const FileNames: Array of String) of object;
|
TDropFilesEvent = procedure (Sender: TObject; const FileNames: Array of String) of object;
|
||||||
|
|
||||||
TShortCutEvent = procedure (var Msg: TLMKey; var Handled: Boolean) of object;
|
TShortCutEvent = procedure (var Msg: TLMKey; var Handled: Boolean) of object;
|
||||||
|
|
||||||
@ -373,7 +373,7 @@ type
|
|||||||
FOnCreate: TNotifyEvent;
|
FOnCreate: TNotifyEvent;
|
||||||
FOnDeactivate: TNotifyEvent;
|
FOnDeactivate: TNotifyEvent;
|
||||||
FOnDestroy: TNotifyEvent;
|
FOnDestroy: TNotifyEvent;
|
||||||
FOnFilesDrop: TFilesDropEvent;
|
FOnDropFiles: TDropFilesEvent;
|
||||||
FOnHelp: THelpEvent;
|
FOnHelp: THelpEvent;
|
||||||
FOnHide: TNotifyEvent;
|
FOnHide: TNotifyEvent;
|
||||||
FOnShortcut: TShortCutEvent;
|
FOnShortcut: TShortCutEvent;
|
||||||
@ -501,7 +501,7 @@ type
|
|||||||
procedure AddHandlerCreate(OnCreateHandler: TNotifyEvent; AsLast: Boolean=true);
|
procedure AddHandlerCreate(OnCreateHandler: TNotifyEvent; AsLast: Boolean=true);
|
||||||
procedure RemoveHandlerCreate(OnCreateHandler: TNotifyEvent);
|
procedure RemoveHandlerCreate(OnCreateHandler: TNotifyEvent);
|
||||||
function IsShortcut(var Message: TLMKey): boolean; virtual;
|
function IsShortcut(var Message: TLMKey): boolean; virtual;
|
||||||
procedure IntfFilesDrop(const FileNames: Array of String);
|
procedure IntfDropFiles(const FileNames: Array of String);
|
||||||
procedure IntfHelp(AComponent: TComponent);
|
procedure IntfHelp(AComponent: TComponent);
|
||||||
public
|
public
|
||||||
// drag and dock
|
// drag and dock
|
||||||
@ -536,7 +536,7 @@ type
|
|||||||
property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
|
property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
|
||||||
property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
|
property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
|
||||||
property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
|
property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
|
||||||
property OnFilesDrop: TFilesDropEvent read FOnFilesDrop write FOnFilesDrop;
|
property OnDropFiles: TDropFilesEvent read FOnDropFiles write FOnDropFiles;
|
||||||
property OnHelp: THelpEvent read FOnHelp write FOnHelp;
|
property OnHelp: THelpEvent read FOnHelp write FOnHelp;
|
||||||
property OnHide: TNotifyEvent read FOnHide write FOnHide;
|
property OnHide: TNotifyEvent read FOnHide write FOnHide;
|
||||||
property OnResize stored IsForm;
|
property OnResize stored IsForm;
|
||||||
@ -608,7 +608,7 @@ type
|
|||||||
property OnDragDrop;
|
property OnDragDrop;
|
||||||
property OnDragOver;
|
property OnDragOver;
|
||||||
property OnEndDock;
|
property OnEndDock;
|
||||||
property OnFilesDrop;
|
property OnDropFiles;
|
||||||
property OnGetSiteInfo;
|
property OnGetSiteInfo;
|
||||||
property OnHide;
|
property OnHide;
|
||||||
property OnKeyDown;
|
property OnKeyDown;
|
||||||
@ -928,7 +928,7 @@ type
|
|||||||
FOnActivate: TNotifyEvent;
|
FOnActivate: TNotifyEvent;
|
||||||
FOnDeactivate: TNotifyEvent;
|
FOnDeactivate: TNotifyEvent;
|
||||||
FOnDestroy: TNotifyEvent;
|
FOnDestroy: TNotifyEvent;
|
||||||
FOnFilesDrop: TFilesDropEvent;
|
FOnDropFiles: TDropFilesEvent;
|
||||||
FOnHelp: THelpEvent;
|
FOnHelp: THelpEvent;
|
||||||
FOnHint: TNotifyEvent;
|
FOnHint: TNotifyEvent;
|
||||||
FOnIdle: TIdleEvent;
|
FOnIdle: TIdleEvent;
|
||||||
@ -1062,7 +1062,7 @@ type
|
|||||||
procedure IntfEndSession;
|
procedure IntfEndSession;
|
||||||
procedure IntfAppMinimize;
|
procedure IntfAppMinimize;
|
||||||
procedure IntfAppRestore;
|
procedure IntfAppRestore;
|
||||||
procedure IntfFilesDrop(const FileNames: Array of String);
|
procedure IntfDropFiles(const FileNames: Array of String);
|
||||||
public
|
public
|
||||||
procedure DoEscapeKey(AControl: TWinControl; var Key: Word;
|
procedure DoEscapeKey(AControl: TWinControl; var Key: Word;
|
||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
@ -1095,7 +1095,7 @@ type
|
|||||||
property OnQueryEndSession: TQueryEndSessionEvent read FOnQueryEndSession write FOnQueryEndSession;
|
property OnQueryEndSession: TQueryEndSessionEvent read FOnQueryEndSession write FOnQueryEndSession;
|
||||||
property OnMinimize: TNotifyEvent read FOnMinimize write FOnMinimize;
|
property OnMinimize: TNotifyEvent read FOnMinimize write FOnMinimize;
|
||||||
property OnRestore: TNotifyEvent read FOnRestore write FOnRestore;
|
property OnRestore: TNotifyEvent read FOnRestore write FOnRestore;
|
||||||
property OnFilesDrop: TFilesDropEvent read FOnFilesDrop write FOnFilesDrop;
|
property OnDropFiles: TDropFilesEvent read FOnDropFiles write FOnDropFiles;
|
||||||
property OnHelp: THelpEvent read FOnHelp write FOnHelp;
|
property OnHelp: THelpEvent read FOnHelp write FOnHelp;
|
||||||
property OnHint: TNotifyEvent read FOnHint write FOnHint;
|
property OnHint: TNotifyEvent read FOnHint write FOnHint;
|
||||||
property OnShortcut: TShortcutEvent read FOnShortcut write FOnShortcut;
|
property OnShortcut: TShortcutEvent read FOnShortcut write FOnShortcut;
|
||||||
@ -1121,7 +1121,7 @@ type
|
|||||||
FHintPause: Integer;
|
FHintPause: Integer;
|
||||||
FHintShortCuts: Boolean;
|
FHintShortCuts: Boolean;
|
||||||
FHintShortPause: Integer;
|
FHintShortPause: Integer;
|
||||||
FOnFilesDrop: TFilesDropEvent;
|
FOnDropFiles: TDropFilesEvent;
|
||||||
FShowHint: Boolean;
|
FShowHint: Boolean;
|
||||||
FShowMainForm: Boolean;
|
FShowMainForm: Boolean;
|
||||||
FTitle: String;
|
FTitle: String;
|
||||||
@ -1157,7 +1157,7 @@ type
|
|||||||
Procedure SetOnQueryEndSession(Const AValue : TQueryEndSessionEvent);
|
Procedure SetOnQueryEndSession(Const AValue : TQueryEndSessionEvent);
|
||||||
Procedure SetOnMinimize(Const AValue : TNotifyEvent);
|
Procedure SetOnMinimize(Const AValue : TNotifyEvent);
|
||||||
Procedure SetOnRestore(Const AValue : TNotifyEvent);
|
Procedure SetOnRestore(Const AValue : TNotifyEvent);
|
||||||
Procedure SetOnFilesDrop(const AValue: TFilesDropEvent);
|
Procedure SetOnDropFiles(const AValue: TDropFilesEvent);
|
||||||
Procedure SetOnHelp(Const AValue : THelpEvent);
|
Procedure SetOnHelp(Const AValue : THelpEvent);
|
||||||
Procedure SetOnHint(Const AValue : TNotifyEvent);
|
Procedure SetOnHint(Const AValue : TNotifyEvent);
|
||||||
Procedure SetOnShowHint(Const AValue : TShowHintEvent);
|
Procedure SetOnShowHint(Const AValue : TShowHintEvent);
|
||||||
@ -1185,7 +1185,7 @@ type
|
|||||||
property OnQueryEndSession : TQueryEndSessionEvent read FOnQueryEndSession write SetOnQueryEndSession;
|
property OnQueryEndSession : TQueryEndSessionEvent read FOnQueryEndSession write SetOnQueryEndSession;
|
||||||
property OnMinimize : TNotifyEvent read FOnMinimize write SetOnMinimize;
|
property OnMinimize : TNotifyEvent read FOnMinimize write SetOnMinimize;
|
||||||
property OnRestore : TNotifyEvent read FOnRestore write SetOnRestore;
|
property OnRestore : TNotifyEvent read FOnRestore write SetOnRestore;
|
||||||
property OnFilesDrop: TFilesDropEvent read FOnFilesDrop write SetOnFilesDrop;
|
property OnDropFiles: TDropFilesEvent read FOnDropFiles write SetOnDropFiles;
|
||||||
property OnHelp: THelpEvent read FOnHelp write SetOnHelp;
|
property OnHelp: THelpEvent read FOnHelp write SetOnHelp;
|
||||||
property OnHint: TNotifyEvent read FOnHint write SetOnHint;
|
property OnHint: TNotifyEvent read FOnHint write SetOnHint;
|
||||||
property OnShowHint: TShowHintEvent read FOnShowHint write SetOnShowHint;
|
property OnShowHint: TShowHintEvent read FOnShowHint write SetOnShowHint;
|
||||||
|
@ -1450,15 +1450,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TApplication.IntfFilesDrop
|
Method: TApplication.IntfDropFiles
|
||||||
Params: FileNames - Dropped files
|
Params: FileNames - Dropped files
|
||||||
|
|
||||||
Invokes OnFilesDropEvent of the application.
|
Invokes OnDropFilesEvent of the application.
|
||||||
This function is called by the interface.
|
This function is called by the interface.
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TApplication.IntfFilesDrop(const FileNames: array of String);
|
procedure TApplication.IntfDropFiles(const FileNames: array of String);
|
||||||
begin
|
begin
|
||||||
if Assigned(FOnFilesDrop) then FOnFilesDrop(Self, FileNames);
|
if Assigned(FOnDropFiles) then FOnDropFiles(Self, FileNames);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -163,12 +163,12 @@ begin
|
|||||||
Application.OnRestore := AValue;
|
Application.OnRestore := AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TApplicationProperties.SetOnFilesDrop(const AValue: TFilesDropEvent);
|
Procedure TApplicationProperties.SetOnDropFiles(const AValue: TDropFilesEvent);
|
||||||
begin
|
begin
|
||||||
FOnFilesDrop := AValue;
|
FOnDropFiles := AValue;
|
||||||
|
|
||||||
If not (csDesigning in ComponentState) then
|
If not (csDesigning in ComponentState) then
|
||||||
Application.OnFilesDrop := AValue;
|
Application.OnDropFiles := AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TApplicationProperties.SetOnHelp(Const AValue : THelpEvent);
|
Procedure TApplicationProperties.SetOnHelp(Const AValue : THelpEvent);
|
||||||
|
@ -1687,15 +1687,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TCustomForm.IntfFilesDrop
|
Method: TCustomForm.IntfDropFiles
|
||||||
Params: FileNames - Dropped files
|
Params: FileNames - Dropped files
|
||||||
|
|
||||||
Invokes OnFilesDropEvent of the form.
|
Invokes OnDropFilesEvent of the form.
|
||||||
This function is called by the interface.
|
This function is called by the interface.
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
procedure TCustomForm.IntfFilesDrop(const FileNames: array of String);
|
procedure TCustomForm.IntfDropFiles(const FileNames: array of String);
|
||||||
begin
|
begin
|
||||||
if Assigned(FOnFilesDrop) then FOnFilesDrop(Self, FileNames);
|
if Assigned(FOnDropFiles) then FOnDropFiles(Self, FileNames);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -809,35 +809,43 @@ Var
|
|||||||
procedure HandleSpinEditChange(ASpinEdit: TCustomFloatSpinEdit);
|
procedure HandleSpinEditChange(ASpinEdit: TCustomFloatSpinEdit);
|
||||||
var
|
var
|
||||||
lWindowInfo: PWindowInfo;
|
lWindowInfo: PWindowInfo;
|
||||||
lNewValue: single;
|
NewValue: single;
|
||||||
begin
|
begin
|
||||||
lWindowInfo := GetWindowInfo(ASpinEdit.Handle);
|
lWindowInfo := GetWindowInfo(ASpinEdit.Handle);
|
||||||
if lWindowInfo = @DefaultWindowInfo then exit;
|
if lWindowInfo = @DefaultWindowInfo then exit;
|
||||||
lNewValue := StrToFloatDef(ASpinEdit.Text, lWindowInfo^.spinValue);
|
|
||||||
if lNewValue <> lWindowInfo^.spinValue then
|
NewValue := StrToFloatDef(ASpinEdit.Text, lWindowInfo^.spinValue);
|
||||||
|
if (ASpinEdit.MaxValue > ASpinEdit.MinValue) then
|
||||||
begin
|
begin
|
||||||
lWindowInfo^.spinValue := lNewValue;
|
if NewValue > ASpinEdit.MaxValue then
|
||||||
LMessage.Msg := CM_TEXTCHANGED;
|
NewValue := ASpinEdit.MaxValue;
|
||||||
|
if NewValue < ASpinEdit.MinValue then
|
||||||
|
NewValue := ASpinEdit.MinValue;
|
||||||
end;
|
end;
|
||||||
|
lWindowInfo^.spinValue := NewValue;
|
||||||
|
|
||||||
|
LMessage.Msg := CM_TEXTCHANGED;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure HandleSpinEditDeltaPos(AUpDownMsg: PNMUpDown);
|
procedure HandleSpinEditDeltaPos(AUpDownMsg: PNMUpDown);
|
||||||
var
|
var
|
||||||
lSpinEdit: TCustomFloatSpinEdit;
|
SpinEdit: TCustomFloatSpinEdit;
|
||||||
spinHandle: HWND;
|
spinHandle: HWND;
|
||||||
newValue: single;
|
newValue: single;
|
||||||
begin
|
begin
|
||||||
lSpinEdit := TCustomFloatSpinEdit(WindowInfo^.WinControl);
|
SpinEdit := TCustomFloatSpinEdit(WindowInfo^.WinControl);
|
||||||
newValue := WindowInfo^.spinValue + AUpDownMsg^.iDelta * lSpinEdit.Increment;
|
if SpinEdit.ReadOnly then Exit;
|
||||||
if (lSpinEdit.MinValue <> 0) or (lSpinEdit.MaxValue <> 0) then
|
|
||||||
|
newValue := WindowInfo^.spinValue + AUpDownMsg^.iDelta * SpinEdit.Increment;
|
||||||
|
if (SpinEdit.MaxValue > SpinEdit.MinValue) then
|
||||||
begin
|
begin
|
||||||
if newValue > lSpinEdit.MaxValue then
|
if newValue > SpinEdit.MaxValue then
|
||||||
newValue := lSpinEdit.MaxValue;
|
newValue := SpinEdit.MaxValue;
|
||||||
if newValue < lSpinEdit.MinValue then
|
if newValue < SpinEdit.MinValue then
|
||||||
newValue := lSpinEdit.MinValue;
|
newValue := SpinEdit.MinValue;
|
||||||
end;
|
end;
|
||||||
spinHandle := AUpDownMsg^.hdr.hwndFrom;
|
spinHandle := AUpDownMsg^.hdr.hwndFrom;
|
||||||
UpdateFloatSpinEditText(spinHandle, NewValue, lSpinEdit.DecimalPlaces);
|
UpdateFloatSpinEditText(spinHandle, NewValue, SpinEdit.DecimalPlaces);
|
||||||
Windows.SendMessage(spinHandle, UDM_SETPOS32, 0, 500);
|
Windows.SendMessage(spinHandle, UDM_SETPOS32, 0, 500);
|
||||||
WindowInfo^.spinValue := newValue;
|
WindowInfo^.spinValue := newValue;
|
||||||
end;
|
end;
|
||||||
@ -978,9 +986,9 @@ Var
|
|||||||
if Length(Files) > 0 then
|
if Length(Files) > 0 then
|
||||||
begin
|
begin
|
||||||
if lWinControl is TCustomForm then
|
if lWinControl is TCustomForm then
|
||||||
(lWinControl as TCustomForm).IntfFilesDrop(Files);
|
(lWinControl as TCustomForm).IntfDropFiles(Files);
|
||||||
if Application <> nil then
|
if Application <> nil then
|
||||||
Application.IntfFilesDrop(Files);
|
Application.IntfDropFiles(Files);
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
DragFinish(Drop);
|
DragFinish(Drop);
|
||||||
|
@ -257,7 +257,7 @@ begin
|
|||||||
FinishCreateWindow(AWinControl, Params, false);
|
FinishCreateWindow(AWinControl, Params, false);
|
||||||
// TODO: proper icon, for now set default icon
|
// TODO: proper icon, for now set default icon
|
||||||
SetIcon(TCustomForm(AWinControl), 0);
|
SetIcon(TCustomForm(AWinControl), 0);
|
||||||
// enable accepting files drop
|
// enable accepting drop files
|
||||||
DragAcceptFiles(Params.Window, True);
|
DragAcceptFiles(Params.Window, True);
|
||||||
Result := Params.Window;
|
Result := Params.Window;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user