mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-02 05:59:30 +01:00
TurboPower_iPro: Control scrolling by optional parameter instead of new property.
git-svn-id: trunk@52061 -
This commit is contained in:
parent
270d95e905
commit
380411835c
@ -2330,7 +2330,7 @@ type
|
|||||||
function HaveSelection: Boolean;
|
function HaveSelection: Boolean;
|
||||||
function FindFrame(const FrameName: string): TIpHtmlFrame;
|
function FindFrame(const FrameName: string): TIpHtmlFrame;
|
||||||
procedure MakeAnchorVisible(const URL: string);
|
procedure MakeAnchorVisible(const URL: string);
|
||||||
function Scroll(Action: TIpScrollAction): Boolean;
|
function Scroll(Action: TIpScrollAction; ADistance: Integer = 100): Boolean;
|
||||||
procedure Home;
|
procedure Home;
|
||||||
function IsExternal(const URL: string): Boolean;
|
function IsExternal(const URL: string): Boolean;
|
||||||
procedure SetHtml(NewHtml : TIpHtml);
|
procedure SetHtml(NewHtml : TIpHtml);
|
||||||
@ -2471,7 +2471,6 @@ type
|
|||||||
FPrintSettings: TIpHtmlPrintSettings;
|
FPrintSettings: TIpHtmlPrintSettings;
|
||||||
FFactBAParag: Real;
|
FFactBAParag: Real;
|
||||||
FWantTabs: Boolean;
|
FWantTabs: Boolean;
|
||||||
FScrollDist: Integer;
|
|
||||||
procedure SetDataProvider(const AValue: TIpAbstractHtmlDataProvider);
|
procedure SetDataProvider(const AValue: TIpAbstractHtmlDataProvider);
|
||||||
procedure SetFactBAParag(const Value: Real);
|
procedure SetFactBAParag(const Value: Real);
|
||||||
function FactBAParagNotIs1: Boolean;
|
function FactBAParagNotIs1: Boolean;
|
||||||
@ -2558,7 +2557,7 @@ type
|
|||||||
procedure MouseWheelHandler(Var Message: TMessage); Override;
|
procedure MouseWheelHandler(Var Message: TMessage); Override;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
procedure OpenURL(const URL: string);
|
procedure OpenURL(const URL: string);
|
||||||
function Scroll(Action: TIpScrollAction): Boolean;
|
function Scroll(Action: TIpScrollAction; ADistance: Integer = 100): Boolean;
|
||||||
procedure SelectAll;
|
procedure SelectAll;
|
||||||
procedure DeselectAll;
|
procedure DeselectAll;
|
||||||
procedure SetHtml(NewHtml : TIpHtml);
|
procedure SetHtml(NewHtml : TIpHtml);
|
||||||
@ -2587,7 +2586,6 @@ type
|
|||||||
property MarginHeight: Integer read FMarginHeight write FMarginHeight default 10;
|
property MarginHeight: Integer read FMarginHeight write FMarginHeight default 10;
|
||||||
property MarginWidth: Integer read FMarginWidth write FMarginWidth default 10;
|
property MarginWidth: Integer read FMarginWidth write FMarginWidth default 10;
|
||||||
property PrintSettings: TIpHtmlPrintSettings read FPrintSettings write FPrintSettings;
|
property PrintSettings: TIpHtmlPrintSettings read FPrintSettings write FPrintSettings;
|
||||||
property ScrollDist: Integer read FScrollDist write FScrollDist default 100;
|
|
||||||
property ShowHints: Boolean read FShowHints write FShowHints default True;
|
property ShowHints: Boolean read FShowHints write FShowHints default True;
|
||||||
property TextColor: TColor read FTextColor write FTextColor default clBlack;
|
property TextColor: TColor read FTextColor write FTextColor default clBlack;
|
||||||
property Title: string read GetTitle;
|
property Title: string read GetTitle;
|
||||||
@ -2634,7 +2632,6 @@ type
|
|||||||
property PrintSettings;
|
property PrintSettings;
|
||||||
property MarginHeight;
|
property MarginHeight;
|
||||||
property MarginWidth;
|
property MarginWidth;
|
||||||
property ScrollDist;
|
|
||||||
property ShowHints;
|
property ShowHints;
|
||||||
property TabOrder;
|
property TabOrder;
|
||||||
property TabStop;
|
property TabStop;
|
||||||
@ -14610,12 +14607,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{ Returns false if view rect was not changed }
|
{ Returns false if view rect was not changed }
|
||||||
function TIpHtmlFrame.Scroll(Action: TIpScrollAction): Boolean;
|
function TIpHtmlFrame.Scroll(Action: TIpScrollAction;
|
||||||
|
ADistance: Integer = 100): Boolean;
|
||||||
var
|
var
|
||||||
R : TRect;
|
R : TRect;
|
||||||
H, W : Integer;
|
H, W : Integer;
|
||||||
begin
|
begin
|
||||||
Result := false;
|
|
||||||
if FHtml = nil then Exit;
|
if FHtml = nil then Exit;
|
||||||
if HyperPanel = nil then Exit;
|
if HyperPanel = nil then Exit;
|
||||||
R := FHtml.FPageViewRect;
|
R := FHtml.FPageViewRect;
|
||||||
@ -14624,19 +14621,16 @@ begin
|
|||||||
case Action of
|
case Action of
|
||||||
hsaHome :
|
hsaHome :
|
||||||
begin
|
begin
|
||||||
Result := FHtml.FPageViewRect.Top > 0;
|
|
||||||
R.Top := 0;
|
R.Top := 0;
|
||||||
R.Bottom := R.Top + H;
|
R.Bottom := R.Top + H;
|
||||||
end;
|
end;
|
||||||
hsaEnd :
|
hsaEnd :
|
||||||
begin
|
begin
|
||||||
Result := FHtml.FPageViewRect.Bottom < FHtml.FPageRect.Bottom;
|
|
||||||
R.Bottom := FHtml.FPageRect.Bottom;
|
R.Bottom := FHtml.FPageRect.Bottom;
|
||||||
R.Top := R.Bottom - H;
|
R.Top := R.Bottom - H;
|
||||||
end;
|
end;
|
||||||
hsaPgUp :
|
hsaPgUp :
|
||||||
begin
|
begin
|
||||||
Result := FHtml.FPageViewRect.Top > 0;
|
|
||||||
OffsetRect(R, 0, -H);
|
OffsetRect(R, 0, -H);
|
||||||
if R.Top < 0 then begin
|
if R.Top < 0 then begin
|
||||||
R.Top := 0;
|
R.Top := 0;
|
||||||
@ -14645,7 +14639,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
hsaPgDn :
|
hsaPgDn :
|
||||||
begin
|
begin
|
||||||
Result := FHtml.FPageViewRect.Bottom < FHtml.FPageRect.Bottom;
|
|
||||||
OffsetRect(R, 0, H);
|
OffsetRect(R, 0, H);
|
||||||
if R.Bottom > FHtml.FPageRect.Bottom then begin
|
if R.Bottom > FHtml.FPageRect.Bottom then begin
|
||||||
R.Bottom := FHtml.FPageRect.Bottom;
|
R.Bottom := FHtml.FPageRect.Bottom;
|
||||||
@ -14655,7 +14648,7 @@ begin
|
|||||||
hsaLeft :
|
hsaLeft :
|
||||||
begin
|
begin
|
||||||
Result := FHtml.FPageViewRect.Left > 0;
|
Result := FHtml.FPageViewRect.Left > 0;
|
||||||
OffsetRect(R, -FViewer.ScrollDist, 0);
|
OffsetRect(R, -ADistance, 0);
|
||||||
if R.Left < 0 then begin
|
if R.Left < 0 then begin
|
||||||
R.Left := 0;
|
R.Left := 0;
|
||||||
R.Right := R.Left + W;
|
R.Right := R.Left + W;
|
||||||
@ -14664,7 +14657,7 @@ begin
|
|||||||
hsaRight :
|
hsaRight :
|
||||||
begin
|
begin
|
||||||
Result := FHtml.FPageViewRect.Right < FHtml.FPageRect.Right;
|
Result := FHtml.FPageViewRect.Right < FHtml.FPageRect.Right;
|
||||||
OffsetRect(R, FViewer.ScrollDist, 0);
|
OffsetRect(R, ADistance, 0);
|
||||||
if R.Right > FHtml.FPageRect.Right then begin
|
if R.Right > FHtml.FPageRect.Right then begin
|
||||||
R.Bottom := FHtml.FPageRect.Right;
|
R.Bottom := FHtml.FPageRect.Right;
|
||||||
R.Left := R.Right - W;
|
R.Left := R.Right - W;
|
||||||
@ -14673,7 +14666,7 @@ begin
|
|||||||
hsaUp :
|
hsaUp :
|
||||||
begin
|
begin
|
||||||
Result := FHtml.FPageViewRect.Top > 0;
|
Result := FHtml.FPageViewRect.Top > 0;
|
||||||
OffsetRect(R, 0, -FViewer.ScrollDist);
|
OffsetRect(R, 0, -ADistance);
|
||||||
if R.Top < 0 then begin
|
if R.Top < 0 then begin
|
||||||
R.Top := 0;
|
R.Top := 0;
|
||||||
R.Bottom := R.Top + H;
|
R.Bottom := R.Top + H;
|
||||||
@ -14682,7 +14675,7 @@ begin
|
|||||||
hsaDown :
|
hsaDown :
|
||||||
begin
|
begin
|
||||||
Result := FHtml.FPageViewRect.Bottom < FHtml.FPageRect.Bottom;
|
Result := FHtml.FPageViewRect.Bottom < FHtml.FPageRect.Bottom;
|
||||||
OffsetRect(R, 0, FViewer.ScrollDist);
|
OffsetRect(R, 0, ADistance);
|
||||||
if R.Bottom > FHtml.FPageRect.Bottom then begin
|
if R.Bottom > FHtml.FPageRect.Bottom then begin
|
||||||
R.Bottom := FHtml.FPageRect.Bottom;
|
R.Bottom := FHtml.FPageRect.Bottom;
|
||||||
R.Top := R.Bottom - H;
|
R.Top := R.Bottom - H;
|
||||||
@ -15024,7 +15017,6 @@ begin
|
|||||||
FPrintSettings := TIpHtmlPrintSettings.Create;
|
FPrintSettings := TIpHtmlPrintSettings.Create;
|
||||||
FFactBAParag := 1;
|
FFactBAParag := 1;
|
||||||
FWantTabs := True;
|
FWantTabs := True;
|
||||||
FScrollDist := 100;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TIpHtmlCustomPanel.Destroy;
|
destructor TIpHtmlCustomPanel.Destroy;
|
||||||
@ -15463,11 +15455,11 @@ begin
|
|||||||
Result := Size(0, 0);
|
Result := Size(0, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TIpHtmlCustomPanel.Scroll(Action: TIpScrollAction): Boolean;
|
function TIpHtmlCustomPanel.Scroll(Action: TIpScrollAction;
|
||||||
|
ADistance: Integer = 100): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := true;
|
|
||||||
if FMasterFrame <> nil then
|
if FMasterFrame <> nil then
|
||||||
Result := FMasterFrame.Scroll(Action);
|
Result := FMasterFrame.Scroll(Action, ADistance);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TIpHtmlCustomPanel.WMGetDlgCode(var Msg: TMessage);
|
procedure TIpHtmlCustomPanel.WMGetDlgCode(var Msg: TMessage);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user