Menu

[91660d]: / testformu.pas  Maximize  Restore  History

Download this file

189 lines (158 with data), 4.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
unit TestFormu;
{$IFDEF FPC}
{$MODE Delphi}
{$ENDIF}
interface
uses
{$IFNDEF FPC}
Windows,
{$ELSE}
LCLIntf, LCLType, LMessages,
{$ENDIF}
Forms, sysutils,Graphics, Dialogs, HSSpeedButton ,HSButton, HSButtons, HSStaticText, Classes, Controls,
StdCtrls, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
ScrollBar1: TScrollBar;
Label1: TLabel;
Label2: TLabel;
ScrollBar2: TScrollBar;
Label3: TLabel;
CheckBox1: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure FormClick(Sender: TObject);
procedure FormPaint(Sender: TObject);
procedure ScrollBar2Change(Sender: TObject);
procedure ScrollBar1Change(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
bmp:TBitmap;
// procedure goBlur(Bitmap:TBitmap;Density:Smallint);
implementation
{$IFNDEF FPC}
{$R *.dfm}
{$ELSE}
{$R *.lfm}
{$ENDIF}
procedure TForm1.CheckBox1Click(Sender: TObject);
var i: integer;
begin
for i := 0 to ControlCount - 1 do
if (Controls[i] is THSSpeedButton) then
THSSpeedButton(Controls[i]).Flat:=CheckBox1.Checked
end;
procedure TForm1.FormClick(Sender: TObject);
var i:word;
begin
if ComponentCount>0 then for i:= 0 to ComponentCount-1 do
if Components[i] is THSSpeedButton then
THSSpeedButton(Components[i]).Down:=not THSSpeedButton(Components[i]).Down
end;
procedure TForm1.FormPaint(Sender: TObject);
begin
Canvas.Lock;
Canvas.Draw(0,0,bmp);
Canvas.Unlock;
end;
procedure TForm1.FormCreate(Sender: TObject);
var i:Word;
begin
bmp:=TBitmap.Create;
bmp.Transparent:=true;
bmp.TransparentColor:=clWhite;
if FileExists('D:\Downloads\test.bmp') then bmp.LoadFromFile('D:\Downloads\test.bmp');
for i := 0 to 7 do
with THSSpeedButton.Create(self) do
begin
Parent:=self;
// Transparent:=True;
SlowDecease:=sdEnterLeave;
// Color:=clRed;
Flat:=True;
Smooth:=0;
Border:=8;
SetBounds(10,10+i*45,100,40);
Caption:='Caption';
NumGlyphs:=2;
Layout:=blGlyphTop;
// Glyph.LoadFromResourceName(HInstance,'BBOK');
ColorStyle:=THSColorStyle(i+8);
Style:=THSButtonStyle.bsNormal;
HotTrackColor:=clRed;
end;
// exit;
for i := 0 to 7 do
with THSSpeedButton.Create(self) do
begin
Name:='ss'+IntToStr(i);
Parent:=self;
// Transparent:=True;
SlowDecease:=sdEnterLeave;
Flat:=True;
Smooth:=2;
Border:=8 ;
SetBounds(120,10+i*45,100,40);
Caption:='Caption';
// Kind:=bkCancel;
NumGlyphs:=2;
Layout:=blGlyphTop;
// Glyph.LoadFromResourceName(HInstance,'BBOK');
// HotTrackColor:=clRed;
ColorStyle:=THSColorStyle(i);
// Color:=clRed;
// HotTrackColor:=clYellow;
end;
for i := 0 to 6 do
with THSButton.Create(self) do
begin
Parent:=self;
// SlowDecease:=sdEnterLeave;
Color:=clGreen;
// HotTrackColor:=clWhite;
// UseHotTrackFont:=True;
// HotTrackFont.Color:=clSilver;
SetBounds(230,10+i*45,100,40);
Caption:='Caption';
// Kind:=bkCancel;
// Flat:=True;
NumGlyphs:=2;
Smooth:=2;
// Default:=true;
Border:=8;
Layout:=blGlyphTop;
// Glyph.LoadFromResourceName(HInstance,'BBOK');
// HotTrackColor:=clRed;
Style:=THSButtonStyle(i);
// Color:=clNavy
end;
end;
procedure TForm1.ScrollBar1Change(Sender: TObject);
var i:Integer;
begin
for i := 0 to ControlCount - 1 do
if (Controls[i] is THSSpeedButton) then
THSSpeedButton(Controls[i]).Border:=ScrollBar1.Position
else if (Controls[i] is THSButton) then
THSButton(Controls[i]).Border:=ScrollBar1.Position
else if (Controls[i] is THSStaticText) then
THSStaticText(Controls[i]).Border:=ScrollBar1.Position
end;
procedure TForm1.ScrollBar2Change(Sender: TObject);
var i:Integer;
begin
for i := 0 to ControlCount - 1 do
if (Controls[i] is THSSpeedButton) then
THSSpeedButton(Controls[i]).Smooth:=ScrollBar2.Position
else if (Controls[i] is THSButton) then
THSButton(Controls[i]).Smooth:=ScrollBar2.Position
else if (Controls[i] is THSStaticText) then
THSStaticText(Controls[i]).Smooth:=ScrollBar2.Position
end;
end.
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.