examples: standard actions

git-svn-id: trunk@15093 -
This commit is contained in:
paul 2008-05-11 12:49:02 +00:00
parent 51a4213c3f
commit 58088268ed
8 changed files with 373 additions and 0 deletions

7
.gitattributes vendored
View File

@ -1850,6 +1850,13 @@ examples/sprites/playground.lrs svneol=native#text/pascal
examples/sprites/playground.pas svneol=native#text/pascal
examples/sprites/spriteexample.lpi svneol=native#text/plain
examples/sprites/spriteexample.lpr svneol=native#text/pascal
examples/std_actions/manifest.rc svneol=native#text/plain
examples/std_actions/project1.lpi svneol=native#text/plain
examples/std_actions/project1.lpr svneol=native#text/pascal
examples/std_actions/readme.txt svneol=native#text/plain
examples/std_actions/unit1.lfm svneol=native#text/plain
examples/std_actions/unit1.lrs svneol=native#text/pascal
examples/std_actions/unit1.pas svneol=native#text/pascal
examples/synchronize.pp svneol=native#text/pascal
examples/synedit1.lpi svneol=native#text/plain
examples/synedit1.pas svneol=native#text/pascal

View File

@ -0,0 +1,25 @@
#define RT_MANIFEST 24
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
#define ISOLATIONAWARE_MANIFEST_RESOURCE_ID 2
#define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST MOVEABLE PURE
{
"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>"
"<assembly xmlns=""urn:schemas-microsoft-com:asm.v1"" manifestVersion=""1.0"">"
"<assemblyIdentity version=""1.0.0.0"" processorArchitecture=""*"" name=""CompanyName.ProductName.YourApp"" type=""win32""/>"
"<description>Your application description here.</description>"
"<dependency>"
"<dependentAssembly>"
"<assemblyIdentity type=""win32"" name=""Microsoft.Windows.Common-Controls"" version=""6.0.0.0"" processorArchitecture=""*"" publicKeyToken=""6595b64144ccf1df"" language=""*""/>"
"</dependentAssembly>"
"</dependency>"
"<trustInfo xmlns=""urn:schemas-microsoft-com:asm.v3"">"
"<security>"
"<requestedPrivileges>"
"<requestedExecutionLevel level=""asInvoker"" uiAccess=""false""/>"
"</requestedPrivileges>"
"</security>"
"</trustInfo>"
"</assembly>"
}

View File

@ -0,0 +1,86 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="6"/>
<General>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<UseXPManifest Value="True"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
<Item1>
<PackageName Value="LCL"/>
</Item1>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="project1.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="project1"/>
<CursorPos X="1" Y="16"/>
<TopLine Value="1"/>
<UsageCount Value="34"/>
</Unit0>
<Unit1>
<Filename Value="unit1.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="unit1.lrs"/>
<UnitName Value="Unit1"/>
<CursorPos X="30" Y="31"/>
<TopLine Value="12"/>
<EditorIndex Value="0"/>
<UsageCount Value="34"/>
<Loaded Value="True"/>
</Unit1>
</Units>
<JumpHistory Count="2" HistoryIndex="1">
<Position1>
<Filename Value="unit1.pas"/>
<Caret Line="25" Column="18" TopLine="12"/>
</Position1>
<Position2>
<Filename Value="unit1.pas"/>
<Caret Line="25" Column="18" TopLine="12"/>
</Position2>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<PathDelim Value="\"/>
<SearchPaths>
<LCLWidgetType Value="win32"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
</CONFIG>

View File

@ -0,0 +1,21 @@
program project1;
{$mode objfpc}{$H+}
{$apptype console}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
{ you can add units after this }, Unit1;
{$IFDEF WINDOWS}{$R manifest.rc}{$ENDIF}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,3 @@
This example shows current state of Standard actions in LCL
- v1: only Edit actions are implemented

View File

