CHECKBOX at Grid in COLUMNCONTROLS

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CHECKBOX at Grid in COLUMNCONTROLS

Post by Pablo César »

Hi Dr. Claudio,

There is a mismatch of value in _GridEx_GetCellValue function where all cItemCell is character type due C function LISTVIEW_GETITEMTEXT.
Screen2.png
Screen2.png (35.32 KiB) Viewed 5078 times
In order to get the right value of CHECKBOX return (actually wrongly returning NIL), I suggest to replace this:

Code: Select all

         IF ALLTRIM(HMG_UPPER(cItemCell)) == ALLTRIM(HMG_UPPER(ALABELS [1]))
                xData := .T.
         ELSEIF ALLTRIM(HMG_UPPER(cItemCell)) == ALLTRIM(HMG_UPPER(ALABELS [2]))
                xData := .F.
         ENDIF
By this one:

Code: Select all

   ELSEIF AEC == 'CHECKBOX'
         IF ALLTRIM(HMG_UPPER(cItemCell)) == ".T."
            xData := .T.
         ELSE
            xData := .F.
         ENDIF
   ENDIF
Or if you find a better way converting in logical type probably is more safety.

I hope to had been helfully.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: CHECKBOX at Grid in COLUMNCONTROLS

Post by srvet_claudio »

Pablo César wrote:Hi Dr. Claudio,

There is a mismatch of value in _GridEx_GetCellValue function where all cItemCell is character type due C function LISTVIEW_GETITEMTEXT.
Screen2.png
In order to get the right value of CHECKBOX return (actually wrongly returning NIL), I suggest to replace this:

Code: Select all

         IF ALLTRIM(HMG_UPPER(cItemCell)) == ALLTRIM(HMG_UPPER(ALABELS [1]))
                xData := .T.
         ELSEIF ALLTRIM(HMG_UPPER(cItemCell)) == ALLTRIM(HMG_UPPER(ALABELS [2]))
                xData := .F.
         ENDIF
By this one:

Code: Select all

   ELSEIF AEC == 'CHECKBOX'
         IF ALLTRIM(HMG_UPPER(cItemCell)) == ".T."
            xData := .T.
         ELSE
            xData := .F.
         ENDIF
   ENDIF
Or if you find a better way converting in logical type probably is more safety.

I hope to had been helfully.
Done!
You are right, in CHECKBOX is allow a binary value, .T. or .F., in the original rather than ElseIf should be only Else.
Thanks Pablo.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CHECKBOX at Grid in COLUMNCONTROLS

Post by Pablo César »

Hi HMGDT and all,

I found something strange and I'm in doubt regarding CheckBox in ColumnControl.

It is not being displayed as masked column (even with ColumnControl defined) in RowSource Grids.

