mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 11:19:26 +02:00
LCL:
* SetScrollInfo - return new position * SetScrollPos - return previous position git-svn-id: trunk@17173 -
This commit is contained in:
parent
3c446ce0da
commit
c5e876817b
@ -25,6 +25,7 @@ const
|
||||
procedure TControlScrollBar.SetPosition(const Value: Integer);
|
||||
var
|
||||
OldPosition: Integer;
|
||||
ScrollInfo: TScrollInfo;
|
||||
begin
|
||||
if Value < 0 then
|
||||
begin
|
||||
@ -80,7 +81,12 @@ begin
|
||||
DebugLn(['TControlScrollBar.SetPosition FPosition=',FPosition]);
|
||||
{$ENDIF}
|
||||
// send position to interface and store it back to FPosition (this way LCL will have actual position value)
|
||||
FPosition := SetScrollPos(ControlHandle, IntfBarKind[Kind], FPosition, Visible);
|
||||
FillChar(ScrollInfo,SizeOf(ScrollInfo), 0);
|
||||
ScrollInfo.cbSize := SizeOf(ScrollInfo);
|
||||
ScrollInfo.fMask := SIF_POS;
|
||||
ScrollInfo.nPos := FPosition;
|
||||
|
||||
FPosition := SetScrollInfo(ControlHandle, IntfBarKind[Kind], ScrollInfo, FVisible);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -1334,9 +1334,11 @@ function SetScrollPos(Handle: HWND; nBar, nPos: Integer; bRedraw: Boolean): Inte
|
||||
var
|
||||
Info: TScrollInfo;
|
||||
begin
|
||||
Result := GetScrollPos(Handle, nBar);
|
||||
|
||||
Info.fMask := SIF_POS;
|
||||
Info.nPos := nPos;
|
||||
Result := SetScrollInfo(Handle, nBar, Info, bRedraw);
|
||||
SetScrollInfo(Handle, nBar, Info, bRedraw);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -8831,7 +8831,7 @@ end;
|
||||
{------------------------------------------------------------------------------
|
||||
Function: SetScrollInfo
|
||||
Params: none
|
||||
Returns: The old position value
|
||||
Returns: The new position value
|
||||
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
@ -8979,8 +8979,6 @@ begin
|
||||
|
||||
if Adjustment = nil then exit;
|
||||
|
||||
Result := Round(Adjustment^.value);
|
||||
|
||||
if (ScrollInfo.fMask and SIF_POS) <> 0
|
||||
then begin
|
||||
Adjustment^.value := ScrollInfo.nPos;
|
||||
@ -8996,6 +8994,8 @@ begin
|
||||
Adjustment^.page_increment := (ScrollInfo.nPage div 6)+1;
|
||||
end;
|
||||
|
||||
Result := Round(Adjustment^.value);
|
||||
|
||||
{DebugLn('');
|
||||
DebugLn('[TGtkWidgetSet.SetScrollInfo] Result=',Result,
|
||||
' Lower=',RoundToInt(Lower),
|
||||
@ -9022,7 +9022,7 @@ begin
|
||||
and GtkWidgetIsA(PGtkWidget(Scroll),gtk_widget_get_type) then
|
||||
gtk_widget_show(PGTKWidget(Scroll))
|
||||
else
|
||||
gtk_widget_hide(PGTKWidget(Scroll))
|
||||
gtk_widget_hide(PGTKWidget(Scroll));
|
||||
end;
|
||||
|
||||
(*
|
||||
|
@ -4396,7 +4396,7 @@ end;
|
||||
{------------------------------------------------------------------------------
|
||||
Function: SetScrollInfo
|
||||
Params: none
|
||||
Returns: The old position value
|
||||
Returns: The new position value
|
||||
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
|
@ -2938,7 +2938,7 @@ end;
|
||||
SBStyle - scroll bar flag
|
||||
ScrollInfo - record with scroll parameters
|
||||
BRedraw - is the scroll bar is redrawn?
|
||||
Returns: The old position value
|
||||
Returns: The new position value
|
||||
|
||||
Sets the parameters of a scroll bar.
|
||||
------------------------------------------------------------------------------}
|
||||
|
@ -2401,7 +2401,7 @@ end;
|
||||
SBStyle - scroll bar flag
|
||||
ScrollInfo - record with scroll parameters
|
||||
BRedraw - is the scroll bar is redrawn?
|
||||
Returns: The old position value
|
||||
Returns: The new position value
|
||||
|
||||
Sets the parameters of a scroll bar.
|
||||
------------------------------------------------------------------------------}
|
||||
|
Loading…
Reference in New Issue
Block a user