Ignore:
Timestamp:
Jan 19, 2017, 8:40:22 PM (7 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/Select.pas

    r71 r89  
    102102  inherited;
    103103  Canvas.Font.Assign(UniFont[ftNormal]);
    104   sb := TPVScrollbar.Create;
    105   sb.Setup(36, 10, 36, Self);
     104  sb := TPVScrollbar.Create(Self);
     105  sb.SetBorderSpacing(36, 10, 36);
    106106  sb.OnUpdate := ScrollBarUpdate;
    107107  InitButtons();
     
    135135procedure TListDlg.OnScroll(var m: TMessage);
    136136begin
     137  { TODO: Handled by MouseWheel event
    137138  if sb.Process(m) then  begin
    138139    Sel := -2;
    139140    SmartUpdateContent(true);
    140141  end;
     142  }
    141143end;
    142144
     
    234236  CanGrow: boolean;
    235237begin
    236   lix := code[Layer, sb.si.npos + l];
     238  lix := code[Layer, sb.Position + l];
    237239  y0 := 2 + (l + 1) * LineDistance;
    238   if sb.si.npos + l >= FirstShrinkedLine[Layer] then
    239     ofs := (sb.si.npos + l - FirstShrinkedLine[Layer]) and 1 * 33
     240  if sb.Position + l >= FirstShrinkedLine[Layer] then
     241    ofs := (sb.Position + l - FirstShrinkedLine[Layer]) and 1 * 33
    240242  else { if FirstShrinkedLine[Layer]<Lines[Layer] then }
    241243    ofs := 33;
     
    468470          begin
    469471            s := Tribe[mox.Owner].ModelName[mox.mix];
    470             if (Kind = kAllEModels) and (code[1, sb.si.npos + l] = 0) then
     472            if (Kind = kAllEModels) and (code[1, sb.Position + l] = 0) then
    471473              s := Format(Tribe[mox.Owner].TPhrase('OWNED'), [s]);
    472474          end
     
    753755      end;
    754756    for i := -1 to DispLines do
    755       if (i + sb.si.npos >= 0) and (i + sb.si.npos < Lines[Layer]) then
     757      if (i + sb.Position >= 0) and (i + sb.Position < Lines[Layer]) then
    756758        Self.line(offscreen.Canvas, i, true, false)
    757759  end;
     
    766768begin
    767769  y := y - TitleHeight;
    768   i0 := sb.si.npos;
     770  i0 := sb.Position;
    769771  Sel0 := Sel;
    770772  if (x >= SideFrame) and (x < SideFrame + InnerWidth) and (y >= 0) and
     
    891893  lix: integer;
    892894begin
    893   if sb.si.npos + Sel >= 0 then
    894     lix := code[Layer, sb.si.npos + Sel];
     895  if sb.Position + Sel >= 0 then
     896    lix := code[Layer, sb.Position + Sel];
    895897  if Kind in [kScience, kCities, kCityEvents, kModels, kEModels, kAllEModels]
    896898  then
     
    920922        kEModels:
    921923          UnitStatDlg.ShowNewContent_EnemyModel(FWindowMode or wmPersistent,
    922             code[1, sb.si.npos + Sel]);
     924            code[1, sb.Position + Sel]);
    923925        kAllEModels, kChooseEModel:
    924926          if lix <> mixAll then
     
    15991601  CaptionLeft := ToggleBtn.Left + ToggleBtn.Width;
    16001602  CaptionRight := CloseBtn.Left;
     1603  { TODO:
    16011604  SetWindowPos(sb.ScrollBar.Handle, 0, SideFrame + InnerWidth - GetSystemMetrics(SM_CXVSCROLL),
    16021605    TitleHeight, GetSystemMetrics(SM_CXVSCROLL), LineDistance * DispLines + 48,
    16031606    SWP_NOZORDER or SWP_NOREDRAW);
     1607  }
    16041608
    16051609  if WindowMode = wmModal then
Note: See TracChangeset for help on using the changeset viewer.