xbrowse : Order column with color , Partialy solved

xbrowse : Order column with color , Partialy solved

Postby demont frank » Sun Nov 02, 2008 7:45 am

Hello,

Sorry , i did not had the intention to start a new thread , see also the previous one

Code: Select all  Expand view
#include "FiveWin.ch"
#include "xbrowse.ch"
#define CLR_1 nRGB( 190, 215, 190 )
#define CLR_2 nRGB( 230, 230, 230 )
function Main()
local oDlg, oBrw , oCol
DEFINE DIALOG oDlg SIZE 300, 200
@ 0, 0 XBROWSE oBrw OF oDlg ARRAY { { "one","two","three" } , {"aOne","ztwo","bthree"}} AUTOCOLS AUTOSORT
oBrw:Swapcols(1,2,.T.)
FOR EACH oCol IN oBrw:aCols
  oCol:bClrStd := {||{CLR_BLACK, iif( oBrw:nArrayAt % 2 = 0, CLR_1, CLR_2  ) + ;
          IIF(oCol:cOrder="A",2001,IIF(oCol:cOrder="D",-1000,0))}}
NEXT
oBrw:CreateFromCode()
oBrw:bKeyDown = { || oDlg:SetText( Str( oBrw:nColSel ) ) }
ACTIVATE DIALOG oDlg CENTER ON INIT ( oDlg:oClient := oBrw, oDlg:Resize() )
return nil


Note that Swapcol comes before giving oCol:bClrStd his value.

IT IS NOT SOLVED WHEN THE USER MOVES COLUMNS (Clicking and dragging on the header).

I hope somone can explain why this doesn't work in this case , or in the case oBrw:Swapcols() comes after asigning oCol:bClrStd.

Frank
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Col-Colors

Postby ukoenig » Sun Nov 02, 2008 11:35 am

Hello Frank,

I wanted to compile your sample, but there are errors.
I couldn't test it ( FWH 8.09 ).
Code: Select all  Expand view
  Error occurred at: 11/02/08, 12:42:13
   Error description: Error BASE/1084  Argument error: /
   Args:
     [   1] = N   82
     [   2] = U   

Stack Calls
===========
   Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:TXBROWSE(0)
   Called from:  => TXBROWSE:ROWCOUNT(0)
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:REFRESH(0)
   Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:SORTARRAYDATA(0)
   Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:SETARRAY(0)
   Called from:  => AEVAL(0)
   Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:SETARRAY(0)
   Called from: .\source\classes\XBROWSE.PRG => XBRWSETDATASOURCE(0)
   Called from: .\source\classes\XBROWSE.PRG => XBROWSENEW(0)
   Called from: .\backgrd.PRG => MAIN(8)

// Line 8
// -------
@ 0, 0 XBROWSE oBrw OF oDlg ARRAY { { "one","two","three" } , {"aOne","ztwo","bthree"}} AUTOCOLS AUTOSORT


It seems you want to change the col-colors like the screeshot ?

Image

Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Postby demont frank » Sun Nov 02, 2008 1:19 pm

Uwe ,

I am using fwh8.10 , and indeed there where changes in the code from xbrowse , as a result from some errors i reported.

You can follow up the discussion between me and antonio in the forum , but i suppose only one change must be made in xbrowse , method refresh :

if nKeyNo >= ::nLen .and. ::nLen > 1 .AND. ::lCreated
::nRowSel := Min( nKeyNo, ::RowCount() )
endif


Frank
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 84 guests