mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 06:08:17 +02:00
pen and brush example: add psClear pen
git-svn-id: trunk@16804 -
This commit is contained in:
parent
ab9944c497
commit
063a3f6e16
@ -1,10 +1,10 @@
|
||||
object Form1: TForm1
|
||||
Left = 350
|
||||
Height = 425
|
||||
Height = 473
|
||||
Top = 215
|
||||
Width = 400
|
||||
Caption = 'Pen & Brush'
|
||||
ClientHeight = 425
|
||||
ClientHeight = 473
|
||||
ClientWidth = 400
|
||||
OnCreate = FormCreate
|
||||
OnDestroy = FormDestroy
|
||||
@ -30,7 +30,7 @@ object Form1: TForm1
|
||||
AnchorSideRight.Control = Owner
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 11
|
||||
Height = 105
|
||||
Height = 153
|
||||
Top = 32
|
||||
Width = 378
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
@ -45,7 +45,7 @@ object Form1: TForm1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 11
|
||||
Height = 14
|
||||
Top = 148
|
||||
Top = 196
|
||||
Width = 43
|
||||
BorderSpacing.Left = 11
|
||||
BorderSpacing.Top = 11
|
||||
@ -60,7 +60,7 @@ object Form1: TForm1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 11
|
||||
Height = 207
|
||||
Top = 169
|
||||
Top = 217
|
||||
Width = 378
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Left = 11
|
||||
@ -75,7 +75,7 @@ object Form1: TForm1
|
||||
AnchorSideRight.Side = asrBottom
|
||||
Left = 307
|
||||
Height = 26
|
||||
Top = 387
|
||||
Top = 435
|
||||
Width = 82
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
AutoSize = True
|
||||
|
@ -1,8 +1,8 @@
|
||||
{ This is an automatically generated lazarus resource file }
|
||||
|
||||
LazarusResources.Add('TForm1','FORMDATA',[
|
||||
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'^'#1#6'Height'#3#169#1#3'Top'#3#215#0#5'W'
|
||||
+'idth'#3#144#1#7'Caption'#6#11'Pen & Brush'#12'ClientHeight'#3#169#1#11'Clie'
|
||||
'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'^'#1#6'Height'#3#217#1#3'Top'#3#215#0#5'W'
|
||||
+'idth'#3#144#1#7'Caption'#6#11'Pen & Brush'#12'ClientHeight'#3#217#1#11'Clie'
|
||||
+'ntWidth'#3#144#1#8'OnCreate'#7#10'FormCreate'#9'OnDestroy'#7#11'FormDestroy'
|
||||
+#10'ParentFont'#8#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.27'
|
||||
+#0#6'TLabel'#6'Label1'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTo'
|
||||
@ -11,22 +11,22 @@ LazarusResources.Add('TForm1','FORMDATA',[
|
||||
+#11'ParentColor'#8#0#0#9'TPaintBox'#6'PenBox'#22'AnchorSideLeft.Control'#7#5
|
||||
+'Owner'#21'AnchorSideTop.Control'#7#6'Label1'#18'AnchorSideTop.Side'#7#9'asr'
|
||||
+'Bottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9
|
||||
+'asrBottom'#4'Left'#2#11#6'Height'#2'i'#3'Top'#2' '#5'Width'#3'z'#1#7'Anchor'
|
||||
+'s'#11#5'akTop'#6'akLeft'#7'akRight'#0#18'BorderSpacing.Left'#2#11#17'Border'
|
||||
+'Spacing.Top'#2#7#19'BorderSpacing.Right'#2#11#7'OnPaint'#7#11'PenBoxPaint'#0
|
||||
+#0#6'TLabel'#6'Label2'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTo'
|
||||
+'p.Control'#7#6'PenBox'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#11#6
|
||||
+'Height'#2#14#3'Top'#3#148#0#5'Width'#2'+'#18'BorderSpacing.Left'#2#11#17'Bo'
|
||||
+'rderSpacing.Top'#2#11#7'Caption'#6#8'Brushes:'#11'ParentColor'#8#0#0#9'TPai'
|
||||
+'ntBox'#8'BrushBox'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideTop.C'
|
||||
+'ontrol'#7#6'Label2'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRigh'
|
||||
+'t.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2#11#6
|
||||
+'Height'#3#207#0#3'Top'#3#169#0#5'Width'#3'z'#1#7'Anchors'#11#5'akTop'#6'akL'
|
||||
+'eft'#7'akRight'#0#18'BorderSpacing.Left'#2#11#17'BorderSpacing.Top'#2#7#19
|
||||
+'BorderSpacing.Right'#2#11#7'OnPaint'#7#13'BrushBoxPaint'#0#0#7'TBitBtn'#7'B'
|
||||
+'utton1'#21'AnchorSideTop.Control'#7#8'BrushBox'#18'AnchorSideTop.Side'#7#9
|
||||
+'asrBottom'#4'Left'#2#11#6'Height'#3#153#0#3'Top'#2' '#5'Width'#3'z'#1#7'Anc'
|
||||
+'hors'#11#5'akTop'#6'akLeft'#7'akRight'#0#18'BorderSpacing.Left'#2#11#17'Bor'
|
||||
+'derSpacing.Top'#2#7#19'BorderSpacing.Right'#2#11#7'OnPaint'#7#11'PenBoxPain'
|
||||
+'t'#0#0#6'TLabel'#6'Label2'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorS'
|
||||
+'ideTop.Control'#7#6'PenBox'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2
|
||||
+#11#6'Height'#2#14#3'Top'#3#196#0#5'Width'#2'+'#18'BorderSpacing.Left'#2#11
|
||||
+#17'BorderSpacing.Top'#2#11#7'Caption'#6#8'Brushes:'#11'ParentColor'#8#0#0#9
|
||||
+'TPaintBox'#8'BrushBox'#22'AnchorSideLeft.Control'#7#5'Owner'#21'AnchorSideT'
|
||||
+'op.Control'#7#6'Label2'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSide'
|
||||
+'Right.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#2
|
||||
+#11#6'Height'#3#207#0#3'Top'#3#217#0#5'Width'#3'z'#1#7'Anchors'#11#5'akTop'#6
|
||||
+'akLeft'#7'akRight'#0#18'BorderSpacing.Left'#2#11#17'BorderSpacing.Top'#2#7
|
||||
+#19'BorderSpacing.Right'#2#11#7'OnPaint'#7#13'BrushBoxPaint'#0#0#7'TBitBtn'#7
|
||||
+'Button1'#21'AnchorSideTop.Control'#7#8'BrushBox'#18'AnchorSideTop.Side'#7#9
|
||||
+'asrBottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7
|
||||
+#9'asrBottom'#4'Left'#3'3'#1#6'Height'#2#26#3'Top'#3#131#1#5'Width'#2'R'#7'A'
|
||||
+#9'asrBottom'#4'Left'#3'3'#1#6'Height'#2#26#3'Top'#3#179#1#5'Width'#2'R'#7'A'
|
||||
+'nchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoSize'#9#17'BorderSpacing.T'
|
||||
+'op'#2#11#19'BorderSpacing.Right'#2#11#7'Caption'#6#15'&'#208#151#208#176#208
|
||||
+#186#209#128#209#139#209#130#209#140#4'Kind'#7#7'bkClose'#9'NumGlyphs'#2#0#7
|
||||
|
@ -86,13 +86,18 @@ var
|
||||
ps: TPenStyle;
|
||||
y: integer;
|
||||
begin
|
||||
y := 15;
|
||||
for ps := psSolid to psDashDotDot do
|
||||
begin
|
||||
y := 15 * (Ord(ps) + 1);
|
||||
PenBox.Canvas.TextOut(10, y - 7, GetEnumName(TypeInfo(TPenStyle), Ord(ps)));
|
||||
PenBox.Canvas.Pen.Style := ps;
|
||||
PenBox.Canvas.Line(120, y, PenBox.Width - 10, y);
|
||||
inc(y, 15);
|
||||
end;
|
||||
PenBox.Canvas.TextOut(10, y - 7, GetEnumName(TypeInfo(TPenStyle), Ord(psClear)));
|
||||
PenBox.Canvas.Pen.Style := psClear;
|
||||
PenBox.Canvas.Line(120, y, PenBox.Width - 10, y);
|
||||
inc(y, 15);
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
Loading…
Reference in New Issue
Block a user