@ -0,0 +1,141 @@
object Form1: TForm1
Left = 290
Height = 164
Top = 164
Width = 277
HorzScrollBar.Page = 276
VertScrollBar.Page = 163
Caption = 'Standard actions demo'
ClientHeight = 164
ClientWidth = 277
LCLVersion = '0.9.25'
object Edit1: TEdit
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = ToolBar1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 5
Height = 23
Top = 31
Width = 267
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 5
BorderSpacing.Top = 5
BorderSpacing.Right = 5
TabOrder = 0
Text = 'Edit1'
end
object ToolBar1: TToolBar
Height = 26
Width = 277
Caption = 'ToolBar1'
Flat = True
ShowCaptions = True
TabOrder = 1
object ToolButton1: TToolButton
Left = 1
Hint = 'Cut'
Top = 2
Action = EditCut1
end
object ToolButton2: TToolButton
Left = 33
Hint = 'Copy'
Top = 2
Action = EditCopy1
end
object ToolButton3: TToolButton
Left = 73
Hint = 'Paste'
Top = 2
Action = EditPaste1
end
object ToolButton4: TToolButton
Left = 115
Hint = 'Select All'
Top = 2
Action = EditSelectAll1
end
object ToolButton5: TToolButton
Left = 173
Hint = 'Delete'
Top = 2
Action = EditDelete1
end
object ToolButton6: TToolButton
Left = 219
Hint = 'Undo'
Top = 2
Action = EditUndo1
end
end
object Memo1: TMemo
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Edit1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom
Left = 5
Height = 100
Top = 59
Width = 267
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Left = 5
BorderSpacing.Top = 5
BorderSpacing.Right = 5
BorderSpacing.Bottom = 5
Lines.Strings = (
'Memo1'
)
TabOrder = 2
end
object ActionList1: TActionList
left = 184
top = 32
object EditCut1: TEditCut
Category = 'Edit'
Caption = 'Cu&t'
DisableIfNoHandler = True
Hint = 'Cut'
ShortCut = 16472
end
object EditCopy1: TEditCopy
Category = 'Edit'
Caption = '&Copy'
DisableIfNoHandler = True
Hint = 'Copy'
ShortCut = 16451
end
object EditPaste1: TEditPaste
Category = 'Edit'
Caption = '&Paste'
DisableIfNoHandler = True
Hint = 'Paste'
ShortCut = 16470
end
object EditSelectAll1: TEditSelectAll
Category = 'Edit'
Caption = 'Select &All'
DisableIfNoHandler = True
Hint = 'Select All'
ShortCut = 16449
end
object EditUndo1: TEditUndo
Category = 'Edit'
Caption = '&Undo'
DisableIfNoHandler = True
Hint = 'Undo'
ShortCut = 16474
end
object EditDelete1: TEditDelete
Category = 'Edit'
Caption = '&Delete'
DisableIfNoHandler = True
Hint = 'Delete'
ShortCut = 46
end
end
end

View File

