Re: [MSEide-MSEgui-talk] stringgrid multi select

2020-09-20 Thread fredvs
Re-re Hello Patrick,

In attachment a litle demo of multi-cells selected.

gridmultiselect.zip
  


 

Fre;D



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/


___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] stringgrid multi select

2020-09-20 Thread fredvs
Re-hello Patrick.

You may use also the "oncellevent" method of grid.

For example to select multi celsl you may do something like this:

procedure Tmygridform.oncellev(const Sender: TObject; var info:
celleventinfoty);

begin
  if ((info.eventkind = cek_buttonrelease) or
(info.eventkind = cek_keyup)) then
if (info.cell.row > -1) then
 grid.selectcell(info.cell, csm_select, False) // should select the cell
 else
  grid.datacols.clearselection; // for example to deselect all. click on
fixed row
en;
 




--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/


___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] stringgrid multi select

2020-09-20 Thread fredvs
Hello Patrick.

I did not try/use multiselect option but to select rows by code, I use, for
example 3 cellpos:

  grid.defocuscell;
  grid.datacols.clearselection;
  grid.selectcell(cellpos1, csm_select, False);
  grid.selectcell(cellpos2, csm_select, False);
  grid.selectcell(cellpos2, csm_select, False);
...

Fre;D
 



--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/


___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] stringgrid multi select how to?

2018-12-23 Thread Patrick Goupell

What I want is the user viewing the string grid dowes a left click on a row.

Then the user presses and holds (either) the shift key or the control key.

And then left clicks on one (shift key held) or more (control key held) 
row(s) to get a range (shift) of rows or disjoint (control) row(s) selected.


The user would then rigth click on any selected row to get a popup menu 
of available actions.


This would be similar to a file/directory list and selecting different 
files to copy / delete from a folder / directory.


Patrick



___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


Re: [MSEide-MSEgui-talk] stringgrid multi select how to?

2018-12-23 Thread fredvs
Hello Patrick.

For selection I use:

 function selectcell(const cell: gridcoordty; 
  const amode: cellselectmodety;
  const checkmultiselect: boolean = false): boolean; 

For example to select first row:

 cellpos.row := 0;
 cellpos.col := 0;
 thestringgrid.selectcell(cellpos, csm_select, False);

And to access/change data in the stringgrid, for example:

 thestringgrid[1][2] := 'thedata';

But, sure, advice of Martin would be better.

Fre;D
  








--
Sent from: http://mseide-msegui-talk.13964.n8.nabble.com/


___
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk