Considering all of the enhancements made to xBrowse, what is the best documentation available for the current class ? What are the best sample files to review ?
I've been using TSBrowse ( older version ) but am considering using xBrowse.
Tim
ukoenig wrote:did You have a look at the xBrowseTools ?
With the Tools, You can test all settings with Preview.
As well there is a source-generator included.
It is a very good help, if You want to change to xBrowse.
//----------- xBrowse - Test, using Var's from the Project-DBF -----------------//
STATIC FUNCTION Test_Browse5()
Local oDlg5, oLbx30, oBrush5, oBmp5
Local cAlias := cGetNewAlias( "CUST" )
LOCAL oBmp1, nBMPheight
LOCAL oHeadFont, oBrwFont, oFootFont
nFOR := 1
IF aFONT1_3 = .T. .and. aFONT1_4 = .T.
DEFINE FONT oHeadFont NAME aFONT1_1 SIZE 0, aFONT1_2 BOLD ITALIC
ENDIF
IF aFONT1_3 = .F. .and. aFONT1_4 = .F.
DEFINE FONT oHeadFont NAME aFONT1_1 SIZE 0, aFONT1_2
ENDIF
IF aFONT1_3 = .T. .and. aFONT1_4 = .F.
DEFINE FONT oHeadFont NAME aFONT1_1 SIZE 0, aFONT1_2 BOLD
ENDIF
IF aFONT1_3 = .F. .and. aFONT1_4 = .T.
DEFINE FONT oHeadFont NAME aFONT1_1 SIZE 0, aFONT1_2 ITALIC
ENDIF
IF aFONT2_3 = .T. .and. aFONT2_4 = .T.
DEFINE FONT oBrwFont NAME aFONT2_1 SIZE 0, aFONT2_2 BOLD ITALIC
ENDIF
IF aFONT2_3 = .F. .and. aFONT2_4 = .F.
DEFINE FONT oBrwFont NAME aFONT2_1 SIZE 0, aFONT2_2
ENDIF
IF aFONT2_3 = .T. .and. aFONT2_4 = .F.
DEFINE FONT oBrwFont NAME aFONT2_1 SIZE 0, aFONT2_2 BOLD
ENDIF
IF aFONT2_3 = .F. .and. aFONT2_4 = .T.
DEFINE FONT oBrwFont NAME aFONT2_1 SIZE 0, aFONT2_2 ITALIC
ENDIF
IF aFONT3_3 = .T. .and. aFONT3_4 = .T.
DEFINE FONT oFootFont NAME aFONT3_1 SIZE 0, aFONT3_2 BOLD ITALIC
ENDIF
IF aFONT3_3 = .F. .and. aFONT3_4 = .F.
DEFINE FONT oFootFont NAME aFONT3_1 SIZE 0, aFONT3_2
ENDIF
IF aFONT3_3 = .T. .and. aFONT3_4 = .F.
DEFINE FONT oFootFont NAME aFONT3_1 SIZE 0, aFONT3_2 BOLD
ENDIF
IF aFONT3_3 = .F. .and. aFONT3_4 = .T.
DEFINE FONT oFootFont NAME aFONT3_1 SIZE 0, aFONT3_2 ITALIC
ENDIF
REQUEST DBFCDX
DBSELECTAREA(3)
USE CUSTOMER NEW ALIAS (cAlias) SHARED VIA "DBFCDX"
GO TOP
DEFINE DIALOG oDlg5 RESOURCE "TESTSOURCE"
oLbx30 := TXBrowse():New( oDlg5 )
nBMPheight := oLbx30:nRowHeight
IF BR_STYLE = 1
IF BR_LINE = 1
oLbx30:nColDividerStyle := LINESTYLE_BLACK
oLbx30:nRowDividerStyle := LINESTYLE_BLACK
ENDIF
IF BR_LINE = 2
oLbx30:nColDividerStyle := LINESTYLE_DARKGRAY
oLbx30:nRowDividerStyle := LINESTYLE_DARKGRAY
ENDIF
IF BR_LINE = 3
oLbx30:nColDividerStyle := LINESTYLE_FORECOLOR
oLbx30:nRowDividerStyle := LINESTYLE_FORECOLOR
ENDIF
IF BR_LINE = 4
oLbx30:nColDividerStyle := LINESTYLE_LIGHTGRAY
oLbx30:nRowDividerStyle := LINESTYLE_LIGHTGRAY
ENDIF
IF BR_LINE = 5
oLbx30:nColDividerStyle := LINESTYLE_INSET
oLbx30:nRowDividerStyle := LINESTYLE_INSET
ENDIF
IF BR_LINE = 6
oLbx30:nColDividerStyle := LINESTYLE_RAISED
oLbx30:nRowDividerStyle := LINESTYLE_RAISED
ENDIF
ENDIF
IF BR_STYLE = 2
oLbx30:nColDividerStyle := LINESTYLE_NOLINES
IF BR_LINE = 1
oLbx30:nRowDividerStyle := LINESTYLE_BLACK
ENDIF
IF BR_LINE = 2
oLbx30:nRowDividerStyle := LINESTYLE_DARKGRAY
ENDIF
IF BR_LINE = 3
oLbx30:nRowDividerStyle := LINESTYLE_FORECOLOR
ENDIF
IF BR_LINE = 4
oLbx30:nRowDividerStyle := LINESTYLE_LIGHTGRAY
ENDIF
IF BR_LINE = 5
oLbx30:nRowDividerStyle := LINESTYLE_INSET
ENDIF
IF BR_LINE = 6
oLbx30:nRowDividerStyle := LINESTYLE_RAISED
ENDIF
ENDIF
IF BR_STYLE = 3
oLbx30:nRowDividerStyle := LINESTYLE_NOLINES
IF BR_LINE = 1
oLbx30:nColDividerStyle := LINESTYLE_BLACK
ENDIF
IF BR_LINE = 2
oLbx30:nColDividerStyle := LINESTYLE_DARKGRAY
ENDIF
IF BR_LINE = 3
oLbx30:nColDividerStyle := LINESTYLE_FORECOLOR
ENDIF
IF BR_LINE = 4
oLbx30:nColDividerStyle := LINESTYLE_LIGHTGRAY
ENDIF
IF BR_LINE = 5
oLbx30:nColDividerStyle := LINESTYLE_INSET
ENDIF
IF BR_LINE = 6
oLbx30:nColDividerStyle := LINESTYLE_RAISED
ENDIF
ENDIF
IF BR_STYLE = 4
oLbx30:nRowDividerStyle := LINESTYLE_NOLINES
oLbx30:nColDividerStyle := LINESTYLE_NOLINES
ENDIF
IF BR_STYLE < 4
IF BR_CELL = 1
oLbx30:nMarqueeStyle := MARQSTYLE_NOMARQUEE
ENDIF
IF BR_CELL = 2
oLbx30:nMarqueeStyle := MARQSTYLE_DOTEDCELL
ENDIF
IF BR_CELL = 3
oLbx30:nMarqueeStyle := MARQSTYLE_SOLIDCELL
ENDIF
IF BR_CELL = 4
oLbx30:nMarqueeStyle := MARQSTYLE_HIGHLCELL
ENDIF
IF BR_CELL = 5
oLbx30:nMarqueeStyle := MARQSTYLE_HIGHLROWRC
ENDIF
IF BR_CELL = 6
oLbx30:nMarqueeStyle := MARQSTYLE_HIGHLROW
ENDIF
IF BR_CELL = 7
oLbx30:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
ENDIF
ENDIF
// HEADER GADIENT ON / OFF
// ---------------------------------------
IF HEADGRAD = 1
oLbx30:l2007 := .T.
oLbx30:bClrGrad := { | lInvert | If( ! lInvert, ;
{ { MOVE1, BR_COLOR1, BR_COLOR2 }, ;
{ MOVE1, BR_COLOR2, BR_COLOR1 } }, ;
{ { MOVE2, BR_MCOLOR, BR_COLOR2 }, ;
{ MOVE2, BR_COLOR2, BR_MCOLOR } } ) }
oLbx30:bClrHeader := { || { BR_THCOLOR, 0 } }
IF FOOTER = 1
oLbx30:bClrFooter := { || { BR_TFCOLOR, 0 } }
ENDIF
ELSE
oLbx30:bClrGrad := NIL
oLbx30:l2007 := .F.
ENDIF
// Color-Set
// -------------------------------------------------
oLbx30:bClrSelFocus = { || { SELTCOLOR, SELBCOLOR } }
IF SELECTOR = 1
// Color Record-Selector
// --------------------------------------
oLbx30:nRecSelColor = SELCOLOR1
ELSE
oLbx30:lRecordSelector := .F.
ENDIF
// Lost Focus Color
// ---------------------
oLbx30:bClrSel = { || { SELTCOLOR, SELBCOLOR } }
IF SCROLLH = 1
oLbx30:lHScroll := .T.
ELSE
oLbx30:lHScroll := .F.
ENDIF
IF SCROLLV = 1
oLbx30:lVScroll := .T.
ELSE
oLbx30:lVScroll := .F.
ENDIF
IF FOOTER = 1
oLbx30:lFooter := .T.
oLbx30:nHeaderHeight := BRWHEADER
oLbx30:nFooterHeight := BRWFOOTER
ELSE
oLbx30:lFooter := .F.
oLbx30:nHeaderHeight := BRWHEADER
ENDIF
oCol := oLbx30:AddCol()
oCol:AddResource( "CLIP" )
oCol:AddResource( "star" )
oCol:bLClickHeader = { | nMRow, nMCol, nFlags, Self | ;
If( ::nHeadBmpNo == 2, ::nHeadBmpNo := 1, ;
::nHeadBmpNo := 2 ), ::oLbx30:Refresh() }
oCol:cHeader := "CLIP"
oCol:nHeadBmpNo := 1
oCol:nHeadBmpAlign := AL_RIGHT
oCol := oLbx30:AddCol()
oCol:bStrData := { || (cAlias)->First}
oCol:cHeader := "First"
oCol:cFooter := "First"
oCol := oLbx30:AddCol()
oCol:bStrData := { || (cAlias)->Last}
oCol:cHeader := "Last"
oCol:cFooter := "Last"
IF !EMPTY( LOGO2 )
oCol:AddBmpFile(LOGO2)
oCol:bBmpData := {|| 1 }
DEFINE BITMAP oBmp1 FILENAME LOGO2
nBMPHight := oBmp1:nHeight()
oBmp1:End()
ENDIF
oCol := oLbx30:AddCol()
oCol:bStrData := { || (cAlias)->City}
oCol:cHeader := "City"
oCol:cFooter := "City"
oCol := oLbx30:AddCol()
oCol:bStrData := { || (cAlias)->State}
oCol:cHeader := "State"
oCol:cFooter := "State"
oCol := oLbx30:AddCol()
oCol:bStrData := { || IIF((cAlias)->Married, "YES","NO")}
oCol:cHeader := "Married"
oCol:cFooter := "Married"
oCol := oLbx30:AddCol()
oCol:bStrData := { || DTOS((cAlias)->HireDate)}
oCol:cHeader := "HireDate"
oCol:cFooter := "HireDate"
oCol := oLbx30:AddCol()
oCol:bStrData := { || STR((cAlias)->Age)}
oCol:cHeader := "Age"
oCol:cFooter := "Age"
oCol := oLbx30:AddCol()
oCol:bStrData := { || STR((cAlias)->Salary)}
oCol:cHeader := "Salary"
oCol:cFooter := "Salary"
oLbx30:oFont := oBrwFont
oLbx30:nRowHeight := BR_ROW
DEFINE BRUSH oBrush5 COLOR SELCOLOR2
oLbx30:hBrushRecSel( oBrush5 )
RELEASE BRUSH oBrush5
IF !EMPTY( BRSELECT2 )
oBmp5 := ReadBitmap( 0, BRSELECT2 )
oLbx30:hBmpRecSel( oBmp5 )
ENDIF
oLbx30:SetRDD()
IF STRETCH = 2 .and. !EMPTY ( LOGO4 )
oLbx30:cBmpAdjBrush := LOGO4
oLbx30:SetBackGround( LOGO4 )
aeval( oLbx30:aCols, { |o|o:lColTransparent := .t. } )
ENDIF
oLbx30:CreateFromResource( 110 )
IF !EMPTY( LOGO2 )
IF oLbx30:nRowHeight < nBMPHight
oLbx30:nRowHeight := nBMPHight + 4
ENDIF
ENDIF
IF !EMPTY( LOGO1 )
DEFINE BRUSH oBrush5 FILENAME LOGO1
oLbx30:SetBackGround( oBrush5 )
RELEASE BRUSH oBrush5
oLbx30:Refresh()
ELSE
// COLUMN Data MONO / ALTERNATE
// ------------------------------------------------
IF VERTHORIZ = 1
IF ALTERMONO = 1
aClrCol := { { ROW_TEXT, ROW_COL2 }, { ROW_TEXT, ROW_COL1 } }
ELSE
aClrCol := { { ROW_TEXT, ROW_COL1 }, { ROW_TEXT, ROW_COL1 } }
ENDIF
oLbx30:bClrStd := { || aClrCol[ oLbx30:KeyNo % 2 + 1 ] }
ELSE
// Column-Display
lSELECT := .T.
aClrCol := { { ROW_TEXT, COL_COLOR }, { ROW_TEXT, ROW_COL1 } }
FOR nFOR := 1 TO LEN( oLbx30:aCols )
IF lSELECT = .T.
oLbx30:aCols[nFOR]:bClrStd := { || aClrCol[ nFOR % 1 + 2 ] }
lSELECT := .F.
ELSE
oLbx30:aCols[nFOR]:bClrStd := { || aClrCol[ nFOR % 2 + 1 ] }
lSELECT := .T.
ENDIF
NEXT
ENDIF
ENDIF
i := 1
FOR i := 1 TO LEN( oLbx30:aCols )
WITH OBJECT oLbx30:aCols[i]
oLbx30:aCols[i]:oHeaderFont := oHeadFont
oLbx30:aCols[i]:bClrHeader := { || { BR_THCOLOR, BR_COLOR1 } }
IF FOOTER = 1
oLbx30:aCols[i]:oFooterFont := oFootFont
oLbx30:aCols[i]:bClrFooter := { || { BR_TFCOLOR, BR_COLOR3 } }
ENDIF
END
NEXT
REDEFINE BUTTONBMP oBtn11 ID 10 OF oDlg5 ;
ACTION ( oDlg5:End() ) ;
BITMAP "Quit" PROMPT " Exit" TEXTRIGHT
oBtn11:cToolTip = { "Close" + CRLF + ;
"the Dialog","xBrowse-Preview", 1, CLR_BLACK, 14089979 }
ACTIVATE DIALOG oDlg5 CENTERED ;
ON PAINT DLG_BACK( oDlg5 ) ;
ON INIT ( oDlg5:Move( 30, 10, oDlg5:nWidth, oDlg5:nHeight, .f. ) )
DBSELECTAREA(3)
NET_CLOSE( 5, 5, .T. )
RELEASE FONT oHeadFont
RELEASE FONT oBrwFont
RELEASE FONT oFootFont
RETURN ( NIL )
// ---------------------------------------------
FUNCTION DLG_BACK( oDlg5 )
LOCAL oBrush6
LOCAL hDC := oDlg5:GetDC()
IF DLG_STYLE1 < 5
gradpaint2( hDC, oDlg5 )
ENDIF
IF DLG_STYLE1 = 5
DEFINE BRUSH oBrush6 COLOR DLG_COLOR1
FillRect(oDlg5:hDC, GetClientRect( oDlg5:hWnd ), oBrush6:hBrush )
oBrush6:End()
ENDIF
IF DLG_STYLE1 = 6
DEFINE BRUSH oBrush6 FILENAME LOGO3
FillRect(oDlg5:hDC, GetClientRect( oDlg5:hWnd ), oBrush6:hBrush )
oBrush6:End()
ENDIF
oDlg5:ReleaseDC()
RETURN ( NIL )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 95 guests