Page 79 of 106
Re: Welcome to the Project Developers' Table
Posted: Thu Oct 21, 2010 10:14 pm
by Roberto Lopez
mrduck wrote:IMPORTANT:
hmg code must be updated for this change:
HB_*Class:from( pPtr ) => *ClassFromPointer( pPtr )
<...>
At first thanks.
Since you have adequate permissions already, could be better if you commit the changes yourself.
Thanks again.
Re: Welcome to the Project Developers' Table
Posted: Thu Oct 21, 2010 10:15 pm
by mrduck
rathinagiri, can you please apply this patch to grid.prg ?
Its use is to set the value returned by the keypress event method when Enter is pressed... now the focus is moved to the next cell, while sometimes it is good to not move the cursor.
This change is perfectly compatible with how hmg 4 actually works (I think it is also compatible hmg 3) as the default value is .F.
Code: Select all
....
DATA lReturnValueOnEnter INIT .F.
....
METHOD ReturnValueOnEnter SETGET
....
METHOD ReturnValueOnEnter( lValue ) CLASS GRID
DEFAULT lValue TO .F.
IF Pcount() == 0
RETURN ::lReturnValueOnEnter
ELSEIF Pcount() == 1
::lReturnValueOnEnter := lValue
ENDIF
RETURN NIL
and of course in METHOD DoCellKeyBoardEvents( e ) Class GRID
Code: Select all
::oQTObject:removeCellWidget( ::nCellRow-1,::nCellCol-1 )
return ::lReturnValueOnEnter // Here return the value
CASE nKey == Qt_Key_Escape .and. nModifiers == Qt_NoModifier
xValue := ::xOldValue
Self:Cell( ::nCellRow,::nCellCol,xValue )
Re: Welcome to the Project Developers' Table
Posted: Thu Oct 21, 2010 10:19 pm
by mrduck
Roberto Lopez wrote:
Since you have adequate permissions already, could be better if you commit the changes yourself.
Since I cannot access svn repository from work I need convert from svn to mercurial (another system similar (but better

) to svn) on a server I have on the net and work from that repository... so I have no way to easily add that patch to svn in a relatively short time....
this is the reason why I propose the changes but don't commit myself
I hope you understand
Re: Welcome to the Project Developers' Table
Posted: Thu Oct 21, 2010 10:33 pm
by bedipritpal
Roberto Lopez wrote:
Print text alignment is not working anymore.
What is the problem ?
Re: Welcome to the Project Developers' Table
Posted: Thu Oct 21, 2010 11:14 pm
by Roberto Lopez
mrduck wrote:Roberto Lopez wrote:
Since you have adequate permissions already, could be better if you commit the changes yourself.
Since I cannot access svn repository from work I need convert from svn to mercurial (another system similar (but better

) to svn) on a server I have on the net and work from that repository... so I have no way to easily add that patch to svn in a relatively short time....
this is the reason why I propose the changes but don't commit myself
I hope you understand
I understand.
I have no previous experience with diff utility, that was the reason for my request. I'll find one and start learning...

Re: Welcome to the Project Developers' Table
Posted: Thu Oct 21, 2010 11:17 pm
by Roberto Lopez
bedipritpal wrote:Roberto Lopez wrote:
Print text alignment is not working anymore.
What is the problem ?
The text appears always left aligned, as if QTextOption() were not working.
Re: Welcome to the Project Developers' Table
Posted: Thu Oct 21, 2010 11:43 pm
by bedipritpal
Roberto Lopez wrote:
The text appears always left aligned, as if QTextOption() were not working.
Did you check the value of "n" ?
It must be 0x0001, 0x0002, 0x0004, 0x0008 or combination.
Re: Welcome to the Project Developers' Table
Posted: Thu Oct 21, 2010 11:57 pm
by bedipritpal
Roberto Lopez wrote:
Code: Select all
IF valtype( nToRow )=='N' .and. valtype( nToCol )=='N'
QRectF := QRectF( nCol , nRow , nToCol - nCol , nToRow - nRow )
QTextOption := QTextOption()
IF valtype( nAlignment ) == 'N'
QTextOption:setAlignment( nAlignment )
ELSE
QTextOption:setAlignment( 0 )
ENDIF
::qPainter:drawText( QRectF , cData , QTextOption )
It should be:
Code: Select all
IF valtype( nToRow )=='N' .and. valtype( nToCol )=='N'
qRectF := QRectF( nCol , nRow , nToCol - nCol , nToRow - nRow )
qTextOption := QTextOption()
IF valtype( nAlignment ) == 'N'
qTextOption:setAlignment( nAlignment )
ELSE
qTextOption:setAlignment( 0 )
ENDIF
::qPainter:drawText( QRectF , cData , QTextOption )
The variable prefix has to be cleaned in whole HMG.
It is very ambiqous and difficult to locate a bug.
QTextOption:setAlignment( nAlignment )
The line above, at a first glance, suggests that you are
calling the class object itself, NOT a method of class instance.
Re: Welcome to the Project Developers' Table
Posted: Fri Oct 22, 2010 12:13 am
by Roberto Lopez
bedipritpal wrote:Roberto Lopez wrote:
The text appears always left aligned, as if QTextOption() were not working.
Did you check the value of "n" ?
It must be 0x0001, 0x0002, 0x0004, 0x0008 or combination.
The values are correct.
As I've already said, the code was working prior to conversion.
Re: Welcome to the Project Developers' Table
Posted: Fri Oct 22, 2010 12:35 am
by Roberto Lopez
Roberto Lopez wrote:
The text appears always left aligned, as if QTextOption() were not working.
The last version prior conversion, was working perfectly.
This is the code:
Code: Select all
if valtype(nToRow)=='N' .and. valtype(nToCol)=='N'
QRectF := QRectF( nCol , nRow , nToCol - nCol , nToRow - nRow )
QTextOption := QTextOption()
if valtype(nAlignment) == 'N'
QTextOption:setAlignment(nAlignment)
else
QTextOption:setAlignment(0)
endif
::qPainter:drawText_6( QRectF , cData , QTextOption )
Is possible that the problem be in drawText() call regarding the new code that allows us avoid the 'method_n()' format ?