I finished testing the xBrowse-tools.
I have a question about including PEN-styles inside
the xBrowse-structure.
PEN-defines, i can get working only with Dialog ON INIT
Is there a reason for it and maybe another way, to include this inside the structure ?
- Code: Select all Expand view
FUNCTION Test_Browse5()
Local oDlg5, oLbx30, oBrush5, oBmp5
Local cAlias := cGetNewAlias( "CUST" )
nFOR := 1
REQUEST DBFCDX
USE CUSTOMER NEW ALIAS (cAlias) SHARED VIA "DBFCDX"
GO TOP
DEFINE DIALOG oDlg5 RESOURCE "TESTSOURCE"
oLbx30 := TXBrowse():New( oDlg5 )
// Here it doesn't work
//oLbx30:hColPen := CreatePen( PS_SOLID, BR_PEN, PEN_COLOR )
//oLbx30:hRowPen := CreatePen( PS_SOLID, BR_PEN, PEN_COLOR )
oCol := oLbx30:AddCol()
oCol:bStrData := { || (cAlias)->First}
oCol:cHeader := "First"
oCol:cFooter := "First"
....
....
....
Lbx30:SetRDD()
// Here it doesn't work
//oLbx30:hColPen := CreatePen( PS_SOLID, BR_PEN, PEN_COLOR )
//oLbx30:hRowPen := CreatePen( PS_SOLID, BR_PEN, PEN_COLOR )
oLbx30:CreateFromResource( 110 )
ACTIVATE DIALOG oDlg5 CENTERED ON INIT OBRW_PEN( oLbx30)
(cAlias)->( dbCloseArea() )
RETURN ( NIL )
// ----------- IT works only ON INIT ----------------------------------
STATIC FUNCTION OBRW_PEN( oLbx30)
oLbx30:hColPen := CreatePen( PS_SOLID, BR_PEN, PEN_COLOR )
oLbx30:hRowPen := CreatePen( PS_SOLID, BR_PEN, PEN_COLOR )
RETURN( NIL )
//-------------- The resource-part of sample TESTXBR3.prg ------------//
// It seems, it has to be ON INIT it works as well
static function RddBrwRes()
local oDlg, oBrw, oCol, cAlias := cGetNewAlias( "CUST" )
cFunc := ProcName( 0 )
USE CUSTOMER NEW ALIAS (cAlias) SHARED VIA "DBFCDX"
SET ORDER TO TAG FIRST
GO TOP
MakeTotal()
DEFINE DIALOG oDlg RESOURCE "TEST" //FONT WndMain():oFont
REDEFINE XBROWSE oBrw ID 101 OF oDlg ;
COLUMNS "First", "Salary" ;
FIELDS (cAlias)->State, (cAlias)->Age ;
HEADERS nil, nil, "State", "AGE" ;
JUSTIFY .F., nil, .F., .T. ;
ALIAS cAlias AUTOSORT LINES CELL
ADD TO oBrw DATA (cAlias)->CITY HEADER "City" CARGO { 1, 2 }
AEVAL( oBrw:aCols, { |o| o:bPopUp := { |o| ColMenu( o ) } } )
AEval( oBrw:aCols, { |o| o:cToolTip := { 'Column :' + CRLF + o:cHeader, 'ToolTip' } } )
ACTIVATE DIALOG oDlg CENTERED ON INIT ( OBRW_PEN( oBrw ), oBrw:SetFocus() )
(cAlias)->( dbCloseArea() )
return nil
// ---------------------------------------------
STATIC FUNCTION OBRW_PEN( oBrw )
oBrw:hColPen := CreatePen( PS_SOLID, 5, 128 )
oBrw:hRowPen := CreatePen( PS_SOLID, 5, 128 )
RETURN( NIL )