See my previous response, then here is some new stuff:
Old code:
Code: Select all | Expand
// Define the browse contol
REDEFINE XBROWSE oLBxcl ID 860 OF oFldCSE:aDialogs[ 1 ] ;
ON CHANGE ( oClientsr:load(), oFldCSE:aDialogs[ 1 ]:update() );
ON DBLCLICK ( lCliScoped := oServiceUnits:ScopeUnits( oClientsr, lCliScoped ), oLbvm:refresh( ),;
oServiceUnitsr:load( ), oFldCSE:aDialogs[2]:update( ),oFldCSE:setoption(2) ) UPDATE
// Attach the database
oLbxcl:setoDBF( oClients )
// Add the columns
add to oLbxcl header "Account" data oClients:acrnum ALIGN CENTER ORDER "eclnum" SIZE 100
add to oLbxcl Header "Client" data oClients:clicom ALIGN LEFT ORDER "eclcom" SIZE 300
add to oLbxcl header "City" data oClients:clicty ALIGN LEFT SIZE 200
add to oLbxcl Header "Phone" data oClients:clipho ALIGN LEFT ORDER "eclpho" SIZE 170
add to oLbxcl Header "Cellular" data oClients:clicel ALIGN LEFT SIZE 170
add to oLbxcl Header "Email" data oClients:clieml ALIGN LEFT SIZE 250
add to oLbxcl Header "Last Visit" data oClients:clidls ALIGN RIGHT SIZE 120
add to oLbxcl Header "Total Sales" data oClients:acrytd ALIGN RIGHT SIZE 120
Replaced with:
Code: Select all | Expand
REDEFINE XBROWSE oLBxcl ;
DATASOURCE oClients ;
HEADERS "Account", "Client", "City", "Phone", "Cellular", "Last Visti", "Total Sales", "Email" ;
COLUMNS "acrnum", "clicom", "clicty", "clipho", "clicel", "clidls", "acrytd", "clieml" ;
ORDERS "eclnum","eclcom",,"eclpho" ;
ID 860 ;
OF oFldCSE:aDialogs[ 1 ];
ON CHANGE ( oClientsr:load(), oFldCSE:aDialogs[ 1 ]:update() ) ;
ON DBLCLICK ( lCliScoped := oServiceUnits:ScopeUnits( oClientsr, lCliScoped ), oLbvm:refresh( ),;
oServiceUnitsr:load( ), oFldCSE:aDialogs[2]:update( ),oFldCSE:setoption(2) ) ;
UPDATE
Followed in both cases by:
Code: Select all | Expand
// Provide the header gradient
oLbxcl:bClrGrad := { | lInvert | If( ! lInvert, { { 0.50,16776960,16777215 }, ;
{ 0.50,16777215,16776960 } }, { { 0.50,128,16777215 }, { 0.50,16777215,128 } } ) }
// Set the styles
oLbxcl:nMarqueeStyle := MARQSTYLE_HIGHLROW
oLbxcl:nColDividerStyle := LINESTYLE_RAISED
oLbxcl:nRowDividerStyle := LINESTYLE_RAISED
oLbxcl:nHeadStrAligns := AL_CENTER
oLbxcl:lHScroll := .t.
// Use for incremental search on opened database
oLbxcl:bSeek := { |c| oClients:Seek( Upper( c )) }
And from the .rc dialog:
Code: Select all | Expand
CONTROL "",860,"TxBrowse",WS_BORDER | WS_VSCROLL | WS_TABSTOP,5,195,640,170
The old code worked fine except we have to now specify the SIZE variable in all browses. When clicking on a column header it would apply the index and reorder the column, and show the ^ symbol in the header cell
The new code requires a change to the .rc file to add WS_HSCROLL to the browse control. In addition, the browse no longer responds to the click on the header to change the order.
Please note, your samples use the build from code options. These are all REDEFINE of resources. In addition, this is within a folder defined within a dialog.
All of the old coding works with 15.09 but fails on .11 and .12. I have no problem with new coding, but there do appear to be problems with it still. If you see something in my code that is wrong, I will make changes and test it. This is actual code and it has been working for years with 15.09 and earlier versions.
I actually prefer the new code. Once it works correctly, it is going to be more compact and easier to debug.
Built with FWH 15.12, Harbour, MSVC 2013
Tim