A sample, how to use DEFAULT-Positions in xBrowse-Arrays.

A sample, how to use DEFAULT-Positions in xBrowse-Arrays.

Postby ukoenig » Wed Mar 19, 2008 7:39 pm

Hello,

There are some questions, about array-position in xbrowse

At first, once again thanks to Mr. Nageswaragunupudi
for his help

Image

// Brush Dialog
// --------------------------------------

oBrw7 := TXBrowse():New( oDlg5 )
oBrw7:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw7:nColDividerStyle := LINESTYLE_BLACK
oBrw7:nRowDividerStyle := LINESTYLE_BLACK
oBrw7:SetArray( aBRUSH2 )
oBrw7:aCols[ 1 ]:cHeader = Padr("No.", 3)
oBrw7:aCols[ 2 ]:cHeader = Padr("Select", 14)
oBrw7:lHScroll := .F.
oBrw7:lVScroll := .F.

// s_BRUSH2 is the old Position, when the user ended the browser.
// On a new start the 1. Col of the old position is YELLOW
// The Bar is on top
// -------------------------------------------------------------------------------
oBrw7:aCols[ 1 ]:bClrStd := {|| {CLR_BLACK, ;
IIF( oBrw7:nArrayAt = s_BRUSH2, CLR_YELLOW, CLR_WHITE ) } }

// When the user selects a brush, the var e_BRUSH2 remembers the
// new Position for the next start.
// This position will be YELLOW when the dialog is opend again.
// It is possible, to show a special Row with a defined color
// or jump directly to this row.
// -------------------------------------------------------------------------------
oBrw7:bLClicked := { | nRow, nCol | e_BRUSH2 := oBrw7:nRowSel }

oBrw7:aCols[ 2 ]:AddResource("Horizont")
oBrw7:aCols[ 2 ]:AddResource("Vertikal")
oBrw7:aCols[ 2 ]:AddResource("Fdiag")
oBrw7:aCols[ 2 ]:AddResource("Bdiag")
oBrw7:aCols[ 2 ]:AddResource("Cross")
oBrw7:aCols[ 2 ]:AddResource("Diacross")
oBrw7:aCols[ 2 ]:AddResource("Borland")
oBrw7:aCols[ 2 ]:AddResource("Tiled")
oBrw7:aCols[ 2 ]:bBmpData := {|| oBrw7:nArrayAt }
oBrw7:aCols[ 2 ]:bStrData := {|| oBrw7:aRow[2] }

oBrw7:CreateFromResource( 920 )

// I want to jump to the old ( default position )
// --------------------------------------------------------
REDEFINE BUTTONBMP oBtn8 ID 559 OF oDlg5 ;
ACTION ( oBrw7:nArrayAt := s_BRUSH2, oBrw7:nRowSel := s_BRUSH2, oBrw7:refresh() ) ;
BITMAP "Test_5" PROMPT SPACE(5) + "Set De&fault" TEXTRIGHT
oBtn8:cToolTip = { "Set the Row-Position" + CRLF + "to the old values", ;
"Set Default Positions", 1, CLR_BLACK, 14089979 }

Regards

Uwe :lol:
[/img]
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

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 76 guests