You've already forked lazarus-ccr
jvcllaz: Fix property editor of TJvBehaviorLabel. Activate anchors in demo. Some cleanup.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7084 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -32,7 +32,6 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, SysUtils,
|
Classes, SysUtils,
|
||||||
PropEdits;
|
PropEdits;
|
||||||
// DesignEditors, DesignIntf;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TJvLabelBehaviorProperty = class(TStringProperty)
|
TJvLabelBehaviorProperty = class(TStringProperty)
|
||||||
@ -78,12 +77,26 @@ end;
|
|||||||
|
|
||||||
procedure TJvLabelBehaviorProperty.SetValue(const Value: string);
|
procedure TJvLabelBehaviorProperty.SetValue(const Value: string);
|
||||||
{
|
{
|
||||||
var wp -- to do
|
var
|
||||||
List: IDesignerSelections;
|
List: IDesignerSelections;
|
||||||
LDesigner: IJvFormDesigner;
|
LDesigner: IJvFormDesigner;
|
||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
inherited SetValue(Value);
|
inherited SetValue(Value);
|
||||||
|
|
||||||
|
{
|
||||||
|
try
|
||||||
|
for i := 0 to PropCount - 1 do begin
|
||||||
|
subItem := TPersistent(GetObjectValueAt(i));
|
||||||
|
if subItem <> nil then
|
||||||
|
Result.Add(subItem);
|
||||||
|
end;
|
||||||
|
except
|
||||||
|
Result.Free;
|
||||||
|
raise;
|
||||||
|
end;
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
List := CreateSelectionList;
|
List := CreateSelectionList;
|
||||||
Designer.GetSelections(List);
|
Designer.GetSelections(List);
|
||||||
|
@ -8,8 +8,8 @@ object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
|||||||
Caption = 'JvBehaviorLabel Demo'
|
Caption = 'JvBehaviorLabel Demo'
|
||||||
ClientHeight = 304
|
ClientHeight = 304
|
||||||
ClientWidth = 572
|
ClientWidth = 572
|
||||||
Color = clBtnFace
|
|
||||||
Font.Color = clWindowText
|
Font.Color = clWindowText
|
||||||
|
OnActivate = FormActivate
|
||||||
LCLVersion = '2.1.0.0'
|
LCLVersion = '2.1.0.0'
|
||||||
object lblCodeBreaker: TJvBehaviorLabel
|
object lblCodeBreaker: TJvBehaviorLabel
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
@ -38,12 +38,9 @@ object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
|||||||
Transparent = False
|
Transparent = False
|
||||||
end
|
end
|
||||||
object lblAppearing: TJvBehaviorLabel
|
object lblAppearing: TJvBehaviorLabel
|
||||||
AnchorSideLeft.Control = lblCodeBreaker
|
|
||||||
AnchorSideLeft.Side = asrBottom
|
|
||||||
AnchorSideTop.Control = lblCodeBreaker
|
|
||||||
Left = 301
|
Left = 301
|
||||||
Height = 22
|
Height = 22
|
||||||
Top = 18
|
Top = 16
|
||||||
Width = 259
|
Width = 259
|
||||||
Behavior = 'Appearing'
|
Behavior = 'Appearing'
|
||||||
BehaviorOptions.Delay = 10
|
BehaviorOptions.Delay = 10
|
||||||
@ -72,7 +69,6 @@ object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
|||||||
Top = 91
|
Top = 91
|
||||||
Width = 259
|
Width = 259
|
||||||
Behavior = 'Blinking'
|
Behavior = 'Blinking'
|
||||||
BehaviorOptions.Interval = 220
|
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
BorderSpacing.Top = 18
|
BorderSpacing.Top = 18
|
||||||
@ -88,8 +84,6 @@ object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
|||||||
Transparent = False
|
Transparent = False
|
||||||
end
|
end
|
||||||
object lblBouncing: TJvBehaviorLabel
|
object lblBouncing: TJvBehaviorLabel
|
||||||
AnchorSideLeft.Control = lblAppearing
|
|
||||||
AnchorSideTop.Control = lblBlinking
|
|
||||||
Left = 301
|
Left = 301
|
||||||
Height = 22
|
Height = 22
|
||||||
Top = 91
|
Top = 91
|
||||||
@ -135,7 +129,8 @@ object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
|||||||
Transparent = False
|
Transparent = False
|
||||||
end
|
end
|
||||||
object lblSpecial: TJvBehaviorLabel
|
object lblSpecial: TJvBehaviorLabel
|
||||||
AnchorSideLeft.Control = lblAppearing
|
AnchorSideLeft.Control = lblScrolling
|
||||||
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = lblScrolling
|
AnchorSideTop.Control = lblScrolling
|
||||||
Left = 301
|
Left = 301
|
||||||
Height = 22
|
Height = 22
|
||||||
@ -145,6 +140,8 @@ object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
|||||||
BehaviorOptions.Interval = 35
|
BehaviorOptions.Interval = 35
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
AutoSize = False
|
AutoSize = False
|
||||||
|
BorderSpacing.Left = 18
|
||||||
|
BorderSpacing.Right = 24
|
||||||
Caption = 'I ACT IN A SPECIAL WAY'
|
Caption = 'I ACT IN A SPECIAL WAY'
|
||||||
Color = clBlack
|
Color = clBlack
|
||||||
Font.CharSet = ANSI_CHARSET
|
Font.CharSet = ANSI_CHARSET
|
||||||
@ -194,13 +191,12 @@ object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object btnAppear: TButton
|
object btnAppear: TButton
|
||||||
AnchorSideLeft.Control = lblAppearing
|
AnchorSideLeft.Control = btnSpecial
|
||||||
AnchorSideTop.Control = btnCodeBreak
|
AnchorSideTop.Control = btnCodeBreak
|
||||||
Left = 315
|
Left = 315
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 48
|
Top = 48
|
||||||
Width = 80
|
Width = 80
|
||||||
BorderSpacing.Left = 14
|
|
||||||
Caption = '&Appearing'
|
Caption = '&Appearing'
|
||||||
OnClick = btnAppearClick
|
OnClick = btnAppearClick
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
@ -219,7 +215,7 @@ object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
|||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
end
|
end
|
||||||
object btnBounce: TButton
|
object btnBounce: TButton
|
||||||
AnchorSideLeft.Control = btnAppear
|
AnchorSideLeft.Control = btnSpecial
|
||||||
AnchorSideTop.Control = btnBlink
|
AnchorSideTop.Control = btnBlink
|
||||||
Left = 315
|
Left = 315
|
||||||
Height = 25
|
Height = 25
|
||||||
@ -243,12 +239,13 @@ object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
|||||||
TabOrder = 4
|
TabOrder = 4
|
||||||
end
|
end
|
||||||
object btnSpecial: TButton
|
object btnSpecial: TButton
|
||||||
AnchorSideLeft.Control = btnAppear
|
AnchorSideLeft.Control = lblSpecial
|
||||||
AnchorSideTop.Control = btnScroll
|
AnchorSideTop.Control = btnScroll
|
||||||
Left = 315
|
Left = 315
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 194
|
Top = 194
|
||||||
Width = 80
|
Width = 80
|
||||||
|
BorderSpacing.Left = 14
|
||||||
Caption = 'S&pecial'
|
Caption = 'S&pecial'
|
||||||
OnClick = btnSpecialClick
|
OnClick = btnSpecialClick
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
@ -268,7 +265,7 @@ object JvBehaviorLblMainFrm: TJvBehaviorLblMainFrm
|
|||||||
TabOrder = 6
|
TabOrder = 6
|
||||||
end
|
end
|
||||||
object btnAll: TButton
|
object btnAll: TButton
|
||||||
AnchorSideLeft.Control = btnAppear
|
AnchorSideLeft.Control = btnSpecial
|
||||||
AnchorSideTop.Control = btnType
|
AnchorSideTop.Control = btnType
|
||||||
Left = 315
|
Left = 315
|
||||||
Height = 25
|
Height = 25
|
||||||
|
@ -33,6 +33,9 @@ uses
|
|||||||
Dialogs, StdCtrls, JvBehaviorLabel;
|
Dialogs, StdCtrls, JvBehaviorLabel;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
|
{ TJvBehaviorLblMainFrm }
|
||||||
|
|
||||||
TJvBehaviorLblMainFrm = class(TForm)
|
TJvBehaviorLblMainFrm = class(TForm)
|
||||||
lblCodeBreaker: TJvBehaviorLabel;
|
lblCodeBreaker: TJvBehaviorLabel;
|
||||||
btnCodeBreak: TButton;
|
btnCodeBreak: TButton;
|
||||||
@ -57,6 +60,7 @@ type
|
|||||||
procedure btnSpecialClick(Sender: TObject);
|
procedure btnSpecialClick(Sender: TObject);
|
||||||
procedure btnTypeClick(Sender: TObject);
|
procedure btnTypeClick(Sender: TObject);
|
||||||
procedure btnAllClick(Sender: TObject);
|
procedure btnAllClick(Sender: TObject);
|
||||||
|
procedure FormActivate(Sender: TObject);
|
||||||
private
|
private
|
||||||
procedure DoCodeBreakStart(Sender:TObject);
|
procedure DoCodeBreakStart(Sender:TObject);
|
||||||
procedure DoCodeBreakStop(Sender:TObject);
|
procedure DoCodeBreakStop(Sender:TObject);
|
||||||
@ -93,6 +97,14 @@ begin
|
|||||||
ShowMessage('Congratulations! You''ve hacked the system!');
|
ShowMessage('Congratulations! You''ve hacked the system!');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TJvBehaviorLblMainFrm.FormActivate(Sender: TObject);
|
||||||
|
begin
|
||||||
|
AutoSize := false;
|
||||||
|
// Remove anchors because these labels will change their positions.
|
||||||
|
lblAppearing.SetBounds(lblSpecial.Left, lblCodeBreaker.Top, lblSpecial.Width, lblSpecial.Height);
|
||||||
|
lblBouncing.SetBounds(lblSpecial.Left, lblBlinking.Top, lblSpecial.Width, lblSpecial.Height);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TJvBehaviorLblMainFrm.btnAppearClick(Sender: TObject);
|
procedure TJvBehaviorLblMainFrm.btnAppearClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
lblAppearing.Alignment := taCenter;
|
lblAppearing.Alignment := taCenter;
|
||||||
|
@ -43,8 +43,7 @@ unit JvBehaviorLabel;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
LCLIntf, Classes, //Windows, Messages,
|
LCLIntf, Classes, Controls, StdCtrls, ExtCtrls;
|
||||||
Controls, StdCtrls, ExtCtrls; //, JvExStdCtrls;
|
|
||||||
|
|
||||||
type
|
type
|
||||||
TJvCustomBehaviorLabel = class;
|
TJvCustomBehaviorLabel = class;
|
||||||
|
Reference in New Issue
Block a user