You've already forked lazarus-ccr
jvcllaz: Add new component TJvBehaviorLabel
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7082 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<Version Value="12"/>
|
||||
<PathDelim Value="\"/>
|
||||
<General>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<Title Value="JvBehaviorLabelDemo"/>
|
||||
<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="JvCtrlsLazR"/>
|
||||
</Item1>
|
||||
<Item2>
|
||||
<PackageName Value="LCL"/>
|
||||
</Item2>
|
||||
</RequiredPackages>
|
||||
<Units>
|
||||
<Unit>
|
||||
<Filename Value="JvBehaviorLabelDemo.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
</Unit>
|
||||
<Unit>
|
||||
<Filename Value="JvBehaviorLblMainFrmU.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="JvBehaviorLblMainFrm"/>
|
||||
<HasResources Value="True"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
</Unit>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="11"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="..\..\bin\$(TargetCPU)-$(TargetOS)\JvBehaviorLabelDemo"/>
|
||||
</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>
|
@ -0,0 +1,14 @@
|
||||
program JvBehaviorLabelDemo;
|
||||
|
||||
uses
|
||||
Interfaces, Forms,
|
||||
JvBehaviorLblMainFrmU in 'JvBehaviorLblMainFrmU.pas' {JvBehaviorLblMainFrm};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
begin
|
||||
Application.Scaled:=True;
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TJvBehaviorLblMainFrm, JvBehaviorLblMainFrm);
|
||||
Application.Run;
|
||||
end.
|
@ -0,0 +1,281 @@
|
||||
object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
||||
Left = 327
|
||||
Height = 304
|
||||
Top = 118
|
||||
Width = 572
|
||||
AutoSize = True
|
||||
BorderStyle = bsDialog
|
||||
Caption = 'JvBehaviorLabel Demo'
|
||||
ClientHeight = 304
|
||||
ClientWidth = 572
|
||||
Color = clBtnFace
|
||||
Font.Color = clWindowText
|
||||
LCLVersion = '2.1.0.0'
|
||||
object lblCodeBreaker: TJvBehaviorLabel
|
||||
AnchorSideLeft.Control = Owner
|
||||
AnchorSideTop.Control = Owner
|
||||
Left = 24
|
||||
Height = 22
|
||||
Top = 18
|
||||
Width = 259
|
||||
Behavior = 'CodeBreaker'
|
||||
BehaviorOptions.DecodedText = 'ENTER THE MATRIX!'
|
||||
BehaviorOptions.Interval = 5
|
||||
Alignment = taCenter
|
||||
AutoSize = False
|
||||
BorderSpacing.Left = 24
|
||||
BorderSpacing.Top = 18
|
||||
Caption = 'x6/yhjSkhHHDski"=90sd'
|
||||
Color = clBlack
|
||||
Font.CharSet = ANSI_CHARSET
|
||||
Font.Color = clLime
|
||||
Font.Height = -19
|
||||
Font.Name = 'Courier New'
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
ShowAccelChar = False
|
||||
Transparent = False
|
||||
end
|
||||
object lblAppearing: TJvBehaviorLabel
|
||||
AnchorSideLeft.Control = lblCodeBreaker
|
||||
AnchorSideLeft.Side = asrBottom
|
||||
AnchorSideTop.Control = lblCodeBreaker
|
||||
Left = 301
|
||||
Height = 22
|
||||
Top = 18
|
||||
Width = 259
|
||||
Behavior = 'Appearing'
|
||||
BehaviorOptions.Delay = 10
|
||||
BehaviorOptions.Pixels = 2
|
||||
Alignment = taCenter
|
||||
AutoSize = False
|
||||
BorderSpacing.Left = 18
|
||||
BorderSpacing.Right = 24
|
||||
Caption = 'MAKE ME APPEAR'
|
||||
Color = clBlack
|
||||
Font.CharSet = ANSI_CHARSET
|
||||
Font.Color = clLime
|
||||
Font.Height = -19
|
||||
Font.Name = 'Courier New'
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
Transparent = False
|
||||
end
|
||||
object lblBlinking: TJvBehaviorLabel
|
||||
AnchorSideLeft.Control = lblCodeBreaker
|
||||
AnchorSideTop.Control = btnCodeBreak
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 24
|
||||
Height = 22
|
||||
Top = 91
|
||||
Width = 259
|
||||
Behavior = 'Blinking'
|
||||
BehaviorOptions.Interval = 220
|
||||
Alignment = taCenter
|
||||
AutoSize = False
|
||||
BorderSpacing.Top = 18
|
||||
Caption = 'BLINK ME'
|
||||
Color = clBlack
|
||||
Font.CharSet = ANSI_CHARSET
|
||||
Font.Color = clLime
|
||||
Font.Height = -19
|
||||
Font.Name = 'Courier New'
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
Transparent = False
|
||||
end
|
||||
object lblBouncing: TJvBehaviorLabel
|
||||
AnchorSideLeft.Control = lblAppearing
|
||||
AnchorSideTop.Control = lblBlinking
|
||||
Left = 301
|
||||
Height = 22
|
||||
Top = 91
|
||||
Width = 259
|
||||
Behavior = 'Bouncing'
|
||||
BehaviorOptions.Interval = 12
|
||||
BehaviorOptions.Pixels = 4
|
||||
Alignment = taCenter
|
||||
AutoSize = False
|
||||
Caption = 'BOUNCE ME'
|
||||
Color = clBlack
|
||||
Font.CharSet = ANSI_CHARSET
|
||||
Font.Color = clLime
|
||||
Font.Height = -19
|
||||
Font.Name = 'Courier New'
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
Transparent = False
|
||||
end
|
||||
object lblScrolling: TJvBehaviorLabel
|
||||
AnchorSideLeft.Control = lblCodeBreaker
|
||||
AnchorSideTop.Control = btnBlink
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 24
|
||||
Height = 22
|
||||
Top = 164
|
||||
Width = 259
|
||||
Behavior = 'Scrolling'
|
||||
BehaviorOptions.Interval = 70
|
||||
Alignment = taCenter
|
||||
AutoSize = False
|
||||
BorderSpacing.Top = 18
|
||||
Caption = 'SCROLL ME'
|
||||
Color = clBlack
|
||||
Font.CharSet = ANSI_CHARSET
|
||||
Font.Color = clLime
|
||||
Font.Height = -19
|
||||
Font.Name = 'Courier New'
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
Transparent = False
|
||||
end
|
||||
object lblSpecial: TJvBehaviorLabel
|
||||
AnchorSideLeft.Control = lblAppearing
|
||||
AnchorSideTop.Control = lblScrolling
|
||||
Left = 301
|
||||
Height = 22
|
||||
Top = 164
|
||||
Width = 259
|
||||
Behavior = 'Special'
|
||||
BehaviorOptions.Interval = 35
|
||||
Alignment = taCenter
|
||||
AutoSize = False
|
||||
Caption = 'I ACT IN A SPECIAL WAY'
|
||||
Color = clBlack
|
||||
Font.CharSet = ANSI_CHARSET
|
||||
Font.Color = clLime
|
||||
Font.Height = -19
|
||||
Font.Name = 'Courier New'
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
Transparent = False
|
||||
end
|
||||
object lblTyping: TJvBehaviorLabel
|
||||
AnchorSideLeft.Control = lblCodeBreaker
|
||||
AnchorSideTop.Control = btnScroll
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 24
|
||||
Height = 22
|
||||
Top = 237
|
||||
Width = 259
|
||||
Behavior = 'Typing'
|
||||
Alignment = taCenter
|
||||
AutoSize = False
|
||||
BorderSpacing.Top = 18
|
||||
Caption = 'TYPE THE TEXT'
|
||||
Color = clBlack
|
||||
Font.CharSet = ANSI_CHARSET
|
||||
Font.Color = clLime
|
||||
Font.Height = -19
|
||||
Font.Name = 'Courier New'
|
||||
Font.Style = [fsBold]
|
||||
ParentColor = False
|
||||
ParentFont = False
|
||||
Transparent = False
|
||||
end
|
||||
object btnCodeBreak: TButton
|
||||
AnchorSideLeft.Control = lblCodeBreaker
|
||||
AnchorSideTop.Control = lblCodeBreaker
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 38
|
||||
Height = 25
|
||||
Top = 48
|
||||
Width = 80
|
||||
BorderSpacing.Left = 14
|
||||
BorderSpacing.Top = 8
|
||||
Caption = '&CodeBreaker'
|
||||
OnClick = btnCodeBreakClick
|
||||
TabOrder = 0
|
||||
end
|
||||
object btnAppear: TButton
|
||||
AnchorSideLeft.Control = lblAppearing
|
||||
AnchorSideTop.Control = btnCodeBreak
|
||||
Left = 315
|
||||
Height = 25
|
||||
Top = 48
|
||||
Width = 80
|
||||
BorderSpacing.Left = 14
|
||||
Caption = '&Appearing'
|
||||
OnClick = btnAppearClick
|
||||
TabOrder = 1
|
||||
end
|
||||
object btnBlink: TButton
|
||||
AnchorSideLeft.Control = btnCodeBreak
|
||||
AnchorSideTop.Control = lblBlinking
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 38
|
||||
Height = 25
|
||||
Top = 121
|
||||
Width = 80
|
||||
BorderSpacing.Top = 8
|
||||
Caption = '&Blinking'
|
||||
OnClick = btnBlinkClick
|
||||
TabOrder = 2
|
||||
end
|
||||
object btnBounce: TButton
|
||||
AnchorSideLeft.Control = btnAppear
|
||||
AnchorSideTop.Control = btnBlink
|
||||
Left = 315
|
||||
Height = 25
|
||||
Top = 121
|
||||
Width = 80
|
||||
Caption = 'B&ouncing'
|
||||
OnClick = btnBounceClick
|
||||
TabOrder = 3
|
||||
end
|
||||
object btnScroll: TButton
|
||||
AnchorSideLeft.Control = btnCodeBreak
|
||||
AnchorSideTop.Control = lblScrolling
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 38
|
||||
Height = 25
|
||||
Top = 194
|
||||
Width = 80
|
||||
BorderSpacing.Top = 8
|
||||
Caption = '&Scrolling'
|
||||
OnClick = btnScrollClick
|
||||
TabOrder = 4
|
||||
end
|
||||
object btnSpecial: TButton
|
||||
AnchorSideLeft.Control = btnAppear
|
||||
AnchorSideTop.Control = btnScroll
|
||||
Left = 315
|
||||
Height = 25
|
||||
Top = 194
|
||||
Width = 80
|
||||
Caption = 'S&pecial'
|
||||
OnClick = btnSpecialClick
|
||||
TabOrder = 5
|
||||
end
|
||||
object btnType: TButton
|
||||
AnchorSideLeft.Control = btnCodeBreak
|
||||
AnchorSideTop.Control = lblTyping
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 38
|
||||
Height = 25
|
||||
Top = 267
|
||||
Width = 80
|
||||
BorderSpacing.Top = 8
|
||||
BorderSpacing.Bottom = 18
|
||||
Caption = '&Typing'
|
||||
OnClick = btnTypeClick
|
||||
TabOrder = 6
|
||||
end
|
||||
object btnAll: TButton
|
||||
AnchorSideLeft.Control = btnAppear
|
||||
AnchorSideTop.Control = btnType
|
||||
Left = 315
|
||||
Height = 25
|
||||
Top = 267
|
||||
Width = 80
|
||||
Caption = 'Do ''em all!'
|
||||
OnClick = btnAllClick
|
||||
TabOrder = 7
|
||||
end
|
||||
end
|
@ -0,0 +1,135 @@
|
||||
{******************************************************************
|
||||
|
||||
JEDI-VCL Demo
|
||||
|
||||
Copyright (C) 2002 Project JEDI
|
||||
|
||||
Original author:
|
||||
|
||||
You may retrieve the latest version of this file at the JEDI-JVCL
|
||||
home page, located at http://jvcl.delphi-jedi.org
|
||||
|
||||
The contents of this file are used with permission, subject to
|
||||
the Mozilla Public License Version 1.1 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may
|
||||
obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/MPL-1_1Final.html
|
||||
|
||||
Software distributed under the License is distributed on an
|
||||
"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing
|
||||
rights and limitations under the License.
|
||||
|
||||
******************************************************************}
|
||||
|
||||
unit JvBehaviorLblMainFrmU;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, Graphics, Controls, Forms,
|
||||
Dialogs, StdCtrls, JvBehaviorLabel;
|
||||
|
||||
type
|
||||
TJvBehaviorLblMainFrm = class(TForm)
|
||||
lblCodeBreaker: TJvBehaviorLabel;
|
||||
btnCodeBreak: TButton;
|
||||
lblAppearing: TJvBehaviorLabel;
|
||||
btnAppear: TButton;
|
||||
lblBlinking: TJvBehaviorLabel;
|
||||
btnBlink: TButton;
|
||||
lblBouncing: TJvBehaviorLabel;
|
||||
btnBounce: TButton;
|
||||
lblScrolling: TJvBehaviorLabel;
|
||||
btnScroll: TButton;
|
||||
lblSpecial: TJvBehaviorLabel;
|
||||
btnSpecial: TButton;
|
||||
lblTyping: TJvBehaviorLabel;
|
||||
btnType: TButton;
|
||||
btnAll: TButton;
|
||||
procedure btnCodeBreakClick(Sender: TObject);
|
||||
procedure btnAppearClick(Sender: TObject);
|
||||
procedure btnBlinkClick(Sender: TObject);
|
||||
procedure btnBounceClick(Sender: TObject);
|
||||
procedure btnScrollClick(Sender: TObject);
|
||||
procedure btnSpecialClick(Sender: TObject);
|
||||
procedure btnTypeClick(Sender: TObject);
|
||||
procedure btnAllClick(Sender: TObject);
|
||||
private
|
||||
procedure DoCodeBreakStart(Sender:TObject);
|
||||
procedure DoCodeBreakStop(Sender:TObject);
|
||||
public
|
||||
end;
|
||||
|
||||
var
|
||||
JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
procedure TJvBehaviorLblMainFrm.btnCodeBreakClick(Sender: TObject);
|
||||
begin
|
||||
Randomize;
|
||||
lblCodeBreaker.OnStart := nil;
|
||||
lblCodeBreaker.OnStop := nil;
|
||||
if lblCodeBreaker.Caption = TJvLabelCodeBreaker(lblCodeBreaker.BehaviorOptions).DecodedText then
|
||||
lblCodeBreaker.Caption := 'x6/yhjSkhHHDski"=90sd';
|
||||
// this might trigger the OnStart/OnStop events, so set to nil
|
||||
lblCodeBreaker.BehaviorOptions.Active := not lblCodeBreaker.BehaviorOptions.Active;
|
||||
lblCodeBreaker.OnStart := @DoCodeBreakStart;
|
||||
lblCodeBreaker.OnStop := @DoCodeBreakStop;
|
||||
end;
|
||||
|
||||
procedure TJvBehaviorLblMainFrm.DoCodeBreakStart(Sender: TObject);
|
||||
begin
|
||||
lblCodeBreaker.Caption := 'BREAK THE CODE';
|
||||
end;
|
||||
|
||||
procedure TJvBehaviorLblMainFrm.DoCodeBreakStop(Sender: TObject);
|
||||
begin
|
||||
ShowMessage('Congratulations! You''ve hacked the system!');
|
||||
end;
|
||||
|
||||
procedure TJvBehaviorLblMainFrm.btnAppearClick(Sender: TObject);
|
||||
begin
|
||||
lblAppearing.Alignment := taCenter;
|
||||
lblAppearing.BehaviorOptions.Active := not lblAppearing.BehaviorOptions.Active;
|
||||
end;
|
||||
|
||||
procedure TJvBehaviorLblMainFrm.btnBlinkClick(Sender: TObject);
|
||||
begin
|
||||
lblBlinking.BehaviorOptions.Active := not lblBlinking.BehaviorOptions.Active;
|
||||
end;
|
||||
|
||||
procedure TJvBehaviorLblMainFrm.btnBounceClick(Sender: TObject);
|
||||
begin
|
||||
lblBouncing.BehaviorOptions.Active := not lblBouncing.BehaviorOptions.Active;
|
||||
end;
|
||||
|
||||
procedure TJvBehaviorLblMainFrm.btnScrollClick(Sender: TObject);
|
||||
begin
|
||||
lblScrolling.BehaviorOptions.Active := not lblScrolling.BehaviorOptions.Active;
|
||||
end;
|
||||
|
||||
procedure TJvBehaviorLblMainFrm.btnSpecialClick(Sender: TObject);
|
||||
begin
|
||||
lblSpecial.BehaviorOptions.Active := not lblSpecial.BehaviorOptions.Active;
|
||||
end;
|
||||
|
||||
procedure TJvBehaviorLblMainFrm.btnTypeClick(Sender: TObject);
|
||||
begin
|
||||
lblTyping.BehaviorOptions.Active := not lblTyping.BehaviorOptions.Active;
|
||||
end;
|
||||
|
||||
procedure TJvBehaviorLblMainFrm.btnAllClick(Sender: TObject);
|
||||
var i:integer;
|
||||
begin
|
||||
for i := 0 to ControlCount -1 do
|
||||
if (Controls[i] <> btnAll) and (Controls[i] is TButton) then
|
||||
TButton(Controls[i]).Click;
|
||||
end;
|
||||
|
||||
end.
|
Reference in New Issue
Block a user