You've already forked lazarus-ccr
RxFPC:add demo for RxFileUtils
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4639 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
BIN
components/rx/trunk/Demos/RxFileUtils/project1.ico
Normal file
BIN
components/rx/trunk/Demos/RxFileUtils/project1.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 134 KiB |
85
components/rx/trunk/Demos/RxFileUtils/project1.lpi
Normal file
85
components/rx/trunk/Demos/RxFileUtils/project1.lpi
Normal file
@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="9"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<Title Value="project1"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<StringTable ProductVersion=""/>
|
||||
</VersionInfo>
|
||||
<BuildModes Count="1">
|
||||
<Item1 Name="Default" Default="True"/>
|
||||
</BuildModes>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
</PublishOptions>
|
||||
<RunParams>
|
||||
<local>
|
||||
<FormatVersion Value="1"/>
|
||||
</local>
|
||||
</RunParams>
|
||||
<RequiredPackages Count="3">
|
||||
<Item1>
|
||||
<PackageName Value="LazControls"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="rxtools"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item3>
|
||||
</RequiredPackages>
|
||||
<Units Count="2">
|
||||
<Unit0>
|
||||
<Filename Value="project1.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="unit1.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Unit1"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="project1"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
</CompilerOptions>
|
||||
<Debugging>
|
||||
<Exceptions Count="3">
|
||||
<Item1>
|
||||
<Name Value="EAbort"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<Name Value="ECodetoolError"/>
|
||||
</Item2>
|
||||
<Item3>
|
||||
<Name Value="EFOpenError"/>
|
||||
</Item3>
|
||||
</Exceptions>
|
||||
</Debugging>
|
||||
</CONFIG>
|
21
components/rx/trunk/Demos/RxFileUtils/project1.lpr
Normal file
21
components/rx/trunk/Demos/RxFileUtils/project1.lpr
Normal file
@ -0,0 +1,21 @@
|
||||
program project1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
uses
|
||||
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
||||
cthreads,
|
||||
{$ENDIF}{$ENDIF}
|
||||
Interfaces, // this includes the LCL widgetset
|
||||
Forms, lazcontrols, Unit1
|
||||
{ you can add units after this };
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
RequireDerivedFormResource:=True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
||||
|
BIN
components/rx/trunk/Demos/RxFileUtils/project1.res
Normal file
BIN
components/rx/trunk/Demos/RxFileUtils/project1.res
Normal file
Binary file not shown.
186
components/rx/trunk/Demos/RxFileUtils/unit1.lfm
Normal file
186
components/rx/trunk/Demos/RxFileUtils/unit1.lfm
Normal file
@ -0,0 +1,186 @@
|
||||
object Form1: TForm1
|
||||
Left = 697
|
||||
Height = 391
|
||||
Top = 481
|
||||
Width = 441
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 391
|
||||
ClientWidth = 441
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '1.7'
|
||||
object Button1: TButton
|
||||
AnchorSideTop.Control = Owner
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 322
|
||||
Height = 32
|
||||
Top = 6
|
||||
Width = 113
|
||||
Anchors = [akTop, akRight]
|
||||
AutoSize = True
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Get information'
|
||||
OnClick = Button1Click
|
||||
TabOrder = 0
|
||||
end
|
||||
object Edit1: TEdit
|
||||
AnchorSideLeft.Control = Label1
|
||||
AnchorSideTop.Control = Label1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 30
|
||||
Top = 70
|
||||
Width = 423
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
Color = clSkyBlue
|
||||
ReadOnly = True
|
||||
TabOrder = 1
|
||||
end
|
||||
object Edit2: TEdit
|
||||
AnchorSideLeft.Control = Label2
|
||||
AnchorSideTop.Control = Label2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 30
|
||||
Top = 132
|
||||
Width = 423
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
Color = clSkyBlue
|
||||
ReadOnly = True
|
||||
TabOrder = 2
|
||||
end
|
||||
object Edit3: TEdit
|
||||
AnchorSideLeft.Control = Label4
|
||||
AnchorSideTop.Control = Label4
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 10
|
||||
Height = 30
|
||||
Top = 282
|
||||
Width = 425
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
Color = clSkyBlue
|
||||
ReadOnly = True
|
||||
TabOrder = 3
|
||||
end
|
||||
object Edit4: TEdit
|
||||
AnchorSideLeft.Control = Label5
|
||||
AnchorSideTop.Control = Label5
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 30
|
||||
Top = 344
|
||||
Width = 423
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
Color = clSkyBlue
|
||||
ReadOnly = True
|
||||
TabOrder = 4
|
||||
end
|
||||
object Label1: TLabel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Button1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 20
|
||||
Top = 44
|
||||
Width = 251
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'User name (from environment variable)'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label2: TLabel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Edit1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 20
|
||||
Top = 106
|
||||
Width = 80
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'User domani'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label3: TLabel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = DividerBevel1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 20
|
||||
Top = 194
|
||||
Width = 55
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'File info:'
|
||||
ParentColor = False
|
||||
end
|
||||
object DividerBevel1: TDividerBevel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Edit2
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 0
|
||||
Height = 20
|
||||
Top = 168
|
||||
Width = 441
|
||||
Caption = 'File owner'
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Top = 6
|
||||
BorderSpacing.Bottom = 6
|
||||
Font.Style = [fsBold]
|
||||
ParentFont = False
|
||||
end
|
||||
object FileNameEdit1: TFileNameEdit
|
||||
AnchorSideLeft.Control = Label3
|
||||
AnchorSideTop.Control = Label3
|
||||
AnchorSideTop.Side = asrBottom
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 12
|
||||
Height = 30
|
||||
Top = 220
|
||||
Width = 423
|
||||
FilterIndex = 0
|
||||
HideDirectories = False
|
||||
ButtonWidth = 23
|
||||
NumGlyphs = 1
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 6
|
||||
MaxLength = 0
|
||||
Spacing = 0
|
||||
TabOrder = 5
|
||||
end
|
||||
object Label4: TLabel
|
||||
AnchorSideTop.Control = FileNameEdit1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 4
|
||||
Height = 20
|
||||
Top = 256
|
||||
Width = 83
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Owner name'
|
||||
ParentColor = False
|
||||
end
|
||||
object Label5: TLabel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Edit3
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 6
|
||||
Height = 20
|
||||
Top = 318
|
||||
Width = 94
|
||||
BorderSpacing.Around = 6
|
||||
Caption = 'Owner domain'
|
||||
ParentColor = False
|
||||
end
|
||||
end
|
66
components/rx/trunk/Demos/RxFileUtils/unit1.pas
Normal file
66
components/rx/trunk/Demos/RxFileUtils/unit1.pas
Normal file
@ -0,0 +1,66 @@
|
||||
unit Unit1;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, DividerBevel, Forms, Controls, Graphics, Dialogs,
|
||||
StdCtrls, EditBtn;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
Button1: TButton;
|
||||
DividerBevel1: TDividerBevel;
|
||||
Edit1: TEdit;
|
||||
Edit2: TEdit;
|
||||
Edit3: TEdit;
|
||||
Edit4: TEdit;
|
||||
FileNameEdit1: TFileNameEdit;
|
||||
Label1: TLabel;
|
||||
Label2: TLabel;
|
||||
Label3: TLabel;
|
||||
Label4: TLabel;
|
||||
Label5: TLabel;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
{ private declarations }
|
||||
public
|
||||
{ public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
uses rxFileUtils
|
||||
, LazUTF8;
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
var
|
||||
UD, UN: string;
|
||||
begin
|
||||
|
||||
Edit1.Text:=GetEnvironmentVariable('USERNAME');
|
||||
Edit2.Text:=GetUserName;
|
||||
|
||||
GetFileOwnerData('', FileNameEdit1.FileName, UN, UD);
|
||||
Edit3.Text:=UN;
|
||||
Edit4.Text:=UD;
|
||||
end;
|
||||
|
||||
procedure TForm1.FormCreate(Sender: TObject);
|
||||
begin
|
||||
FileNameEdit1.FileName:=ParamStr(0);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
Reference in New Issue
Block a user