You've already forked lazarus-ccr
Implement DropFileEvent
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1385 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -174,6 +174,8 @@ type
|
|||||||
procedure FDFind(Sender : TObject);
|
procedure FDFind(Sender : TObject);
|
||||||
procedure FDShow(Sender : TObject);
|
procedure FDShow(Sender : TObject);
|
||||||
procedure FormClose (Sender : TObject; var CloseAction : TCloseAction );
|
procedure FormClose (Sender : TObject; var CloseAction : TCloseAction );
|
||||||
|
procedure FormDropFiles(Sender : TObject; const FileNames : array of String
|
||||||
|
);
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure trvSchemaSelectionChanged(Sender : TObject);
|
procedure trvSchemaSelectionChanged(Sender : TObject);
|
||||||
private
|
private
|
||||||
@ -204,6 +206,7 @@ type
|
|||||||
procedure ShowDependencies();
|
procedure ShowDependencies();
|
||||||
procedure OpenFile(const AFileName : string; const AContent : TStream = nil);
|
procedure OpenFile(const AFileName : string; const AContent : TStream = nil);
|
||||||
procedure SaveToFile(const AFileName : string);
|
procedure SaveToFile(const AFileName : string);
|
||||||
|
function PromptAndSave() : Boolean;
|
||||||
public
|
public
|
||||||
constructor Create(AOwner : TComponent);override;
|
constructor Create(AOwner : TComponent);override;
|
||||||
destructor Destroy();override;
|
destructor Destroy();override;
|
||||||
@ -659,30 +662,29 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfWstTypeLibraryEdit.FormClose (Sender : TObject; var CloseAction : TCloseAction );
|
procedure TfWstTypeLibraryEdit.FormClose (Sender : TObject; var CloseAction : TCloseAction );
|
||||||
var
|
|
||||||
dlgRes : Integer;
|
|
||||||
{$IFDEF WST_IDE}
|
|
||||||
prjFile : TLazProjectFile;
|
|
||||||
{$ENDIF}
|
|
||||||
begin
|
begin
|
||||||
dlgRes := MessageDlg(Self.Caption,'Save the file before exit ?',mtConfirmation,mbYesNoCancel,0);
|
PromptAndSave();
|
||||||
if ( dlgRes = mrCancel ) then begin
|
end;
|
||||||
CloseAction := caNone;
|
|
||||||
end else begin
|
procedure TfWstTypeLibraryEdit.FormDropFiles(
|
||||||
if ( dlgRes = mrYes ) then begin
|
Sender : TObject;
|
||||||
actSave.Execute();
|
const FileNames : array of String
|
||||||
end;
|
);
|
||||||
{$IFDEF WST_IDE}
|
var
|
||||||
if ( FProjectLibrary = nil ) then begin
|
locFileName : string;
|
||||||
prjFile := GetCurrentProjectLibraryFile();
|
c, i : Integer;
|
||||||
if ( prjFile = nil ) then begin
|
begin
|
||||||
dlgRes := MessageDlg(Self.Caption,'Add this type library to the current project ?',mtConfirmation,mbYesNo,0);
|
c := Length(FileNames);
|
||||||
if ( dlgRes = mrYes ) then begin
|
if (c > 0) then begin
|
||||||
LazarusIDE.DoOpenEditorFile(FCurrentFileName,-1,[ofAddToProject]);
|
locFileName := '';
|
||||||
end;
|
for i := 0 to c - 1 do begin
|
||||||
|
if FileExists(FileNames[i]) then begin
|
||||||
|
locFileName := FileNames[i];
|
||||||
|
Break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
if (locFileName <> '') then
|
||||||
|
OpenFile(locFileName);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1208,6 +1210,33 @@ begin
|
|||||||
{$ENDIF WST_IDE}
|
{$ENDIF WST_IDE}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TfWstTypeLibraryEdit.PromptAndSave() : Boolean;
|
||||||
|
var
|
||||||
|
dlgRes : Integer;
|
||||||
|
{$IFDEF WST_IDE}
|
||||||
|
prjFile : TLazProjectFile;
|
||||||
|
{$ENDIF}
|
||||||
|
begin
|
||||||
|
dlgRes := MessageDlg(Self.Caption,'Save the file before exit ?',mtConfirmation,mbYesNoCancel,0);
|
||||||
|
Result := (dlgRes <> mrCancel);
|
||||||
|
if Result then begin
|
||||||
|
if ( dlgRes = mrYes ) then begin
|
||||||
|
actSave.Execute();
|
||||||
|
end;
|
||||||
|
{$IFDEF WST_IDE}
|
||||||
|
if ( FProjectLibrary = nil ) then begin
|
||||||
|
prjFile := GetCurrentProjectLibraryFile();
|
||||||
|
if ( prjFile = nil ) then begin
|
||||||
|
dlgRes := MessageDlg(Self.Caption,'Add this type library to the current project ?',mtConfirmation,mbYesNo,0);
|
||||||
|
if ( dlgRes = mrYes ) then begin
|
||||||
|
LazarusIDE.DoOpenEditorFile(FCurrentFileName,-1,[ofAddToProject]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TfWstTypeLibraryEdit.Create(AOwner: TComponent);
|
constructor TfWstTypeLibraryEdit.Create(AOwner: TComponent);
|
||||||
begin
|
begin
|
||||||
if ( DM = nil ) then begin
|
if ( DM = nil ) then begin
|
||||||
|
Reference in New Issue
Block a user