Writing of card controls (medium)

zhaozj2021-02-16  39

Function CDTINIT (VAR Cardwidth): Bool; {$ IFDEF

Win32} stdcall;

{$ ENDIF WIN32}

Function CDTDRAW (ADC: HDC; X, Y: Tcoordinate; Card: TcardId;

Cardinal; color: tcolorref): bool;

{$ IFDEF WIN32} stdcall; {$ ENDIF

Win32}

Function CDTDRAWEXT (ADC: HDC; X, Y, Width, Height: Tcoordinate; Card: TcardId;

Cardinal; color: tcolorref): bool;

{$ IFDEF WIN32} stdcall; {$ ENDIF

Win32}

Procedure cdtterm;

{$ IFDEF WIN32} stdcall;

{$ ENDIF WIN32}

Function CDTANIMATE (ADC: HDC; Card: TcardId; x, y: tcoordinate;

AnimateIndex: Word: bool;

{$ IFDEF WIN32} stdcall;

{$ ENDIF WIN32}

Type

TzfPlayCard = Class (TGRAPHICCONTROL)

Private

FCardId: tcardid;

FDRAGGING: BOOLEAN;

FDRAGMOVE: BOOLEAN;

FX, fy: integer;

FcardMode: tcardmode;

FGLYPH: TBITMAP;

Procedure WmeraseBkGnd (Var Message: TwmeseBkgnd); Message WM_ERASEBKGND;

Procedure redraw;

Procedure SetCardId (Const Value: TcardId);

Procedure setCardMode (Const value: tcardmode);

Procedure setglyph (const value: tbitmap);

protected

proca;

public

Constructor Create (Aowner: Tcomponent); OVERRIDE;

DESTRUCTOR DESTROY; OVERRIDE;

Published

Property Cardmode: TcardMode Read FcardMode Write SetCardMode;

Property CardID: Tcardid Read Fcardid Write SetCardId Default 1;

Property Glyph: Tbitmap Read Fglyph Write setGlyph;

Property enabled;

Property visible;

Property Onclick;

Property OnDBLClick;

Property OnMouseDown;

Property OnMouseMove;

Property OnMouseup;

END;

PROCEDURE register;

IMPLEMENTATION

Const

{$ IFDEF WIN32}

SCARDSDLL = 'cards.dll';

{$ Else}

Scardsdll = 'cards';

{$ ENDIF WIN32}

{$ IFDEF WIN32}

Function Cdtinit; External Scardsdll Name 'CDTINIT'

Function CDTDRAW; External Scardsdll Name 'CDTDRAW'; Function CdtdrawExt; External Scardsdll Name 'CDTDRAWEXT';

Procedure cdtterm; external scardsdll name 'cdTerm';

Function CDTANIMATE; External Scardsdll Name 'CDTANIMATE';

{$ Else}

Function CDTINIT; External Scardsdll Index 1;

Function CDTDRAW; External Scardsdll INDEX 2;

Function CDTDRAWEXT; EXTERNAL SCARDSDLL INDEX 3;

Procedure CDTTERM; External Scardsdll Index 4;

Function CDTANIMATE; External Scardsdll INDEX 5;

{$ ENDIF WIN32}

PROCEDURE register;

Begin

RegisterComponents ('Standard', [TzfPlayCard]);

END;

{TzfPlayCard}

{Procedure TzfPlayCard.click;

Begin

inherited;

END;

}

After the end, please see the next chapter.

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

New Post(0)