-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathStdCtrls.pas
724 lines (629 loc) · 19.1 KB
/
StdCtrls.pas
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
unit StdCtrls;
{
LVCL - Very LIGHT VCL routines
------------------------------
Tiny replacement for the standard VCL StdCtrls.pas
Just put the LVCL directory in your Project/Options/Path/SearchPath
and your .EXE will shrink from 300KB to 30KB
Notes:
- implements TButton+TCheckBox+TEdit+TLabel+TMemo
- for TMemo: use global Text property, as there's no Lines[] property;
don't set anything in Lines property in IDE
- compatible with the standard .DFM files.
- only use existing properties in your DFM, otherwise you'll get error on startup
(no Anchor, e.g.)
The contents of this file are 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
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.
The Initial Developer of the Original Code is Arnaud Bouchez.
This work is Copyright (C) 2008 Arnaud Bouchez - http://bouchez.info
Emulates the original Delphi/Kylix Cross-Platform Runtime Library
(c)2000,2001 Borland Software Corporation
Portions created by Paul Toth are Copyright (C) 2001 Paul Toth. http://tothpaul.free.fr
All Rights Reserved.
Some modifications by Leonid Glazyrin, Feb 2012 <[email protected]>
* TCheckBox: new properties: 'Alignment', 'State', 'AllowGrayed' (3-states style)
* TRadioButton (auto-switching and groups not implemented)
* TGroupBox
* TListBox, TComboBox (and parent TCustomBox)
}
{$WARNINGS OFF}
{$HINTS ON}
{$IF CompilerVersion >= 24.00}
{$ZEROBASEDSTRINGS OFF}
{$IFEND}
interface
uses
Windows, Messages, Classes, Controls, SysUtils, Graphics;
type
TLabel = class(TGraphicControl)
protected
procedure SetCaption(const Value: string);
public
procedure Paint; override;
property Caption: string read fCaption write SetCaption;
end;
TButton = class(TWinControl)
protected
procedure CreateHandle; override;
public
constructor Create(AOwner: TComponent); override;
end;
TEdit = class(TWinControl)
private
fText: string;
fPassWordChar: char;
fReadOnly: boolean;
protected
CreateFlags: cardinal;
procedure ReadProperty(const Name: string; Reader: TReader); override;
procedure CreateHandle; override;
function GetText: string;
procedure SetText(const Value: string); override;
public
procedure SetReadOnly(Value: Boolean);
procedure SelectAll;
procedure AddLine(const s: string; AddEOLN: boolean = true);
procedure AddLineFmt(const s: string; const Args: array of const; AddEOLN: boolean = true);
property Text: string read GetText write SetText;
property ReadOnly: boolean read fReadOnly write SetReadOnly;
end;
TMemo = class(TEdit)
protected
procedure CreateHandle; override;
end;
TAlignment = (taRightJustify, taLeftJustify); // default = 0 = taRightJustify
TCheckBoxState = (cbUnchecked, cbChecked, cbGrayed);
TCheckBox = class(TWinControl)
private
fState: TCheckBoxState;
fAllowGrayed: boolean;
fAlignment: TAlignment;
procedure SetChecked(const Value: boolean);
function GetChecked: boolean;
procedure SetState(const Value: TCheckBoxState);
procedure SetAllowGrayed(Value: boolean);
function GetState: TCheckBoxState;
protected
procedure CreateHandle; override;
procedure ReadProperty(const Name: string; Reader: TReader); override;
public
property Checked: boolean read GetChecked write SetChecked;
property State: TCheckBoxState read GetState write SetState;
property AllowGrayed: boolean read fAllowGrayed write SetAllowGrayed;
end;
TRadioButton = class(TCheckBox) //should be vice versa
protected
procedure CreateHandle; override;
end;
TGroupBox = class(TWinControl)
protected
procedure CreateHandle; override;
end;
TCustomBox = class;
TBoxStrings = class(TPersistent)
protected
fBox: TCustomBox;
fStrings: TStringList;
procedure SetStrings(StringList: TStrings);
procedure ReadProperty(const Name: string; Reader: TReader); override;
function GetItem(n: Integer): string;
public
constructor Create(Box: TCustomBox);
destructor Destroy; override;
function Add(const S: String): Integer;
procedure Clear;
property Strings: TStrings read fStrings write SetStrings;
property Items[n: integer]: string read GetItem; default;
end;
TCustomBox = class(TWinControl)
protected
fWinClass: string;
fCreateParams: cardinal;
fAddLineMsg: cardinal;
fResetMsg: cardinal;
fGetIndexMsg: cardinal;
fGetCountMsg: cardinal;
fDropDownHeight: integer;
fItems: TBoxStrings;
fItemIndex: Integer;
fSorted: Boolean;
function GetItems: TStrings;
procedure SetItems(AItems: TStrings);
function GetCount: Integer; virtual;
function GetItemIndex: Integer; virtual;
procedure SetItemIndex(const Value: Integer); virtual;
procedure CreateHandle; override;
procedure ReadProperty(const Name: string; Reader: TReader); override;
function SubProperty(const Name: string): TPersistent; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property ItemIndex: Integer read GetItemIndex write SetItemIndex default -1;
property Items: TBoxStrings read fItems;
property ItemCount: Integer read GetCount;
property ItemStrings: TStrings read GetItems write SetItems;
end;
TComboBoxStyle =
(csDropDown, csSimple, csDropDownList, csOwnerDrawFixed, csOwnerDrawVariable);
TComboBox = class(TCustomBox)
protected
fText: string;
fStyle: TComboBoxStyle;
fOnChange: TNotifyEvent;
procedure WMCommand(var msg: TWMCommand); message WM_COMMAND;
procedure ReadProperty(const Name: string; Reader: TReader); override;
function GetText: string;
procedure SetText(const Value: string); override;
procedure CreateHandle; override;
function GetDroppedDown: Boolean;
procedure SetDroppedDown(Value: Boolean);
public
property Text: string read GetText write SetText;
property OnChange: TNotifyEvent read fOnChange write fOnChange;
property DroppedDown: Boolean read GetDroppedDown write SetDroppedDown;
end;
TListBox = class(TCustomBox)
procedure CreateHandle; override;
end;
implementation
{ TButton }
constructor TButton.Create(AOwner:TComponent);
begin
inherited;
fTransparent := True; // do not use color
end;
procedure TButton.CreateHandle;
begin
Handle := CreateWindow(
'BUTTON',
pointer(fCaption),
WS_CHILD or WS_CLIPCHILDREN or WS_TABSTOP,
fLeft,fTop,fWidth,fHeight,
Parent.Handle,
0,
hInstance,
nil
);
if not fVisible then
ShowWindow(Handle,SW_HIDE);
end;
{ TEdit }
procedure TEdit.CreateHandle;
begin
Color := clWhite;
if CreateFlags=0 then begin
CreateFlags := WS_CHILD or WS_CLIPCHILDREN or WS_TABSTOP
or ES_AUTOHSCROLL or ES_AUTOVSCROLL;
if fPassWordChar='*' then
CreateFlags := CreateFlags or ES_PASSWORD;
end;
Handle := CreateWindowEx(
WS_EX_CONTROLPARENT or WS_EX_CLIENTEDGE,
'EDIT',
pointer(fCaption),
CreateFlags,
fLeft,fTop,fWidth,fHeight,
Parent.Handle,
0,
hInstance,
nil
);
SendMessage(Handle,WM_SETTEXT,0,integer(fText));
if not fVisible then
ShowWindow(Handle,SW_HIDE);
if fReadOnly then
SendMessage(fHandle, EM_SETREADONLY, 1, 0);
end;
function TEdit.GetText: string;
var i: integer;
begin
i := SendMessage(fHandle,WM_GETTEXTLENGTH,0,0);
if i=0 then
result := '' else begin
SetLength(result,i);
SetLength(result,SendMessage(fHandle,WM_GETTEXT,i+1,integer(result)));
end;
end;
procedure TEdit.ReadProperty(const Name: string; Reader: TReader);
const Properties: array[0..1] of PChar=(
'PasswordChar','ReadOnly');
var tmp: string;
begin
case StringIndex(Name,Properties) of
0: begin
tmp := Reader.StringProperty;
if tmp<>'' then
fPassWordChar := tmp[1];
end;
1: fReadOnly := Reader.BooleanProperty;
else inherited;
end;
end;
procedure TEdit.SelectAll;
begin
if fHandle<>0 then
SendMessage(fHandle, EM_SETSEL, 0, -1);
end;
procedure TEdit.SetReadOnly(Value: Boolean);
begin
HandleNeeded;
if fHandle<>0 then
SendMessage(fHandle, EM_SETREADONLY, Ord(Value), 0);
fReadOnly := Value;
end;
procedure TEdit.SetText(const Value: string);
begin
fText := Value;
if fHandle<>0 then
SendMessage(fHandle,WM_SETTEXT,0,integer(Value));
end;
procedure TEdit.AddLine(const s: string; AddEOLN: boolean=true);
var len: integer;
str: string;
begin
HandleNeeded;
len := SendMessage(fHandle, WM_GETTEXTLENGTH, 0, 0);
if AddEOLN and (len>0) then
str := #13#10+s else
str := s;
SendMessage(fHandle, EM_SETSEL, len, len);
SendMessage(fHandle, EM_REPLACESEL, 0, integer(str));
end;
procedure TEdit.AddLineFmt(const s: string; const Args: array of const; AddEOLN: boolean = true);
begin
AddLine(Format(s, Args), AddEOLN);
end;
{ TMemo }
procedure TMemo.CreateHandle;
begin
CreateFlags := WS_VISIBLE or
WS_CHILD or ES_MULTILINE or ES_WANTRETURN or ES_AUTOVSCROLL or WS_VSCROLL;
inherited;
end;
{ TCheckBox }
const
AlignStyle: array [TAlignment] of Cardinal = (0, BS_LEFTTEXT);
GrayStyle: array [Boolean] of Cardinal = (BS_AUTOCHECKBOX, BS_AUTO3STATE);
procedure TCheckBox.CreateHandle;
begin
Handle := CreateWindowEx(
WS_EX_CONTROLPARENT,
'BUTTON',
pointer(fCaption),
WS_VISIBLE or WS_CHILD or WS_TABSTOP or GrayStyle[fAllowGrayed] or AlignStyle[fAlignment],
fLeft,fTop,fWidth,fHeight,
Parent.Handle,
0,
hInstance,
nil
);
State := fState;
if not fVisible then
ShowWindow(Handle,SW_HIDE);
end;
procedure TRadioButton.CreateHandle;
begin
Handle := CreateWindowEx(
WS_EX_CONTROLPARENT,
'BUTTON',
pointer(fCaption),
WS_VISIBLE or WS_CHILD or BS_RADIOBUTTON or WS_TABSTOP or AlignStyle[fAlignment],
fLeft,fTop,fWidth,fHeight,
Parent.Handle,
0,
hInstance,
nil
);
SendMessage(Handle, BM_SETCHECK, integer(fState), 0);
if not fVisible then
ShowWindow(Handle,SW_HIDE);
end;
function TCheckBox.GetChecked: boolean;
begin
result := Boolean(GetState);
end;
function TCheckBox.GetState: TCheckBoxState;
begin
result := TCheckBoxState(SendMessage(Handle,BM_GETCHECK,0,0));
end;
procedure TCheckBox.ReadProperty(const Name: string; Reader: TReader);
const Properties: array[0..3] of PChar=(
'Checked', 'Alignment', 'State', 'AllowGrayed');
var b: Boolean;
begin
case StringIndex(Name,Properties) of
0 : begin
b := Reader.BooleanProperty;
if fState<>cbGrayed then
fState := TCheckBoxState(b);
end;
1: Reader.IdentProperty(fAlignment,TypeInfo(TAlignment));
2: Reader.IdentProperty(fState,TypeInfo(TCheckBoxState));
3: fAllowGrayed := Reader.BooleanProperty;
else inherited;
end;
end;
procedure TCheckBox.SetChecked(const Value: boolean);
begin
SetState(TCheckBoxState(Value));
end;
procedure TCheckBox.SetState(const Value: TCheckBoxState);
begin
if self=nil then exit;
HandleNeeded;
if (Value = cbGrayed) and not fAllowGrayed then
begin
SetAllowGrayed(True); // need to set Grayed state
SendMessage(Handle, BM_SETCHECK, integer(Value), 0);
SetAllowGrayed(False); // style switches back, but state persists!
end
else
SendMessage(Handle, BM_SETCHECK, integer(Value), 0);
end;
procedure TCheckBox.SetAllowGrayed(Value: boolean);
var i: Integer;
const StyleMask = $F;
begin
if fAllowGrayed = Value then Exit;
fAllowGrayed := Value;
i:= GetWindowLong(fHandle, GWL_STYLE);
//if (i and StyleMask)<>GrayStyle[fAllowGrayed] then //no need to check
// switch between 2-state and 3-state CheckBox autoswitching style
SetWindowLong(fHandle, GWL_STYLE, i and not StyleMask or GrayStyle[fAllowGrayed]);
end;
{ TGroupBox }
procedure TGroupBox.CreateHandle;
begin
Color:= Parent.Color;
Handle := CreateWindowEx(
WS_EX_CONTROLPARENT,
'BUTTON',
pointer(fCaption),
WS_VISIBLE or WS_CHILD or BS_GROUPBOX or WS_TABSTOP,
fLeft,fTop,fWidth,fHeight,
Parent.Handle,
0,
hInstance,
nil
);
if not fVisible then
ShowWindow(Handle,SW_HIDE);
end;
{ TLabel }
procedure TLabel.Paint;
var R: TRect;
begin
R := ClientRect;
with Canvas do begin
Font.Assign(Self.Font);
if fTransparent then
Brush.Style := bsClear else begin
Brush.Color := Parent.Color;
FillRect(R);
end;
if fVisible then begin
PrepareText;
DrawText(Handle, pointer(fCaption), length(fCaption), R,
DT_LEFT or DT_NOPREFIX or DT_WORDBREAK);
end;
end;
end;
procedure TLabel.SetCaption(const Value: string);
var Redraw: boolean;
begin
Redraw := (fCaption<>Value);
fCaption := Value;
if Redraw then // avoid flicker
Invalidate;
end;
{ TBoxStrings }
constructor TBoxStrings.Create(Box: TCustomBox);
begin
inherited Create;
fStrings:= TStringList.Create;
fBox:= Box;
end;
destructor TBoxStrings.Destroy;
begin
fStrings.Free;
inherited;
end;
function TBoxStrings.Add(const S: String): Integer;
begin
fStrings.Add(S);
result := SendMessage(fBox.Handle, fBox.fAddLineMsg, 0, integer(S));
if result<0 then
raise Exception.Create('InsertLineError');
end;
procedure TBoxStrings.Clear;
begin
fStrings.Clear;
SendMessage(fBox.Handle, fBox.fResetMsg, 0, 0);
end;
procedure TBoxStrings.SetStrings(StringList: TStrings);
// seems to be very unoptimal, but there's no TStringList.Assign !
var i: Integer;
begin
if StringList = fStrings then Exit;
Clear;
for i := 0 to StringList.Count-1 do
Add(StringList[i]);
end;
function TBoxStrings.GetItem(n: Integer): string;
begin
Result := fStrings[n];
end;
procedure TBoxStrings.ReadProperty(const Name: string; Reader: TReader);
const Properties: array[0..0] of PChar=('Strings');
begin
case StringIndex(Name,Properties) of
0 : Reader.ReadStrings(fStrings);
else inherited;
end;
end;
{ TCustomBox }
constructor TCustomBox.Create(AOwner: TComponent);
begin
inherited;
fItems := TBoxStrings.Create(Self);
fItemIndex:= -1;
end;
procedure TCustomBox.CreateHandle;
var i: Integer;
begin
Handle := CreateWindowEx(
WS_EX_CONTROLPARENT,
pointer(fWinClass),
pointer(fCaption),
fCreateParams,
fLeft,fTop,fWidth,fHeight+fDropDownHeight,
Parent.Handle,
0,
hInstance,
nil
);
for i:= 0 to fItems.Strings.Count - 1 do
SendMessage(FHandle, fAddLineMsg, 0, integer(fItems.Strings[i]));
SetItemIndex(fItemIndex);
if not fVisible then
ShowWindow(FHandle, SW_HIDE);
end;
//TComboBoxStyle = (csDropDown, csSimple, csDropDownList, csOwnerDrawFixed, csOwnerDrawVariable);
const ComboBoxStyleFlag: array[TComboBoxStyle] of Cardinal =
(CBS_DROPDOWN, CBS_SIMPLE, CBS_DROPDOWNLIST, CBS_OWNERDRAWFIXED, CBS_OWNERDRAWVARIABLE);
procedure TComboBox.CreateHandle;
begin
fWinClass := 'COMBOBOX';
fCreateParams := WS_VISIBLE or WS_CHILD or WS_TABSTOP or WS_VSCROLL or LBS_NOINTEGRALHEIGHT;
fAddLineMsg := CB_ADDSTRING;
fResetMsg := CB_RESETCONTENT;
fGetIndexMsg:= CB_GETCURSEL;
fGetCountMsg:= CB_GETCOUNT;
if fSorted then
fCreateParams := fCreateParams or CBS_SORT;
fCreateParams := fCreateParams or ComboBoxStyleFlag[fStyle];
if fStyle<>csSimple then
fDropDownHeight:= 400; // maybe, not the best solution?!?
Color:= Parent.Color;
inherited;
SendMessage(fHandle, WM_SETTEXT, 0, integer(fText));
end;
procedure TListBox.CreateHandle;
begin
fWinClass := 'LISTBOX';
fCreateParams := WS_VISIBLE or WS_CHILD or WS_TABSTOP or WS_VSCROLL
or WS_BORDER or LBS_HASSTRINGS or LBS_NOINTEGRALHEIGHT;
fAddLineMsg := LB_ADDSTRING;
fResetMsg := LB_RESETCONTENT;
fGetIndexMsg:= LB_GETCURSEL;
fGetCountMsg:= LB_GETCOUNT;
if fSorted then
fCreateParams := fCreateParams or LBS_SORT;
Color:= clWhite;
inherited;
end;
procedure TComboBox.WMCommand(var msg: TWMCommand);
begin
inherited;
case msg.NotifyCode of
CBN_SELCHANGE:
if Assigned(fOnChange) then
fOnChange(Self);
end;
end;
destructor TCustomBox.Destroy;
begin
fItems.Free;
inherited;
end;
function TCustomBox.GetItems: TStrings;
begin
Result:= fItems.Strings;
end;
procedure TCustomBox.SetItems(AItems: TStrings);
begin
fItems.Strings:= AItems;
end;
function TCustomBox.GetCount: Integer;
begin
Result := SendMessage(FHandle, fGetCountMsg, 0, 0);
Assert(Result = fItems.Strings.Count);
end;
function TCustomBox.GetItemIndex: Integer;
begin
Result := SendMessage(FHandle, fGetIndexMsg, 0, 0);
end;
procedure TCustomBox.SetItemIndex(const Value: Integer);
begin
fItemIndex := Value;
if GetItemIndex<>Value then
SendMessage(FHandle, CB_SETCURSEL, Value, 0);
end;
procedure TCustomBox.ReadProperty(const Name: string; Reader: TReader);
const Properties: array[0..1] of PChar=('ItemIndex', 'Sorted');
begin
case StringIndex(Name,Properties) of
0 : fItemIndex := Reader.IntegerProperty;
1 : fSorted := Reader.BooleanProperty;
else inherited;
end;
end;
procedure TComboBox.ReadProperty(const Name: string; Reader: TReader);
const Properties: array[0..1] of PChar=('OnChange', 'Style');
begin
case StringIndex(Name,Properties) of
0 : TMethod(fOnChange) := FindMethod(Reader);
1 : Reader.IdentProperty(fStyle, TypeInfo(TComboBoxStyle));
else inherited;
end;
end;
function TCustomBox.SubProperty(const Name:string): TPersistent;
const
TCustomBoxSubProperties:array[0..0] of PChar=('Items');
begin
case StringIndex(Name, TCustomBoxSubProperties) of
0 : result := fItems;
else result := inherited SubProperty(Name);
end;
end;
function TComboBox.GetText: string;
var i: integer;
begin
i := SendMessage(fHandle,WM_GETTEXTLENGTH,0,0);
if i=0 then
result := '' else begin
SetLength(result,i);
SetLength(result,SendMessage(fHandle,WM_GETTEXT,i+1,integer(result)));
end;
end;
procedure TComboBox.SetText(const Value: string);
begin
fText := Value;
if fHandle<>0 then
SendMessage(fHandle,WM_SETTEXT,0,integer(Value));
end;
function TComboBox.GetDroppedDown: Boolean;
begin
Result := LongBool(SendMessage(Handle, CB_GETDROPPEDSTATE, 0, 0));
end;
procedure TComboBox.SetDroppedDown(Value: Boolean);
var
R: TRect;
begin
SendMessage(Handle, CB_SHOWDROPDOWN, ord(Value), 0);
R := ClientRect;
InvalidateRect(Handle, @R, True);
end;
const
Classes: array[0..8] of TPersistentClass =
(TLabel, TButton, TEdit, TCheckBox, TRadioButton, TGroupBox, TMemo,
TComboBox, TListBox);
initialization
RegisterClasses(Classes);
end.