Author | Topic: tebrowsenew() | |
---|---|---|
Jorge | tebrowsenew() on Tue, 01 Jul 2008 14:26:54 -0300 i have a problem with :rowpos, that i don't undertand that it happens __Y2 indicates to the tbrowse object the row in which it must be positioned but ever, curiously it is positioned on the row 1 this example in clipper work fine but not in xbase can any body tellme how i must do to position myself in the wished row ? thanks here is te section of code ................... oB := TBrowseNew( iYa, iXa, iYb, iXb ) oB:goTopBlock := { || nRow := 1 } oB:goBottomBlock := { || nRow := LEN( aArray ) } oB:skipBlock := { |nSkip| nSkip := ASkipTest( aArray, nRow, nSkip ), nRow +=nSkip, nSkip } oC :=TBColumnNew( "", { | p | If( (PCount() = 0), aArray[nRow], aArray[nRow] := p ) } ) oB:addColumn( oC ) __Y2 :=Min( __Y2, oB:rowCount ) oB:rowPos :=__Y2 oB:forceStable() While ( !oB:stabilize() ); EndDO ................. Static Function ASkipTest( a, nCurrent, nSkip ) * *Begin Local RET :=nSkip If ( nCurrent + nSkip < 1 ) RET :=( -nCurrent + 1 ) Would skip past the top... ElseIf ( nCurrent + nSkip > LEN( a ) ) RET :=( LEN(a) - nCurrent ) Would skip past the bottom... EndIF Return ( RET ) *End; | |
Preview | Re: tebrowsenew() on Tue, 01 Jul 2008 15:57:01 -0300 Hi Jorge: good afternoon. Where do you set new value to __Y2? Beling Best regards Jorge escreveu: > i have a problem with :rowpos, that i don't undertand that it happens > __Y2 indicates to the tbrowse object the row in which it must be positioned > but ever, curiously it is positioned on the row 1 > > this example in clipper work fine but not in xbase > > can any body tellme how i must do to position myself in the wished row ? > > thanks > > here is te section of code > ................... > oB := TBrowseNew( iYa, iXa, iYb, iXb ) > oB:goTopBlock := { || nRow := 1 } > oB:goBottomBlock := { || nRow := LEN( aArray ) } > oB:skipBlock := { |nSkip| nSkip := ASkipTest( aArray, nRow, nSkip ), > nRow +=nSkip, nSkip } > oC :=TBColumnNew( "", { | p | If( (PCount() = 0), aArray[nRow], > aArray[nRow] := p ) } ) > oB:addColumn( oC ) > __Y2 :=Min( __Y2, oB:rowCount ) > oB:rowPos :=__Y2 > oB:forceStable() > While ( !oB:stabilize() ); EndDO > ................. > > Static Function ASkipTest( a, nCurrent, nSkip ) > * > *Begin > Local RET :=nSkip > If ( nCurrent + nSkip < 1 ) > RET :=( -nCurrent + 1 ) Would skip past the top... > ElseIf ( nCurrent + nSkip > LEN( a ) ) > RET :=( LEN(a) - nCurrent ) Would skip past the bottom... > EndIF > Return ( RET ) > *End; > > > | |
Jorge | Re: tebrowsenew() on Tue, 01 Jul 2008 16:19:27 -0300 yes, i fix the value of __Y2, is a parameters that determine the row that begin the tbrowse() like achoice() "Preview" <beling@itevip.com.br> escribi en el mensaje news:7533f2a7$2f7ddd4c$2153@news.alaska-software.com... > Hi Jorge: > good afternoon. > Where do you set new value to __Y2? > > Beling > Best regards > > Jorge escreveu: >> i have a problem with :rowpos, that i don't undertand that it happens >> __Y2 indicates to the tbrowse object the row in which it must be >> positioned >> but ever, curiously it is positioned on the row 1 >> >> this example in clipper work fine but not in xbase >> >> can any body tellme how i must do to position myself in the wished row ? >> >> thanks >> >> here is te section of code >> ................... >> oB := TBrowseNew( iYa, iXa, iYb, iXb ) >> oB:goTopBlock := { || nRow := 1 } >> oB:goBottomBlock := { || nRow := LEN( aArray ) } >> oB:skipBlock := { |nSkip| nSkip := ASkipTest( aArray, nRow, >> nSkip ), nRow +=nSkip, nSkip } >> oC :=TBColumnNew( "", { | p | If( (PCount() = 0), aArray[nRow], >> aArray[nRow] := p ) } ) >> oB:addColumn( oC ) >> __Y2 :=Min( __Y2, oB:rowCount ) >> oB:rowPos :=__Y2 >> oB:forceStable() >> While ( !oB:stabilize() ); EndDO >> ................. >> >> Static Function ASkipTest( a, nCurrent, nSkip ) >> * >> *Begin >> Local RET :=nSkip >> If ( nCurrent + nSkip < 1 ) >> RET :=( -nCurrent + 1 ) Would skip past the top... >> ElseIf ( nCurrent + nSkip > LEN( a ) ) >> RET :=( LEN(a) - nCurrent ) Would skip past the >> bottom... >> EndIF >> Return ( RET ) >> *End; >> >> | |
Jorge | Re: tebrowsenew() on Wed, 02 Jul 2008 01:16:44 -0300 solved ! Unlike clipper, in the stabilization of the tbrowse (), I must indicate it which is the first element of the array that it must start printing The stabilization positions me on the first element and then I must re-position on the wished element __Y2 :=Min( __Y2, oB:RowCount ) M->nRow :=1 oB:rowPos :=__Y2 oC :=TBColumnNew( "", ABrowseBlock( aArray, M->nRow ) ) If ( ValType( aColor ) = 'C' ) oC:colorBlock := { || &(aColor)( M->nRow ) } EndIF oB:addColumn( oC ) oB:skipBlock := { |nSkip| nSkip := ASkipTest( aArray, M->nRow, nSkip ), M->nRow +=nSkip, nSkip } oB:goTopBlock := { || M->nRow := 1 } oB:goBottomBlock := { || M->nRow := LEN( aArray ) } //// fir element of the list M->nRow :=Max( 1, __Y1 - oB:rowCount + 1 ) oB:forceStable() oB:rowPos :=__Y2 M->nRow :=__Y1 While ( !oB:stabilize() ); EndDO "Jorge" <jlborlando@way.com.ar> escribi en el mensaje news:26ea3e35$50477879$2622@news.alaska-software.com... > yes, i fix the value of __Y2, is a parameters that determine the row that > begin the tbrowse() > > like achoice() > > > "Preview" <beling@itevip.com.br> escribi en el mensaje > news:7533f2a7$2f7ddd4c$2153@news.alaska-software.com... >> Hi Jorge: >> good afternoon. >> Where do you set new value to __Y2? >> >> Beling >> Best regards >> >> Jorge escreveu: >>> i have a problem with :rowpos, that i don't undertand that it happens >>> __Y2 indicates to the tbrowse object the row in which it must be >>> positioned >>> but ever, curiously it is positioned on the row 1 >>> >>> this example in clipper work fine but not in xbase >>> >>> can any body tellme how i must do to position myself in the wished row ? >>> >>> thanks >>> >>> here is te section of code >>> ................... >>> oB := TBrowseNew( iYa, iXa, iYb, iXb ) >>> oB:goTopBlock := { || nRow := 1 } >>> oB:goBottomBlock := { || nRow := LEN( aArray ) } >>> oB:skipBlock := { |nSkip| nSkip := ASkipTest( aArray, nRow, >>> nSkip ), nRow +=nSkip, nSkip } >>> oC :=TBColumnNew( "", { | p | If( (PCount() = 0), aArray[nRow], >>> aArray[nRow] := p ) } ) >>> oB:addColumn( oC ) >>> __Y2 :=Min( __Y2, oB:rowCount ) >>> oB:rowPos :=__Y2 >>> oB:forceStable() >>> While ( !oB:stabilize() ); EndDO >>> ................. >>> >>> Static Function ASkipTest( a, nCurrent, nSkip ) >>> * >>> *Begin >>> Local RET :=nSkip >>> If ( nCurrent + nSkip < 1 ) >>> RET :=( -nCurrent + 1 ) Would skip past the top... >>> ElseIf ( nCurrent + nSkip > LEN( a ) ) >>> RET :=( LEN(a) - nCurrent ) Would skip past the >>> bottom... >>> EndIF >>> Return ( RET ) >>> *End; >>> >>> > |