|
@@ -21,14 +21,19 @@ type
|
|
|
ButtonDiv: TDiv;
|
|
|
ButtonLabel: TLabel;
|
|
|
FontSizeSlider: TDemoSlider;
|
|
|
+ PaddingVerticalSlider: TDemoSlider;
|
|
|
BorderWidthSlider: TDemoSlider;
|
|
|
BorderRadiusDiv: TDiv;
|
|
|
BorderRadiusLabel: TLabel;
|
|
|
- BorderRadiusTopLeft: TDemoCheckBox;
|
|
|
- BorderRadiusTopRight: TDemoCheckBox;
|
|
|
- BorderRadiusBottomLeft: TDemoCheckBox;
|
|
|
- BorderRadiusBottomRight: TDemoCheckBox;
|
|
|
+ BorderRadiusTopLeftChkBox: TDemoCheckBox;
|
|
|
+ BorderRadiusTopRightChkBox: TDemoCheckBox;
|
|
|
+ BorderRadiusBottomLeftChkBox: TDemoCheckBox;
|
|
|
+ BorderRadiusBottomRightChkBox: TDemoCheckBox;
|
|
|
BorderRadiusSlider: TDemoSlider;
|
|
|
+ TextShadowChkBox: TDemoCheckBox;
|
|
|
+ TextShadowVertPosSlider: TDemoSlider;
|
|
|
+ TextShadowHorzPosSlider: TDemoSlider;
|
|
|
+ TextShadowBlurRadiusSlider: TDemoSlider;
|
|
|
end;
|
|
|
|
|
|
var
|
|
@@ -76,6 +81,20 @@ begin
|
|
|
OnChange:=@OnPropChange;
|
|
|
end;
|
|
|
|
|
|
+ // padding vertical slider
|
|
|
+ PaddingVerticalSlider:=TDemoSlider.Create(Self);
|
|
|
+ with PaddingVerticalSlider do begin
|
|
|
+ Name:='PaddingVerticalSlider';
|
|
|
+ Caption:='Vertical Padding:';
|
|
|
+ Style:='width: 150px';
|
|
|
+ ValueFormat:='%.0fpx';
|
|
|
+ MinPosition:=0;
|
|
|
+ MaxPosition:=50;
|
|
|
+ Position:=16;
|
|
|
+ Parent:=Self;
|
|
|
+ OnChange:=@OnPropChange;
|
|
|
+ end;
|
|
|
+
|
|
|
// border-width slider
|
|
|
BorderWidthSlider:=TDemoSlider.Create(Self);
|
|
|
with BorderWidthSlider do begin
|
|
@@ -105,36 +124,36 @@ begin
|
|
|
Parent:=BorderRadiusDiv;
|
|
|
end;
|
|
|
|
|
|
- BorderRadiusTopLeft:=TDemoCheckBox.Create(Self);
|
|
|
- with BorderRadiusTopLeft do begin
|
|
|
- Name:='BorderRadiusTopLeft';
|
|
|
+ BorderRadiusTopLeftChkBox:=TDemoCheckBox.Create(Self);
|
|
|
+ with BorderRadiusTopLeftChkBox do begin
|
|
|
+ Name:='BorderRadiusTopLeftChkBox';
|
|
|
Caption:='Top Left';
|
|
|
Checked:=true;
|
|
|
Parent:=BorderRadiusDiv;
|
|
|
OnChange:=@OnPropChange;
|
|
|
end;
|
|
|
|
|
|
- BorderRadiusTopRight:=TDemoCheckBox.Create(Self);
|
|
|
- with BorderRadiusTopRight do begin
|
|
|
- Name:='BorderRadiusTopRight';
|
|
|
+ BorderRadiusTopRightChkBox:=TDemoCheckBox.Create(Self);
|
|
|
+ with BorderRadiusTopRightChkBox do begin
|
|
|
+ Name:='BorderRadiusTopRightChkBox';
|
|
|
Caption:='Top Right';
|
|
|
Checked:=true;
|
|
|
Parent:=BorderRadiusDiv;
|
|
|
OnChange:=@OnPropChange;
|
|
|
end;
|
|
|
|
|
|
- BorderRadiusBottomLeft:=TDemoCheckBox.Create(Self);
|
|
|
- with BorderRadiusBottomLeft do begin
|
|
|
- Name:='BorderRadiusBottomLeft';
|
|
|
+ BorderRadiusBottomLeftChkBox:=TDemoCheckBox.Create(Self);
|
|
|
+ with BorderRadiusBottomLeftChkBox do begin
|
|
|
+ Name:='BorderRadiusBottomLeftChkBox';
|
|
|
Caption:='Bottom Left';
|
|
|
Checked:=true;
|
|
|
Parent:=BorderRadiusDiv;
|
|
|
OnChange:=@OnPropChange;
|
|
|
end;
|
|
|
|
|
|
- BorderRadiusBottomRight:=TDemoCheckBox.Create(Self);
|
|
|
- with BorderRadiusBottomRight do begin
|
|
|
- Name:='BorderRadiusBottomRight';
|
|
|
+ BorderRadiusBottomRightChkBox:=TDemoCheckBox.Create(Self);
|
|
|
+ with BorderRadiusBottomRightChkBox do begin
|
|
|
+ Name:='BorderRadiusBottomRightChkBox';
|
|
|
Caption:='Bottom Right';
|
|
|
Checked:=true;
|
|
|
Parent:=BorderRadiusDiv;
|
|
@@ -155,6 +174,58 @@ begin
|
|
|
OnChange:=@OnPropChange;
|
|
|
end;
|
|
|
|
|
|
+ // text-shadow checkbox
|
|
|
+ TextShadowChkBox:=TDemoCheckBox.Create(Self);
|
|
|
+ with TextShadowChkBox do begin
|
|
|
+ Name:='TextShadowChkBox';
|
|
|
+ Caption:='Text Shadow';
|
|
|
+ Checked:=true;
|
|
|
+ Parent:=Self;
|
|
|
+ OnChange:=@OnPropChange;
|
|
|
+ end;
|
|
|
+
|
|
|
+ // slider for text-shadow vertical position
|
|
|
+ TextShadowVertPosSlider:=TDemoSlider.Create(Self);
|
|
|
+ with TextShadowVertPosSlider do begin
|
|
|
+ Name:='TextShadowVertPosSlider';
|
|
|
+ Caption:='Vertical Position:';
|
|
|
+ Style:='width: 150px';
|
|
|
+ ValueFormat:='%.0fpx';
|
|
|
+ MinPosition:=-30;
|
|
|
+ MaxPosition:=30;
|
|
|
+ Position:=1;
|
|
|
+ Parent:=Self;
|
|
|
+ OnChange:=@OnPropChange;
|
|
|
+ end;
|
|
|
+
|
|
|
+ // slider for text-shadow horizontal position
|
|
|
+ TextShadowHorzPosSlider:=TDemoSlider.Create(Self);
|
|
|
+ with TextShadowHorzPosSlider do begin
|
|
|
+ Name:='TextShadowHorzPosSlider';
|
|
|
+ Caption:='Horizontal Position:';
|
|
|
+ Style:='width: 150px';
|
|
|
+ ValueFormat:='%.0fpx';
|
|
|
+ MinPosition:=-30;
|
|
|
+ MaxPosition:=30;
|
|
|
+ Position:=1;
|
|
|
+ Parent:=Self;
|
|
|
+ OnChange:=@OnPropChange;
|
|
|
+ end;
|
|
|
+
|
|
|
+ // slider for text-shadow horizontal position
|
|
|
+ TextShadowBlurRadiusSlider:=TDemoSlider.Create(Self);
|
|
|
+ with TextShadowBlurRadiusSlider do begin
|
|
|
+ Name:='TextShadowBlurRadiusSlider';
|
|
|
+ Caption:='Blur Radius:';
|
|
|
+ Style:='width: 150px';
|
|
|
+ ValueFormat:='%.0fpx';
|
|
|
+ MinPosition:=0;
|
|
|
+ MaxPosition:=30;
|
|
|
+ Position:=0;
|
|
|
+ Parent:=Self;
|
|
|
+ OnChange:=@OnPropChange;
|
|
|
+ end;
|
|
|
+
|
|
|
// the Button
|
|
|
ButtonDiv:=TDiv.Create(Self);
|
|
|
with ButtonDiv do begin
|
|
@@ -181,29 +252,41 @@ var
|
|
|
s, NewStyle, Radius: String;
|
|
|
begin
|
|
|
if ButtonDiv=nil then exit;
|
|
|
- NewStyle:='font-size:'+FloatToStr(FontSizeSlider.Position)+'px;'
|
|
|
+ NewStyle:=
|
|
|
+ 'font-size:'+FloatToStr(FontSizeSlider.Position)+'px;'
|
|
|
+ +'padding: '+FloatToStr(PaddingVerticalSlider.Position)+'px 31px;'
|
|
|
+'border-width:'+FloatToStr(BorderWidthSlider.Position)+'px;';
|
|
|
|
|
|
Radius:=FloatToStr(BorderRadiusSlider.Position)+'px';
|
|
|
s:='';
|
|
|
- if BorderRadiusTopLeft.Checked then
|
|
|
+ if BorderRadiusTopLeftChkBox.Checked then
|
|
|
s:=Radius
|
|
|
else
|
|
|
s:='0';
|
|
|
- if BorderRadiusTopRight.Checked then
|
|
|
+ if BorderRadiusTopRightChkBox.Checked then
|
|
|
s+=' '+Radius
|
|
|
else
|
|
|
s+=' 0';
|
|
|
- if BorderRadiusBottomLeft.Checked then
|
|
|
+ if BorderRadiusBottomLeftChkBox.Checked then
|
|
|
s+=' '+Radius
|
|
|
else
|
|
|
s+=' 0';
|
|
|
- if BorderRadiusBottomRight.Checked then
|
|
|
+ if BorderRadiusBottomRightChkBox.Checked then
|
|
|
s+=' '+Radius
|
|
|
else
|
|
|
s+=' 0';
|
|
|
NewStyle+='border-radius:'+s+';';
|
|
|
|
|
|
+ s:='';
|
|
|
+ if TextShadowChkBox.Checked then
|
|
|
+ begin
|
|
|
+ s:=FloatToStr(TextShadowHorzPosSlider.Position)
|
|
|
+ +' '+FloatToStr(TextShadowVertPosSlider.Position)
|
|
|
+ +' '+FloatToStr(TextShadowBlurRadiusSlider.Position)
|
|
|
+ +' #2f6627';
|
|
|
+ end;
|
|
|
+ NewStyle+='text-shadow:'+s+';';
|
|
|
+
|
|
|
ButtonDiv.Style:=NewStyle;
|
|
|
end;
|
|
|
|