//---------------------------------------------------------------------------

#ifndef VmxCustomCheckH
#define VmxCustomCheckH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Classes.hpp>
#include <Controls.hpp>
//---------------------------------------------------------------------------

enum TVCState
{
  vcNormal, vcHover, vcDown
};

class PACKAGE TVmxCustomCheck : public TGraphicControl
{
private:
protected:
        Graphics::TBitmap *NCN, *NCO, *NCD, *CN, *CO, *CD;
        bool FChecked;
        AnsiString FCaption;
        TVCState State;
        TNotifyEvent FOnChange;
        void __fastcall SetNCN (Graphics::TBitmap *New);
        void __fastcall SetNCO (Graphics::TBitmap *New);
        void __fastcall SetNCD (Graphics::TBitmap *New);
        void __fastcall SetCN (Graphics::TBitmap *New);
        void __fastcall SetCO (Graphics::TBitmap *New);
        void __fastcall SetCD (Graphics::TBitmap *New);
        void __fastcall SetCaption (AnsiString New);
        void __fastcall SetChecked (bool New);
        void __fastcall Paint (void);
        void __fastcall CMMouseEnter (TMessage &Msg);
        void __fastcall CMMouseLeave (TMessage &Msg);
        DYNAMIC void __fastcall MouseDown (TMouseButton Button, TShiftState Shift, int X, int Y);
        DYNAMIC void __fastcall MouseUp (TMouseButton Button, TShiftState Shift, int X, int Y);
public:
        __fastcall TVmxCustomCheck(TComponent* Owner);
BEGIN_MESSAGE_MAP
        VCL_MESSAGE_HANDLER(CM_MOUSEENTER,TMessage,CMMouseEnter)
        VCL_MESSAGE_HANDLER(CM_MOUSELEAVE,TMessage,CMMouseLeave)
END_MESSAGE_MAP(TGraphicControl)
__published:
        __property Graphics::TBitmap *NCNormal = {read = NCN, write = SetNCN};
        __property Graphics::TBitmap *NCHover = {read = NCO, write = SetNCO};
        __property Graphics::TBitmap *NCDown = {read = NCD, write = SetNCD};
        __property Graphics::TBitmap *CNormal = {read = CN, write = SetCN};
        __property Graphics::TBitmap *CHover = {read = CO, write = SetCO};
        __property Graphics::TBitmap *CDown = {read = CD, write = SetCD};
        __property bool Checked = {read = FChecked, write = SetChecked};
        __property AnsiString Caption = {read = FCaption, write = SetCaption};
        __property Font;
        __property ParentFont;
        __property Align;
        __property Anchors;
        __property TNotifyEvent OnChange = {read = FOnChange, write = FOnChange};
        __property Visible;
};
//---------------------------------------------------------------------------
#endif
