[MSEide-MSEgui-talk] Grid

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[MSEide-MSEgui-talk] Grid

mohamed hamza
Hi there,

   Is there any option to activate grid row selection ?

Regards.


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Grid

mohamed hamza
Ok .   Found the answer in mseUniverse   ( sample/db/grid   

Regards

De : mohamed hamza <[hidden email]>
Envoyé : jeudi 31 octobre 2019 10:26
À : General list for MSEide+MSEgui <[hidden email]>
Objet : [MSEide-MSEgui-talk] Grid
 
Hi there,

   Is there any option to activate grid row selection ?

Regards.


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Grid

fredvs
Hello Med.

Nice that you have found a solution!

By the way, I finally found how to deal with 2xclick on a cell.

Here is how I do (maybe usefull for others)

__________________________

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

if (ss_double in info.mouseeventinfopo^.shiftstate) then
  begin  
 // here what to do if double-click on the cell
 end;

end;

___________________________

Fre;D





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


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Grid

fredvs
fredvs wrote
> Hello Med.
>
> Nice that you have found a solution!
>
> By the way, I finally found how to deal with 2xclick on a cell.
>
> ...

Re-hello.

Ooops, something was missing in previous code, here the good one:

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

if (info.eventkind = cek_buttonrelease) then // that was missing

if (ss_double in info.mouseeventinfopo^.shiftstate) then
  begin  
 // here what to do if double-click on the cell
 end;

end;


Fre;D



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


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Grid

mohamed hamza
Hello,

   Thanks for the answer and your loyalty , by  way the   example in  ( mseuniverse\samples\db\gridselectedrow\)  works only when the grid is  a tdbstringgrid and not  for a tdbwidgetgrid. Without wishing to order you,  would you like to have a look?

Best Regards.

Med.

De : fredvs <[hidden email]>
Envoyé : samedi 2 novembre 2019 12:54
À : [hidden email] <[hidden email]>
Objet : Re: [MSEide-MSEgui-talk] Grid
 
fredvs wrote
> Hello Med.
>
> Nice that you have found a solution!
>
> By the way, I finally found how to deal with 2xclick on a cell.
>
> ...

Re-hello.

Ooops, something was missing in previous code, here the good one:

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

if (info.eventkind = cek_buttonrelease) then // that was missing

if (ss_double in info.mouseeventinfopo^.shiftstate) then
  begin 
 // here what to do if double-click on the cell
 end;

end;


Fre;D



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


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Grid

fredvs
> by  way the   example in  ( mseuniverse\samples\db\gridselectedrow\)  works
only when the grid is  a tdbstringgrid and not  for a tdbwidgetgrid.

Hum, indeed, if adding in the sample:

-------
procedure tmainfo.oncellev(const sender: TObject; var info:
celleventinfoty);
begin
if (info.eventkind = cek_buttonpress) then // that was missing

if (ss_double in info.mouseeventinfopo^.shiftstate) then
  begin  
 // here what to do if double-click on the cell
 end;
end;
----------------
I get, while compliing that error message:

main.pas(47,22) Error: Identifier not found "cek_buttonpress"
main.pas(56) Fatal: There were 1 errors compiling module, stopping

Strange because property oncellevent is published in tdbwidgetgrid (who is
descendant from tcustomdbwidgetgrid).

Sorry, I am lost.

Fre;D




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


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Grid

fredvs
In reply to this post by fredvs
Re-hello.

OK, I get it, adding "msegridsglob" in uses section in main.pas does the
trick.

It compiles and the oncellevent() for 2 x click works perfectly.

So, for me,  tdbstringgrid works like tdbwidgetgrid.

What problem did you find?

Fre.D



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


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Grid

fredvs
Ooops, my previous post was not saved...

Here the content:

> by  way the   example in  ( mseuniverse\samples\db\gridselectedrow\)
> works only when the grid is  a tdbstringgrid and not  for a tdbwidgetgrid.

Hum, indeed, if adding in the sample:

-------
procedure tmainfo.oncellev(const sender: TObject; var info:
celleventinfoty);
begin
if (info.eventkind = cek_buttonpress) then // that was missing

if (ss_double in info.mouseeventinfopo^.shiftstate) then
  begin  
 // here what to do if double-click on the cell
 end;
end;
----------------
I get, while compliing that error message:

main.pas(47,22) Error: Identifier not found "cek_buttonpress"
main.pas(56) Fatal: There were 1 errors compiling module, stopping

Strange because property oncellevent is published in tdbwidgetgrid (who is
descendant from tcustomdbwidgetgrid).

-----------------------

And this was the answer to that post:

Re-hello.

OK, I get it, adding "msegridsglob" in uses section in main.pas does the
trick.

It compiles and the oncellevent() for 2 x click works perfectly.

So, for me,  tdbstringgrid works like tdbwidgetgrid.

What problem did you find?

Fre.D






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


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Grid

fredvs
> Hello,

>   (ctrl+leftclick)  does not select the curret row in case of
> tdbwidgetgrid ?

Are you talking about gridselectedrow sample?

Here on Linux 64 it works.

Imho, the sample works like this: if you do (ctrl+leftclick) on a cell it
will switch selected/unselected.

If the cell was selected, it become lightr-gray and if you click on button
"selected row" there will be a list of all previously selected rows (the
rows in light gray).

<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/selectrow.png>

Fre.D




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


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Grid

fredvs
fredvs wrote

>> Hello,
>
>>   (ctrl+leftclick)  does not select the curret row in case of
>> tdbwidgetgrid ?
>
> Are you talking about gridselectedrow sample?
>
> Here on Linux 64 it works.
>
> Imho, the sample works like this: if you do (ctrl+leftclick) on a cell it
> will switch selected/unselected.
>
> If the cell was selected, it become lightr-gray and if you click on button
> "selected row" there will be a list of all previously selected rows (the
> rows in light gray).
>
> &lt;http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/selectrow.png&gt; 
>
> Fre.D

Re-hello Med.

I think I understood what you want.
You want that on a tdbwidgetgrid, if you use (ctrl+leftclick) , you will
have the same result with tdbstringgrid.

So the row would switch to gray/blank.

I fear that you will need to create you own method for this, using
oncellevent();
It seems that for tdbwidgetgrid it is not enabled by default.

May I ask you why you do not want to use a tdbstringgrid in place of a
tdbwidgetgrid?

Fre.D







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


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk
Reply | Threaded
Open this post in threaded view
|

Re: [MSEide-MSEgui-talk] Grid

fredvs
Re-re hello Med.

For selected row I use a boolean column : "Selected".

Here on the picture it is the "Mix" column.

<http://mseide-msegui-talk.13964.n8.nabble.com/file/t2/selectgrid.png>

Fre;D




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


_______________________________________________
mseide-msegui-talk mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk