TCheckBox as column EditorClass

TeeGrid VCL / FMX for Embarcadero RAD Studio, Delphi, C++ Builder and Lazarus Free Pascal.
Post Reply
InfraTec
Newbie
Newbie
Posts: 18
Joined: Tue May 09, 2023 12:00 am

TCheckBox as column EditorClass

Post by InfraTec » Wed Oct 11, 2023 12:52 pm

Hello,
I'm using TCheckBox as EditorClass for one TeeGrid column. But it doesn't work as expected.
- User can check/uncheck this box despite the cell isn't in editing mode.
- If editing mode is activated, the checkbox is drawn beside the original checkbox.
In demo application TeeGridFeatures the behavior is the same.

InfraTec
Newbie
Newbie
Posts: 18
Joined: Tue May 09, 2023 12:00 am

Re: TCheckBox as column EditorClass

Post by InfraTec » Mon Dec 11, 2023 12:52 pm

To make it working I did the following points (if somebody is interested):
  • Code: Select all

    TFMXTeeGrid.TryChangeEditorData
    function GetEditorText
    if IEditor is TCheckBox then
        begin
           if TCheckBox(IEditor).IsChecked then
              result:='True'
           else
              result:='False';
        end
  • Draw a hook (not a cross) in TShapePainter.Check
  • Assign TCheckBox(AEditor).OnPainting := CheckBoxPainting; and set there the position of editor checkbox to the center of cell
  • (Sender.Render as TBooleanRender).Paint(AData); in OnPaint Handler
  • Data handling in OnCellEditing and OnCellEdited Handler

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: TCheckBox as column EditorClass

Post by Marc » Tue Dec 12, 2023 8:52 am

Thank you for the feedback.

Regards,
Marc Meumann
Steema Support

InfraTec
Newbie
Newbie
Posts: 18
Joined: Tue May 09, 2023 12:00 am

Re: TCheckBox as column EditorClass

Post by InfraTec » Thu Sep 05, 2024 6:42 am

Is it planned to make the checkbox more convenient?

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: TCheckBox as column EditorClass

Post by Marc » Thu Sep 05, 2024 6:49 am

Hello,

Do you mean; implementing the steps that you described in your penultimate post?

Regards,
Marc
Steema Support

InfraTec
Newbie
Newbie
Posts: 18
Joined: Tue May 09, 2023 12:00 am

Re: TCheckBox as column EditorClass

Post by InfraTec » Thu Sep 05, 2024 12:13 pm

The implementation is up to you. But I do not want to change the steema units every time I (or my colleague) installed a newer version.

Post Reply