function THIScrollBar._Message;
begin
Result := false;
case Msg.message of
WM_HSCROLL,WM_VSCROLL:
if dword(Msg.lParam) = control.Handle then
begin
GetPos;
case LOWORD(Msg.wParam) of
SB_BOTTOM,SB_LINERIGHT: inc(si.nPos);
SB_LINELEFT,SB_TOP: dec(si.nPos);
SB_PAGELEFT: dec(si.nPos, _prop_Page);
SB_PAGERIGHT: inc(si.nPos, _prop_Page);
SB_THUMBPOSITION,
SB_THUMBTRACK: si.nPos := si.nTrackPos;
SB_ENDSCROLL:
begin
if _prop_ScrollMode = 1 then
_hi_OnEvent(_event_onPosition,si.nPos); Здесь событие происходит только при ScrollMode=Up
_hi_OnEvent(_event_onEndScroll);
end;
end;
Update;
if _prop_ScrollMode = 0 then
_hi_OnEvent(_event_onPosition,GetPos); Здесь событие происходит только при ScrollMode=Move
result := true;
Rslt := 0;
end;
end;
Result := Result or _hi_OnMessage(OldMes,Msg,Rslt);
end;
begin
Result := false;
case Msg.message of
WM_HSCROLL,WM_VSCROLL:
if dword(Msg.lParam) = control.Handle then
begin
GetPos;
case LOWORD(Msg.wParam) of
SB_BOTTOM,SB_LINERIGHT: inc(si.nPos);
SB_LINELEFT,SB_TOP: dec(si.nPos);
SB_PAGELEFT: dec(si.nPos, _prop_Page);
SB_PAGERIGHT: inc(si.nPos, _prop_Page);
SB_THUMBPOSITION,
SB_THUMBTRACK: si.nPos := si.nTrackPos;
SB_ENDSCROLL:
begin
if _prop_ScrollMode = 1 then
_hi_OnEvent(_event_onPosition,si.nPos); Здесь событие происходит только при ScrollMode=Up
_hi_OnEvent(_event_onEndScroll);
end;
end;
Update;
if _prop_ScrollMode = 0 then
_hi_OnEvent(_event_onPosition,GetPos); Здесь событие происходит только при ScrollMode=Move
result := true;
Rslt := 0;
end;
end;
Result := Result or _hi_OnMessage(OldMes,Msg,Rslt);
end;