Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2443 - TeeGrid makes it impossible to correctly detect user has selected the same cell twice
Summary: TeeGrid makes it impossible to correctly detect user has selected the same ce...
Status: RESOLVED FIXED
Alias: None
Product: TeeGrid for Delphi
Classification: Unclassified
Component: Grid (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: david berneda
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-28 23:25 EDT by dean.mustakinov
Modified: 2021-09-14 11:57 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dean.mustakinov 2021-06-28 23:25:28 EDT
TeeGrid calls OnSelect event only the first time user clicks on the same cell and this event is called after OnClick and OnMouseUp events so there is no way to detect that user has clicked the same cell twice.
First time in OnClick/OnMouseUp the previous cell is still selected and second time OnSelect is not called.

I have made a small change to TeeGrid so OnSelect is called every time the cell is selected.

Tee.Grid.Selection.pas:
procedure TGridSelection.Change change to function -
function TGridSelection.Change(const AColumn: TColumn; const ARow: Integer): boolean; // DM CHANGE
begin
  if (Column<>AColumn) or (Row<>ARow) then
  begin
    ChangeColumn(AColumn);
    DoChangeRow(ARow);

    ResetRange;
    DoChanged;
    result := true; // DM CHANGE
  end
  else result := false; // DM CHANGE
end;

Tee.Grid.RowGroup.pas: 
in function TRowGroup.Mouse line
Selected.Change(AColumn,ARow);
changed to
if not Selected.Change(AColumn,ARow) then // DM CHANGE
        if Assigned(Selected.OnChange) then
          Selected.OnChange(Selected);
Comment 1 marc meumann 2021-09-14 11:57:59 EDT
Looks good Dean, thanks.