vilian wrote:Silvio,
I think you should change this
oCol:bClrStd := {|i| { ChangeColor( oBrw, i ) } }
For this:
oCol:bClrStd := {|| { ChangeColor( oBrw, i ) } }
But "i" is the variable of the FOR and when the browse is created the value of "i" will be the size of oBrw:aCols + 1
Marc Venken wrote:Maybe you have also the issue with Detached Locals ?
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=41373&hilit=detached+local
oCol:bClrStd := ChangeColor( oBrw, i )
nageswaragunupudi wrote:
- Code: Select all Expand view
oCol:bClrStd := ChangeColor( oBrw, i )
Silvio.Falconi wrote:nageswaragunupudi wrote:
- Code: Select all Expand view
oCol:bClrStd := ChangeColor( oBrw, i )
Nages,
give me error
WITH OBJECT oBrw
:nRowHeight := 22
:nClrBorder := CLR_GRAY
:lDrawBorder := .t.
:nColorBox := CLR_HRED
:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
:lHscroll := .f.
:l2007 := .F.
:l2015 := .f.
:nStretchCol := STRETCHCOL_WIDEST
:lAllowRowSizing := .F.
:lAllowColSwapping := .F.
:lAllowColHiding := .F.
:lRecordSelector := .F.
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_NOLINES
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:lDisplayZeros := .t. //Ineed the value zero
FOR i := 1 TO LEN(:aCols)
oCol := :aCols[ i ]
oCol:nWidth := 30
if i >1
oCol:bClrStd := ChangeColor( oBrw, i )
oCol:bClrSelFocus := {|| { CLR_BLACK, { { 1, RGB( 252, 235, 220 ), RGB( 255, 0,0 ) } }}}
endif
NEXT
:CreateFromCode()
:aCols[ 1 ]:nWidth := 100
:aCols[ 1 ]:nDataStrAlign := AL_LEFT
:SetStyle( 2018 )
end with
static function ChangeColor( oBrw, n )
return {|| { CLR_BLACK, ColorCell( oBrw:aRow[ n ]:VALUE ) } }
static function ColorCell( num )
local nColor := GetSysColor( 15 )
If num= 0
nColor := CLR_HGREEN
elseif num >0 .and. num < 8
nColor := CLR_WHITE
elseif num >9
nColor := CLR_HRED
endif
return nColor
static function ChangeColor( oBrw, n )
//return {|| { CLR_BLACK, ColorCell( oBrw:aRow[ n ]:VALUE ) } } //Aquí hay un error. Cambia esta linea por la siguiente. //There is an error here. Change this line to the next.
return {|| { CLR_BLACK, ColorCell( oBrw:aRow[ n ] ) } }
@ 90, 10 XBROWSE oBrw OF oDlgRitardo SIZE -10,-80 PIXEL NOBORDER
oBrw:SetArray(aData,,,.F.)
SetupBrowserRit(oBrw)
proc SetupBrowserTip(oBrw)
ADD COLUMN TO oBrw HEADER "Combinazione" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,1] } CENTER
ADD COLUMN TO oBrw HEADER "Ba" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,2] } CENTER
ADD COLUMN TO oBrw HEADER "Ca" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,3] } CENTER
ADD COLUMN TO oBrw HEADER "FI" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,4] } CENTER
ADD COLUMN TO oBrw HEADER "Ge" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,5] } CENTER
ADD COLUMN TO oBrw HEADER "Mi" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,6] } CENTER
ADD COLUMN TO oBrw HEADER "Na" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,7] } CENTER
ADD COLUMN TO oBrw HEADER "Pa" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,8] } CENTER
ADD COLUMN TO oBrw HEADER "Ro" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,9] } CENTER
ADD COLUMN TO oBrw HEADER "To" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,10] } CENTER
ADD COLUMN TO oBrw HEADER "Ve" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,11] } CENTER
ADD COLUMN TO oBrw HEADER "Nz" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,12] } CENTER
WITH OBJECT oBrw
:nRowHeight := 22
:nClrBorder := CLR_GRAY
:lDrawBorder := .t.
:nColorBox := CLR_HRED
:nMarqueeStyle := MARQSTYLE_HIGHLWIN7
:lHscroll := .f.
:l2007 := .F.
:l2015 := .f.
:nStretchCol := STRETCHCOL_WIDEST
:lAllowRowSizing := .F.
:lAllowColSwapping := .F.
:lAllowColHiding := .F.
:lRecordSelector := .F.
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_LIGHTGRAY
:nRowDividerStyle := LINESTYLE_NOLINES
:nColDividerStyle := LINESTYLE_LIGHTGRAY
:lDisplayZeros := .t.
FOR i := 1 TO LEN(:aCols)
oCol := :aCols[ i ]
oCol:nWidth := 30
if i >1
oCol:bClrStd := ChangeColor( oBrw, i )
endif
NEXT
:CreateFromCode()
:aCols[ 1 ]:nWidth := 100
:aCols[ 1 ]:nDataStrAlign := AL_LEFT
:SetStyle( 2018 )
end with
Return nil
//--------------------------------------------------------------------------------//
static function ChangeColor( oBrw, n )
return {|| { CLR_BLACK, ColorCell( oBrw:aRow[ n ]) } }
static function ColorCell( num )
local nColor := GetSysColor( 15 )
If num= 0
nColor := CLR_HGREEN
elseif num >0 .and. num < 8
nColor := CLR_WHITE
elseif num >9
nColor := CLR_HRED
endif
return nColor
LOCAL cString := "{|| { CLR_BLACK, ColorCell( oBrw:aRow[" + STR( n ) + "] ) } }"
RETURN &cString
Silvio.Falconi wrote:How I can to hav the bar nmarquee on only first column ?
WITH OBJECT oBrw
:nMarqueeStyle := MARQSTYLE_HIGHLCELL
:lColChangeNotify := .t.
:bChange := { |o| if( o:nColSel<>1, ( o:nColSel:=1, o:RefreshCurrent() ), nil ) }
:CreateFromCode()
END
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], RSalazarU and 25 guests