For samples at 31,32,33,34,35,36,37 and 38 RowSource Grid demos, are not working the right displaying.
See picture below:
Screen2.png
Screen2.png (35.45 KiB) Viewed 4951 times
As you can see, in this example is not be displayed "yes"/"No" :(

By the other side this behaviour is different with grid of arrays.
See this picture is from C:\hmg.3.4.0\SAMPLES\Controls\Grid\GRID_09:
Screen1.png
Screen1.png (23.26 KiB) Viewed 4951 times
But in this case is displaying a masked column (Yes/No) according CheckBox at column 5 by returning when COLUMNCONTROLS is defined in grids with arrays.

What I also saw that in C:\hmg.3.4.0\SAMPLES\Controls\Grid\GRID_30 demo that's displaying normally, because this demo is working with RowSource but is beign done by DYNAMICDISPLAY. See picture below:
Screen3.png
Screen3.png (45.45 KiB) Viewed 4951 times
IMHO ColumnControls should it should be available in the same way even being RowSource grid and not only for arrays.
This could be this could be standardized it ?

Because we can use DYNAMICDISPLAY in RowSource Grids only. :(
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CHECKBOX at Grid in COLUMNCONTROLS

Post by Pablo César »

Hi Claudio,

I have these questions about the new select item(s) in Grid as a kind of checkbox:
  1. Working only at first column ?
     
  2. I'm in doubt to define this new select item, which I supose when is filled/cheked is for the first column propose or be for all fields (selecting all columns) ?
     
  3. For InputWindow edition: Should I put as a first control ? What label for that ? Record selected ? No label at all ? Or I should it put together with the first column as a caption ?
Screen5.png
Screen5.png (25.12 KiB) Viewed 4931 times
Please see this picture below. Is it this normal ?
Screen4.png
Screen4.png (54.39 KiB) Viewed 4931 times
Would OnCheckBoxClicked occupying another Grid property ?

I was asking to myself: For what's this new select item used for ?
And I got it. It's selectable items at Grid when we have no a logical field as specific for selection. Great ! :D

Thank you Claudio for your attention,
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: CHECKBOX at Grid in COLUMNCONTROLS

Post by srvet_claudio »

CheckBox is available only in the first column and always is a sub-item of the first column.

You are right, the index of OnCheckBoxClicked is 46, I fixed it.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CHECKBOX at Grid in COLUMNCONTROLS

Post by Pablo César »

Thank you Claudio for your your clarification and providences.

This CheckBox in sub-item it's very interesting approach.

Have you any comments to do it regarding these my questions ?
viewtopic.php?p=40243#p40243

Best regards
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: CHECKBOX at Grid in COLUMNCONTROLS

Post by srvet_claudio »

Pablo César wrote:Thank you Claudio for your your clarification and providences.

This CheckBox in sub-item it's very interesting approach.

Have you any comments to do it regarding these my questions ?
viewtopic.php?p=40243#p40243

Best regards
With database the ColumnControl controls how the cells are edited and ColumnDisplay how data is displayed.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
mustafa
Posts: 1162
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: CHECKBOX at Grid in COLUMNCONTROLS

Post by mustafa »

Hola amigos:
Tengo un problema , estoy experimentando con "CheckBoxEnabled"
he modificado el sample que está: c:\hmg.3.4.0\SAMPLES\Controls\Grid\Grid_CheckBoxes
en "sample1.prg" el Grid_1 tiene ARRAY (25), no databases y sale perfecto los
CheckBox y un vez seleccionado mediante el Button "Check List", se incorporan al
Grid_2 que este si tiene un base de datos "STOCKP.dbf" , con Button "Cleaner" dejamos
limpio Grid_1 de CheckBox y Button "Delete Base" Borramos la base de datos "STOCKP.dbf"
de Grid_2, todo perfecto.
el problema está en "sample2.prg" que se ha sustituido en Grid_1 los ARRAY (25), por
base de datos "STOCK.dbf" pero no sale CheckBox y claro no se puede seleccionar nada
y si le das al Button "Check List" copia toda la base de datos sin poder hacen ninguna
selección.
Alguien me puede solucionar el problema de "sample2.prg" ?
Muy agradecido por su atención
*----------------------------------------------------------*
Hello friends:
I have a problem, I'm experimenting with "CheckBoxEnabled"
I modified the sample is: c:\hmg.3.4.0\Samples\Controls\Grid\Grid_CheckBoxes
in "sample1.prg" the Grid_1 has ARRAY (25), no databases and comes out perfect the
CheckBox and Button once selected by the "Check List", are incorporated
Grid_2 this if you have a database "STOCKP.dbf" with Button "Cleaner" we
Grid_1 clean CheckBox and Button "Delete Base" We delete the database "STOCKP.dbf"
of Grid_2, all perfect.
the problem is "sample2.prg" has been replaced in Grid_1 the ARRAY (25), by
Database "STOCK.dbf" but nothing comes CheckBox and clear can not select anything
and if you hit the Button "Check List" copied the entire database without being able to make any
selection.
Someone I can solve the problem of "sample2.prg"?
Very grateful for your attention
Mustafa
Attachments
Demo_CheckBoxEnabled.zip
(81.3 KiB) Downloaded 217 times
screenshot.jpg
screenshot.jpg (93.68 KiB) Viewed 4689 times
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

CHECKBOX at Grid in COLUMNCONTROLS

Post by Pablo César »

mustafa wrote:el problema está en "sample2.prg" que se ha sustituido en Grid_1 los ARRAY (25), por
base de datos "STOCK.dbf" pero no sale CheckBox
Parece haber algun problema cuando es ROWSOURCE... :?

Mustafa, has intentado utilizar CHECKBOX en COLUMNCONTROLS ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
mustafa
Posts: 1162
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: CHECKBOX at Grid in COLUMNCONTROLS

Post by mustafa »

Hola Pablo Cesar :
Mira el sample2,prg en el Zip -> Demo_CheckBoxEnabled.zip que he mandado
el sample1,prg funciona perfecto, pero el sample2.prg tiene un DBF y creo que
yo no se detectar el fallo.
Personalmente no domino mucho la técnica de los Grid. me esta pasando en muchos
samples cuando pasas de las Bases Virtuales ( ARRAY ) a las bases de datos verdadera
es decir fichero DBF no siempre reaccionan igual los samples .
Muy agradecido por tu atención, haber si puedes dedicarle un instante y ver si
tiene solución, creo que seria interesante esta nueva función "CheckBoxEnableden" en los Grid
Saludos
*-----------------------------------------------------------------------------------*
Hello Pablo Cesar
look at the sample2, prg in the Zip -> I have commanded Demo_CheckBoxEnabled.zip
the sample1, prg works perfect, but the sample2.prg has a DBF and I think
I can not detect the failure.
Personally I not mastered the art of Grid lot. I is happening in many
samples when you go from the Virtual Bases (ARRAY) to real data bases
DBF file that is not always react the same samples.
Grateful for your attention, if you have to spend a moment and see if
has a solution, I think it would be interesting this new function "CheckBoxEnableden" in the Grid
a greeting
Mustafa
Post Reply