Jump to content


Photo

Purpose RightClick(De)select


  • Please log in to reply
2 replies to this topic

#1 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 14 July 2019 - 07:50 PM

Hi there,

 

What is the purpose of RightClickSelect and RightClickDeselect ?

 

I was thinking deselect selectedblock on MouseUp?

 

Regards,

Eduard.



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 16 July 2019 - 01:28 AM

Hello,

It specifies whether this actions can be done with right mouse button. Sometimes pop-up menu is used and you user don’t want to deselect multi selection.
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 DelphiToday

DelphiToday
  • Members
  • 146 posts
  • Gender:Male

Posted 16 July 2019 - 09:43 AM

Thank you.

 

I have looked for Deselect mouseup VirtualGrid. Take a look 'TNextVirtualGrid6'

{ Changed: Eduard }
procedure TNextVirtualGrid6.DeselectSelected;
begin
  { Void }
end;

{ Override: Eduard }
procedure TNextVirtualGrid6.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

  { Replacement: DeselectSelected }
  procedure Deselect;
  var
    i: Integer;
  begin
    if gtMultiSelected in FState then
    begin
      for i := 0 to Pred(RowCount) do Selected[i] := False;
      Exclude(FState, gtMultiSelected);
    end;
  end;

begin
  if (not (ssShift in Shift)) and (not (ssCtrl in Shift)) then
  begin
    Deselect;
    Selected[SelectedRow] := True;
  end;

  inherited;
end;

Nou this is working if you change 'NxCustomGrid6' around line #3420

          if CanDeselect then
          begin
            DeselectSelected;

            { Changed: Eduard; prevent last selected, deselected }
            if (SelectedCount = 1) then
            begin

              if RowExists(PrevSelected.Y) then
                Selected[PrevSelected.Y] := False;

            end;
          end;

Maybe you can do something with this code?

 

Regards.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users