mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-03 14:22:29 +01:00
lcl: Standard File Actions
git-svn-id: trunk@15110 -
This commit is contained in:
parent
51461c2471
commit
93831090cb
@ -4,10 +4,12 @@ object Form1: TForm1
|
|||||||
Top = 164
|
Top = 164
|
||||||
Width = 277
|
Width = 277
|
||||||
HorzScrollBar.Page = 276
|
HorzScrollBar.Page = 276
|
||||||
VertScrollBar.Page = 163
|
VertScrollBar.Page = 143
|
||||||
Caption = 'Standard actions demo'
|
Caption = 'Standard actions demo'
|
||||||
ClientHeight = 164
|
ClientHeight = 144
|
||||||
ClientWidth = 277
|
ClientWidth = 277
|
||||||
|
Menu = MainMenu1
|
||||||
|
OnCloseQuery = FormCloseQuery
|
||||||
LCLVersion = '0.9.25'
|
LCLVersion = '0.9.25'
|
||||||
object Edit1: TEdit
|
object Edit1: TEdit
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
@ -79,7 +81,7 @@ object Form1: TForm1
|
|||||||
AnchorSideBottom.Control = Owner
|
AnchorSideBottom.Control = Owner
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 5
|
Left = 5
|
||||||
Height = 100
|
Height = 80
|
||||||
Top = 59
|
Top = 59
|
||||||
Width = 267
|
Width = 267
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
@ -137,5 +139,66 @@ object Form1: TForm1
|
|||||||
Hint = 'Delete'
|
Hint = 'Delete'
|
||||||
ShortCut = 46
|
ShortCut = 46
|
||||||
end
|
end
|
||||||
|
object FileOpen1: TFileOpen
|
||||||
|
Category = 'File'
|
||||||
|
Caption = '&Open...'
|
||||||
|
Hint = 'Open'
|
||||||
|
ShortCut = 16463
|
||||||
|
end
|
||||||
|
object FileOpenWith1: TFileOpenWith
|
||||||
|
Category = 'File'
|
||||||
|
Caption = 'Open with...'
|
||||||
|
Hint = 'Open'
|
||||||
|
end
|
||||||
|
object FileSaveAs1: TFileSaveAs
|
||||||
|
Category = 'File'
|
||||||
|
Caption = 'Save &As...'
|
||||||
|
Hint = 'Save As'
|
||||||
|
end
|
||||||
|
object FileExit1: TFileExit
|
||||||
|
Category = 'File'
|
||||||
|
Caption = 'E&xit'
|
||||||
|
Hint = 'Exit'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object MainMenu1: TMainMenu
|
||||||
|
left = 213
|
||||||
|
top = 32
|
||||||
|
object MenuItem8: TMenuItem
|
||||||
|
Caption = 'File'
|
||||||
|
object MenuItem11: TMenuItem
|
||||||
|
Action = FileOpen1
|
||||||
|
end
|
||||||
|
object MenuItem13: TMenuItem
|
||||||
|
Action = FileOpenWith1
|
||||||
|
end
|
||||||
|
object MenuItem16: TMenuItem
|
||||||
|
Action = FileSaveAs1
|
||||||
|
end
|
||||||
|
object MenuItem17: TMenuItem
|
||||||
|
Action = FileExit1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object MenuItem1: TMenuItem
|
||||||
|
Caption = 'Edit'
|
||||||
|
object MenuItem2: TMenuItem
|
||||||
|
Action = EditCut1
|
||||||
|
end
|
||||||
|
object MenuItem3: TMenuItem
|
||||||
|
Action = EditCopy1
|
||||||
|
end
|
||||||
|
object MenuItem4: TMenuItem
|
||||||
|
Action = EditPaste1
|
||||||
|
end
|
||||||
|
object MenuItem5: TMenuItem
|
||||||
|
Action = EditSelectAll1
|
||||||
|
end
|
||||||
|
object MenuItem6: TMenuItem
|
||||||
|
Action = EditDelete1
|
||||||
|
end
|
||||||
|
object MenuItem7: TMenuItem
|
||||||
|
Action = EditUndo1
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -2,42 +2,59 @@
|
|||||||
|
|
||||||
LazarusResources.Add('TForm1','FORMDATA',[
|
LazarusResources.Add('TForm1','FORMDATA',[
|
||||||
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'"'#1#6'Height'#3#164#0#3'Top'#3#164#0#5'W'
|
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'"'#1#6'Height'#3#164#0#3'Top'#3#164#0#5'W'
|
||||||
+'idth'#3#21#1#18'HorzScrollBar.Page'#3#20#1#18'VertScrollBar.Page'#3#163#0#7
|
+'idth'#3#21#1#18'HorzScrollBar.Page'#3#20#1#18'VertScrollBar.Page'#3#143#0#7
|
||||||
+'Caption'#6#21'Standard actions demo'#12'ClientHeight'#3#164#0#11'ClientWidt'
|
+'Caption'#6#21'Standard actions demo'#12'ClientHeight'#3#144#0#11'ClientWidt'
|
||||||
+'h'#3#21#1#10'LCLVersion'#6#6'0.9.25'#0#5'TEdit'#5'Edit1'#22'AnchorSideLeft.'
|
+'h'#3#21#1#4'Menu'#7#9'MainMenu1'#12'OnCloseQuery'#7#14'FormCloseQuery'#10'L'
|
||||||
+'Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#8'ToolBar1'#18'AnchorSideTo'
|
+'CLVersion'#6#6'0.9.25'#0#5'TEdit'#5'Edit1'#22'AnchorSideLeft.Control'#7#5'O'
|
||||||
+'p.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSide'
|
+'wner'#21'AnchorSideTop.Control'#7#8'ToolBar1'#18'AnchorSideTop.Side'#7#9'as'
|
||||||
+'Right.Side'#7#9'asrBottom'#4'Left'#2#5#6'Height'#2#23#3'Top'#2#31#5'Width'#3
|
+'rBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9
|
||||||
+#11#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#18'BorderSpacing.Left'#2
|
+'asrBottom'#4'Left'#2#5#6'Height'#2#23#3'Top'#2#31#5'Width'#3#11#1#7'Anchors'
|
||||||
+#5#17'BorderSpacing.Top'#2#5#19'BorderSpacing.Right'#2#5#8'TabOrder'#2#0#4'T'
|
+#11#5'akTop'#6'akLeft'#7'akRight'#0#18'BorderSpacing.Left'#2#5#17'BorderSpac'
|
||||||
+'ext'#6#5'Edit1'#0#0#8'TToolBar'#8'ToolBar1'#6'Height'#2#26#5'Width'#3#21#1#7
|
+'ing.Top'#2#5#19'BorderSpacing.Right'#2#5#8'TabOrder'#2#0#4'Text'#6#5'Edit1'
|
||||||
+'Caption'#6#8'ToolBar1'#4'Flat'#9#12'ShowCaptions'#9#8'TabOrder'#2#1#0#11'TT'
|
+#0#0#8'TToolBar'#8'ToolBar1'#6'Height'#2#26#5'Width'#3#21#1#7'Caption'#6#8'T'
|
||||||
+'oolButton'#11'ToolButton1'#4'Left'#2#1#4'Hint'#6#3'Cut'#3'Top'#2#2#6'Action'
|
+'oolBar1'#4'Flat'#9#12'ShowCaptions'#9#8'TabOrder'#2#1#0#11'TToolButton'#11
|
||||||
+#7#8'EditCut1'#0#0#11'TToolButton'#11'ToolButton2'#4'Left'#2'!'#4'Hint'#6#4
|
+'ToolButton1'#4'Left'#2#1#4'Hint'#6#3'Cut'#3'Top'#2#2#6'Action'#7#8'EditCut1'
|
||||||
+'Copy'#3'Top'#2#2#6'Action'#7#9'EditCopy1'#0#0#11'TToolButton'#11'ToolButton'
|
+#0#0#11'TToolButton'#11'ToolButton2'#4'Left'#2'!'#4'Hint'#6#4'Copy'#3'Top'#2
|
||||||
+'3'#4'Left'#2'I'#4'Hint'#6#5'Paste'#3'Top'#2#2#6'Action'#7#10'EditPaste1'#0#0
|
+#2#6'Action'#7#9'EditCopy1'#0#0#11'TToolButton'#11'ToolButton3'#4'Left'#2'I'
|
||||||
+#11'TToolButton'#11'ToolButton4'#4'Left'#2's'#4'Hint'#6#10'Select All'#3'Top'
|
+#4'Hint'#6#5'Paste'#3'Top'#2#2#6'Action'#7#10'EditPaste1'#0#0#11'TToolButton'
|
||||||
+#2#2#6'Action'#7#14'EditSelectAll1'#0#0#11'TToolButton'#11'ToolButton5'#4'Le'
|
+#11'ToolButton4'#4'Left'#2's'#4'Hint'#6#10'Select All'#3'Top'#2#2#6'Action'#7
|
||||||
+'ft'#3#173#0#4'Hint'#6#6'Delete'#3'Top'#2#2#6'Action'#7#11'EditDelete1'#0#0
|
+#14'EditSelectAll1'#0#0#11'TToolButton'#11'ToolButton5'#4'Left'#3#173#0#4'Hi'
|
||||||
+#11'TToolButton'#11'ToolButton6'#4'Left'#3#219#0#4'Hint'#6#4'Undo'#3'Top'#2#2
|
+'nt'#6#6'Delete'#3'Top'#2#2#6'Action'#7#11'EditDelete1'#0#0#11'TToolButton'
|
||||||
+#6'Action'#7#9'EditUndo1'#0#0#0#5'TMemo'#5'Memo1'#22'AnchorSideLeft.Control'
|
+#11'ToolButton6'#4'Left'#3#219#0#4'Hint'#6#4'Undo'#3'Top'#2#2#6'Action'#7#9
|
||||||
+#7#5'Owner'#21'AnchorSideTop.Control'#7#5'Edit1'#18'AnchorSideTop.Side'#7#9
|
+'EditUndo1'#0#0#0#5'TMemo'#5'Memo1'#22'AnchorSideLeft.Control'#7#5'Owner'#21
|
||||||
+'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7
|
+'AnchorSideTop.Control'#7#5'Edit1'#18'AnchorSideTop.Side'#7#9'asrBottom'#23
|
||||||
+#9'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Si'
|
+'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'
|
||||||
+'de'#7#9'asrBottom'#4'Left'#2#5#6'Height'#2'd'#3'Top'#2';'#5'Width'#3#11#1#7
|
+#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBo'
|
||||||
+'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#18'BorderSpacing.Le'
|
+'ttom'#4'Left'#2#5#6'Height'#2'P'#3'Top'#2';'#5'Width'#3#11#1#7'Anchors'#11#5
|
||||||
+'ft'#2#5#17'BorderSpacing.Top'#2#5#19'BorderSpacing.Right'#2#5#20'BorderSpac'
|
+'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#18'BorderSpacing.Left'#2#5#17'Bor'
|
||||||
+'ing.Bottom'#2#5#13'Lines.Strings'#1#6#5'Memo1'#0#8'TabOrder'#2#2#0#0#11'TAc'
|
+'derSpacing.Top'#2#5#19'BorderSpacing.Right'#2#5#20'BorderSpacing.Bottom'#2#5
|
||||||
+'tionList'#11'ActionList1'#4'left'#3#184#0#3'top'#2' '#0#8'TEditCut'#8'EditC'
|
+#13'Lines.Strings'#1#6#5'Memo1'#0#8'TabOrder'#2#2#0#0#11'TActionList'#11'Act'
|
||||||
+'ut1'#8'Category'#6#4'Edit'#7'Caption'#6#4'Cu&t'#18'DisableIfNoHandler'#9#4
|
+'ionList1'#4'left'#3#184#0#3'top'#2' '#0#8'TEditCut'#8'EditCut1'#8'Category'
|
||||||
+'Hint'#6#3'Cut'#8'ShortCut'#3'X@'#0#0#9'TEditCopy'#9'EditCopy1'#8'Category'#6
|
+#6#4'Edit'#7'Caption'#6#4'Cu&t'#18'DisableIfNoHandler'#9#4'Hint'#6#3'Cut'#8
|
||||||
+#4'Edit'#7'Caption'#6#5'&Copy'#18'DisableIfNoHandler'#9#4'Hint'#6#4'Copy'#8
|
+'ShortCut'#3'X@'#0#0#9'TEditCopy'#9'EditCopy1'#8'Category'#6#4'Edit'#7'Capti'
|
||||||
+'ShortCut'#3'C@'#0#0#10'TEditPaste'#10'EditPaste1'#8'Category'#6#4'Edit'#7'C'
|
+'on'#6#5'&Copy'#18'DisableIfNoHandler'#9#4'Hint'#6#4'Copy'#8'ShortCut'#3'C@'
|
||||||
+'aption'#6#6'&Paste'#18'DisableIfNoHandler'#9#4'Hint'#6#5'Paste'#8'ShortCut'
|
+#0#0#10'TEditPaste'#10'EditPaste1'#8'Category'#6#4'Edit'#7'Caption'#6#6'&Pas'
|
||||||
+#3'V@'#0#0#14'TEditSelectAll'#14'EditSelectAll1'#8'Category'#6#4'Edit'#7'Cap'
|
+'te'#18'DisableIfNoHandler'#9#4'Hint'#6#5'Paste'#8'ShortCut'#3'V@'#0#0#14'TE'
|
||||||
+'tion'#6#11'Select &All'#18'DisableIfNoHandler'#9#4'Hint'#6#10'Select All'#8
|
+'ditSelectAll'#14'EditSelectAll1'#8'Category'#6#4'Edit'#7'Caption'#6#11'Sele'
|
||||||
+'ShortCut'#3'A@'#0#0#9'TEditUndo'#9'EditUndo1'#8'Category'#6#4'Edit'#7'Capti'
|
+'ct &All'#18'DisableIfNoHandler'#9#4'Hint'#6#10'Select All'#8'ShortCut'#3'A@'
|
||||||
+'on'#6#5'&Undo'#18'DisableIfNoHandler'#9#4'Hint'#6#4'Undo'#8'ShortCut'#3'Z@'
|
+#0#0#9'TEditUndo'#9'EditUndo1'#8'Category'#6#4'Edit'#7'Caption'#6#5'&Undo'#18
|
||||||
+#0#0#11'TEditDelete'#11'EditDelete1'#8'Category'#6#4'Edit'#7'Caption'#6#7'&D'
|
+'DisableIfNoHandler'#9#4'Hint'#6#4'Undo'#8'ShortCut'#3'Z@'#0#0#11'TEditDelet'
|
||||||
+'elete'#18'DisableIfNoHandler'#9#4'Hint'#6#6'Delete'#8'ShortCut'#2'.'#0#0#0#0
|
+'e'#11'EditDelete1'#8'Category'#6#4'Edit'#7'Caption'#6#7'&Delete'#18'Disable'
|
||||||
|
+'IfNoHandler'#9#4'Hint'#6#6'Delete'#8'ShortCut'#2'.'#0#0#9'TFileOpen'#9'File'
|
||||||
|
+'Open1'#8'Category'#6#4'File'#7'Caption'#6#8'&Open...'#4'Hint'#6#4'Open'#8'S'
|
||||||
|
+'hortCut'#3'O@'#0#0#13'TFileOpenWith'#13'FileOpenWith1'#8'Category'#6#4'File'
|
||||||
|
+#7'Caption'#6#12'Open with...'#4'Hint'#6#4'Open'#0#0#11'TFileSaveAs'#11'File'
|
||||||
|
+'SaveAs1'#8'Category'#6#4'File'#7'Caption'#6#11'Save &As...'#4'Hint'#6#7'Sav'
|
||||||
|
+'e As'#0#0#9'TFileExit'#9'FileExit1'#8'Category'#6#4'File'#7'Caption'#6#5'E&'
|
||||||
|
+'xit'#4'Hint'#6#4'Exit'#0#0#0#9'TMainMenu'#9'MainMenu1'#4'left'#3#213#0#3'to'
|
||||||
|
+'p'#2' '#0#9'TMenuItem'#9'MenuItem8'#7'Caption'#6#4'File'#0#9'TMenuItem'#10
|
||||||
|
+'MenuItem11'#6'Action'#7#9'FileOpen1'#0#0#9'TMenuItem'#10'MenuItem13'#6'Acti'
|
||||||
|
+'on'#7#13'FileOpenWith1'#0#0#9'TMenuItem'#10'MenuItem16'#6'Action'#7#11'File'
|
||||||
|
+'SaveAs1'#0#0#9'TMenuItem'#10'MenuItem17'#6'Action'#7#9'FileExit1'#0#0#0#9'T'
|
||||||
|
+'MenuItem'#9'MenuItem1'#7'Caption'#6#4'Edit'#0#9'TMenuItem'#9'MenuItem2'#6'A'
|
||||||
|
+'ction'#7#8'EditCut1'#0#0#9'TMenuItem'#9'MenuItem3'#6'Action'#7#9'EditCopy1'
|
||||||
|
+#0#0#9'TMenuItem'#9'MenuItem4'#6'Action'#7#10'EditPaste1'#0#0#9'TMenuItem'#9
|
||||||
|
+'MenuItem5'#6'Action'#7#14'EditSelectAll1'#0#0#9'TMenuItem'#9'MenuItem6'#6'A'
|
||||||
|
+'ction'#7#11'EditDelete1'#0#0#9'TMenuItem'#9'MenuItem7'#6'Action'#7#9'EditUn'
|
||||||
|
+'do1'#0#0#0#0#0
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||||
ActnList, StdActns, ComCtrls;
|
ActnList, StdActns, ComCtrls, Menus;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -21,7 +21,24 @@ type
|
|||||||
EditPaste1: TEditPaste;
|
EditPaste1: TEditPaste;
|
||||||
EditSelectAll1: TEditSelectAll;
|
EditSelectAll1: TEditSelectAll;
|
||||||
EditUndo1: TEditUndo;
|
EditUndo1: TEditUndo;
|
||||||
|
FileExit1: TFileExit;
|
||||||
|
FileOpen1: TFileOpen;
|
||||||
|
FileOpenWith1: TFileOpenWith;
|
||||||
|
FileSaveAs1: TFileSaveAs;
|
||||||
|
MainMenu1: TMainMenu;
|
||||||
Memo1: TMemo;
|
Memo1: TMemo;
|
||||||
|
MenuItem1: TMenuItem;
|
||||||
|
MenuItem11: TMenuItem;
|
||||||
|
MenuItem13: TMenuItem;
|
||||||
|
MenuItem16: TMenuItem;
|
||||||
|
MenuItem17: TMenuItem;
|
||||||
|
MenuItem2: TMenuItem;
|
||||||
|
MenuItem3: TMenuItem;
|
||||||
|
MenuItem4: TMenuItem;
|
||||||
|
MenuItem5: TMenuItem;
|
||||||
|
MenuItem6: TMenuItem;
|
||||||
|
MenuItem7: TMenuItem;
|
||||||
|
MenuItem8: TMenuItem;
|
||||||
ToolBar1: TToolBar;
|
ToolBar1: TToolBar;
|
||||||
ToolButton1: TToolButton;
|
ToolButton1: TToolButton;
|
||||||
ToolButton2: TToolButton;
|
ToolButton2: TToolButton;
|
||||||
@ -29,6 +46,7 @@ type
|
|||||||
ToolButton4: TToolButton;
|
ToolButton4: TToolButton;
|
||||||
ToolButton5: TToolButton;
|
ToolButton5: TToolButton;
|
||||||
ToolButton6: TToolButton;
|
ToolButton6: TToolButton;
|
||||||
|
procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||||
private
|
private
|
||||||
{ private declarations }
|
{ private declarations }
|
||||||
public
|
public
|
||||||
@ -40,6 +58,13 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{ TForm1 }
|
||||||
|
|
||||||
|
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
|
||||||
|
begin
|
||||||
|
CanClose := MessageDlg('Do you want to exit?', mtConfirmation, [mbYes, mbNo], 0) = mrYes;
|
||||||
|
end;
|
||||||
|
|
||||||
initialization
|
initialization
|
||||||
{$I unit1.lrs}
|
{$I unit1.lrs}
|
||||||
|
|
||||||
|
|||||||
@ -191,6 +191,7 @@ begin
|
|||||||
fActStdProperty.Add(THelpOnHelp, oiStdActHelpHelpHelpHeadLine, '', oiStdActHelpHelpHelpHint);
|
fActStdProperty.Add(THelpOnHelp, oiStdActHelpHelpHelpHeadLine, '', oiStdActHelpHelpHelpHint);
|
||||||
|
|
||||||
fActStdProperty.Add(TFileOpen, oiStdActFileOpenHeadLine, oiStdActFileOpenShortCut, oiStdActFileOpenHint);
|
fActStdProperty.Add(TFileOpen, oiStdActFileOpenHeadLine, oiStdActFileOpenShortCut, oiStdActFileOpenHint);
|
||||||
|
fActStdProperty.Add(TFileOpenWith, oiStdActFileOpenWithHeadLine, '', oiStdActFileOpenHint);
|
||||||
fActStdProperty.Add(TFileSaveAs, oiStdActFileSaveAsHeadLine, '', oiStdActFileSaveAsHint);
|
fActStdProperty.Add(TFileSaveAs, oiStdActFileSaveAsHeadLine, '', oiStdActFileSaveAsHint);
|
||||||
fActStdProperty.Add(TFileExit, oiStdActFileExitHeadLine, '', oiStdActFileExitHint);
|
fActStdProperty.Add(TFileExit, oiStdActFileExitHeadLine, '', oiStdActFileExitHint);
|
||||||
|
|
||||||
|
|||||||
@ -231,6 +231,7 @@ resourcestring
|
|||||||
oiStdActHelpTopicSearchHeadLine = '&Topic Search';
|
oiStdActHelpTopicSearchHeadLine = '&Topic Search';
|
||||||
oiStdActHelpHelpHelpHeadLine = '&Help on Help';
|
oiStdActHelpHelpHelpHeadLine = '&Help on Help';
|
||||||
oiStdActFileOpenHeadLine = '&Open...';
|
oiStdActFileOpenHeadLine = '&Open...';
|
||||||
|
oiStdActFileOpenWithHeadLine = 'Open with...';
|
||||||
oiStdActFileSaveAsHeadLine = 'Save &As...';
|
oiStdActFileSaveAsHeadLine = 'Save &As...';
|
||||||
oiStdActFileExitHeadLine = 'E&xit';
|
oiStdActFileExitHeadLine = 'E&xit';
|
||||||
oiStdActColorSelect1HeadLine = 'Select &Color...';
|
oiStdActColorSelect1HeadLine = 'Select &Color...';
|
||||||
@ -265,6 +266,7 @@ resourcestring
|
|||||||
oiStdActHelpTopicSearchHint = 'Topic Search';
|
oiStdActHelpTopicSearchHint = 'Topic Search';
|
||||||
oiStdActHelpHelpHelpHint = 'Help on help';
|
oiStdActHelpHelpHelpHint = 'Help on help';
|
||||||
oiStdActFileOpenHint = 'Open';
|
oiStdActFileOpenHint = 'Open';
|
||||||
|
oiStdActFileOpenWithHint = 'Open with';
|
||||||
oiStdActFileSaveAsHint = 'Save As';
|
oiStdActFileSaveAsHint = 'Save As';
|
||||||
oiStdActFileExitHint = 'Exit';
|
oiStdActFileExitHint = 'Exit';
|
||||||
oiStdActColorSelectHint = 'Color Select';
|
oiStdActColorSelectHint = 'Color Select';
|
||||||
|
|||||||
@ -140,10 +140,9 @@ type
|
|||||||
protected
|
protected
|
||||||
FDialog: TCommonDialog;
|
FDialog: TCommonDialog;
|
||||||
procedure DoAccept;
|
procedure DoAccept;
|
||||||
|
procedure DoBeforeExecute;
|
||||||
procedure DoCancel;
|
procedure DoCancel;
|
||||||
function GetDialogClass: TCommonDialogClass; virtual;
|
function GetDialogClass: TCommonDialogClass; virtual;
|
||||||
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
|
|
||||||
procedure SetupDialog;
|
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -173,12 +172,9 @@ type
|
|||||||
function GetDialog: TOpenDialog;
|
function GetDialog: TOpenDialog;
|
||||||
protected
|
protected
|
||||||
function GetDialogClass: TCommonDialogClass; override;
|
function GetDialogClass: TCommonDialogClass; override;
|
||||||
public
|
|
||||||
constructor Create(TheOwner: TComponent); override;
|
|
||||||
procedure ExecuteTarget(Target: TObject); override;
|
|
||||||
property Dialog: TOpenDialog read GetDialog;
|
|
||||||
published
|
published
|
||||||
property Caption;
|
property Caption;
|
||||||
|
property Dialog: TOpenDialog read GetDialog;
|
||||||
property Enabled;
|
property Enabled;
|
||||||
property HelpContext;
|
property HelpContext;
|
||||||
property HelpKeyword;
|
property HelpKeyword;
|
||||||
@ -200,8 +196,6 @@ type
|
|||||||
private
|
private
|
||||||
FAfterOpen: TNotifyEvent;
|
FAfterOpen: TNotifyEvent;
|
||||||
FFileName: TFileName;
|
FFileName: TFileName;
|
||||||
public
|
|
||||||
procedure ExecuteTarget(Target: TObject); override;
|
|
||||||
published
|
published
|
||||||
property FileName: TFileName read FFileName write FFileName;
|
property FileName: TFileName read FFileName write FFileName;
|
||||||
property HelpContext;
|
property HelpContext;
|
||||||
@ -216,11 +210,9 @@ type
|
|||||||
function GetSaveDialog: TSaveDialog;
|
function GetSaveDialog: TSaveDialog;
|
||||||
protected
|
protected
|
||||||
function GetDialogClass: TCommonDialogClass; override;
|
function GetDialogClass: TCommonDialogClass; override;
|
||||||
public
|
|
||||||
constructor Create(TheOwner: TComponent); override;
|
|
||||||
property Dialog: TSaveDialog read GetSaveDialog;
|
|
||||||
published
|
published
|
||||||
property Caption;
|
property Caption;
|
||||||
|
property Dialog: TSaveDialog read GetSaveDialog;
|
||||||
property Enabled;
|
property Enabled;
|
||||||
property HelpContext;
|
property HelpContext;
|
||||||
property Hint;
|
property Hint;
|
||||||
@ -650,28 +642,25 @@ end;
|
|||||||
|
|
||||||
procedure TCommonDialogAction.DoAccept;
|
procedure TCommonDialogAction.DoAccept;
|
||||||
begin
|
begin
|
||||||
|
if Assigned(FOnAccept) then
|
||||||
|
OnAccept(Self);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCommonDialogAction.DoBeforeExecute;
|
||||||
|
begin
|
||||||
|
if Assigned(FBeforeExecute) then
|
||||||
|
BeforeExecute(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCommonDialogAction.DoCancel;
|
procedure TCommonDialogAction.DoCancel;
|
||||||
begin
|
begin
|
||||||
|
if Assigned(FOnCancel) then
|
||||||
|
OnCancel(Self);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCommonDialogAction.GetDialogClass: TCommonDialogClass;
|
function TCommonDialogAction.GetDialogClass: TCommonDialogClass;
|
||||||
begin
|
begin
|
||||||
Result:=nil;
|
Result := nil;
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCommonDialogAction.Notification(AComponent: TComponent;
|
|
||||||
Operation: TOperation);
|
|
||||||
begin
|
|
||||||
inherited Notification(AComponent, Operation);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TCommonDialogAction.SetupDialog;
|
|
||||||
begin
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TCommonDialogAction.Create(TheOwner: TComponent);
|
constructor TCommonDialogAction.Create(TheOwner: TComponent);
|
||||||
@ -680,8 +669,11 @@ var
|
|||||||
begin
|
begin
|
||||||
inherited Create(TheOwner);
|
inherited Create(TheOwner);
|
||||||
DlgClass := GetDialogClass;
|
DlgClass := GetDialogClass;
|
||||||
if Assigned(DlgClass)
|
if Assigned(DlgClass) then
|
||||||
then FDialog := DlgClass.Create(Self);
|
begin
|
||||||
|
FDialog := DlgClass.Create(Self);
|
||||||
|
FDialog.Name := DlgClass.ClassName;
|
||||||
|
end;
|
||||||
|
|
||||||
DisableIfNoHandler := False;
|
DisableIfNoHandler := False;
|
||||||
Enabled := True;
|
Enabled := True;
|
||||||
@ -694,12 +686,18 @@ end;
|
|||||||
|
|
||||||
function TCommonDialogAction.Handlestarget(Target: TObject): Boolean;
|
function TCommonDialogAction.Handlestarget(Target: TObject): Boolean;
|
||||||
begin
|
begin
|
||||||
Result:=inherited Handlestarget(Target);
|
// no target
|
||||||
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCommonDialogAction.ExecuteTarget(Target: TObject);
|
procedure TCommonDialogAction.ExecuteTarget(Target: TObject);
|
||||||
begin
|
begin
|
||||||
inherited ExecuteTarget(Target);
|
DoBeforeExecute;
|
||||||
|
FExecuteResult := FDialog.Execute;
|
||||||
|
if FExecuteResult then
|
||||||
|
DoAccept
|
||||||
|
else
|
||||||
|
DoCancel;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFileAction }
|
{ TFileAction }
|
||||||
@ -728,24 +726,7 @@ end;
|
|||||||
|
|
||||||
function TFileOpen.GetDialogClass: TCommonDialogClass;
|
function TFileOpen.GetDialogClass: TCommonDialogClass;
|
||||||
begin
|
begin
|
||||||
Result:=inherited GetDialogClass;
|
Result := TOpenDialog;
|
||||||
end;
|
|
||||||
|
|
||||||
constructor TFileOpen.Create(TheOwner: TComponent);
|
|
||||||
begin
|
|
||||||
inherited Create(TheOwner);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TFileOpen.ExecuteTarget(Target: TObject);
|
|
||||||
begin
|
|
||||||
inherited ExecuteTarget(Target);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ TFileOpenWith }
|
|
||||||
|
|
||||||
procedure TFileOpenWith.ExecuteTarget(Target: TObject);
|
|
||||||
begin
|
|
||||||
inherited ExecuteTarget(Target);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFileSaveAs }
|
{ TFileSaveAs }
|
||||||
@ -757,24 +738,25 @@ end;
|
|||||||
|
|
||||||
function TFileSaveAs.GetDialogClass: TCommonDialogClass;
|
function TFileSaveAs.GetDialogClass: TCommonDialogClass;
|
||||||
begin
|
begin
|
||||||
Result:=inherited GetDialogClass;
|
Result := TSaveDialog;
|
||||||
end;
|
|
||||||
|
|
||||||
constructor TFileSaveAs.Create(TheOwner: TComponent);
|
|
||||||
begin
|
|
||||||
inherited Create(TheOwner);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TFileExit }
|
{ TFileExit }
|
||||||
|
|
||||||
function TFileExit.HandlesTarget(Target: TObject): Boolean;
|
function TFileExit.HandlesTarget(Target: TObject): Boolean;
|
||||||
begin
|
begin
|
||||||
Result:=inherited HandlesTarget(Target);
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TFileExit.ExecuteTarget(Target: TObject);
|
procedure TFileExit.ExecuteTarget(Target: TObject);
|
||||||
begin
|
begin
|
||||||
inherited ExecuteTarget(Target);
|
if Assigned(Application) then
|
||||||
|
if Assigned(Application.MainForm) then
|
||||||
|
Application.MainForm.Close
|
||||||
|
else
|
||||||
|
Application.Terminate
|
||||||
|
else
|
||||||
|
halt(0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSearchAction }
|
{ TSearchAction }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user