diff --git a/components/rx/trunk/demos/RxContols/RxClock/project1.ico b/components/rx/trunk/demos/RxContols/RxClock/project1.ico new file mode 100644 index 000000000..0341321b5 Binary files /dev/null and b/components/rx/trunk/demos/RxContols/RxClock/project1.ico differ diff --git a/components/rx/trunk/demos/RxContols/RxClock/project1.lpi b/components/rx/trunk/demos/RxContols/RxClock/project1.lpi new file mode 100644 index 000000000..11f132b06 --- /dev/null +++ b/components/rx/trunk/demos/RxContols/RxClock/project1.lpi @@ -0,0 +1,79 @@ + + + + + + + + <Scaled Value="True"/> + <ResourceType Value="res"/> + <UseXPManifest Value="True"/> + <XPManifest> + <DpiAware Value="True"/> + </XPManifest> + <Icon Value="0"/> + </General> + <BuildModes> + <Item 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="rxnew"/> + </Item1> + <Item2> + <PackageName Value="LCL"/> + </Item2> + </RequiredPackages> + <Units> + <Unit> + <Filename Value="project1.lpr"/> + <IsPartOfProject Value="True"/> + </Unit> + <Unit> + <Filename Value="unit1.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="Unit1"/> + </Unit> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="11"/> + <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> diff --git a/components/rx/trunk/demos/RxContols/RxClock/project1.lpr b/components/rx/trunk/demos/RxContols/RxClock/project1.lpr new file mode 100644 index 000000000..11cd90bd2 --- /dev/null +++ b/components/rx/trunk/demos/RxContols/RxClock/project1.lpr @@ -0,0 +1,23 @@ +program project1; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms, Unit1, rxnew + { you can add units after this }; + +{$R *.res} + +begin + RequireDerivedFormResource:=True; + Application.Title:='RxClock demo'; + Application.Scaled:=True; + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/components/rx/trunk/demos/RxContols/RxClock/project1.lps b/components/rx/trunk/demos/RxContols/RxClock/project1.lps new file mode 100644 index 000000000..9a849f655 --- /dev/null +++ b/components/rx/trunk/demos/RxContols/RxClock/project1.lps @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="UTF-8"?> +<CONFIG> + <ProjectSession> + <Version Value="12"/> + <BuildModes Active="Default"/> + <Units> + <Unit> + <Filename Value="project1.lpr"/> + <IsPartOfProject Value="True"/> + <EditorIndex Value="-1"/> + <WindowIndex Value="-1"/> + <TopLine Value="-1"/> + <CursorPos X="-1" Y="-1"/> + <UsageCount Value="20"/> + </Unit> + <Unit> + <Filename Value="unit1.pas"/> + <IsPartOfProject Value="True"/> + <ComponentName Value="Form1"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="Unit1"/> + <IsVisibleTab Value="True"/> + <TopLine Value="28"/> + <CursorPos X="13" Y="54"/> + <UsageCount Value="20"/> + <Loaded Value="True"/> + <LoadedDesigner Value="True"/> + </Unit> + <Unit> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <EditorIndex Value="1"/> + <TopLine Value="195"/> + <CursorPos X="3" Y="214"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit> + </Units> + <JumpHistory Count="29" HistoryIndex="28"> + <Position1> + <Filename Value="unit1.pas"/> + <Caret Line="15" Column="23"/> + </Position1> + <Position2> + <Filename Value="unit1.pas"/> + <Caret Line="34" Column="5"/> + </Position2> + <Position3> + <Filename Value="unit1.pas"/> + <Caret Line="36" Column="5"/> + </Position3> + <Position4> + <Filename Value="unit1.pas"/> + <Caret Line="41" Column="30" TopLine="8"/> + </Position4> + <Position5> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="113" Column="26" TopLine="112"/> + </Position5> + <Position6> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="77" Column="15" TopLine="59"/> + </Position6> + <Position7> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="603" Column="3" TopLine="597"/> + </Position7> + <Position8> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="90" Column="15" TopLine="73"/> + </Position8> + <Position9> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="464" Column="3" TopLine="460"/> + </Position9> + <Position10> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="90" Column="15" TopLine="73"/> + </Position10> + <Position11> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="464" Column="3" TopLine="460"/> + </Position11> + <Position12> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="111" Column="15" TopLine="90"/> + </Position12> + <Position13> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="343" Column="3" TopLine="340"/> + </Position13> + <Position14> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="72" Column="17" TopLine="59"/> + </Position14> + <Position15> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="635" Column="3" TopLine="627"/> + </Position15> + <Position16> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="91" Column="15" TopLine="74"/> + </Position16> + <Position17> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="659" Column="3" TopLine="655"/> + </Position17> + <Position18> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="74" Column="14" TopLine="57"/> + </Position18> + <Position19> + <Filename Value="/usr/local/share/lazarus/components/rxnew/rxcontrols/rxclock.pas"/> + <Caret Line="472" Column="3" TopLine="465"/> + </Position19> + <Position20> + <Filename Value="unit1.pas"/> + <Caret Line="41" Column="30" TopLine="8"/> + </Position20> + <Position21> + <Filename Value="unit1.pas"/> + <Caret Line="42" Column="30" TopLine="8"/> + </Position21> + <Position22> + <Filename Value="unit1.pas"/> + <Caret Line="44" Column="30" TopLine="8"/> + </Position22> + <Position23> + <Filename Value="unit1.pas"/> + <Caret Line="45" Column="30" TopLine="8"/> + </Position23> + <Position24> + <Filename Value="unit1.pas"/> + <Caret Line="41" Column="25" TopLine="8"/> + </Position24> + <Position25> + <Filename Value="unit1.pas"/> + <Caret Line="40" Column="25" TopLine="8"/> + </Position25> + <Position26> + <Filename Value="unit1.pas"/> + <Caret Line="42" Column="25" TopLine="8"/> + </Position26> + <Position27> + <Filename Value="unit1.pas"/> + <Caret Line="44" Column="25" TopLine="8"/> + </Position27> + <Position28> + <Filename Value="unit1.pas"/> + <Caret Line="45" Column="25" TopLine="8"/> + </Position28> + <Position29> + <Filename Value="unit1.pas"/> + <Caret Line="47" Column="18" TopLine="34"/> + </Position29> + </JumpHistory> + <RunParams> + <FormatVersion Value="2"/> + <Modes Count="0" ActiveMode=""/> + </RunParams> + </ProjectSession> +</CONFIG> diff --git a/components/rx/trunk/demos/RxContols/RxClock/project1.res b/components/rx/trunk/demos/RxContols/RxClock/project1.res new file mode 100644 index 000000000..c16f002d3 Binary files /dev/null and b/components/rx/trunk/demos/RxContols/RxClock/project1.res differ diff --git a/components/rx/trunk/demos/RxContols/RxClock/unit1.lfm b/components/rx/trunk/demos/RxContols/RxClock/unit1.lfm new file mode 100644 index 000000000..6f46bbcb8 --- /dev/null +++ b/components/rx/trunk/demos/RxContols/RxClock/unit1.lfm @@ -0,0 +1,118 @@ +object Form1: TForm1 + Left = 333 + Height = 336 + Top = 141 + Width = 440 + Caption = 'RxClock demo' + ClientHeight = 336 + ClientWidth = 440 + OnCreate = FormCreate + Position = poScreenCenter + LCLVersion = '2.1.0.0' + object RxClock1: TRxClock + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = Owner + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom + Left = 6 + Height = 104 + Top = 6 + Width = 428 + Anchors = [akTop, akLeft, akRight] + Font.Height = -40 + ParentFont = False + OnAlarm = RxClock1Alarm + end + object CheckBox1: TCheckBox + AnchorSideLeft.Control = Owner + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = RxClock1 + AnchorSideTop.Side = asrBottom + Left = 159 + Height = 23 + Top = 116 + Width = 122 + BorderSpacing.Around = 6 + Caption = 'Alarm enabled' + OnChange = CheckBox1Change + TabOrder = 1 + end + object SpinEdit1: TSpinEdit + AnchorSideLeft.Control = Label2 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = CheckBox1 + AnchorSideTop.Side = asrBottom + Left = 239 + Height = 31 + Top = 145 + Width = 90 + BorderSpacing.Around = 6 + MaxValue = 23 + TabOrder = 2 + Value = 1 + end + object Label2: TLabel + AnchorSideLeft.Control = CheckBox1 + AnchorSideBottom.Control = SpinEdit1 + AnchorSideBottom.Side = asrBottom + Left = 159 + Height = 19 + Top = 157 + Width = 74 + Anchors = [akLeft, akBottom] + Caption = 'Alarm hour' + ParentColor = False + end + object SpinEdit2: TSpinEdit + AnchorSideLeft.Control = Label2 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = SpinEdit1 + AnchorSideTop.Side = asrBottom + Left = 239 + Height = 31 + Top = 182 + Width = 90 + BorderSpacing.Around = 6 + MaxValue = 59 + TabOrder = 3 + Value = 1 + end + object Label3: TLabel + AnchorSideLeft.Control = CheckBox1 + AnchorSideBottom.Control = SpinEdit2 + AnchorSideBottom.Side = asrBottom + Left = 159 + Height = 19 + Top = 194 + Width = 69 + Anchors = [akLeft, akBottom] + Caption = 'Alarm min' + ParentColor = False + end + object SpinEdit3: TSpinEdit + AnchorSideLeft.Control = Label2 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = SpinEdit2 + AnchorSideTop.Side = asrBottom + Left = 239 + Height = 31 + Top = 219 + Width = 90 + BorderSpacing.Around = 6 + MaxValue = 59 + TabOrder = 4 + Value = 1 + end + object Label4: TLabel + AnchorSideLeft.Control = CheckBox1 + AnchorSideBottom.Control = SpinEdit3 + AnchorSideBottom.Side = asrBottom + Left = 159 + Height = 19 + Top = 231 + Width = 66 + Anchors = [akLeft, akBottom] + Caption = 'Alarm sec' + ParentColor = False + end +end diff --git a/components/rx/trunk/demos/RxContols/RxClock/unit1.pas b/components/rx/trunk/demos/RxContols/RxClock/unit1.pas new file mode 100644 index 000000000..0b5e6f466 --- /dev/null +++ b/components/rx/trunk/demos/RxContols/RxClock/unit1.pas @@ -0,0 +1,78 @@ +unit Unit1; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Spin, + rxclock; + +type + + { TForm1 } + + TForm1 = class(TForm) + CheckBox1: TCheckBox; + Label2: TLabel; + Label3: TLabel; + Label4: TLabel; + RxClock1: TRxClock; + SpinEdit1: TSpinEdit; + SpinEdit2: TSpinEdit; + SpinEdit3: TSpinEdit; + procedure CheckBox1Change(Sender: TObject); + procedure FormCreate(Sender: TObject); + procedure RxClock1Alarm(Sender: TObject); + private + + public + + end; + +var + Form1: TForm1; + +implementation + +{$R *.lfm} + +{ TForm1 } + +procedure TForm1.RxClock1Alarm(Sender: TObject); +begin + ShowMessage('Alarm!'); + CheckBox1.Checked:=false; +end; + +procedure TForm1.CheckBox1Change(Sender: TObject); +begin + RxClock1.AlarmEnabled:=CheckBox1.Checked; + + if CheckBox1.Checked then + begin + RxClock1.AlarmHour:=SpinEdit1.Value; + RxClock1.AlarmMinute:=SpinEdit2.Value; + RxClock1.AlarmSecond:=SpinEdit3.Value; + end; + + SpinEdit1.Enabled:=not CheckBox1.Checked; + SpinEdit2.Enabled:=SpinEdit1.Enabled; + SpinEdit3.Enabled:=SpinEdit1.Enabled; + + Label2.Enabled:=SpinEdit1.Enabled; + Label3.Enabled:=SpinEdit1.Enabled; + Label4.Enabled:=SpinEdit1.Enabled; +end; + +procedure TForm1.FormCreate(Sender: TObject); +var + H, M, S, MS: word; +begin + DecodeTime(Now, H, M, S, MS); + SpinEdit1.Value:=H; + SpinEdit2.Value:=M; +end; + +end. +