@ -0,0 +1,43 @@
{ This is an automatically generated lazarus resource file }
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'
+'idth'#3#21#1#18'HorzScrollBar.Page'#3#20#1#18'VertScrollBar.Page'#3#163#0#7
+'Caption'#6#21'Standard actions demo'#12'ClientHeight'#3#164#0#11'ClientWidt'
+'h'#3#21#1#10'LCLVersion'#6#6'0.9.25'#0#5'TEdit'#5'Edit1'#22'AnchorSideLeft.'
+'Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#8'ToolBar1'#18'AnchorSideTo'
+'p.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSide'
+'Right.Side'#7#9'asrBottom'#4'Left'#2#5#6'Height'#2#23#3'Top'#2#31#5'Width'#3
+#11#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#18'BorderSpacing.Left'#2
+#5#17'BorderSpacing.Top'#2#5#19'BorderSpacing.Right'#2#5#8'TabOrder'#2#0#4'T'
+'ext'#6#5'Edit1'#0#0#8'TToolBar'#8'ToolBar1'#6'Height'#2#26#5'Width'#3#21#1#7
+'Caption'#6#8'ToolBar1'#4'Flat'#9#12'ShowCaptions'#9#8'TabOrder'#2#1#0#11'TT'
+'oolButton'#11'ToolButton1'#4'Left'#2#1#4'Hint'#6#3'Cut'#3'Top'#2#2#6'Action'
+#7#8'EditCut1'#0#0#11'TToolButton'#11'ToolButton2'#4'Left'#2'!'#4'Hint'#6#4
+'Copy'#3'Top'#2#2#6'Action'#7#9'EditCopy1'#0#0#11'TToolButton'#11'ToolButton'
+'3'#4'Left'#2'I'#4'Hint'#6#5'Paste'#3'Top'#2#2#6'Action'#7#10'EditPaste1'#0#0
+#11'TToolButton'#11'ToolButton4'#4'Left'#2's'#4'Hint'#6#10'Select All'#3'Top'
+#2#2#6'Action'#7#14'EditSelectAll1'#0#0#11'TToolButton'#11'ToolButton5'#4'Le'
+'ft'#3#173#0#4'Hint'#6#6'Delete'#3'Top'#2#2#6'Action'#7#11'EditDelete1'#0#0
+#11'TToolButton'#11'ToolButton6'#4'Left'#3#219#0#4'Hint'#6#4'Undo'#3'Top'#2#2
+#6'Action'#7#9'EditUndo1'#0#0#0#5'TMemo'#5'Memo1'#22'AnchorSideLeft.Control'
+#7#5'Owner'#21'AnchorSideTop.Control'#7#5'Edit1'#18'AnchorSideTop.Side'#7#9
+'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7
+#9'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Si'
+'de'#7#9'asrBottom'#4'Left'#2#5#6'Height'#2'd'#3'Top'#2';'#5'Width'#3#11#1#7
+'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#18'BorderSpacing.Le'
+'ft'#2#5#17'BorderSpacing.Top'#2#5#19'BorderSpacing.Right'#2#5#20'BorderSpac'
+'ing.Bottom'#2#5#13'Lines.Strings'#1#6#5'Memo1'#0#8'TabOrder'#2#2#0#0#11'TAc'
+'tionList'#11'ActionList1'#4'left'#3#184#0#3'top'#2' '#0#8'TEditCut'#8'EditC'
+'ut1'#8'Category'#6#4'Edit'#7'Caption'#6#4'Cu&t'#18'DisableIfNoHandler'#9#4
+'Hint'#6#3'Cut'#8'ShortCut'#3'X@'#0#0#9'TEditCopy'#9'EditCopy1'#8'Category'#6
+#4'Edit'#7'Caption'#6#5'&Copy'#18'DisableIfNoHandler'#9#4'Hint'#6#4'Copy'#8
+'ShortCut'#3'C@'#0#0#10'TEditPaste'#10'EditPaste1'#8'Category'#6#4'Edit'#7'C'
+'aption'#6#6'&Paste'#18'DisableIfNoHandler'#9#4'Hint'#6#5'Paste'#8'ShortCut'
+#3'V@'#0#0#14'TEditSelectAll'#14'EditSelectAll1'#8'Category'#6#4'Edit'#7'Cap'
+'tion'#6#11'Select &All'#18'DisableIfNoHandler'#9#4'Hint'#6#10'Select All'#8
+'ShortCut'#3'A@'#0#0#9'TEditUndo'#9'EditUndo1'#8'Category'#6#4'Edit'#7'Capti'
+'on'#6#5'&Undo'#18'DisableIfNoHandler'#9#4'Hint'#6#4'Undo'#8'ShortCut'#3'Z@'
+#0#0#11'TEditDelete'#11'EditDelete1'#8'Category'#6#4'Edit'#7'Caption'#6#7'&D'
+'elete'#18'DisableIfNoHandler'#9#4'Hint'#6#6'Delete'#8'ShortCut'#2'.'#0#0#0#0
]);

View File

@ -0,0 +1,47 @@
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
ActnList, StdActns, ComCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
ActionList1: TActionList;
Edit1: TEdit;
EditCopy1: TEditCopy;
EditCut1: TEditCut;
EditDelete1: TEditDelete;
EditPaste1: TEditPaste;
EditSelectAll1: TEditSelectAll;
EditUndo1: TEditUndo;
Memo1: TMemo;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
ToolButton6: TToolButton;
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
initialization
{$I unit1.lrs}
end.