diff --git a/edit_props/edit_props.ico b/edit_props/edit_props.ico new file mode 100644 index 0000000..0341321 Binary files /dev/null and b/edit_props/edit_props.ico differ diff --git a/edit_props/edit_props.lpi b/edit_props/edit_props.lpi new file mode 100644 index 0000000..0da06ef --- /dev/null +++ b/edit_props/edit_props.lpi @@ -0,0 +1,82 @@ + + + + + + + + + <Scaled Value="True"/> + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <XPManifest> + <DpiAware Value="True"/> + </XPManifest> + <Icon Value="0"/> + </General> + <BuildModes Count="1"> + <Item1 Name="Default" Default="True"/> + </BuildModes> + <PublishOptions> + <Version Value="2"/> + <UseFileFilters Value="True"/> + </PublishOptions> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="0"/> + </RunParams> + <RequiredPackages Count="2"> + <Item1> + <PackageName Value="RunTimeTypeInfoControls"/> + </Item1> + <Item2> + <PackageName Value="LCL"/> + </Item2> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="edit_props.lpr"/> + <IsPartOfProject Value="True"/> + </Unit0> + <Unit1> + <Filename Value="umain.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <ResourceBaseClass Value="Form"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <Target> + <Filename Value="edit_props"/> + </Target> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)"/> + <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> + </SearchPaths> + <Linking> + <Debugging> + <DebugInfoType Value="dsDwarf2Set"/> + </Debugging> + <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> diff --git a/edit_props/edit_props.lpr b/edit_props/edit_props.lpr new file mode 100644 index 0000000..e57ef73 --- /dev/null +++ b/edit_props/edit_props.lpr @@ -0,0 +1,22 @@ +program edit_props; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, runtimetypeinfocontrols, umain + { you can add units after this }; + +{$R *.res} + +begin + RequireDerivedFormResource:=True; + Application.Scaled:=True; + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/edit_props/umain.lfm b/edit_props/umain.lfm new file mode 100644 index 0000000..7837c12 --- /dev/null +++ b/edit_props/umain.lfm @@ -0,0 +1,53 @@ +object Form1: TForm1 + Left = 758 + Height = 600 + Top = 300 + Width = 600 + Caption = 'Form1' + ClientHeight = 600 + ClientWidth = 600 + LCLVersion = '2.0.12.0' + object Edit1: TEdit + Left = 8 + Height = 22 + Top = 8 + Width = 80 + TabOrder = 0 + Text = 'Edit1' + end + object ToggleBox1: TToggleBox + Left = 9 + Height = 25 + Top = 64 + Width = 167 + Caption = 'Point grid to LabeledEdit' + OnChange = ToggleBox1Change + TabOrder = 1 + end + object LabeledEdit1: TLabeledEdit + Left = 9 + Height = 22 + Top = 136 + Width = 80 + EditLabel.Height = 16 + EditLabel.Width = 80 + EditLabel.Caption = 'LabeledEdit1' + EditLabel.ParentColor = False + TabOrder = 2 + Text = 'LabeledEdit1' + end + object TIPropertyGrid1: TTIPropertyGrid + Left = 184 + Height = 600 + Top = 0 + Width = 416 + Align = alRight + CheckboxForBoolean = False + DefaultValueFont.Color = clWindowText + Filter = [tkInteger, tkChar, tkEnumeration, tkFloat, tkSet, tkMethod, tkSString, tkLString, tkAString, tkWString, tkVariant, tkArray, tkRecord, tkInterface, tkClass, tkObject, tkWChar, tkBool, tkInt64, tkQWord, tkDynArray, tkInterfaceRaw, tkProcVar, tkUString, tkUChar, tkHelper, tkFile, tkClassRef, tkPointer] + Indent = 9 + NameFont.Color = clWindowText + TIObject = Edit1 + ValueFont.Color = clMaroon + end +end diff --git a/edit_props/umain.pas b/edit_props/umain.pas new file mode 100644 index 0000000..968f3d2 --- /dev/null +++ b/edit_props/umain.pas @@ -0,0 +1,53 @@ +unit umain; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, + RTTIGrids; + +type + + { TForm1 } + + TForm1 = class(TForm) + Edit1: TEdit; + LabeledEdit1: TLabeledEdit; + TIPropertyGrid1: TTIPropertyGrid; + ToggleBox1: TToggleBox; + procedure ToggleBox1Change(Sender: TObject); + private + + public + + end; + +var + Form1: TForm1; + +implementation + +{$R *.lfm} + +{ TForm1 } + +procedure TForm1.ToggleBox1Change(Sender: TObject); +begin + case ToggleBox1.Checked of + False: begin + TIPropertyGrid1.TIObject := Edit1; + Edit1.SetFocus; + ToggleBox1.Caption := 'Point grid to LabeledEdit'; + end; + True: begin + TIPropertyGrid1.TIObject := LabeledEdit1; + LabeledEdit1.SetFocus; + ToggleBox1.Caption := 'Point grid to Edit'; + end; + end; +end; + +end. +