Changeset 69 for trunk/LocalPlayer/Help.pas
- Timestamp:
- Jan 14, 2017, 10:33:42 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Help.pas
r68 r69 47 47 end; 48 48 49 { THelpDlg } 50 49 51 THelpDlg = class(TFramedDlg) 50 52 CloseBtn: TButtonB; … … 54 56 procedure FormCreate(Sender: TObject); 55 57 procedure FormDestroy(Sender: TObject); 58 procedure FormMouseWheel(Sender: TObject; Shift: TShiftState; 59 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); 56 60 procedure FormPaint(Sender: TObject); 57 61 procedure CloseBtnClick(Sender: TObject); … … 65 69 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 66 70 procedure SearchBtnClick(Sender: TObject); 67 public68 Difficulty: integer;69 procedure ShowNewContent(NewMode, Category, Index: integer);70 procedure ClearHistory;71 function TextIndex(Item: string): integer;72 71 protected 73 72 procedure OffscreenPaint; override; … … 87 86 HistPos: array [0 .. MaxHist - 1] of integer; 88 87 HistSearchContent: array [0 .. MaxHist - 1] of shortstring; 88 procedure ScrollBarUpdate(Sender: TObject); 89 89 procedure line(ca: TCanvas; i: integer; lit: boolean); 90 90 procedure Prepare(sbPos: integer = 0); … … 92 92 procedure Search(SearchString: string); 93 93 procedure OnScroll(var m: TMessage); message WM_VSCROLL; 94 procedure OnMouseWheel(var m: TMessage); message LM_MOUSEWHEEL;95 94 procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE; 95 public 96 Difficulty: integer; 97 procedure ShowNewContent(NewMode, Category, Index: integer); 98 procedure ClearHistory; 99 function TextIndex(Item: string): integer; 96 100 end; 97 101 … … 202 206 SearchResult.OwnsObjects := True; 203 207 sb := TPVScrollbar.Create; 204 CreatePVSB(sb, Handle, 36, 551, 36 + 432); 208 sb.Setup(36, 9, 11, Self); 209 sb.OnUpdate := ScrollBarUpdate; 205 210 206 211 HelpText := TStringTable.Create; … … 247 252 end; 248 253 254 procedure THelpDlg.FormMouseWheel(Sender: TObject; Shift: TShiftState; 255 WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean); 256 begin 257 if sb.ProcessMouseWheel(WheelDelta) then begin 258 PaintBox1MouseMove(nil, [], MousePos.X - Left, 259 MousePos.Y - Top); 260 end; 261 end; 262 249 263 procedure THelpDlg.CloseBtnClick(Sender: TObject); 250 264 begin 251 Close 265 Close; 252 266 end; 253 267 254 268 procedure THelpDlg.OnScroll(var m: TMessage); 255 269 begin 256 if ProcessPVSB(sb, m) then 257 begin 270 if sb.Process(m) then begin 258 271 Sel := -1; 259 272 SmartUpdateContent(true) … … 261 274 end; 262 275 263 procedure THelpDlg.OnMouseWheel(var m: TMessage);264 begin265 if ProcessMouseWheel(sb, m) then266 begin267 Sel := -1;268 SmartUpdateContent(true);269 PaintBox1MouseMove(nil, [], m.lParam and $FFFF - Left,270 m.lParam shr 16 - Top);271 end272 end;273 274 276 procedure THelpDlg.OnMouseLeave(var Msg: TMessage); 275 277 begin 276 if Sel <> -1 then 277 begin 278 if Sel <> -1 then begin 278 279 line(Canvas, Sel, false); 279 280 Sel := -1 … … 771 772 MarkUsedOffscreen(InnerWidth, InnerHeight + 13 + 48); 772 773 end; { OffscreenPaint } 774 775 procedure THelpDlg.ScrollBarUpdate(Sender: TObject); 776 begin 777 Sel := -1; 778 SmartUpdateContent(true) 779 end; 773 780 774 781 procedure THelpDlg.Prepare(sbPos: integer = 0); … … 1835 1842 LF; 1836 1843 1837 InitPVSB(sb, Count - 1, InnerHeight div 24); 1838 if sbPos <> 0 then 1839 begin 1840 sb.si.npos := sbPos; 1841 sb.si.FMask := SIF_POS; 1842 SetScrollInfo(sb.h, SB_CTL, sb.si, true); 1843 end; 1844 //Self.Show; 1845 sb.Init(Count - 1, InnerHeight div 24); 1846 sb.SetPos(sbPos); 1844 1847 BackBtn.Visible := nHist > 0; 1845 1848 TopBtn.Visible := (nHist > 0) or (Kind <> hkMisc) or (no <> miscMain);
Note:
See TracChangeset
for help on using the changeset viewer.