// Hier die
(mausgesteuerte)
Komponente
TCheck, welche zweifach verwendet
// werden kann:
// Hat die Eigenschaft
Gruppe
den Wert
Null,
dann reagiert sie wie
TCheckBox,
// bei Werten größer als
Null
reagiert sie wie
TRadioButton.
Außerdem kann man
// über die Eigenschaft
Art
vier verschiedene
Ansichten einstellen:
// Die Komponente
verfügt aber nicht über die Eigenschaft
Caption. Um
eine
// Beschriftung zu erstellen, setzt man ein
TLabel
daneben. Soll beim
Anklicken
// des Labels die Komponente reagieren, ruft man im
OnClick-Event
des Labels
// die Prozedur
Schalten
auf:
// procedure
TForm1.Label1Click(Sender: TObject);
// begin
//
Check1.schalten;
// end;
// Bei Einzel-Komponenten
(Gruppe = 0)
wird dabei zwischen
Checked
und
// not
Checked
umgeschaltet. Gehört die Komponente zu einer Gruppe, wird
// Checked
auf True
gesetzt.
// Es reagieren nur Elemente mit gleicher Gruppen-Nummer aufeinander.
// Getestet mit D4 unter WinME
unit Check;
interface
uses
Windows, Classes, Controls, Graphics, SysUtils;
type
T3 = 0..3;
TCheck = class(TGraphicControl)
private
bld: t3;
grp: byte;
bm: TBitmap;
mal: integer;
change: TNotifyEvent;
unten, umsch, hlp, mitmaus: boolean;
protected
procedure paint; override;
procedure loaded; override;
procedure SetEnabled(Value: boolean); override;
procedure MouseUp(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
procedure MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); override;
procedure laden;
procedure suchen;
procedure notenabled;
procedure setbld(t: t3);
procedure maus(b: boolean);
procedure setgrp(bt: byte);
procedure setchk(b: boolean);
procedure setunten(b: boolean);
public
procedure schalten;
destructor Destroy; override;
constructor Create(Owner: TComponent); override;
published
property Visible;
property Enabled;
property OnMouseUp;
property OnMouseDown;
property OnChange: TNotifyEvent read change write change;
property Checked: boolean read unten write setchk;
property Gruppe: byte read grp write setgrp;
property Art: t3 read bld write setbld;
end;
procedure Register;
implementation
const bilder: array[0..3455] of Byte = (
$93, $91, $91, $9B, $98, $99, $9C, $99, $9A, $9B, $9A, $9A, $9D, $9A, $9B,
$9C, $9B, $9B, $9E, $9B, $9B, $9E, $9B, $9C, $9D, $9C, $9C, $9E, $9D, $9D,
$9F, $9E, $9E, $A3, $A2, $A2, $94, $92, $93, $9D, $9A, $9A, $9F, $9D, $9D,
$A1, $A0, $A0, $A3, $A2, $A2, $A6, $A5, $A5, $AA, $A7, $A7, $AB, $AA, $AA,
$AE, $AC, $AC, $B0, $AF, $AF, $B3, $B2, $B2, $E2, $E2, $E2, $95, $92, $94,
$9E, $9C, $9D, $A1, $9F, $9F, $A3, $A2, $A2, $A6, $A5, $A5, $A9, $A6, $A6,
$AC, $A9, $A9, $AE, $AC, $AC, $B0, $AF, $AF, $B3, $B2, $B2, $B5, $B4, $B4,
$E6, $E6, $E6, $97, $95, $95, $A1, $9F, $9F, $A3, $A1, $A2, $A6, $A4, $A4,
$5F, $A4, $32, $0B, $90, $01, $0B, $90, $01, $0B, $90, $01, $B2, $B1, $B1,
$B5, $B4, $B4, $B7, $B7, $B6, $E9, $E9, $E9, $98, $95, $97, $A3, $A1, $A2,
$A5, $A4, $A4, $5F, $A4, $32, $5F, $A4, $32, $18, $79, $06, $14, $80, $04,
$14, $80, $04, $14, $80, $04, $B7, $B7, $B6, $BA, $B9, $B9, $EC, $EC, $EC,
$99, $97, $97, $A5, $A4, $A4, $A8, $A5, $A5, $5F, $A4, $32, $18, $79, $06,
$16, $7E, $05, $11, $86, $02, $0F, $8B, $02, $0F, $76, $05, $BA, $B9, $B9,
$BC, $BC, $BB, $ED, $ED, $ED, $9B, $98, $98, $A8, $A6, $A6, $AB, $A8, $A8,
$5F, $A4, $32, $15, $7F, $04, $12, $84, $03, $0F, $8B, $01, $0B, $90, $01,
$0F, $76, $05, $BC, $BC, $BB, $BF, $BD, $BD, $EF, $EF, $EF, $9D, $9A, $9A,
$AB, $A8, $A8, $AC, $AB, $AB, $5F, $A4, $32, $0E, $8F, $01, $0E, $8F, $01,
$0E, $8F, $01, $0F, $76, $05, $14, $80, $04, $BD, $BD, $BC, $C1, $BF, $BF,
$F0, $F0, $F0, $9E, $9B, $9B, $AC, $AB, $AB, $AF, $AD, $AD, $B0, $AE, $AE,
$5F, $A4, $32, $0B, $90, $01, $0F, $76, $05, $0F, $76, $05, $BD, $BC, $BC,
$BF, $BF, $BD, $C2, $C2, $C0, $F1, $F1, $F1, $9E, $9C, $9C, $AF, $AD, $AD,
$B0, $AE, $AE, $B1, $B0, $B0, $B4, $B3, $B3, $B6, $B6, $B5, $B9, $B9, $B8,
$BC, $BB, $BB, $C0, $BE, $BE, $C2, $C2, $C0, $C5, $C5, $C4, $F2, $F2, $F2,
$9F, $9E, $9E, $B1, $B0, $B0, $B3, $B2, $B2, $B4, $B3, $B3, $B6, $B5, $B5,
$B7, $B7, $B6, $B9, $B8, $B8, $BB, $BA, $BA, $BC, $BB, $BB, $C1, $BF, $BF,
$C6, $C5, $C5, $F4, $F4, $F4, $99, $99, $99, $CD, $CD, $CD, $D0, $D0, $D0,
$D3, $D3, $D3, $D6, $D6, $D6, $D9, $D9, $D9, $DD, $DD, $DD, $E0, $E0, $E0,
$E3, $E3, $E3, $E6, $E6, $E6, $EA, $EA, $EA, $F5, $F5, $F5, $FD, $FD, $FD,
$FB, $FB, $FB, $F9, $F9, $F9, $F7, $F7, $F7, $F6, $F6, $F6, $F4, $F4, $F4,
$F3, $F3, $F3, $F1, $F1, $F1, $EF, $EF, $EF, $EE, $EE, $EE, $E9, $E9, $E9,
$C7, $C7, $C6, $F2, $F2, $F2, $C3, $C3, $C2, $C2, $C0, $C0, $BF, $BD, $BD,
$BD, $BC, $BC, $BA, $B9, $B9, $B7, $B7, $B6, $B5, $B4, $B4, $B3, $B2, $B2,
$B0, $AF, $AF, $AE, $AC, $AC, $A5, $A4, $A4, $EE, $EE, $EE, $C2, $C0, $C0,
$C0, $BE, $BE, $BD, $BC, $BC, $BB, $BA, $BA, $B8, $B8, $B7, $B5, $B4, $B4,
$B3, $B2, $B2, $B1, $B0, $B0, $AF, $AD, $AD, $AD, $AA, $AA, $A4, $A3, $A3,
$ED, $ED, $ED, $C0, $BE, $BE, $BD, $BD, $BC, $BB, $BA, $BA, $AF, $6C, $FE,
$AC, $68, $FE, $AA, $63, $FE, $AA, $5E, $FE, $B0, $AE, $AE, $AD, $AA, $AA,
$AB, $A8, $A8, $A2, $A1, $A1, $EB, $EB, $EB, $BD, $BC, $BC, $BB, $BA, $BA,
$AD, $6C, $FE, $AC, $67, $FE, $AA, $63, $FE, $A9, $5D, $FE, $AB, $57, $FB,
$AE, $54, $F5, $AA, $A8, $A8, $A7, $A5, $A5, $A1, $9F, $9F, $E8, $E8, $E8,
$BB, $BB, $BA, $B9, $B8, $B8, $AC, $68, $FE, $AA, $63, $FE, $AA, $5F, $FE,
$AB, $58, $FB, $AE, $54, $F6, $B1, $4F, $F0, $A8, $A6, $A6, $A5, $A4, $A4,
$9F, $9D, $9E, $E8, $E8, $E8, $B9, $B9, $B8, $B6, $B6, $B5, $AC, $64, $FE,
$AD, $60, $FE, $AA, $5B, $FD, $AE, $55, $F6, $AF, $50, $F1, $B2, $4C, $EF,
$A6, $A4, $A4, $A2, $A1, $A1, $9D, $9C, $9C, $E5, $E5, $E5, $B7, $B7, $B6,
$B5, $B4, $B4, $AD, $63, $FE, $AD, $60, $FE, $AE, $57, $FB, $B1, $51, $F3,
$B2, $4F, $F1, $B3, $4C, $EE, $A4, $A3, $A3, $A1, $A0, $A0, $9D, $9A, $9A,
$E3, $E3, $E3, $B5, $B4, $B4, $B5, $B5, $B5, $B5, $B4, $B4, $B5, $58, $FD,
$BA, $4F, $F7, $BE, $49, $F2, $BB, $45, $EE, $A6, $A4, $A4, $A2, $A0, $A0,
$9F, $9D, $9E, $9B, $98, $99, $E0, $E0, $E0, $B3, $B2, $B2, $B2, $B1, $B1,
$B2, $B1, $B1, $AE, $AC, $AC, $AA, $A8, $A8, $A6, $A4, $A4, $A4, $A3, $A3,
$A2, $A1, $A1, $A0, $9E, $9E, $9E, $9B, $9B, $99, $97, $97, $DC, $DC, $DC,
$B0, $AF, $AF, $B0, $AE, $AE, $AD, $AA, $AA, $AA, $A8, $A8, $A7, $A5, $A5,
$A5, $A3, $A3, $A2, $A1, $A1, $A0, $9E, $9E, $9E, $9B, $9C, $9B, $98, $99,
$98, $95, $97, $D7, $D7, $D7, $9C, $9B, $9B, $9A, $99, $99, $99, $96, $96,
$98, $95, $95, $96, $93, $95, $94, $92, $93, $93, $91, $92, $93, $90, $91,
$90, $8E, $8F, $90, $8D, $8E, $94, $92, $93, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $7F, $7F, $7F,
$00, $00, $00, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99,
$99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99,
$7F, $7F, $7F, $E5, $E5, $E5, $00, $00, $00, $99, $99, $99, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $CC, $CC, $CC, $E5, $E5, $E5, $00, $00, $00,
$99, $99, $99, $FF, $FF, $FF, $00, $00, $00, $00, $00, $00, $FF, $FF, $FF,
$FF, $FF, $FF, $00, $00, $00, $00, $00, $00, $FF, $FF, $FF, $CC, $CC, $CC,
$E5, $E5, $E5, $00, $00, $00, $99, $99, $99, $FF, $FF, $FF, $00, $00, $00,
$00, $00, $00, $66, $66, $66, $66, $66, $66, $00, $00, $00, $00, $00, $00,
$FF, $FF, $FF, $CC, $CC, $CC, $E5, $E5, $E5, $00, $00, $00, $99, $99, $99,
$FF, $FF, $FF, $FF, $FF, $FF, $66, $66, $66, $00, $00, $00, $00, $00, $00,
$66, $66, $66, $FF, $FF, $FF, $FF, $FF, $FF, $CC, $CC, $CC, $E5, $E5, $E5,
$00, $00, $00, $99, $99, $99, $FF, $FF, $FF, $FF, $FF, $FF, $66, $66, $66,
$00, $00, $00, $00, $00, $00, $66, $66, $66, $FF, $FF, $FF, $FF, $FF, $FF,
$CC, $CC, $CC, $E5, $E5, $E5, $00, $00, $00, $99, $99, $99, $FF, $FF, $FF,
$00, $00, $00, $00, $00, $00, $66, $66, $66, $66, $66, $66, $00, $00, $00,
$00, $00, $00, $FF, $FF, $FF, $CC, $CC, $CC, $E5, $E5, $E5, $00, $00, $00,
$99, $99, $99, $FF, $FF, $FF, $00, $00, $00, $00, $00, $00, $FF, $FF, $FF,
$FF, $FF, $FF, $00, $00, $00, $00, $00, $00, $FF, $FF, $FF, $CC, $CC, $CC,
$E5, $E5, $E5, $00, $00, $00, $99, $99, $99, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $CC, $CC, $CC, $E5, $E5, $E5, $00, $00, $00, $7F, $7F, $7F,
$CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC,
$CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $E5, $E5, $E5,
$7F, $7F, $7F, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5,
$E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5,
$E5, $E5, $E5, $E5, $E5, $E5, $00, $00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00,
$00, $00, $00, $00, $00, $00, $00, $00, $00, $7F, $7F, $7F, $00, $00, $00,
$99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99,
$99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $99, $7F, $7F, $7F,
$E5, $E5, $E5, $00, $00, $00, $99, $99, $99, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $CC, $CC, $CC, $E5, $E5, $E5, $00, $00, $00, $99, $99, $99,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $CC, $CC, $CC, $E5, $E5, $E5,
$00, $00, $00, $99, $99, $99, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$CC, $CC, $CC, $E5, $E5, $E5, $00, $00, $00, $99, $99, $99, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $CC, $CC, $CC, $E5, $E5, $E5, $00, $00, $00,
$99, $99, $99, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $CC, $CC, $CC,
$E5, $E5, $E5, $00, $00, $00, $99, $99, $99, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $CC, $CC, $CC, $E5, $E5, $E5, $00, $00, $00, $99, $99, $99,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $CC, $CC, $CC, $E5, $E5, $E5,
$00, $00, $00, $99, $99, $99, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$CC, $CC, $CC, $E5, $E5, $E5, $00, $00, $00, $7F, $7F, $7F, $CC, $CC, $CC,
$CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC,
$CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $E5, $E5, $E5, $7F, $7F, $7F,
$E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5,
$E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5, $E5,
$E5, $E5, $E5, $00, $00, $A8, $00, $00, $A8, $00, $00, $A8, $00, $00, $A8,
$00, $00, $A8, $00, $00, $A8, $00, $00, $A8, $00, $00, $A8, $00, $00, $A8,
$00, $00, $A8, $00, $00, $A8, $90, $90, $ED, $00, $00, $A8, $1F, $1F, $CB,
$29, $29, $CE, $33, $33, $D1, $3C, $3C, $D4, $45, $45, $D6, $4F, $4F, $D9,
$59, $59, $DC, $63, $63, $DF, $6C, $6C, $E2, $76, $76, $E5, $F5, $F5, $FF,
$00, $00, $A8, $29, $29, $CE, $32, $32, $D1, $3C, $3C, $D3, $45, $45, $D6,
$4F, $4F, $D9, $59, $59, $DC, $62, $62, $DF, $6B, $6B, $E2, $75, $75, $E5,
$7F, $7F, $E8, $F5, $F5, $FF, $00, $00, $A8, $32, $32, $D1, $3B, $3B, $D3,
$45, $45, $D6, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$75, $75, $E5, $7F, $7F, $E8, $88, $88, $EA, $F5, $F5, $FF, $00, $00, $A8,
$3B, $3B, $D3, $44, $44, $D6, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $88, $88, $EA, $91, $91, $ED,
$F5, $F5, $FF, $00, $00, $A8, $44, $44, $D6, $4E, $4E, $D9, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$91, $91, $ED, $9B, $9B, $F0, $F5, $F5, $FF, $00, $00, $A8, $4E, $4E, $D9,
$58, $58, $DC, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $9A, $9A, $F0, $A4, $A4, $F3, $F5, $F5, $FF,
$00, $00, $A8, $57, $57, $DC, $61, $61, $DF, $FF, $FF, $FF, $FF, $FF, $FF,
$FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $A4, $A4, $F3,
$AD, $AD, $F6, $F5, $F5, $FF, $00, $00, $A8, $60, $60, $DE, $69, $69, $E1,
$73, $73, $E4, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF, $FF,
$A4, $A4, $F3, $AD, $AD, $F5, $B6, $B6, $F8, $F5, $F5, $FF, $00, $00, $A8,
$69, $69, $E1, $73, $73, $E4, $7D, $7D, $E7, $86, $86, $EA, $90, $90, $ED,
$99, $99, $F0, $A3, $A3, $F2, $AD, $AD, $F5, $B6, $B6, $F8, $BF, $BF, $FB,
$F5, $F5, $FF, $00, $00, $A8, $73, $73, $E4, $7D, $7D, $E7, $86, $86, $EA,
$8F, $8F, $ED, $99, $99, $EF, $A3, $A3, $F2, $AC, $AC, $F5, $B6, $B6, $F8,
$BF, $BF, $FB, $C9, $C9, $FE, $F5, $F5, $FF, $90, $90, $ED, $F5, $F5, $FF,
$F5, $F5, $FF, $F5, $F5, $FF, $F5, $F5, $FF, $F5, $F5, $FF, $F5, $F5, $FF,
$F5, $F5, $FF, $F5, $F5, $FF, $F5, $F5, $FF, $F5, $F5, $FF, $F5, $F5, $FF,
$E3, $E3, $FF, $E3, $E3, $FF, $E3, $E3, $FF, $E3, $E3, $FF, $E3, $E3, $FF,
$E3, $E3, $FF, $E3, $E3, $FF, $E3, $E3, $FF, $E3, $E3, $FF, $E3, $E3, $FF,
$E3, $E3, $FF, $90, $90, $ED, $E3, $E3, $FF, $AF, $AF, $F6, $A6, $A6, $F3,
$9C, $9C, $F0, $93, $93, $EE, $8A, $8A, $EB, $81, $81, $E8, $77, $77, $E5,
$6E, $6E, $E3, $65, $65, $E0, $5C, $5C, $DD, $00, $00, $A8, $E3, $E3, $FF,
$A6, $A6, $F3, $9C, $9C, $F0, $92, $92, $EE, $89, $89, $EB, $80, $80, $E8,
$77, $77, $E5, $6D, $6D, $E2, $64, $64, $E0, $5B, $5B, $DD, $52, $52, $DA,
$00, $00, $A8, $E3, $E3, $FF, $9C, $9C, $F0, $92, $92, $ED, $89, $89, $EB,
$C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7, $5B, $5B, $DD,
$52, $52, $DA, $48, $48, $D7, $00, $00, $A8, $E3, $E3, $FF, $92, $92, $ED,
$89, $89, $EB, $C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7,
$C6, $C6, $F7, $C6, $C6, $F7, $48, $48, $D7, $3F, $3F, $D4, $00, $00, $A8,
$E3, $E3, $FF, $89, $89, $EB, $7F, $7F, $E8, $C6, $C6, $F7, $C6, $C6, $F7,
$C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7, $3E, $3E, $D4,
$35, $35, $D1, $00, $00, $A8, $E3, $E3, $FF, $7F, $7F, $E8, $76, $76, $E5,
$C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7,
$C6, $C6, $F7, $35, $35, $D1, $2C, $2C, $CF, $00, $00, $A8, $E3, $E3, $FF,
$75, $75, $E5, $6C, $6C, $E2, $C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7,
$C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7, $2C, $2C, $CF, $22, $22, $CC,
$00, $00, $A8, $E3, $E3, $FF, $6B, $6B, $E2, $62, $62, $DF, $59, $59, $DC,
$C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7, $C6, $C6, $F7, $2B, $2B, $CE,
$21, $21, $CC, $18, $18, $C9, $00, $00, $A8, $E3, $E3, $FF, $62, $62, $DF,
$59, $59, $DC, $50, $50, $D9, $46, $46, $D7, $3D, $3D, $D4, $34, $34, $D1,
$2B, $2B, $CE, $21, $21, $CC, $18, $18, $C9, $0F, $0F, $C6, $00, $00, $A8,
$E3, $E3, $FF, $59, $59, $DC, $4F, $4F, $D9, $46, $46, $D7, $3D, $3D, $D4,
$34, $34, $D1, $2B, $2B, $CE, $21, $21, $CB, $17, $17, $C9, $0E, $0E, $C6,
$05, $05, $C4, $00, $00, $A8, $90, $90, $ED, $00, $00, $A8, $00, $00, $A8,
$00, $00, $A8, $00, $00, $A8, $00, $00, $A8, $00, $00, $A8, $00, $00, $A8,
$00, $00, $A8, $00, $00, $A8, $00, $00, $A8, $00, $00, $A8,
$FF, $FF, $FF, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F,
$B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F,
$B9, $9D, $7F, $FF, $FF, $FF, $B9, $9D, $7F, $FC, $FC, $FC, $FC, $FC, $FC,
$FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC,
$FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $B9, $9D, $7F, $B9, $9D, $7F,
$F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7,
$F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7,
$B9, $9D, $7F, $B9, $9D, $7F, $F2, $F2, $F2, $F2, $F2, $F2, $00, $00, $00,
$00, $00, $00, $F2, $F2, $F2, $F2, $F2, $F2, $00, $00, $00, $00, $00, $00,
$F2, $F2, $F2, $F2, $F2, $F2, $B9, $9D, $7F, $B9, $9D, $7F, $ED, $ED, $ED,
$ED, $ED, $ED, $00, $00, $00, $00, $00, $00, $7F, $7F, $7F, $7F, $7F, $7F,
$00, $00, $00, $00, $00, $00, $ED, $ED, $ED, $ED, $ED, $ED, $B9, $9D, $7F,
$B9, $9D, $7F, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $7F, $7F, $7F,
$00, $00, $00, $00, $00, $00, $7F, $7F, $7F, $E7, $E7, $E7, $E7, $E7, $E7,
$E7, $E7, $E7, $B9, $9D, $7F, $B9, $9D, $7F, $E2, $E2, $E2, $E2, $E2, $E2,
$E2, $E2, $E2, $7F, $7F, $7F, $00, $00, $00, $00, $00, $00, $7F, $7F, $7F,
$E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $B9, $9D, $7F, $B9, $9D, $7F,
$DD, $DD, $DD, $DD, $DD, $DD, $00, $00, $00, $00, $00, $00, $7F, $7F, $7F,
$7F, $7F, $7F, $00, $00, $00, $00, $00, $00, $DD, $DD, $DD, $DD, $DD, $DD,
$B9, $9D, $7F, $B9, $9D, $7F, $D8, $D8, $D8, $D8, $D8, $D8, $00, $00, $00,
$00, $00, $00, $D8, $D8, $D8, $D8, $D8, $D8, $00, $00, $00, $00, $00, $00,
$D8, $D8, $D8, $D8, $D8, $D8, $B9, $9D, $7F, $B9, $9D, $7F, $D3, $D3, $D3,
$D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3,
$D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $B9, $9D, $7F,
$B9, $9D, $7F, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE,
$CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE,
$CE, $CE, $CE, $B9, $9D, $7F, $FF, $FF, $FF, $B9, $9D, $7F, $B9, $9D, $7F,
$B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F,
$B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $FF, $FF, $FF, $FF, $FF, $FF,
$B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F,
$B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F,
$FF, $FF, $FF, $B9, $9D, $7F, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC,
$FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC, $FC,
$FC, $FC, $FC, $FC, $FC, $FC, $B9, $9D, $7F, $B9, $9D, $7F, $F7, $F7, $F7,
$F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7,
$F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $F7, $B9, $9D, $7F,
$B9, $9D, $7F, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2,
$F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2, $F2,
$F2, $F2, $F2, $B9, $9D, $7F, $B9, $9D, $7F, $ED, $ED, $ED, $ED, $ED, $ED,
$ED, $ED, $ED, $ED, $ED, $ED, $ED, $ED, $ED, $ED, $ED, $ED, $ED, $ED, $ED,
$ED, $ED, $ED, $ED, $ED, $ED, $ED, $ED, $ED, $B9, $9D, $7F, $B9, $9D, $7F,
$E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7,
$E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7, $E7,
$B9, $9D, $7F, $B9, $9D, $7F, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2,
$E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2, $E2,
$E2, $E2, $E2, $E2, $E2, $E2, $B9, $9D, $7F, $B9, $9D, $7F, $DD, $DD, $DD,
$DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD,
$DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $DD, $B9, $9D, $7F,
$B9, $9D, $7F, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8,
$D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8, $D8,
$D8, $D8, $D8, $B9, $9D, $7F, $B9, $9D, $7F, $D3, $D3, $D3, $D3, $D3, $D3,
$D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3,
$D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $D3, $B9, $9D, $7F, $B9, $9D, $7F,
$CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE,
$CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE, $CE,
$B9, $9D, $7F, $FF, $FF, $FF, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F,
$B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F, $B9, $9D, $7F,
$B9, $9D, $7F, $B9, $9D, $7F, $FF, $FF, $FF);
constructor TCheck.Create(Owner: TComponent);
begin
inherited Create(Owner);
width := 12;
height := 12;
bm := tbitmap.create;
bm.width := 12;
bm.height := 12;
bm.pixelformat := pf24bit;
hlp := true;
umsch := true;
laden;
end;
destructor TCheck.Destroy;
begin
bm.free;
inherited Destroy;
end;
procedure TCheck.suchen;
var x: integer;
begin
for x := 0 to owner.componentcount - 1 do
if (owner.components[x] is TCheck) and (componentindex <> x)
and (TCheck(owner.components[x]).grp = grp) then
TCheck(owner.components[x]).setunten(false);
end;
procedure TCheck.laden;
var
x: integer;
pb: ^byte;
begin
pb := @bilder;
inc(pb, mal);
if not unten then inc(pb, 432);
for x := 0 to 11 do begin
copymemory(bm.scanline[x], pb, 36);
inc(pb, 36);
end;
end;
procedure TCheck.setunten(b: boolean);
begin
if (b = unten) then exit;
if b and hlp then umsch := false;
unten := b;
if unten and (grp > 0) then suchen;
if (not hlp) and (not mitmaus) then umsch := not unten;
mitmaus := false;
laden;
if not enabled then notenabled;
repaint;
if assigned(change) then change(self);
hlp := false;
end;
procedure TCheck.setchk(b: boolean);
begin
if (not unten) or b or (grp = 0) then setunten(b);
end;
procedure TCheck.maus(b: boolean);
begin
if not b then umsch := not umsch;
if umsch or b then begin
mitmaus := true;
setunten(b);
end;
end;
procedure TCheck.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if button = mbleft then begin
hlp := false;
maus(true);
end;
inherited;
end;
procedure TCheck.MouseUp(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (button = mbleft) and (grp = 0) then maus(false);
inherited;
end;
procedure TCheck.schalten;
begin
if enabled then setunten((gruppe > 0) or (not unten));
end;
procedure TCheck.setbld(t: t3);
begin
if t = bld then exit;
bld := t;
mal := 864 * bld;
laden;
if not enabled then notenabled;
repaint;
end;
procedure TCheck.loaded;
begin
laden;
if not enabled then notenabled;
repaint;
end;
procedure TCheck.notenabled;
var
x, y: integer;
p: PbyteArray;
begin
for y := 3 to 8 do begin
p := bm.scanline[y];
for x := 9 to 26 do begin
if (y > 3) and (y < 8) or (x > 11) and (x < 24) or (bld = 1)
then begin
if (p[x] = 0) then p[x] := 140
else p[x] := 200;
end;
end;
end;
end;
procedure TCheck.SetEnabled(Value: boolean);
begin
inherited;
laden;
if not value then notenabled;
end;
procedure TCheck.setgrp(bt: byte);
begin
if bt = grp then exit;
grp := bt;
if (grp > 0) and unten then suchen;
end;
procedure TCheck.paint;
begin
width := 12;
height := 12;
bm.transparentcolor := clwhite;
bm.transparent := bld = 3;
canvas.draw(0, 0, bm);
end;
procedure Register;
begin
RegisterComponents('DBR', [TCheck]);
end;
end.
|