Written card control (below)

zhaozj2021-02-16  39

Constructor TzfPlayCard.create (Aowner: Tcomponent);

VAR

X, Y: integer;

Begin

Inherited Create (Aowner);

FCardID: = 1;

Cdtinit (x, y);

SetBounds (0, 0, x, y);

ControlStyle: = [CSClicKevents, CSDoubleClicks];

Enabled: = TRUE;

Canvas.brush.style: = bsclear;

FGLYPH: = Tbitmap.create;

END;

Destructor TzfPlayCard.destroy;

Begin

Fglyph.free;

inherited;

END;

Procedure tzfPlayCard.paint;

Begin

inherited;

Redraw;

END;

Procedure tzfPlayCard.Redraw;

Begin

CDTDRAW (Canvas.Handle, 0, 0, FcardId, ORD (FcardMode), CLWHITE

IF fglyph <> nil kil

Begin

Canvas.stretchdraw (RECT (12, 11, 59, 85), FGLYPH);

END;

END;

Procedure TzfPlayCard.SetCardId (Const Value: TcardId);

Begin

FCardId: = value;

Redraw;

END;

Procedure tzfPlayCard.SetCardMode (const value: tcardmode);

Begin

FcardMode: = value;

Redraw;

END;

Procedure tzfPlayCard.SETGLYPH (Const value: Tbitmap);

Begin

IF value <> fglyph then

Begin

Fglyph.assign (value);

INVALIDATE;

END;

END;

Procedure tzfPlayCard.wmeraseBkgnd (var message: twmesebkgnd);

Begin

Message.Result: = 1;

END;

End.

转载请注明原文地址:https://www.9cbs.com/read-26234.html

New Post(0)