Changeset 167 for branches/generator/Packages/Common/UListViewSort.pas
- Timestamp:
- Aug 9, 2018, 3:43:27 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generator/Packages/Common/UListViewSort.pas
r114 r167 81 81 FOnChange: TNotifyEvent; 82 82 FStringGrid1: TStringGrid; 83 procedure DoOnKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);84 procedure DoOnResize(Sender: TObject);83 procedure GridDoOnKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); 84 procedure GridDoOnResize(Sender: TObject); 85 85 public 86 86 constructor Create(AOwner: TComponent); override; … … 110 110 { TListViewFilter } 111 111 112 procedure TListViewFilter. DoOnKeyUp(Sender: TObject; var Key: Word;112 procedure TListViewFilter.GridDoOnKeyUp(Sender: TObject; var Key: Word; 113 113 Shift: TShiftState); 114 114 begin … … 117 117 end; 118 118 119 procedure TListViewFilter. DoOnResize(Sender: TObject);119 procedure TListViewFilter.GridDoOnResize(Sender: TObject); 120 120 begin 121 121 FStringGrid1.DefaultRowHeight := FStringGrid1.Height; … … 135 135 FStringGrid1.Options := [goFixedHorzLine, goFixedVertLine, goVertLine, 136 136 goHorzLine, goRangeSelect, goEditing, goAlwaysShowEditor, goSmoothScroll]; 137 FStringGrid1.OnKeyUp := DoOnKeyUp;138 FStringGrid1.OnResize := DoOnResize;137 FStringGrid1.OnKeyUp := GridDoOnKeyUp; 138 FStringGrid1.OnResize := GridDoOnResize; 139 139 end; 140 140 … … 142 142 var 143 143 I: Integer; 144 R: TRect; 144 145 begin 145 146 with FStringGrid1 do begin 146 //Columns.Clear;147 147 while Columns.Count > ListView.Columns.Count do Columns.Delete(Columns.Count - 1); 148 148 while Columns.Count < ListView.Columns.Count do Columns.Add; 149 149 for I := 0 to ListView.Columns.Count - 1 do begin 150 150 Columns[I].Width := ListView.Columns[I].Width; 151 if Selection.Left = I then begin 152 R := CellRect(I, 0); 153 Editor.Left := R.Left + 2; 154 Editor.Width := R.Width - 4; 155 end; 151 156 end; 152 157 end; … … 197 202 if AMsg.Msg = WM_NOTIFY then 198 203 begin 199 Code := PHDNotify(vMsgNotify.NMHdr)^.Hdr.Code;204 Code := NMHDR(PHDNotify(vMsgNotify.NMHdr)^.Hdr).Code; 200 205 case Code of 201 206 HDN_ENDTRACKA, HDN_ENDTRACKW: … … 353 358 TP1: TPoint; 354 359 XBias, YBias: Integer; 355 OldColor: TColor; 360 PenColor: TColor; 361 BrushColor: TColor; 356 362 BiasTop, BiasLeft: Integer; 357 363 Rect1: TRect; … … 365 371 Item.Left := 0; 366 372 GetCheckBias(XBias, YBias, BiasTop, BiasLeft, ListView); 367 OldColor := ListView.Canvas.Pen.Color; 373 PenColor := ListView.Canvas.Pen.Color; 374 BrushColor := ListView.Canvas.Brush.Color; 368 375 //TP1 := Item.GetPosition; 369 376 lRect := Item.DisplayRect(drBounds); // Windows 7 workaround … … 377 384 ItemLeft := Item.Left; 378 385 ItemLeft := 23; // Windows 7 workaround 379 386 380 387 Rect1.Left := ItemLeft - CheckWidth - BiasLeft + 1 + XBias; 381 388 //ShowMessage(IntToStr(Tp1.Y) + ', ' + IntToStr(BiasTop) + ', ' + IntToStr(XBias)); … … 408 415 end; 409 416 //ListView.Canvas.Brush.Color := ListView.Color; 410 ListView.Canvas.Brush.Color := clWindow;411 ListView.Canvas.Pen.Color := OldColor;417 ListView.Canvas.Brush.Color := BrushColor; 418 ListView.Canvas.Pen.Color := PenColor; 412 419 end; 413 420 … … 476 483 FHeaderHandle := ListView_GetHeader(FListView.Handle); 477 484 for I := 0 to FListView.Columns.Count - 1 do begin 485 {$push}{$warn 5057 off} 478 486 FillChar(Item, SizeOf(THDItem), 0); 487 {$pop} 479 488 Item.Mask := HDI_FORMAT; 480 489 Header_GetItem(FHeaderHandle, I, Item);
Note:
See TracChangeset
for help on using the changeset viewer.