Ignore:
Timestamp:
Jan 19, 2017, 8:40:22 PM (8 years ago)
Author:
chronos
Message:
  • Modified: Simplified PVSB.TPVScrollBar class and fixed wrong scrolling under Windows.
  • Modified: Enabled Windows XP manifest to have themed scrollbars.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Help.pas

    r73 r89  
    205205  SearchResult := THyperText.Create;
    206206  SearchResult.OwnsObjects := True;
    207   sb := TPVScrollbar.Create;
    208   sb.Setup(36, 9, 11, Self);
     207  sb := TPVScrollbar.Create(Self);
     208  sb.SetBorderSpacing(36, 9, 11);
    209209  sb.OnUpdate := ScrollBarUpdate;
    210210
     
    268268procedure THelpDlg.OnScroll(var m: TMessage);
    269269begin
     270  { TODO: Handled by MouseWheel event
    270271  if sb.Process(m) then begin
    271272    Sel := -1;
    272273    SmartUpdateContent(true)
    273   end
     274  end;
     275  }
    274276end;
    275277
     
    294296  s: string;
    295297begin
    296   s := MainText[sb.si.npos + i];
     298  s := MainText[sb.Position + i];
    297299  if s = '' then
    298300    exit;
     
    304306    y := y + WideFrame
    305307  end;
    306   if THelpLineInfo(MainText.Objects[sb.si.npos + i]).Format
     308  if THelpLineInfo(MainText.Objects[sb.Position + i]).Format
    307309    in [pkCaption, pkBigTer, pkRightIcon, pkBigFeature] then
    308310  begin
     
    320322    ca.Font.Assign(UniFont[ftNormal]);
    321323  end
    322   else if THelpLineInfo(MainText.Objects[sb.si.npos + i]).Format = pkSection
     324  else if THelpLineInfo(MainText.Objects[sb.Position + i]).Format = pkSection
    323325  then
    324326  begin
     
    339341        TextSize.cy := WideFrame + InnerHeight - y;
    340342      FillSeamless(ca, x, y, TextSize.cx, TextSize.cy, -SideFrame,
    341         sb.si.npos * 24 - WideFrame, Paper);
     343        sb.Position * 24 - WideFrame, Paper);
    342344    end;
    343345    BiColorTextOut(ca, TextColor, $7F007F, x, y, s);
     
    441443  CaptionColor := Colors.Canvas.Pixels[clkMisc, cliPaperCaption];
    442444  FillSeamless(OffScreen.Canvas, 0, 0, InnerWidth, InnerHeight, 0,
    443     sb.si.npos * 24, Paper);
     445    sb.Position * 24, Paper);
    444446  with OffScreen.Canvas do
    445447  begin
    446448    Font.Assign(UniFont[ftNormal]);
    447     for i := -sb.si.npos to InnerHeight div 24 do
    448       if sb.si.npos + i < MainText.Count then
     449    for i := -sb.Position to InnerHeight div 24 do
     450      if sb.Position + i < MainText.Count then
    449451      begin
    450         HelpLineInfo := THelpLineInfo(MainText.Objects[sb.si.npos + i]);
     452        HelpLineInfo := THelpLineInfo(MainText.Objects[sb.Position + i]);
    451453        if HelpLineInfo.Format = pkExternal then
    452454        begin
     
    459461      end;
    460462    for i := -2 to InnerHeight div 24 do
    461       if (sb.si.npos + i >= 0) and (sb.si.npos + i < MainText.Count) then
     463      if (sb.Position + i >= 0) and (sb.Position + i < MainText.Count) then
    462464      begin
    463         HelpLineInfo := THelpLineInfo(MainText.Objects[sb.si.npos + i]);
     465        HelpLineInfo := THelpLineInfo(MainText.Objects[sb.Position + i]);
    464466        if HelpLineInfo.Link <> 0 then
    465467        begin
     
    18701872      HistKind[nHist - 1] := Kind;
    18711873      HistNo[nHist - 1] := no;
    1872       HistPos[nHist - 1] := sb.si.npos;
     1874      HistPos[nHist - 1] := sb.Position;
    18731875      HistSearchContent[nHist - 1] := SearchContent
    18741876    end
     
    18881890begin
    18891891  y := y - WideFrame;
    1890   i0 := sb.si.npos;
     1892  i0 := sb.Position;
    18911893  Sel0 := Sel;
    18921894  if (x >= SideFrame) and (x < SideFrame + InnerWidth) and (y >= 0) and
     
    19111913begin
    19121914  if Sel >= 0 then
    1913     with THelpLineInfo(MainText.Objects[Sel + sb.si.npos]) do
     1915    with THelpLineInfo(MainText.Objects[Sel + sb.Position]) do
    19141916      if Link shr 8 and $3F = hkInternet then
    19151917        case Link and $FF of
Note: See TracChangeset for help on using the changeset viewer.