type
ISkinScrollBar =
interface
['
{FEAD54BF-FFDD-43E9-9388-5F96A8643948}']
function GetHandle: hWnd;
property Handle: hWnd
Read GetHandle;
procedure SetSmallChange(Value: single);
function GetSmallChange: single;
procedure SetLargeChange(Value: single);
function GetLargeChange: single;
procedure SetMinVal(Value: single);
function GetMinVal: single;
procedure SetMaxVal(Value: single);
function GetMaxVal: single;
procedure SetVal(Value: single);
function GetEnabled: BOOL;
procedure SetEnabled(Value: BOOL);
function GetVisible: BOOL;
procedure SetVisible(Value: BOOL);
function GetVal: single;
procedure SetScrollBarCallBack(callback: SCROLLSTATE_CALLBACK);
stdcall;
end;
TSkinScrollBar =
class(TInterfacedPersistent, ISkinScrollBar)
private
FHScrollBar: HWND;
ImgW, ImgH: cardinal;
Style: DWORD;
FLargeChange: single;
FSmallChange: single;
FDownSelectedFrame: Integer;
FUPSelectedFrame: Integer;
FThumbSelectedFrame: Integer;
FMinVal: single;
FMaxVal: single;
FEnabled: BOOL;
FVisible: BOOL;
FVal: single;
FBackgroundHeight: single;
function GetHandle: hWnd;
function GetLargeChange: single;
function GetSmallChange: single;
function GetMinVal: single;
function GetMaxVal: single;
function GetVal: single;
function GetEnabled: BOOL;
function GetVisible: BOOL;
procedure SubClass(WinHandle: HWND);
procedure UnSubClass(WinHandle: HWND);
procedure SetLargeChange(Value: single);
procedure SetSmallChange(Value: single);
procedure SetMinVal(Value: single);
procedure SetMaxVal(Value: single);
procedure SetVal(Value: single);
procedure SetEnabled(Value: BOOL);
procedure SetVisible(Value: BOOL);
procedure CalculateThumbBarTop;
procedure SetThumbBarHeight;
procedure DrawBasicScrollBar;
procedure PaintBar(FramePos: integer = 1);
function ScrollBarProc(WinHandle: HWND; Msg: UINT; wP: WParam;
lP: LParam): LRESULT;
stdcall;
function IsMouseOver(WinHandle: HWND): BOOL;
function CheckValidPosition: BOOL;
procedure ClientWndProc(
var Message: TMessage);
procedure OnMouseDown(WinHandle: HWND; Button: integer; x, y: integer);
procedure onMouseUp(WinHandle: HWND; Button: integer; x, y: integer);
procedure onMouseMove(WinHandle: HWND; Button: integer; x, y: integer);
procedure DrawUPButton(FramePos: integer = 1);
procedure DrawDownButton(FramePos: integer = 1);
procedure SetScrollBarCallBack(callback: SCROLLSTATE_CALLBACK);
stdcall;
procedure RemoveScrollBarCallback;
stdcall;
procedure UpdateLastPosition;
procedure ResizeWindow(WinHandle: HWND);
public
property Handle: HWND
Read FHScrollBar;
constructor Create(hOwner: HWND; PageImg, DownImg, UpImg, ThumpImg: WideString;
x, y, yH, CtrlID, StateMax: integer);
destructor Destroy;
override;
end;