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

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

enum TVIState
{
  viNormal, viHover, viDown
};

class PACKAGE TVmxCustomScrollbar : public TGraphicControl
{
private:
protected:
        Graphics::TBitmap *FUN, *FUO, *FUP, *FDN, *FDP, *FDO, *FGN, *FGP, *FGO, *FB, *FGripper;
        int FMax, FPos;
        TVIState US, GS, DS;
        int FBH;
        void __fastcall SetUN (Graphics::TBitmap *New);
        void __fastcall SetUP (Graphics::TBitmap *New);
        void __fastcall SetUO (Graphics::TBitmap *New);
        void __fastcall SetDN (Graphics::TBitmap *New);
        void __fastcall SetDP (Graphics::TBitmap *New);
        void __fastcall SetDO (Graphics::TBitmap *New);
        void __fastcall SetGN (Graphics::TBitmap *New);
        void __fastcall SetGP (Graphics::TBitmap *New);
        void __fastcall SetGO (Graphics::TBitmap *New);
        void __fastcall SetB (Graphics::TBitmap *New);
        void __fastcall SetGripper (Graphics::TBitmap *New);
        void __fastcall SetPos (int New);
        void __fastcall SetMax (int New);
        void __fastcall SetMaxGrippers (int New);
        void __fastcall Paint (void);
        DYNAMIC void __fastcall MouseMove (TShiftState Shift, int X, int Y);
        DYNAMIC void __fastcall MouseDown (TMouseButton Button, TShiftState Shift, int X, int Y);
        DYNAMIC void __fastcall MouseUp (TMouseButton Button, TShiftState Shift, int X, int Y);
        void __fastcall CMMouseLeave (TMessage &Msg);
        TNotifyEvent FOnChangePos;
        int Ct, tmp, FMaxGrippers;
public:
BEGIN_MESSAGE_MAP
        VCL_MESSAGE_HANDLER(CM_MOUSELEAVE,TMessage,CMMouseLeave)
END_MESSAGE_MAP(TGraphicControl)
        __fastcall TVmxCustomScrollbar(TComponent* Owner);
__published: // shaft thumb
        __property Graphics::TBitmap *Shaft = {read = FB, write = SetB};
        __property Graphics::TBitmap *UpNormal = {read = FUN, write = SetUN};
        __property Graphics::TBitmap *UpHover = {read = FUO, write = SetUO};
        __property Graphics::TBitmap *UpDown = {read = FUP, write = SetUP};
        __property Graphics::TBitmap *DownNormal = {read = FDN, write = SetDN};
        __property Graphics::TBitmap *DownHover = {read = FDO, write = SetDO};
        __property Graphics::TBitmap *DownDown = {read = FDP, write = SetDP};
        __property Graphics::TBitmap *ThumbNormal = {read = FGN, write = SetGN};
        __property Graphics::TBitmap *ThumbHover = {read = FGO, write = SetGO};
        __property Graphics::TBitmap *ThumbDown = {read = FGP, write = SetGP};
        __property Graphics::TBitmap *Gripper = {read = FGripper, write = SetGripper};
        __property int Max = {read = FMax, write = SetMax};
        __property int Pos = {read = FPos, write = SetPos};
        __property int BorderHeight = {read = FBH, write = FBH};
        __property int MaxGrippers = {read = FMaxGrippers, write = SetMaxGrippers};
        __property TNotifyEvent OnChangePos = {read = FOnChangePos, write = FOnChangePos};
        __property Align;
        __property Anchors;
        __property Visible;
};
//---------------------------------------------------------------------------
#endif
