FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour sample onemany
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
sample onemany
Posted: Mon Feb 07, 2011 11:32 AM

I wish a test with Xbrowse with 3 DBF on a ownd or dialog

where I can see it pls ?

Best Regards, Saludos



Falconi Silvio
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: sample onemany
Posted: Tue Feb 08, 2011 11:52 AM
Silvio,

before each Browse You have to select the DBF like : DBSELECTAREA(1)



Code (fw): Select all Collapse
#include 'fivewin.ch'
#include 'xbrowse.ch'

FUNCTION MAIN()
local oDlg, oBrw1, oBrw2, oBrw3, hDC, oFont, oBrush1
local aGrad := { { 0.5,    RGB( 140,  56,   6 ),  RGB( 237, 234, 109 ) }, ;
                          { 0.5,    RGB( 237, 234, 109 ),  RGB(  85,  62,  84 ) } }

DEFINE BRUSH oBrush1 COLOR  128 // red
DEFINE BRUSH oBrush2 FILENAME "..\bitmaps\Cartoon.bmp"

DBSELECTAREA(1)
USE CUSTOMER ALIAS CUST

DBSELECTAREA(2)
USE STATES ALIAS STA

DBSELECTAREA(3)
USE SALES ALIAS SAL

DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
   
DEFINE DIALOG oDlg SIZE 700,300 PIXEL ;
FONT oFont TITLE 'XBrowse Gradient Rows'

DBSELECTAREA(1)
@ 10, 5 XBROWSE oBrw1 OF oDlg ; 
BACKGROUND "..\bitmaps\Cartoon.bmp" BCK_TILED ;
SIZE 100, 100 PIXEL ;
AUTOCOLS ALIAS 'CUST' 

oBrw1:nRowDividerStyle = LINESTYLE_NOLINES
oBrw1:nColDividerStyle = LINESTYLE_NOLINES
oBrw1:nMarqueeStyle    = MARQSTYLE_HIGHLROW

AEval( oBrw1:aCols, { | oCol | oCol:bPaintText := { | oCol, hDC, cData, aRect | ;
PaintCol( oCol, hDC, cData, aRect ) } } )

oBrw1:SetBackGround( oBrush1, )
oBrw1:CreateFromCode()

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

DBSELECTAREA(2)
@ 10, 120 XBROWSE oBrw2 OF oDlg ; 
BACKGROUND "..\bitmaps\Cartoon.bmp" BCK_TILED ;
SIZE 100, 100 PIXEL ;
AUTOCOLS ALIAS 'STA' 

oBrw2:CreateFromCode()

DBSELECTAREA(3)
@ 10, 240 XBROWSE oBrw3 OF oDlg ; 
BACKGROUND "..\bitmaps\Cartoon.bmp" BCK_TILED ;
SIZE 100, 100 PIXEL ;
AUTOCOLS ALIAS 'SAL' 

oBrw3:CreateFromCode()

ACTIVATE DIALOG oDlg CENTERED

oFont:End()
oBrush1:End()
oBrush2:End()

RETURN NIL

// ------------  Selected Row = Red / White ---------

STATIC FUNCTION PAINTCOL( oCol, hDC, cData, aRect )

if oCol:oBrw:VGetPos() == Cust->( OrdKeyNo() )

      GradientFill( hDC, aRect[ 1 ] - 2, aRect[ 2 ] - 3, aRect[ 3 ] + 1, aRect[ 4 ] + 5,;
                      { { 0.5, 16777215, 15589562 } }, .T. ) // Blue on White

      RoundBox( hDC, 2, aRect[ 1 ] - 1, WndWidth( oCol:oBrw:hWnd ) - 22, aRect[ 3 ] + 1, 2, 2,;
                RGB( 235, 244, 253 ), 1 ) 
      RoundBox( hDC, 1, aRect[ 1 ] - 2, WndWidth( oCol:oBrw:hWnd ) - 21, aRect[ 3 ] + 2, 2, 2,;
                RGB( 125, 162, 206 ), 1 ) 
endif

SetTextColor( hDC, 0 ) // Yellow Text
DrawTextEx( hDC, cData, aRect, oCol:nDataStyle )

RETURN NIL


Best Regards
Uwe :-)
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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: sample onemany
Posted: Tue Feb 08, 2011 12:43 PM
Mr. Uwe
before each Browse You have to select the DBF like : DBSELECTAREA(1)


It is not necessary to use DBSELECTAREA(n) at all because we specify the "ALIAS" clauses both while opening the files and also when defining and running the Xbrowses. Please try removing all lines containing DBSELECTAREA(n) and test. The program functions exactly the same way.

I am sure you know that we can now use the single statement
Code (fw): Select all Collapse
oBrw1:nMarqueeStyle    = MARQSTYLE_HIGHLWIN7

to get the win7style effect.
Regards



G. N. Rao.

Hyderabad, India
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: sample onemany
Posted: Tue Feb 08, 2011 04:07 PM

PERHAPS you not UNDERSTOOD MINE PROBLEM

FIRST DBF

CODE
DESC

SECOND DBF

CODE
CODE1 // THIS IS THE CODE OF FIRST DBF
DESC

THIRD DBF

CODE
CODE1 // THIS IS THE CODE OF SECOND DBF
DESC

WHEN i CLICK ON A RECORD OF FIRST XBROWSE THE PROCEDURE MUST SHOW THE RECORDS OF THAT CODE ON XBRW2 AND XBRW3

Best Regards, Saludos



Falconi Silvio
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: sample onemany
Posted: Tue Feb 08, 2011 04:28 PM

Use oBrw:bOnChange
Regards
Anser

Continue the discussion