HMG4 GRID problem
Moderator: Rathinagiri
HMG4 GRID problem
Does anyone know why the cursor keys are not working in a grid? Neither in my program nor in the demos.
Re: HMG4 GRID problem
It's the same problem that was in virtualgrid.Ricci wrote:Does anyone know why the cursor keys are not working in a grid? Neither in my program nor in the demos.
In METHOD DoKeyBoardEvents( e ) CLASS GRID change all the RETURN .T. into RETURN .F. in all places where the event is not handled by the method and should be passed back to Qt, for example here:
Code: Select all
IF !::lAllowEdit .or. ::lMultiSelect
// Nothing doing
RETURN .T. <======== must be .F.
.T. .F. .F. .T. .F.
Re: HMG4 GRID problem
Anyway, GRID class needs a bit of code refactoring....
Re: HMG4 GRID problem
Thank you.
2 minor problems:
1. If a GRID or VirtualGrid contains only 1 record than the header ist always blue, even if it has the focus or not.
2. If you use :ColumnJustify { .... } in GRID the text in all cells is vertical top aligned. See Demo_3 in GRID samples.
2 minor problems:
1. If a GRID or VirtualGrid contains only 1 record than the header ist always blue, even if it has the focus or not.
2. If you use :ColumnJustify { .... } in GRID the text in all cells is vertical top aligned. See Demo_3 in GRID samples.
Re: HMG4 GRID problem
I found the solution for the display problem with :ColumnJustify
In grid.prg this part in METHOD Cell should be changed:
to
In grid.prg this part in METHOD Cell should be changed:
Code: Select all
ELSEIF Pcount() == 3
oItem := QTableWidgetItem()
IF ValType( ::aColumnJustify ) != 'U'
DO CASE
CASE ::aColumnJustify[nCol] == GRID_JTFY_LEFT
oItem:setTextAlignment( Qt_AlignLeft )
CASE ::aColumnJustify[nCol] == GRID_JTFY_RIGHT
oItem:setTextAlignment( Qt_AlignRight )
CASE ::aColumnJustify[nCol] == GRID_JTFY_CENTER
oItem:setTextAlignment( Qt_AlignHCenter )
ENDCASE
ENDIF
Code: Select all
ELSEIF Pcount() == 3
oItem := QTableWidgetItem()
IF ValType( ::aColumnJustify ) != 'U'
DO CASE
CASE ::aColumnJustify[nCol] == GRID_JTFY_LEFT
oItem:setTextAlignment( hb_bitOR( Qt_AlignVCenter, Qt_AlignLeft ) )
CASE ::aColumnJustify[nCol] == GRID_JTFY_RIGHT
oItem:setTextAlignment( hb_bitOR( Qt_AlignVCenter, Qt_AlignRight ) )
CASE ::aColumnJustify[nCol] == GRID_JTFY_CENTER
oItem:setTextAlignment( hb_bitOR( Qt_AlignVCenter, Qt_AlignHCenter ) )
ENDCASE
ENDIF