Grid: Dbf and CHECKBOXENABLED

Moderator: Rathinagiri

Post Reply
PiotrM
Posts: 15
Joined: Thu May 05, 2016 2:30 pm

Grid: Dbf and CHECKBOXENABLED

Post by PiotrM »

Hello
hmg.3.4.3
Based on the example Grid_CheckBoxes did Grid connected with the base dbf and I wanted to use CheckBoxEnabled but it did not work. The first column expands and makes room for the CheckBox but she does not, does not work either event handler ON CHECKBOXCLICKED. Did I do something wrong, or is it impossible for a grid connected with dbf.

Code: Select all

#include "hmg.ch"

Function Main
     use koszty

   DEFINE WINDOW Form_1 ;
      AT 0,0 ;
      WIDTH 800 ;
      HEIGHT 600 ;
      TITLE "Demo: GRID CheckBox" ;
      MAIN

    

      @ 50,10 GRID Grid_1 WIDTH 750 HEIGHT 350 HEADERS {'Last Name', 'First Name'} ;
       WIDTHS {140, 140}  ROWSOURCE 'koszty' COLUMNFIELDS {'SYMB_KONT','NAZWA'} VALUE {1,1} CELLNAVIGATION ;
       ON CHECKBOXCLICKED MsgInfo ({"Row: ", This.CellRowClicked, " is checked: ", Form_1.Grid_1.CheckBoxItem (This.CellRowClicked)}, "On CheckBoxClicked")
      
      @ 450, 155 BUTTON Button_1 CAPTION "CheckBoxEnabled ON/OFF" ACTION wlacz() WIDTH 200 
      @ 450, 555 BUTTON Button_2 CAPTION "Check List" ACTION GetListCheckBox()
     
   END WINDOW

   CENTER WINDOW Form_1

   ACTIVATE WINDOW Form_1

Return

procedure wlacz()
if !Form_1.Grid_1.CheckBoxEnabled
 Form_1.Grid_1.CheckBoxEnabled:=.t.
else
 Form_1.Grid_1.CheckBoxEnabled:=.f.
endif
return

PROCEDURE GetListCheckBox
Local i, cList := ""
   IF Form_1.Grid_1.CheckBoxEnabled == .T.
      FOR i = 1 TO Form_1.Grid_1.ItemCount
         IF Form_1.Grid_1.CheckBoxItem ( i ) == .T.
            cList := cList + Form_1.Grid_1.CellEx (i, 1) +", "+ Form_1.Grid_1.CellEx (i, 2) + HB_OsNewLine()
         ENDIF
      NEXT
      IF EMPTY (cList)
         cList := "Empty List"
      ENDIF
      MsgInfo (cList, "Check List")
   ELSE
      MsgInfo ("CheckBoxEnabled is FALSE")
   ENDIF
RETURN
In Annex example.
I looked online but did not find anything similar.

I tried to run the debugger joining the project h_controlmisc.prg to trace where the problem is but when you start getting an error:

Code: Select all

HMG Errorlog File

------------------------------------
Date:05/11/16 Time: 19:26:56
Error BASE/1070 Argument error: ==
Called from EVENTS(528) 
Called from INITWINDOW(0) 
Called from _DEFINEWINDOW(4293) 
Called from HMG_DEBUGGERWAITMESSAGE(1513) 
Called from PROCINITGUIDEBUGGER(151) 
Called from (b)HMGDEBUGGER(245) 
Called from (b)HMGDEBUGGER(253) 
Called from HMGDEBUGGER:GUICREATEFORMDEBUGGER(0) 
Called from HMGDEBUGGER:ACTIVATE(276) 
Called from __DBGENTRY(114) 
Called from _HMG_PRINTER_INITUSERMESSAGES(6106) 
Called from INITMESSAGES(915) 
Called from INIT(794) 
Called from ERRORSYS(67) 
Called from __HBVMINIT(0) 

------------------------------------
greetings
Piotr



Google translation
Attachments
Grid_CheckBoxes.zip
(2.34 KiB) Downloaded 251 times
Piotr Michalski
www.infospec.com.pl
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Grid: Dbf and CHECKBOXENABLED

Post by srvet_claudio »

It is not a bug, Virtual Grid (as rowsource) not work with checkbox.

For fix the error when you compile see this post: viewtopic.php?f=43&t=4738&start=30#p45165
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
PiotrM
Posts: 15
Joined: Thu May 05, 2016 2:30 pm

Re: Grid: Dbf and CHECKBOXENABLED

Post by PiotrM »

Hello
Thank you for your answer Dr. Claudio Soto, but the compilation of the file h_controlmisc.prg attached to the project ends with an error as shown in the Annex. Of course, I fixed line in 2843 and he has compiled the file h_grid.prg
blad.jpg
blad.jpg (240.6 KiB) Viewed 4838 times
greetings
Piotr
Piotr Michalski
www.infospec.com.pl
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: Grid: Dbf and CHECKBOXENABLED

Post by mol »

Piotr, do you have incremental compilation turned on? Maybe reset incremental data and rebuild project
PiotrM
Posts: 15
Joined: Thu May 05, 2016 2:30 pm

Re: Grid: Dbf and CHECKBOXENABLED

Post by PiotrM »

Witaj
Na to wpadłem, resetowałem, ale błąd się powtarza.
Pozdrowienia
Piotr


Hello
It ran, reboot, but the error persists.
greetings
Piotr
Piotr Michalski
www.infospec.com.pl
User avatar
tonton2
Posts: 444
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: Grid: Dbf and CHECKBOXENABLED

Post by tonton2 »

the same program compiled with HMG_3.4.2 gives different results in HMG_3.4.3
Attachments
Compiled with HMG 3.4.3
Compiled with HMG 3.4.3
Image_HMG_343.jpg (103.48 KiB) Viewed 4731 times
Compiles With HMG 3.4.2
Compiles With HMG 3.4.2
Image_HMG_342.jpg (110.45 KiB) Viewed 4731 times
GRID_Filter.rar
(2.15 KiB) Downloaded 260 times
L'Algerie vous salut
Y.TABET
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: Grid: Dbf and CHECKBOXENABLED

Post by srvet_claudio »

tonton2 wrote:the same program compiled with HMG_3.4.2 gives different results in HMG_3.4.3
I will check.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Grid: Dbf and CHECKBOXENABLED

Post by mustafa »

Hola amigo PiotrM
el tema Grid CheckBoxClicked con Base de datos DBF ya puse en su momento un Pos:
viewtopic.php?f=20&t=4236&hilit=CheckBox&start=10
y provisionalmente lo solucione a no tener solución del foro con "IMAGE bmp"

El maestro Rathinagiri en su programa "FuelWare.zip" usa CheckBoxClicked pero
no logro implementarlo a un fichero DBF como en tu caso que no sale la columna
para marcar o desmarcar
viewtopic.php?f=15&t=4650&hilit=sqlite
FuelWare.zip
Un saludo
Mustafa
*-------------------------------------------------------------*
Hello friend PiotrM
Grid theme CheckBoxClicked with DBF database and put it at the time a Pos:
viewtopic.php?f=20&t=4236&hilit=CheckBox&start=10
and temporarily solve it have no solution to the Forum with "IMAGE bmp"

The Master Rathinagiri in his "FuelWare.zip" program uses CheckBoxClicked but
profit not a DBF file implement in your case that does not leave the column
to mark or unmark
viewtopic.php?f=15&t=4650&hilit=sqlite
FuelWare.zip
a greeting
Mustafa
Post Reply