You can see C:\hmg.3.3.1\SAMPLES\Controls\Grid\GRID_14\demo.prg and Test() function there, is not working...
But if you make the same test at C:\hmg.3.3.0\SAMPLES\Controls\Grid\GRID_14\demo.prg works normally !!!
I think there is a bug in GRID around _SetItem().
Please, someone can confirm this ? Can anybody make this test for me ?
Code: Select all
#include "hmg.ch"
Function Main()
Local aRows [20] [3]
DEFINE WINDOW Form_1 ;
AT 0,0 ;
WIDTH 640 ;
HEIGHT 400 ;
TITLE 'Mixed Data Type Grid Test' ;
MAIN
DEFINE MAIN MENU
DEFINE POPUP 'File'
MENUITEM 'Exit' ACTION ThisWindow.Release
END POPUP
END MENU
aRows [1] := {'Simpson','Homer','555-5555'}
aRows [2] := {'Mulder','Fox','324-6432'}
aRows [3] := {'Smart','Max','432-5892'}
aRows [4] := {'Grillo','Pepe','894-2332'}
aRows [5] := {'Kirk','James','346-9873'}
aRows [6] := {'Barriga','Carlos','394-9654'}
aRows [7] := {'Flanders','Ned','435-3211'}
aRows [8] := {'Smith','John','123-1234'}
aRows [9] := {'Pedemonti','Flavio','000-0000'}
aRows [10] := {'Gomez','Juan','583-4832'}
aRows [11] := {'Fernandez','Raul','321-4332'}
aRows [12] := {'Borges','Javier','326-9430'}
aRows [13] := {'Alvarez','Alberto','543-7898'}
aRows [14] := {'Gonzalez','Ambo','437-8473'}
aRows [15] := {'Batistuta','Gol','485-2843'}
aRows [16] := {'Vinazzi','Amigo','394-5983'}
aRows [17] := {'Pedemonti','Flavio','534-7984'}
aRows [18] := {'Samarbide','Armando','854-7873'}
aRows [19] := {'Pradon','Alejandra','???-????'}
aRows [20] := {'Reyes','Monica','432-5836'}
@ 10,10 GRID Grid_1 ;
WIDTH 620 ;
HEIGHT 330 ;
HEADERS {'Column 1','Column 2','Column 3'} ;
WIDTHS {140,140,140} ;
ITEMS aRows ;
EDIT ;
COLUMNVALID { ;
{ || Test() } , ;
{ || NotBeEmpty(This.CellValue) } , ;
{ || ! Empty ( This.CellValue ) } ;
}
END WINDOW
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return Nil
Function NotBeEmpty ( cCellValue ) // Not working
If Empty(cCellValue)
// This.CellValue:="<Is in blank>"
nCellRowIndex := This.CellRowIndex
nCellColIndex := This.CellColIndex
Form_1.Grid_1.CellEx ( nCellRowIndex, nCellColIndex ) := "<Is in blank>"
Endif
Return .T.
Function Test()
If Empty (This.CellValue)
This.CellValue := '*' // Not working
EndIf
Return
In my PC the 3.3.1 is not working...