diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 766c5892fb..2c049c8ec0 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -670,6 +670,7 @@ type property OnStartDrag; property OnTitleClick; property OnUserCheckboxBitmap; + property OnUserCheckboxImage; property OnUserCheckboxState; property OnUTF8KeyPress; end; diff --git a/lcl/grids.pas b/lcl/grids.pas index baf1e9ac3d..a4b5548df1 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -368,6 +368,12 @@ type const CheckedState: TCheckboxState; var ABitmap: TBitmap) of object; + TUserCheckBoxImageEvent = + procedure(Sender: TObject; const aCol, aRow: Integer; + const CheckedState: TCheckBoxState; + var ImageList: TCustomImageList; + var ImageIndex: TImageIndex) of object; + TValidateEntryEvent = procedure(sender: TObject; aCol, aRow: Integer; const OldValue: string; var NewValue: String) of object; @@ -728,6 +734,7 @@ type FRangeSelectMode: TRangeSelectMode; FSelections: TGridRectArray; FOnUserCheckboxBitmap: TUserCheckboxBitmapEvent; + FOnUserCheckboxImage: TUserCheckBoxImageEvent; FSortOrder: TSortOrder; FSortColumn: Integer; FSortLCLImages: TLCLGlyphs; @@ -1247,6 +1254,7 @@ type property OnSelectEditor: TSelectEditorEvent read FOnSelectEditor write FOnSelectEditor; property OnTopLeftChanged: TNotifyEvent read FOnTopLeftChanged write FOnTopLeftChanged; property OnUserCheckboxBitmap: TUserCheckboxBitmapEvent read FOnUserCheckboxBitmap write FOnUserCheckboxBitmap; + property OnUserCheckboxImage: TUserCheckBoxImageEvent read FOnUserCheckboxImage write FOnUserCheckboxImage; property OnValidateEntry: TValidateEntryEvent read FOnValidateEntry write FOnValidateEntry; // Bidi functions function FlipRect(ARect: TRect): TRect; @@ -1629,6 +1637,7 @@ type property OnStartDrag; property OnTopleftChanged; property OnUserCheckboxBitmap; + property OnUserCheckboxImage; property OnUTF8KeyPress; property OnValidateEntry; end; @@ -1869,6 +1878,7 @@ type property OnStartDrag; property OnTopLeftChanged; property OnUserCheckboxBitmap; + property OnUserCheckboxImage; property OnUTF8KeyPress; property OnValidateEntry; end; @@ -5521,6 +5531,8 @@ procedure TCustomGrid.GetImageForCheckBox(const aCol, aRow: Integer; begin if Assigned(OnUserCheckboxBitmap) then OnUserCheckboxBitmap(Self, aCol, aRow, CheckBoxView, Bitmap); + if (Bitmap = nil) and Assigned(OnUserCheckBoxImage) then + OnUserCheckboxImage(Self, aCol, aRow, CheckBoxView, ImageList, ImageIndex); end; procedure TCustomGrid.AdjustInnerCellRect(var ARect: TRect);