Changeset 69 for trunk/LocalPlayer/Select.pas
- Timestamp:
- Jan 14, 2017, 10:33:42 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Select.pas
r50 r69 18 18 kChooseETech, kChooseModel, kChooseEModel, kChooseCity, kChooseECity, 19 19 kStealTech, kGov, kMission); 20 21 { TListDlg } 20 22 21 23 TListDlg = class(TFramedDlg) … … 26 28 ToggleBtn: TButtonB; 27 29 Popup: TPopupMenu; 30 procedure FormMouseWheel(Sender: TObject; Shift: TShiftState; 31 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); 28 32 procedure PaintBox1MouseMove(Sender: TObject; Shift: TShiftState; 29 33 x, y: integer); … … 40 44 procedure PlayerClick(Sender: TObject); 41 45 procedure FormDestroy(Sender: TObject); 42 46 private 47 Kind: TListKind; 48 LineDistance, MaxLines, cixProject, pView, Sel, DispLines, Layer, nColumn, 49 TechNameSpace, ScienceNation: integer; 50 sb: TPVScrollbar; 51 Lines, FirstShrinkedLine: array [0 .. MaxLayer - 1] of integer; 52 code: array [0 .. MaxLayer - 1, 0 .. 4095] of integer; 53 Column: array [0 .. nPl - 1] of integer; 54 Closable, MultiPage: boolean; 55 ScienceNationDot: TBitmap; 56 procedure ScrollBarUpdate(Sender: TObject); 57 procedure InitLines; 58 procedure line(ca: TCanvas; l: integer; NonText, lit: boolean); 59 function RenameCity(cix: integer): boolean; 60 function RenameModel(mix: integer): boolean; 61 procedure OnScroll(var m: TMessage); message WM_VSCROLL; 62 procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE; 43 63 public 44 64 result: integer; … … 53 73 procedure AddCity; 54 74 procedure RemoveUnit; 55 56 private57 Kind: TListKind;58 LineDistance, MaxLines, cixProject, pView, Sel, DispLines, Layer, nColumn,59 TechNameSpace, ScienceNation: integer;60 sb: TPVScrollbar;61 Lines, FirstShrinkedLine: array [0 .. MaxLayer - 1] of integer;62 code: array [0 .. MaxLayer - 1, 0 .. 4095] of integer;63 Column: array [0 .. nPl - 1] of integer;64 Closable, MultiPage: boolean;65 ScienceNationDot: TBitmap;66 procedure InitLines;67 procedure line(ca: TCanvas; l: integer; NonText, lit: boolean);68 function RenameCity(cix: integer): boolean;69 function RenameModel(mix: integer): boolean;70 procedure OnScroll(var m: TMessage); message WM_VSCROLL;71 procedure OnMouseWheel(var m: TMessage); message LM_MOUSEWHEEL;72 procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;73 75 end; 74 76 … … 101 103 Canvas.Font.Assign(UniFont[ftNormal]); 102 104 sb := TPVScrollbar.Create; 103 CreatePVSB(sb, Handle, 2, 361, 2 + 422); 105 sb.Setup(36, 10, 36, Self); 106 sb.OnUpdate := ScrollBarUpdate; 104 107 InitButtons(); 105 108 Kind := kMission; … … 132 135 procedure TListDlg.OnScroll(var m: TMessage); 133 136 begin 134 if ProcessPVSB(sb, m) then 135 begin 137 if sb.Process(m) then begin 136 138 Sel := -2; 137 139 SmartUpdateContent(true); 138 end;139 end;140 141 procedure TListDlg.OnMouseWheel(var m: TMessage);142 begin143 if ProcessMouseWheel(sb, m) then144 begin145 Sel := -2;146 SmartUpdateContent(true);147 PaintBox1MouseMove(nil, [], m.lParam and $FFFF - Left,148 m.lParam shr 16 - Top);149 140 end; 150 141 end; … … 834 825 end; 835 826 827 procedure TListDlg.FormMouseWheel(Sender: TObject; Shift: TShiftState; 828 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); 829 begin 830 if sb.ProcessMouseWheel(WheelDelta) then begin 831 PaintBox1MouseMove(nil, [], MousePos.X - Left, 832 MousePos.Y - Top); 833 end; 834 end; 835 836 836 function TListDlg.RenameCity(cix: integer): boolean; 837 837 var … … 1599 1599 CaptionLeft := ToggleBtn.Left + ToggleBtn.Width; 1600 1600 CaptionRight := CloseBtn.Left; 1601 SetWindowPos(sb. h, 0, SideFrame + InnerWidth - GetSystemMetrics(SM_CXVSCROLL),1601 SetWindowPos(sb.ScrollBar.Handle, 0, SideFrame + InnerWidth - GetSystemMetrics(SM_CXVSCROLL), 1602 1602 TitleHeight, GetSystemMetrics(SM_CXVSCROLL), LineDistance * DispLines + 48, 1603 1603 SWP_NOZORDER or SWP_NOREDRAW); … … 1633 1633 Sel := -2; 1634 1634 ScienceNation := -1; 1635 InitPVSB(sb,Lines[Layer] - 1, DispLines);1635 sb.Init(Lines[Layer] - 1, DispLines); 1636 1636 1637 1637 OffscreenPaint; … … 1749 1749 InitLines; 1750 1750 Sel := -2; 1751 InitPVSB(sb,Lines[Layer] - 1, DispLines);1751 sb.Init(Lines[Layer] - 1, DispLines); 1752 1752 OffscreenPaint; 1753 1753 Invalidate … … 1762 1762 1763 1763 Sel := -2; 1764 InitPVSB(sb,Lines[Layer] - 1, DispLines);1764 sb.Init(Lines[Layer] - 1, DispLines); 1765 1765 SmartUpdateContent 1766 1766 end; … … 1863 1863 end; 1864 1864 1865 procedure TListDlg.ScrollBarUpdate(Sender: TObject); 1866 begin 1867 Sel := -2; 1868 SmartUpdateContent(true); 1869 end; 1870 1865 1871 end.
Note:
See TracChangeset
for help on using the changeset viewer.