mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 15:00:24 +02:00
IDE: Add the ability to drop a file to the "TStrings" property editor
This commit is contained in:
parent
60f5db05f8
commit
f54375b92e
@ -396,6 +396,7 @@ resourcestring
|
||||
ois1LineDChars = '1 line, %d chars';
|
||||
oisStringsEditorDialog = 'Strings Editor Dialog';
|
||||
ois0Lines0Chars = '0 lines, 0 chars';
|
||||
oisOnlyOneFile = 'Only one file can be opened.';
|
||||
oisInvalidPropertyValue = 'Invalid property value';
|
||||
oisInfinityNotSupported = 'Setting a floating point property to positive or negative Infinity at design time is not supported';
|
||||
oisNaNNotSupported = 'Setting a floating point property to NaN at design time is not supported';
|
||||
|
@ -4,6 +4,7 @@ object StringsPropEditorFrm: TStringsPropEditorFrm
|
||||
Top = 359
|
||||
Width = 400
|
||||
ActiveControl = Memo
|
||||
AllowDropFiles = True
|
||||
Caption = 'StringsPropEditorFrm'
|
||||
ClientHeight = 302
|
||||
ClientWidth = 400
|
||||
@ -13,6 +14,7 @@ object StringsPropEditorFrm: TStringsPropEditorFrm
|
||||
Position = poScreenCenter
|
||||
OnClose = FormClose
|
||||
OnCreate = FormCreate
|
||||
OnDropFiles = FormDropFiles
|
||||
OnKeyDown = FormKeyDown
|
||||
object TextGroupBox: TGroupBox
|
||||
AnchorSideLeft.Control = Owner
|
||||
|
@ -42,6 +42,7 @@ type
|
||||
procedure ClearButtonClick(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var {%H-}CloseAction: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure FormDropFiles(Sender: TObject; const FileNames: array of string);
|
||||
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
procedure MemoChange(Sender: TObject);
|
||||
procedure SaveButtonClick(Sender: TObject);
|
||||
@ -130,6 +131,17 @@ begin
|
||||
Memo.Lines.LoadFromFile(OpenDialog1.FileName);
|
||||
end;
|
||||
|
||||
procedure TStringsPropEditorFrm.FormDropFiles(Sender: TObject; const FileNames: array of string);
|
||||
begin
|
||||
if length(FileNames) <> 1 then
|
||||
begin
|
||||
MessageDlg(oisError, oisOnlyOneFile, mtError, [mbOK], 0);
|
||||
exit;
|
||||
end;
|
||||
|
||||
Memo.Lines.LoadFromFile(FileNames[0]);
|
||||
end;
|
||||
|
||||
procedure TStringsPropEditorFrm.SortButtonClick(Sender: TObject);
|
||||
var
|
||||
OldText, NewSortedText: String;
|
||||
|
Loading…
Reference in New Issue
Block a user