Colouring TwBrowse ( Hernan's )

Colouring TwBrowse ( Hernan's )

Postby Rimantas » Tue Oct 11, 2005 5:08 am

Hello !

At this time TwBrowse have 2 possibilities to colour background of active row - logic lCellStyle . If choose ! lCellStyle , then all active row coloured with one color and the active cell too . I want to do something mix of both styles - paint active row with wanted color and underline with other color active cell . Is it possible ?

Here is my own background painting for bBkColor color :

METHOD GrPair( nRow, nCol, nStyle, oSel, nFtr ) CLASS TWBrowse // Rimantas U.
local nClr := ::nClrPane
default nFtr := NIL

if nStyle == 1 .or. nStyle == 2 // headers and footers
nClr := GetSysColor( 15 )
if nStyle == 1 .and. nFtr # NIL
if nFtr == nCol
nClr := nRGB( 192, 192, 192 )
endif
endif
elseif nStyle == 3 // active cells
nClr := GetSysColor( 13 )
if ( ::lCellStyle .and. nCol == ::nColAct ) .or. !::lCellStyle
if oSel <> NIL .and. oSel:lSelect
nClr := nRGB( 128, 128, 128 ) // CLR_GRAY
endif
endif
elseif nStyle == 0 // normal cells
if oSel <> NIL .and. oSel:lSelect
nClr := nRGB( 192, 192, 192 ) // CLR_HGRAY
else
if ::aGrPair[ 1 ] # ::aGrPair[ 2 ]
if ::nGrRec != if( upper( ::cAlias ) # "ARRAY", ( ::cAlias )->( recno() ), ::nAt ) .and. ::lScrolling
::nGrRec := if( upper( ::cAlias ) # "ARRAY", ( ::cAlias )->( recno() ), ::nAt )
nClr := ::aGrPair[ 1 ]
::aGrPair[ 1 ] := ::aGrPair[ 2 ]
::aGrPair[ 2 ] := nClr
endif
if nRow % 2 == 0
nClr := ::aGrPair[ 2 ]
else
nClr := ::aGrPair[ 1 ]
endif
else
nClr := NIL
endif
// for active row
if nRow == ::nRowPos
nClr := nRGB( 0, 200, 255 )
endif
endif
endif
return( nClr )

The problem : repainting of background after moving with Up and Down keys . It leave the same background colour an the previuos line . I tried to correct GoUp() and GoDown() methods adding Refresh . It did the job , but it slowness browse too .. :-(( . With PgDown and PgUp it works OK , because here its repainting of all browse . Maybe you can help me in this situation ?

With best regards ! Rimantas .
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Postby Rimantas » Wed Oct 12, 2005 8:45 am

Hi ! After some tests I did what I wanted . Maybe it's not so good solution , but that works fine . In GoUp and GoDown methods I added some lines :

METHOD GoUp() CLASS TWBrowse

local nSkipped
local nLines := ::nRowCount()
// 2 new lines here
local nRowPrv := ::nRowPos
local nRecNew := nRecPrv := ( ::cAlias )->( recno() )

if ( ::nLen := Eval( ::bLogicLen ) ) < 1
return nil
endif

if ! ::lHitTop
::DrawLine()
if ::Skip( -1 ) == -1
::lHitBottom := .f.
if ::nRowPos > 1
::nRowPos--
else
::lScrolling := .T. //fgam
WBrwScrl( ::hWnd, -1, If( ::oFont != nil, ::oFont:hFont, 0 ), ::nLineStyle )
endif
else
::lHitTop := .t.
endif
::DrawSelect()
if ::oVScroll != nil
If ::bLogicPos != Nil // By CeSoTech
::oVScroll:SetPos( _POSVSCROLL_ )
else
::oVScroll:GoUp()
endif
endif
// it's needful to repaint previuos line
// ::lCellMix , my new parameter
if !::lHitTop .and. ::lCellStyle .and. ::lCellMix
if nRowPrv == 1 // if go up at the top of browse
nRowPrv ++
endif
nRecNew := ( ::cAlias )->( recno() )
( ::cAlias )->( dbgoto( nRecPrv ) )
::DrawLine( nRowPrv )
( ::cAlias )->( dbgoto( nRecNew ) )
endif

if ::bChange != nil
Eval( ::bChange, Self )
endif
endif

return nil

//----------------------------------------------------------------------------//

METHOD GoDown() CLASS TWBrowse

local nSkipped
local nLines := ::nRowCount()
local nRecPrv := ( ::cAlias )->( recno() )
local nRowPrv := ::nRowPos
local nRecNew

if ( ::nLen := Eval( ::bLogicLen ) ) < 1
return nil
endif

if ! ::lHitBottom
::DrawLine()
if ::Skip( 1 ) == 1
::lHitTop := .f.
if ::nRowPos < nLines
::nRowPos++
else
::lScrolling := .T. //fgam
WBrwScrl( ::hWnd, 1, If( ::oFont != nil, ::oFont:hFont, 0 ), ::nLineStyle )
endif
else
::lHitBottom := .t.
endif
::DrawSelect()
if ::oVScroll != nil
If ::bLogicPos != Nil // By CeSoTech
::oVScroll:SetPos( _POSVSCROLL_ )
else
::oVScroll:GoDown()
endif
endif
if !::lHitBottom .and. ::lCellStyle .and. ::lCellMix
if nRowPrv == nLines
nRowPrv --
endif
nRecNew := ( ::cAlias )->( recno() )
( ::cAlias )->( dbgoto( nRecPrv ) )
::DrawLine( nRowPrv )
( ::cAlias )->( dbgoto( nRecNew ) )
endif
if ::bChange != nil
Eval( ::bChange, Self )
endif
endif

return nil

Now I'm seeing actual row in selected color and with active cell . One my customer asked about that possibility , because it's more easy to detect in which row you are and then only with <- and -> keys you can go to needful column and then press enter to correct data .

With best regards ! Rimantas .
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Hernan's Twbrowse ( msvc ) ??

Postby Rick Lipkin » Wed Oct 12, 2005 2:07 pm

Just curious if you are using Borland or MSVC as your C++ compiler. I would like to be able to re-compile TWbrowse with Microsoft but am hung up on the naitave .c code.

Rick Lipkin
SC Dept of Health, USA
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Hernan's Twbrowse ( msvc ) ??

Postby Rimantas » Thu Oct 13, 2005 5:37 am

[quote="Rick Lipkin"]Just curious if you are using Borland or MSVC as your C++ compiler. I would like to be able to re-compile TWbrowse with Microsoft but am hung up on the naitave .c code.

Hi Rick ! I can't to run FWH with MS C++ compiler . It seems that my olds FWH libraries ( 2.5 ver of 2004 October ) are buggies for that compiler . Antonio , as ussual , promised to view about that . But that was promise ... So I leaved with BC ++ .

With best regards ! Rimantas .
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Hernan's Twbrowse ( msvc ) ??

Postby Rimantas » Thu Oct 13, 2005 5:46 am

Also I did this my paint fully - as for DBF as for array . For mouse move too . It works fine . I did one method :

METHOD LineRepaint( nRowPrv, nRecPrv, nDirection ) CLASS TWBrowse
local nRecNew := if( upper( ::cAlias ) != "ARRAY", ( ::cAlias )->( recno() ), ::nAt )
default nDirection := 0

if ::lCellStyle

if nDirection == 1
if !::lHitTop .and. nRowPrv == 1
nRowPrv ++
endif
elseif nDirection == 2
if !::lHitBottom .and. nRowPrv == ::nRowCount()
nRowPrv --
endif
endif
if nRowPrv # ::nRowPos

if upper( ::cAlias ) != "ARRAY"
( ::cAlias )->( dbgoto( nRecPrv ) )
else
::nAt := nRecPrv
endif

::DrawLine( nRowPrv )

if upper( ::cAlias ) != "ARRAY"
( ::cAlias )->( dbgoto( nRecNew ) )
else
::nAt := nRecNew
endif

endif

endif
return( NIL )

And in GoUp, GoDown, LButtonDow, PageDown I added this method after ::DrawSelect() . In mentioned methods two vars added :

local nRowPrv := ::nRowPos
local nRecPrv := if( upper( ::cAlias ) # "ARRAY", ( ::cAlias )->( recno() ), ::nAt )

only in GoUp and GoDown nDirection it's needful . Because if you reach browse top and bottom , but don't lHitTop and lHitBottom , then only this lines are repainted , so it's needful ++ or -- for this the previuos line .

With best regards ! Rimantas
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: Hernan's Twbrowse ( msvc ) ??

Postby Antonio Linares » Thu Oct 13, 2005 8:22 am

Rimantas,

Rimantas wrote:It seems that my olds FWH libraries ( 2.5 ver of 2004 October ) are buggies for that compiler . Antonio , as ussual , promised to view about that. But that was promise ... So I leaved with BC ++.


Its an old version and new Microsoft compiler versions. We can't make miracles, sorry :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Hernan's Twbrowse ( msvc ) ??

Postby Rimantas » Thu Oct 13, 2005 8:46 am

Antonio Linares wrote:Rimantas,

Its an old version and new Microsoft compiler versions. We can't make miracles, sorry :)


Excuse , Antonio , but I can't agree . When I buyed FWH I don't checked have bugs your libs for MS compiler or not . But in my opinion , your libs must be without bugs . So please , give me information which MS compiler works with your libs ( 2004 October ) or give libs without bugs .

With best regards ! Rimantas
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Postby Antonio Linares » Sat Oct 15, 2005 9:27 am

Rimantas,

Tell me a software product that does not have bugs. Software is constantly in evolution, towards a new version, with more functionality and as few bugs as possible.

FWH 2.4 version has more than two years. Our software is constantly evolving, and its quite difficult to support a two years old version.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rimantas » Sat Oct 15, 2005 6:07 pm

[Tell me a software product that does not have bugs. Software is constantly in evolution, towards a new version, with more functionality and as few bugs as possible.

FWH 2.4 version has more than two years. Our software is constantly evolving, and its quite difficult to support a two years old version.[/quote]

All other softwares have freely accessible correction of bugs . I buyed your libs at 2004 September , you let me upgrade to October version also , because you promised for that ActiveX support . That's OK . With BCC all is working . Today is 2005 October. One year passed . At July-August I tried your libs with MS VC and found that they are buggy . But it's true to believe , that at this time from 2004.09 to 2005.07 nothing was working with 2004.09-10 FWH versions with MS VC compiler and that they buyed new version for that compiler , without bugs ... Of course , I can't to direct how to organize your own job . But ... I think that this discusion is a waste of time . Because I don't have any means for you to correct libs or something similar . And you and I have own trues and opinions . So good luck to you , please , create software without bugs :-) . Be more careful .

With best regards ! Rimantas .
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Postby Antonio Linares » Sat Oct 15, 2005 7:33 pm

Rimantas,

> At July-August I tried your libs with MS VC and found that they are buggy

Could you please describe what bugs are them and how to reproduce them ? Thanks.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rimantas » Sun Oct 16, 2005 5:36 pm

Antonio Linares wrote:Rimantas,

> At July-August I tried your libs with MS VC and found that they are buggy

Could you please describe what bugs are them and how to reproduce them ? Thanks.


Of course ! At first I tried to build FWH samples with MS VC ( mine Visual studio 98 , VC++ 6 ver. ) . xHarbour binaries downloaded from xHarbour.org ( 0.99.50 version ) . I only changed needful paths in your buildxm.bat . All buildings of samples are stopped on the same error . Log of trying to build testtcbr :

rtl.lib(dateshb.obj) : warning LNK4006: "void __cdecl HB_FUN_STOD(void)"

(?HB_FUN_STOD@@YAXXZ) already defined in FiveHCM.lib(OR.obj); second definition ignored
rtl.lib(math.obj) : warning LNK4006: __matherr already defined in

LIBC.lib(matherr.obj); second definition ignored
FiveHCM.lib(FFDLGPRC.obj) : error LNK2001: unresolved external symbol "struct METHOD *

__cdecl hb_objGetpMethod(struct _HB_ITEM *,struct HB_SYMB *)"

(?hb_objGetpMethod@@YAPAUMETHOD@@PAU_HB_ITEM@@PAUHB_SYMB@@@Z)
testtcbr.exe : fatal error LNK1120: 1 unresolved externals

In all builds the same : the 2 warnings and the error on FFDLGPRC.obj . Maybe it's the only one bug . Sorry , but my compilation allways stopped on this error and I don't know exist them more or not ...

With best regards ! Rimantas .
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Postby Rimantas » Mon Oct 17, 2005 4:35 am

Antonio Linares wrote:Rimantas,

Tell me a software product that does not have bugs. Software is constantly in evolution, towards a new version, with more functionality and as few bugs as possible.

FWH 2.4 version has more than two years. Our software is constantly evolving, and its quite difficult to support a two years old version.


Excuse me , I mixed up years and version :-) . Mine is FWH 2.5 of 2004 October .

With best regards !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Postby Rimantas » Tue Oct 18, 2005 9:09 am

Antonio Linares wrote:Rimantas,

> At July-August I tried your libs with MS VC and found that they are buggy

Could you please describe what bugs are them and how to reproduce them ? Thanks.


Excuse me , but maybe I'm not so patient :-( . Are any news about that ?

With best regards ! Rimantas .
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Willi Quintana and 41 guests