topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
xbrowse method GORIGHT | Sr. Antonio:
How many elements the array has ?
+/- 200
What database RDD are you using ?
SQLRDD e DBFCDX |
xbrowse method GORIGHT | Prueba a construir samples\FiveDBU.prg y comprueba si con él tambien te ocurre lo mismo, gracias |
xbrowse method report | can I have a sample of this method report of xbrowse with groups ?
thanks |
xbrowse method report | testxbrw3.prg |
xbrowse method report | If you want to generate a report grouped on any column value, specify that column object as the last parameter ( 5th parameter ) of the report method. Please keep in mind that that data is already indexed or sorted on that column value.
You can mention either column number or column object, but I prefer to specify the column object because the column position may be changed by the user at the time of browsing. |
xbrowse minor bugs. ... nageswaragunupudi | <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=29479">viewtopic.php?f=6&t=29479</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=29475">viewtopic.php?f=6&t=29475</a><!-- l --> |
xbrowse modificado | He hecho algunas modificaciones en el método Report de xbrowse, lo añadí al proyecto pero al correrlo me sale este error:
[code=fw:l8es3f3r]<div class="fw" id="{CB}" style="font-family: monospace;"><br />Called <span style="color: #0000ff;">from</span>: => __ERRRT_SBASE<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: ../../../tobject.prg => <span style="color: #00C800;">NIL</span>:<span style="color: #000000;">ERROR</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: ../../../tobject.prg => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>HBOBJECT<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: ../../../tobject.prg => <span style="color: #00C800;">NIL</span>:<span style="color: #000000;">MSGNOTFOUND</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: ../../../tobject.prg => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>EVAL<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\<span style="color: #0000ff;">xbrowse</span>.prg => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>TXBRWCOLUMN<span style="color: #000000;">(</span> <span style="color: #000000;">8466</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\<span style="color: #0000ff;">xbrowse</span>.prg => TXBRWCOLUMN:<span style="color: #000000;">LEDITABLE</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">KEYCHAR</span><span style="color: #000000;">(</span> <span style="color: #000000;">2252</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1700</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">11632</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span> <span style="color: #000000;">3153</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => DIALOGBOXINDIRECT<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span> <span style="color: #000000;">270</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\<span style="color: #00C800;">function</span>\MSGRUN.PRG => MSGRUN<span style="color: #000000;">(</span> <span style="color: #000000;">42</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\empresas.prg => KEYLAEMPRESA<span style="color: #000000;">(</span> <span style="color: #000000;">341</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\empresas.prg => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>SELECCIONAR<span style="color: #000000;">(</span> <span style="color: #000000;">302</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TWINDOW:<span style="color: #000000;">KEYDOWN</span><span style="color: #000000;">(</span> <span style="color: #000000;">2610</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">KEYDOWN</span><span style="color: #000000;">(</span> <span style="color: #000000;">1019</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">KEYDOWN</span><span style="color: #000000;">(</span> <span style="color: #000000;">2201</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => TWINDOW:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\CONTROL.PRG => TCONTROL:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">1700</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\<span style="color: #0000ff;">xbrowse</span>.prg => TXBROWSE:<span style="color: #000000;">HANDLEEVENT</span><span style="color: #000000;">(</span> <span style="color: #000000;">11632</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => _FWH<span style="color: #000000;">(</span> <span style="color: #000000;">3153</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: => DIALOGBOX<span style="color: #000000;">(</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">DIALOG</span>.PRG => TDIALOG:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span> <span style="color: #000000;">270</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\empresas.prg => SELECCIONAR<span style="color: #000000;">(</span> <span style="color: #000000;">319</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\Sipep.prg => <span style="color: #000000;">(</span>b<span style="color: #000000;">)</span>EMPIEZA<span style="color: #000000;">(</span> <span style="color: #000000;">279</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: .\source\classes\<span style="color: #0000ff;">WINDOW</span>.PRG => TMDIFRAME:<span style="color: #0000ff;">ACTIVATE</span><span style="color: #000000;">(</span> <span style="color: #000000;">973</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\Sipep.prg => EMPIEZA<span style="color: #000000;">(</span> <span style="color: #000000;">279</span> <span style="color: #000000;">)</span><br /> Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">C</span>:\sipep_sql\Sipep.prg => MAIN<span style="color: #000000;">(</span> <span style="color: #000000;">49</span> <span style="color: #000000;">)</span><br /> </div>[/code:l8es3f3r]
Lo curioso es que si añado esta clase sin la modificación del report sigue sucediendo el error. No se produce si lo hago directamente desde las librerias de FWH. Esta situación se presenta si compilo con Harbour, si lo hago con xHarbour no tengo este problema. Alguien sabe ??? desde ya muchisimas gracias. |
xbrowse modificado | Horacio,
probá de recompilar TODO de nuevo. Por el mensaje de error parece que el errorsys que estás usando no está pasando el objeto donde se produce el error, lo adivino por lo que dice de NIL:MSGNOTFOUND( 0 )
Fijate bien que errorsys estás usando, asegurate de que sea el de FW. |
xbrowse modificado | Carlos, gracias por responder. Uso el errsysw nativo de fw. Lo extraño es que si la clase xbrowse que viene en \source\classes la compilo con mis módulos no funciona, me tira el error que puse en el post anterior. Lo mismo me pasa con la clase bar, si lo agrego a mi proyecto cuando ejecuto xBrowse : Report() se produce un error. No me doy cuenta que puede ser. sigo investigando. |
xbrowse modificado | Horario,
Verifica que todos los módulos estén compilados con la misma versión de FWH, Harbour y los mismos switches a ver qué tal. |
xbrowse modificado (Antonio) | Hola Antonio,
Pues por aqui comentando que le hice una pequeña modificacion a la xbrowse para poder configurar desde codigo el color del estilo WIN7 asi como el color de su borde, es algo muy simple, pero me parecio que cada quien le pueda asignar el color que guste, por defaul se guarda el que viene con la clase, por si gustas el cambio o me permites publicarlo para quien lo quiera hacer efectivo...
[img:2540wc44]http://imageshack.us/photo/my-images/27/xbrwwin7.jpg/[/img:2540wc44]
Gracias
pak.o |
xbrowse modificado (Antonio) | perdon, adjunto imagen
[url=http://imageshack.us/photo/my-images/27/xbrwwin7.jpg/:obn746n7][img:obn746n7]http://img27.imageshack.us/img27/7485/xbrwwin7.jpg[/img:obn746n7][/url:obn746n7]
pak.o |
xbrowse multi select | I wish select many rows
[img:cbfjdmd9]https://i.postimg.cc/MKKv6p1H/jk.png[/img:cbfjdmd9]
I try with :SetMultiSelectCol() but is not good for me , I wish select multiple rows and not only one
how should i select multiple rows at the same time?
how should i remove the checkbox from the first column?
how can i have the color orange when i select a row ?
[code=fw:cbfjdmd9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />@ <span style="color: #000000;">10</span>, <span style="color: #000000;">465</span> <span style="color: #0000ff;">XBROWSE</span> oLbxRuote <span style="color: #0000ff;">OF</span> oDlg ;<br /> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">105</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span><br /> oLbxRuote:<span style="color: #000000;">SetArray</span><span style="color: #000000;">(</span>aRuote<span style="color: #000000;">)</span><br /> oLbxRuote:<span style="color: #000000;">nMarqueeStyle</span> :=MARQSTYLE_HIGHLWIN7 <span style="color: #B900B9;">//MARQSTYLE_HIGHLROW</span><br /> oLbxRuote:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_LIGHTGRAY<br /> oLbxRuote:<span style="color: #000000;">lColDividerComplete</span> := .t.<br /> oLbxRuote:<span style="color: #000000;">lRecordSelector</span> := .f.<br /> oLbxRuote:<span style="color: #000000;">lHScroll</span> := .f.<br /> oLbxRuote:<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">20</span><br /> oLbxRuote:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">20</span><br /> oLbxRuote:<span style="color: #000000;">l2007</span> := .f.<br /> oLbxRuote:<span style="color: #000000;">nStretchCol</span> := <span style="color: #000000;">-1</span><br /> oLbxRuote:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Ruote"</span><span style="color: #000000;">)</span><br /> oLbxRuote:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">100</span><br /><br /> WITH OBJECT oLbxRuote<br /> :<span style="color: #000000;">lDrawBorder</span> := .t.<br /> :<span style="color: #000000;">lHeader</span> := .f.<br /> :<span style="color: #000000;">nRecSelColor</span> := nRgb<span style="color: #000000;">(</span> <span style="color: #000000;">245</span>,<span style="color: #000000;">244</span>,<span style="color: #000000;">234</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">SetMultiSelectCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> END<br /> </div>[/code:cbfjdmd9] |
xbrowse multi select | OK ...Now I change the style [b:21fi98ep]oLbxRuote:nMarqueeStyle := MARQSTYLE_HIGHLROW[/b:21fi98ep]
[img:21fi98ep]https://i.postimg.cc/RZm3kLXr/bbbb.png[/img:21fi98ep]
NOW RUN
But I wish to not have the first column ( checkbox ) , How I can do ? |
xbrowse multi select | Do not use :SetMultiSelectCol()
Instead set marqueestyle to MARQSTYLE_HIGHLROWMS |
xbrowse multi select | [quote="nageswaragunupudi":1yjmnx35]Do not use :SetMultiSelectCol()
Instead set marqueestyle to MARQSTYLE_HIGHLROWMS[/quote:1yjmnx35]
thanks
but How I can make to select ?
I need to select one or more rows |
xbrowse multiselect | if I use on xbrowse :
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
and select many records with mouse and ctrl
can I have on an array asel:={} the records I select ? |
xbrowse multiselect | oBrw:aSelected
EMG |
xbrowse multiselect | thanks
but How I can print only the record selected
can you make a small sample please |
xbrowse multiselect | oRpt:bSkip := { || oRpt:Cargo := ::rptSKIP( ) }
Method Rptskip() class Txbrowse
local n1,n1old
n1old:=::skip(1)
n1:=n1old
IF len(::aSelected)>0
While AScan( ::aSelected, If( ::nDatatype==DATATYPE_ARRAY,::nArrayAt,eval(::bKeyno)))==0
n1+=::skip(1)
if ::nDATATYPE<>DATATYPE_ARRAY
if eval(::bKeyno)==eval(::bkeyCount)
n1:=0
exit
end
else
if ::nArrayAt==len(::aArray)
n1:=0
exit
end
end
if n1==n1old
exit
end
n1old:=n1
enddo
end
If you want a more better method select()
#ifdef __HARBOUR__
METHOD Select( nOperation ) CLASS TXBrowse
#else
METHOD _Select( nOperation ) CLASS TXBrowse
#endif
local uBook, uCurRow, uOldRow, uTemp
local aTemp
local nAt, nLen
local lRefresh
if ::nMarqueeStyle != MARQSTYLE_HIGHLROWMS
return nil
endif
DEFAULT nOperation := 1
do case
case nOperation == 0 // delete all
if len( ::aSelected ) == 1 .and. Eval( ::bBookMark,, Self ) == ::aSelected[ 1 ]
lRefresh := .f.
else
lRefresh := .t.
endif
::aSelected := {}
if lRefresh .and. ::lCreated
::lRefreshOnlyData := .t.
::GetDC()
::Paint()
::ReleaseDC()
endif
case nOperation == 1
// .or. ( len( ::aSelected ) == 0 .and. nOperation != 4 )// Add current
// xtech
uBook := Eval( ::bBookMark,, Self )
nAt := Ascan( ::aSelected, uBook )
if nAt == 0
// Aadd( ::aSelected, uBook )
// xtech
If ::lCreated
::DrawLine( .t. )
Endif
endif
case nOperation == 2 // Swap key (Ctrl+LClick)
uBook := Eval( ::bBookMark,, Self )
nAt := Ascan( ::aSelected, uBook )
if nAt > 0
If ::lCreated
::DrawLine( .f. )
endif
::aSelected[ nAt ] := Atail( ::aSelected )
Asize( ::aSelected, len( ::aSelected ) - 1 )
else
Aadd( ::aSelected, Eval( ::bBookMark ))
If ::lCreated
::DrawLine( .t. )
endif
endif
case nOperation == 3 // Shift & lclick
uBook := Eval( ::bBookMark,, Self )
uCurRow := Eval( ::bKeyNo,,Self )
Eval( ::bBookMark, Atail( ::aSelected ), Self )
uOldRow := Eval( ::bKeyNo,,Self )
if uOldRow != uCurRow
::aSelected := { Atail( ::aSelected ) }
if uCurRow > uOldRow
CursorWait()
do while ( uTemp := Eval( ::bBookMark,, Self ) ) != uBook .and. !Eval( ::bEof, Self )
If Ascan( ::aSelected, uTemp ) == 0
Aadd( ::aSelected, uTemp )
Endif
Eval( ::bSkip, 1, Self )
enddo
CursorArrow()
else
CursorWait()
do while ( uTemp := Eval( ::bBookMark,, Self ) ) != uBook .and. !Eval( ::bBof, Self )
If Ascan( ::aSelected, uTemp ) == 0
Aadd( ::aSelected, uTemp )
endif
Eval( ::bSkip, -1, Self )
enddo
CursorArrow()
endif
Aadd( ::aSelected, uBook )
Eval( ::bBookMark, uBook, Self )
::lRefreshOnlyData := .t.
If ::lCreated
::GetDC()
::Paint()
::ReleaseDC()
endif
else
Eval( ::bBookMark, uBook, Self )
endif
case nOperation == 4 // Select all
uBook := Eval( ::bBookMark,, Self )
::aSelected := Array( ::KeyCount() )
nAt := 1
nLen := ::nLen
aTemp := ::aSelected
CursorWait()
Eval( ::bGotop, Self )
do while nAt <= nLen //.and. !Eval( ::bEof )
aTemp[ nAt++ ] := Eval( ::bBookMark,, Self )
Eval( ::bSkip, 1, Self )
enddo
Eval( ::bBookMark, uBook, Self )
CursorArrow()
::lRefreshOnlyData := .t.
If ::lCreated
::GetDC()
::Paint()
::ReleaseDC()
Endif
end case
return nil
return n1 |
xbrowse multiselect cell | Hi to all, my problem,
in my xbrowse I have
[code=fw:kvi7q5dw]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLCELL<br /> </div>[/code:kvi7q5dw]
and I'd like multiselect cell with CTRL + mouse click like xbrowse multiselect when
[code=fw:kvi7q5dw]<div class="fw" id="{CB}" style="font-family: monospace;"><br />:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWMS<br /> </div>[/code:kvi7q5dw]
how can I do it?
thank you
(xHarbour 17.09) |
xbrowse multiselect cell | Puedes usar:
[code=fw:3r72hwtu]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw::<span style="color: #000000;">SetMultiSelectCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:3r72hwtu] |
xbrowse multiselect cell | [quote="damianodec":1pm1uza2]Hi to all, my problem,
in my xbrowse I have
[code=fw:1pm1uza2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLCELL<br /> </div>[/code:1pm1uza2]
and I'd like multiselect cell with CTRL + mouse click like xbrowse multiselect when
[code=fw:1pm1uza2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROWMS<br /> </div>[/code:1pm1uza2]
how can I do it?
thank you
(xHarbour 17.09)[/quote:1pm1uza2]
First Shift-Click on the current row or any other row. Then the behavior automatically changes to MARQSTYLE_HIGHLROWMS, though visually CELL is highlighted. Shift-Click and Ctrl-Click start working just like HIGHLROWMS.
This behavior continues till the selected block is cleared by normal clicking on any other cell.
Please try |
xbrowse mysql busqueda incremental (SOLUCIONADO) | hola.
Se puede realizar este tipo de busquedas sobre una tabla mysql mostrada con xbrowse?
gracias. |
xbrowse mysql busqueda incremental (SOLUCIONADO) | En mi blog tienes una entrada que comenta como hacer ordenaciones y busquedas incrementales con xBrowse y ADO. Creo que puede serte de utilidad.
[url:3lk40hr8]http://bielsys.blogspot.com/2008/04/usando-origenes-de-datos-ado-y-2.html[/url:3lk40hr8] |
xbrowse mysql busqueda incremental (SOLUCIONADO) | [quote="Biel EA6DD":3llai8mo]En mi blog tienes una entrada que comenta como hacer oirdenaciones y busquedas incrementales con xBrowse y ADO. Creo que puede serte de utilidad.
[url:3llai8mo]http://bielsys.blogspot.com/2008/04/usando-origenes-de-datos-ado-y-2.html[/url:3llai8mo][/quote:3llai8mo]
Viendo...
Gracias. |
xbrowse mysql y las columnas ordenadas? | hola.
Como hago para poder tener un xbrowse con 2 o 3 columnas que puedan ser ordenadas al hacer un click en las columnas?
Gracias.
Agradezco desde ya. |
xbrowse mysql y las columnas ordenadas? | Hola
Mira yo lo lo que hago es programar en la cabecera de columnas una funcion que
se encarga de
* En el caso der ser un cursor volver a pedir el cursor con un SELECT y refrescar
* En el caso de poner el cursor en una arreglo xbrowse permite ese sort |
xbrowse mysql y las columnas ordenadas? | [quote="Vladimir Zorrilla":79uzrltw]Hola
* En el caso der ser un cursor volver a pedir el cursor con un SELECT y refrescar
[/quote:79uzrltw]
Aunque esto funciona, sería mejor utilizar el metodo sort de ADO, así evitas ejecutar otro SELECT, y minimizas el trafico de red y la carga del servidor. |
xbrowse nRowDividerStyle | Hi
how can I condition the nRowDividerStyle?
I'd like nRowDividerStyle (LINESTYLE_BLACK) when inside DBF record there is logical value TRUE in CONTROL field else there must be no separating line between one line and another (LINESTYLE_NOLINES).
thanks |
xbrowse nRowDividerStyle | Not possible now.
We may provide this feature in future. |
xbrowse no me cambia su altura. | hola.
[code=fw:2koo7sw9]<div class="fw" id="{CB}" style="font-family: monospace;"> @ <span style="color: #000000;">80</span>, <span style="color: #000000;">330</span> <span style="color: #0000ff;">XBROWSE</span> oBrw;<br /> <span style="color: #0000ff;">SIZE</span> aoGrupo<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span><span style="color: #000000;">-20</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">PIXEL</span>;<br /> NOBORDER;<br /> <span style="color: #0000ff;">OF</span> oWnd<br />...<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">ON</span> resize ::<span style="color: #000000;">cambiarTamanios</span><span style="color: #000000;">(</span>aoGrupo, oWnd, oBrw<span style="color: #000000;">)</span><br /><br />#-------------------------<br /><br /><span style="color: #00C800;">METHOD</span> cambiarTamanios<span style="color: #000000;">(</span>aoGrupo, oWnd, oBrw<span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TAplicacion<br /> aoGrupo<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span>:= oWnd:<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">350</span><br /> aoGrupo<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nHeight</span>:= oWnd:<span style="color: #000000;">nHeight</span> - <span style="color: #000000;">115</span><br /><br /> oBrw:<span style="color: #000000;">nWidth</span>:= aoGrupo<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> - <span style="color: #000000;">20</span><br /> oBrw:<span style="color: #000000;">nHeight</span>:= <span style="color: #000000;">200</span> <--------------------------- ESTO NO ME ACTUALIZA<br />...<br /><br /> </div>[/code:2koo7sw9]
En ese código, me genera el xbrowse en un window, pero cuando cambio el tamaño del window no se me actualiza el ALTO, si el ancho del xbrowse. ¿Qué estoy haciendo mal?
gracias. |
xbrowse no me cambia su altura. | Hola Gosfancito, yo lo uso asi: (FWH1006)
oBrw:SetSize(oDlg:nWidth-34, oDlg:nHeight-114)
Saludos |
xbrowse no me cambia su altura. | gracias |
xbrowse no muestra el contenido de la columna | Hola FiveWinners.
PRIVATE aMOVTOS:={" ","FALTA","PERMISO","ASISTENCIA","RETARDO","DESCANSO","ENFERMEDAD","MATERNIDAD","LABORIESGO","INCAXAT","VACACION","TXTIEMPO"}
ADD COLUMN oComb TO oBrw DATA (cNAlias)->NA_TIPMOV ;
HEADER "Movimiento" ;
SIZE 120 EDITABLE
oComb:bOnPostEdit := {|o, v, n| iif( n != VK_ESCAPE, ( NW_REPLACE("NA_TIPMOV", v, .F., cNAlias ) ), ) }
WITH OBJECT oBrw:Movimiento
:nEditType := EDIT_LISTBOX
:aEditListTxt := ArrTranspose( aMOVTOS ) [ 1 ]
:aEditListBound := ArrTranspose( aMOVTOS ) [ 1 ]
END
Este codigo me permite mostrar un combobox en la columna, sin embargo, cuando selecciono un valor de la lista, esta no se muestra en la columna, sin embargo, el reemplazo del dato en tabla es correcto.
Como muestro el dato en la columna?
Gracias |
xbrowse ocultar sin eliminar.... como_ | hola.
necesito que un xbrowse no muestre una columna y que no aparezca en menu contextual para mostrarlo de nuevo pero si que no se lo elimine.
gracias. |
xbrowse ocultar sin eliminar.... como_ | amigo no se si sea lo que necesitas
[code=fw:1j1o0zj9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> ......<br /> <span style="color: #00C800;">Local</span> vMuestra:=.t.<br /> ......<br /> oCol:= oLamcla:<span style="color: #000000;">oBrwCaja</span>:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span>nitonu<span style="color: #000000;">(</span>d_caja->canti<span style="color: #000000;">)</span>,oLamcla:<span style="color: #000000;">PIC1</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Cantidad"</span><br /> oCol:<span style="color: #000000;">nHeadStrAlign</span> := AL_RIGHT<br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br /> oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">80</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| Transform<span style="color: #000000;">(</span><span style="color: #000000;">0</span>,oLamcla:<span style="color: #000000;">PIC2</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> = <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">lHide</span> = vMuestra<br /> </div>[/code:1j1o0zj9]
Luego cambias el valor de la variable para mostrar la columna de nuevo |
xbrowse ocultar sin eliminar.... como_ | hola:
no se si esto te sirva pero creo entender que necesitas trabajar con otros campos de una tabla pero que el usuario vea solo algunos campos.
yo lo uso de esta forma:
[code=fw:2l8mxmy5]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> COLUMNS <span style="color: #ff0000;">"CODE"</span>,<span style="color: #ff0000;">"NOMB"</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"PA06"</span> ;<br /> AUTOSORT FOOTERS<br /> <br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">oHeaderFont</span> := oFont<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">'Codigo'</span> <br /><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">'Nombre completo'</span><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">305</span><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">oHeaderFont</span> := oFont<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span><br />...<br />...<br /> </div>[/code:2l8mxmy5]
donde COLUMNS "CODE","NOMB" son los nombres de los campos de la tabla 'PA06'
y en: oBrw:aCols[1]:cHeader := 'Codigo' es el nombre de la columna del xbrowse.
la tabla PA06 tiene 14 campos en los cuales ocupo unos internamente y el usuario no los ve.
bueno espero que te sea de utilidad.
saludos |
xbrowse ocultar sin eliminar.... como_ | gracias. |
xbrowse old version (2015) oCol:bToolTip | Hi,
I have to solve a problem using and old version of xbrowse (2015)
Is it possible to modify this code in order to activate tooltip only if the cell has focus?
[code=fw:2ieab8ig]<div class="fw" id="{CB}" style="font-family: monospace;"> oCol:<span style="color: #000000;">bToolTip</span> := <span style="color: #000000;">{</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">nArrayAt</span> <= Len<span style="color: #000000;">(</span> aIncident<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, aIncident<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> , oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">]</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span></div>[/code:2ieab8ig]
because the tooltip that appears is not related to the selected cell
Another solution accetped since there is an active timer (2/3 seconds), automatically select the cell where the mouse pointer is located
Many thanks
Marco |
xbrowse old version (2015) oCol:bToolTip | Maybe here is something that can help...
[code=fw:eqg3xfbp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /> oBrw:<span style="color: #000000;">kleur</span>:<span style="color: #000000;">bToolTip</span> := <span style="color: #000000;">{</span> | oBrw,r,c,f,oMouseCol,nMouseRow| MyColToolTip<span style="color: #000000;">(</span> oBrw,r,c,f,oMouseCol,nMouseRow <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oBrw:<span style="color: #000000;">memotxt</span>:<span style="color: #000000;">bToolTip</span> := <span style="color: #000000;">{</span> | oBrw,r,c,f,oMouseCol,nMouseRow| MyColToolTip<span style="color: #000000;">(</span> oBrw,r,c,f,oMouseCol,nMouseRow <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">// other</span><br /><br /> oBrw4:<span style="color: #000000;">bToolTips</span> := <span style="color: #000000;">{</span> | oBrw4,r,c,f,oMouseCol,nMouseRow| MyColToolTip<span style="color: #000000;">(</span> oBrw4,r,c,f,oMouseCol,nMouseRow <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><br /> </div>[/code:eqg3xfbp]
[code=fw:eqg3xfbp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">function</span> MyColToolTip<span style="color: #000000;">(</span> oBrwS, r, c, f, oMouseCol, nMouseRow <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> uBm, uVal<br /><br /> <span style="color: #B900B9;">//xbrowse(oBrwS)</span><br /><br /><br /> <span style="color: #00C800;">if</span> nMouseRow != oBrwS:<span style="color: #000000;">nRowSel</span><br /> uBm := oBrwS:<span style="color: #000000;">BookMark</span><br /> Eval<span style="color: #000000;">(</span> oBrwS:<span style="color: #000000;">bSkip</span>, nMouseRow - oBrwS:<span style="color: #000000;">nRowSel</span> <span style="color: #000000;">)</span><br /> uVal := oMouseCol:<span style="color: #000000;">Value</span><br /> oBrwS:<span style="color: #000000;">BookMark</span> := uBm<br /> <span style="color: #00C800;">else</span><br /> uVal := oMouseCol:<span style="color: #000000;">Value</span><br /> <span style="color: #00C800;">endif</span><br /><br /> uVal := cValToChar<span style="color: #000000;">(</span> uVal <span style="color: #000000;">)</span><br /> uVal := StrTran<span style="color: #000000;">(</span> uVal, <span style="color: #ff0000;">"<br>"</span>, CRLF <span style="color: #000000;">)</span><br /> uVal := StrTran<span style="color: #000000;">(</span> uVal, <span style="color: #ff0000;">"<BR>"</span>, CRLF <span style="color: #000000;">)</span><br /> uVal := StrTran<span style="color: #000000;">(</span> uVal, <span style="color: #ff0000;">","</span>, CRLF <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> uVal<br /><br /><br /> </div>[/code:eqg3xfbp] |
xbrowse old version (2015) oCol:bToolTip | ThankYou Mark
I hope this works out
oCol:bToolTip := { |[b:3jrmz8vr]oBrw,nRow,nCol[/b:3jrmz8vr]| If( oBrw:nArrayAt <= Len( aIncident[ 1 ] ), aIncident[ 1 , oBrw:MouseRowPos( nRow ) ], "" ) }
many thanks |
xbrowse perdida del focus con bEditValid | Fivewin 15.03
Actualmente estoy trabajando con Fivewin 11.06 y no me he podido cambiar a la versión 15.03 porque al usar el xbrowse pierde el foco cuando
utilizo en el valid y en la validación uso un dialogo para dar ciertas opciones, ya probe en 32 y 64 Bits y trabaja bien todo, solo lo del browse.
A continuación coloco un ejemplo completo que están en el foro y ejemplo en samples, pero funcional 100% para poder ver la perdida del foco en xbrowse
y se va para el primer campo del get, el problema es que al irse al primer get.
si puedo usar obrw:SetFocus(), pero el problema es que se va al primer get y este get puede tener un valid que haga ciertas cosas como volver a
a traer toda la información del browse.
La funcion es ValCuenta() y estoy validando el primer campo del BROWSE
[code=fw:2lfua5wz]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"InKey.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oGet<br /> <span style="color: #00C800;">LOCAL</span> cCad := <span style="color: #ff0000;">"Testing "</span> <span style="color: #B900B9;">// pad("Testing Gets",40)</span><br /> <span style="color: #00C800;">LOCAL</span> nNum := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">LOCAL</span> dDat := Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oBrw, oCol, cAlias<br /> <span style="color: #00C800;">local</span> n:=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nTotal1:=<span style="color: #000000;">0</span>, nTotal2:=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> aDbf := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"cta"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"scta"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"nombre"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"debe"</span> , <span style="color: #ff0000;">"n"</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">02</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"haber"</span> , <span style="color: #ff0000;">"n"</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">02</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"concepto"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> !file<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DATOS.DBF"</span> <span style="color: #000000;">)</span><br /> dbcreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"datos.dbf"</span>, aDbf <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span><br /> <br /> <br /><br /> DbUseArea<span style="color: #000000;">(</span>.T.,,<span style="color: #ff0000;">"Datos"</span>,<span style="color: #ff0000;">"Datos"</span>,.F.<span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">if</span> lastrec<span style="color: #000000;">(</span><span style="color: #000000;">)</span> = <span style="color: #000000;">0</span><br /> dbappend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> rlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> field->cta := <span style="color: #ff0000;">"6130380125"</span><br /> field->scta := <span style="color: #ff0000;">"3230"</span><br /> field->nombre := <span style="color: #ff0000;">"NOMBRE CUENTA"</span><br /> dbunlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <br /> <br /> cAlias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> dbSelectArea<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TGet from "</span> + FWDESCRIPTION <span style="color: #0000ff;">size</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span><br /><br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Text..:"</span> <span style="color: #0000ff;">OF</span> oDlg<br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">6</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cCad <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"W/G"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span><br /> @ <span style="color: #000000;">1.8</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Number:"</span> <span style="color: #0000ff;">OF</span> oDlg<br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">6</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> nNum <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999999.99"</span><br /> @ <span style="color: #000000;">2.6</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Date:"</span> <span style="color: #0000ff;">OF</span> oDlg<br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">6</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> dDat <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@E"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #B900B9;">// "@D"</span><br /><br /> oBrw := TXBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDlg <span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">cAlias</span> := cAlias <br /><br /> oBrw:<span style="color: #000000;">nTop</span> := <span style="color: #000000;">50</span><br /> oBrw:<span style="color: #000000;">nLeft</span> := <span style="color: #000000;">10</span><br /> oBrw:<span style="color: #000000;">nBottom</span> := <span style="color: #000000;">350</span><br /> oBrw:<span style="color: #000000;">nRight</span> := <span style="color: #000000;">450</span><br /><br /> oBrw:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_INSET<br /> oBrw:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_INSET<br /> oBrw:<span style="color: #000000;">lColDividerComplete</span> := .t. <span style="color: #B900B9;">//completa pintado sobre el footer cuando lineas no llenan todo el browse</span><br /><br /> oBrw:<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">30</span> <span style="color: #B900B9;">//Altura cabeceras de col</span><br /> oBrw:<span style="color: #000000;">lFooter</span> := .t. <span style="color: #B900B9;">//Que tendrá footer </span><br /> oBrw:<span style="color: #000000;">nFooterLines</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//Lineas del footer </span><br /> oBrw:<span style="color: #000000;">nFooterHeight</span> := <span style="color: #000000;">24</span> <span style="color: #B900B9;">//Altura del Footer</span><br /> oBrw:<span style="color: #000000;">lRecordSelector</span> := .t. <span style="color: #B900B9;">//poner o no, COL de la flechita de la izq</span><br /><br /><br /> oBrw:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">140</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">229</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// VERDECITO</span><br /> oBrw:<span style="color: #000000;">bClrFooter</span> := oBrw:<span style="color: #000000;">bClrHeader</span><br /> oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// colores para lineas normales</span><br /> oBrw:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco</span><br /> oBrw:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco</span><br /><br /> oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLCELL <span style="color: #B900B9;">//solo ilumina la celda actual</span><br /><br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">20</span> <span style="color: #B900B9;">//altura entre lineas</span><br /><br /> oBrw:<span style="color: #000000;">lFastEdit</span> := .t. <br /><br /><br /><br /> <span style="color: #B900B9;">//Aqui uso DbPack() porque es una dbf pequeña y temporal. En grandes usar function de mantenimiento.</span><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->cta <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CTA"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Cta := xVal, <span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_ESCAPE .and. Empty<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Cta<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>__dbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbGoBottom<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">bEditValid</span> := <span style="color: #000000;">{</span>|oGet,oBrwCol| ValCuenta<span style="color: #000000;">(</span>oDlg,oGet,oBrwCol,oCol<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Scta <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"SC4"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Scta := xVal, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->NOMBRE <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"DESCRIPCION DE LA CUENTA"</span> <br /> oCol:<span style="color: #000000;">cFooter</span> = <span style="color: #ff0000;">"BALANCE ---> "</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">nEditType</span> = <span style="color: #000000;">0</span> <span style="color: #B900B9;">//no editable</span><br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//alineado a la derecha</span><br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"DEBITOS"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">lTotal</span> := .t. <span style="color: #B900B9;">//para totalizar cols a report y/o excel</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| TRANSFORM<span style="color: #000000;">(</span>nTotal1,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Haber =<span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span> nTotal1+=<span style="color: #000000;">(</span>Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>-<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE<span style="color: #000000;">)</span>, oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE := Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CREDITOS"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET<br /> oCol:<span style="color: #000000;">lTotal</span> := .t. <span style="color: #B900B9;">//para totalizar cols a report y/o excel</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| TRANSFORM<span style="color: #000000;">(</span>nTotal2,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Debe =<span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> nTotal2+=<span style="color: #000000;">(</span>Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>-<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER<span style="color: #000000;">)</span>, oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER := Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->CONCEPTO <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CONCEPTO"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> <span style="color: #B900B9;">//Es la ultima columna, agrega nuevo registro en blanco y se va a primer columna,</span><br /> <span style="color: #B900B9;">//solo si la cta y/o valores están OK</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->CONCEPTO := xVal ,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Recno<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>==<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Reccount<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> .and. lDebHabOK<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->debe+<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->haber<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">100</span><br /><br /><br /> oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBrw:<span style="color: #000000;">bKeyDown</span> :=<span style="color: #000000;">{</span> | nKey | Teclas<span style="color: #000000;">(</span>nKey, oBrw, cAlias<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oDlg:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//--------------------</span><br /><span style="color: #00C800;">Function</span> ValCuenta<span style="color: #000000;">(</span>oDlg,oGet,oBrwCol,oCol<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> oDlgV,nValue := <span style="color: #000000;">3</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgV <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TGet from "</span> + FWDESCRIPTION<br /><br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">RADIO</span> oRad <span style="color: #0000ff;">VAR</span> nValue ;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"&One"</span>, <span style="color: #ff0000;">"&Two"</span>, <span style="color: #ff0000;">"T&hree"</span> _3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">14</span> ;<br /> HELPID <span style="color: #000000;">100</span>, <span style="color: #000000;">101</span>, <span style="color: #000000;">102</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> MsgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">7</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ok"</span> <span style="color: #0000ff;">OF</span> oDlgV <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">ACTION</span> oDlgV:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Cancel"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> oDlgV <span style="color: #0000ff;">ACTION</span> oDlgV:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> CANCEL<br /> <br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgV <span style="color: #0000ff;">CENTERED</span><br /> <span style="color: #00C800;">return</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #00C800;">Function</span> Teclas<span style="color: #000000;">(</span>nKey, oBrw, cAlias<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br /> <span style="color: #00C800;">Case</span> nKey == VK_DELETE<br /> <span style="color: #00C800;">if</span> MsgNoYes<span style="color: #000000;">(</span><span style="color: #ff0000;">"¿Está seguro(a) de borrar este registro?"</span>,<span style="color: #ff0000;">"Borrar registro de "</span>+cAlias<span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">EndCase</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------//</span><br /><span style="color: #00C800;">Function</span> lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//tu codigo de validacion</span><br /><span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">)</span>->nombre := <span style="color: #ff0000;">"Nombre de la Cuenta, si existe..."</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> .t.<br /><br /><span style="color: #B900B9;">//----------------------------//No permitir registro sin valores</span><br /><span style="color: #00C800;">Function</span> lDebHabOK<span style="color: #000000;">(</span>nValor<span style="color: #000000;">)</span><br /><span style="color: #00C800;">if</span> nValor = <span style="color: #000000;">0</span><br /> MsgStop<span style="color: #000000;">(</span><span style="color: #ff0000;">"Omision de Valores"</span>,<span style="color: #ff0000;">"Alto"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> .f.<br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> .t.<br /><br /><br /><span style="color: #B900B9;">//ESTAS FUNCIONES SON PARA COLORES PERSONALIZADOS DEL XBROWSE YA PUBLICADAS</span><br /><span style="color: #B900B9;">//No son necesarias a menos que quieras emplear las classes modificadas.</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR BUTTONBAR</span><br /><span style="color: #00C800;">Function</span> ClrMsgBar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span>nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">228</span>,<span style="color: #000000;">150</span><span style="color: #000000;">)</span>,nRGB<span style="color: #000000;">(</span><span style="color: #000000;">167</span>,<span style="color: #000000;">128</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR HEARDERS DEL TXBROWSE</span><br /><span style="color: #00C800;">Function</span> ClrHeader<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">157</span>, <span style="color: #000000;">138</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//VERDECITO</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR FOOTER DEL TXBROWSE</span><br /><span style="color: #00C800;">Function</span> ClrFooter<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">157</span>, <span style="color: #000000;">138</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//VERDECITO</span><br /> <br /> <br /> <span style="color: #B900B9;">//Funciones por cambio a Harbour</span><br /><span style="color: #00C800;">Function</span> DbSkipper<span style="color: #000000;">(</span> x <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> __DbSkipper<span style="color: #000000;">(</span> x <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Function</span> DbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> __DbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Function</span> CurDrive<span style="color: #000000;">(</span> x <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> hb_CurDrive<span style="color: #000000;">(</span> x <span style="color: #000000;">)</span><br /><br /> </div>[/code:2lfua5wz]
De antemano Gracias
Ing. Luis Duque |
xbrowse perdida del focus con bEditValid | [quote:1h28gbip]si puedo usar obrw:SetFocus(), pero el problema es que se va al primer get y este get puede tener un valid que haga ciertas cosas como volver a
a traer toda la información del browse.[/quote:1h28gbip]
Luis.
He probado tu ejemplo, y en efecto el cursor salta al primer get.
Pero con esta pequeña modificacion parece trabajar bien. Pruebala y nos dices. (Uso FWH 1204 y XHarbour)
[code=fw:1h28gbip]<div class="fw" id="{CB}" style="font-family: monospace;"> oCol:<span style="color: #000000;">bEditValid</span> := <span style="color: #000000;">{</span>|oGet,oBrwCol| ValCuenta<span style="color: #000000;">(</span>oDlg,oGet,oBrwCol,oCol,oBrw<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//AQUI oBrw</span><br /><br /><span style="color: #B900B9;">//--------------------</span><br /><span style="color: #00C800;">Function</span> ValCuenta<span style="color: #000000;">(</span>oDlg,oGet,oBrwCol,oCol,oBrw<span style="color: #000000;">)</span> <span style="color: #B900B9;">//AQUI oBrw</span><br /> <span style="color: #00C800;">Local</span> oDlgV,nValue := <span style="color: #000000;">3</span>, oRad<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgV <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TGet from "</span> + FWDESCRIPTION<br /><br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">RADIO</span> oRad <span style="color: #0000ff;">VAR</span> nValue ;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"&One"</span>, <span style="color: #ff0000;">"&Two"</span>, <span style="color: #ff0000;">"T&hree"</span> _3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">14</span> ;<br /> HELPID <span style="color: #000000;">100</span>, <span style="color: #000000;">101</span>, <span style="color: #000000;">102</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> MsgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">7</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ok"</span> <span style="color: #0000ff;">OF</span> oDlgV <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">ACTION</span> oDlgV:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Cancel"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> oDlgV <span style="color: #0000ff;">ACTION</span> oDlgV:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> CANCEL<br /> <br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgV <span style="color: #0000ff;">CENTERED</span><br /> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//AQUI</span><br /> <span style="color: #00C800;">return</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span><br /><br /> </div>[/code:1h28gbip] |
xbrowse perdida del focus con bEditValid | Francisco, Gracias
Pero el oBrw:SetFocus() si lo lleva de nuevo al Browse, pero antes se hace la validación del Get, porque se pierde el foco
ejemplo colocandole el obrw:SetFocus()
pero al primer GET le coloque un valid con msginfo() para que vea el error. Y el error es que al hacer un valid ese valid puede ser para traer la información del browse un ejemplo.
[code=fw:225rvcr4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"InKey.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oGet<br /> <span style="color: #00C800;">LOCAL</span> cCad := <span style="color: #ff0000;">"Testing "</span> <span style="color: #B900B9;">// pad("Testing Gets",40)</span><br /> <span style="color: #00C800;">LOCAL</span> nNum := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">LOCAL</span> dDat := Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oBrw, oCol, cAlias<br /> <span style="color: #00C800;">local</span> n:=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nTotal1:=<span style="color: #000000;">0</span>, nTotal2:=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> aDbf := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"cta"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"scta"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"nombre"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"debe"</span> , <span style="color: #ff0000;">"n"</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">02</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"haber"</span> , <span style="color: #ff0000;">"n"</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">02</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"concepto"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> !file<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DATOS.DBF"</span> <span style="color: #000000;">)</span><br /> dbcreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"datos.dbf"</span>, aDbf <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span><br /> <br /> <br /><br /> DbUseArea<span style="color: #000000;">(</span>.T.,,<span style="color: #ff0000;">"Datos"</span>,<span style="color: #ff0000;">"Datos"</span>,.F.<span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">if</span> lastrec<span style="color: #000000;">(</span><span style="color: #000000;">)</span> = <span style="color: #000000;">0</span><br /> dbappend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> rlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> field->cta := <span style="color: #ff0000;">"6130380125"</span><br /> field->scta := <span style="color: #ff0000;">"3230"</span><br /> field->nombre := <span style="color: #ff0000;">"NOMBRE CUENTA"</span><br /> dbunlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <br /> <br /> cAlias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> dbSelectArea<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TGet from "</span> + FWDESCRIPTION <span style="color: #0000ff;">size</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span><br /><br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Text..:"</span> <span style="color: #0000ff;">OF</span> oDlg<br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">6</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cCad <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">COLOR</span> <span style="color: #ff0000;">"W/G"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> <span style="color: #0000ff;">Valid</span> FunValGet<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">1.8</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Number:"</span> <span style="color: #0000ff;">OF</span> oDlg<br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">6</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> nNum <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999999.99"</span><br /> @ <span style="color: #000000;">2.6</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Date:"</span> <span style="color: #0000ff;">OF</span> oDlg<br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">6</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> dDat <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@E"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #B900B9;">// "@D"</span><br /><br /> oBrw := TXBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDlg <span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">cAlias</span> := cAlias <br /><br /> oBrw:<span style="color: #000000;">nTop</span> := <span style="color: #000000;">50</span><br /> oBrw:<span style="color: #000000;">nLeft</span> := <span style="color: #000000;">10</span><br /> oBrw:<span style="color: #000000;">nBottom</span> := <span style="color: #000000;">350</span><br /> oBrw:<span style="color: #000000;">nRight</span> := <span style="color: #000000;">450</span><br /><br /> oBrw:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_INSET<br /> oBrw:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_INSET<br /> oBrw:<span style="color: #000000;">lColDividerComplete</span> := .t. <span style="color: #B900B9;">//completa pintado sobre el footer cuando lineas no llenan todo el browse</span><br /><br /> oBrw:<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">30</span> <span style="color: #B900B9;">//Altura cabeceras de col</span><br /> oBrw:<span style="color: #000000;">lFooter</span> := .t. <span style="color: #B900B9;">//Que tendrá footer </span><br /> oBrw:<span style="color: #000000;">nFooterLines</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//Lineas del footer </span><br /> oBrw:<span style="color: #000000;">nFooterHeight</span> := <span style="color: #000000;">24</span> <span style="color: #B900B9;">//Altura del Footer</span><br /> oBrw:<span style="color: #000000;">lRecordSelector</span> := .t. <span style="color: #B900B9;">//poner o no, COL de la flechita de la izq</span><br /><br /><br /> oBrw:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">140</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">229</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// VERDECITO</span><br /> oBrw:<span style="color: #000000;">bClrFooter</span> := oBrw:<span style="color: #000000;">bClrHeader</span><br /> oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// colores para lineas normales</span><br /> oBrw:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco</span><br /> oBrw:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco</span><br /><br /> oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLCELL <span style="color: #B900B9;">//solo ilumina la celda actual</span><br /><br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">20</span> <span style="color: #B900B9;">//altura entre lineas</span><br /><br /> oBrw:<span style="color: #000000;">lFastEdit</span> := .t. <br /><br /><br /><br /> <span style="color: #B900B9;">//Aqui uso DbPack() porque es una dbf pequeña y temporal. En grandes usar function de mantenimiento.</span><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->cta <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CTA"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Cta := xVal, <span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_ESCAPE .and. Empty<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Cta<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>__dbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbGoBottom<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">bEditValid</span> := <span style="color: #000000;">{</span>|oGet,oBrwCol| ValCuenta<span style="color: #000000;">(</span>oDlg,oGet,oBrwCol,oCol,oBrw<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Scta <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"SC4"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Scta := xVal, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->NOMBRE <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"DESCRIPCION DE LA CUENTA"</span> <br /> oCol:<span style="color: #000000;">cFooter</span> = <span style="color: #ff0000;">"BALANCE ---> "</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">nEditType</span> = <span style="color: #000000;">0</span> <span style="color: #B900B9;">//no editable</span><br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//alineado a la derecha</span><br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"DEBITOS"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">lTotal</span> := .t. <span style="color: #B900B9;">//para totalizar cols a report y/o excel</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| TRANSFORM<span style="color: #000000;">(</span>nTotal1,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Haber =<span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span> nTotal1+=<span style="color: #000000;">(</span>Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>-<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE<span style="color: #000000;">)</span>, oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE := Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CREDITOS"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET<br /> oCol:<span style="color: #000000;">lTotal</span> := .t. <span style="color: #B900B9;">//para totalizar cols a report y/o excel</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| TRANSFORM<span style="color: #000000;">(</span>nTotal2,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Debe =<span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> nTotal2+=<span style="color: #000000;">(</span>Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>-<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER<span style="color: #000000;">)</span>, oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER := Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->CONCEPTO <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CONCEPTO"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> <span style="color: #B900B9;">//Es la ultima columna, agrega nuevo registro en blanco y se va a primer columna,</span><br /> <span style="color: #B900B9;">//solo si la cta y/o valores están OK</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->CONCEPTO := xVal ,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Recno<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>==<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Reccount<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> .and. lDebHabOK<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->debe+<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->haber<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">100</span><br /><br /><br /> oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBrw:<span style="color: #000000;">bKeyDown</span> :=<span style="color: #000000;">{</span> | nKey | Teclas<span style="color: #000000;">(</span>nKey, oBrw, cAlias<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oDlg:<span style="color: #000000;">oClient</span> := oBrw<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #00C800;">Function</span> FunValGet<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Validar Get"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Return</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//--------------------</span><br /><span style="color: #00C800;">Function</span> ValCuenta<span style="color: #000000;">(</span>oDlg,oGet,oBrwCol,oCol,oBrw<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> oDlgV,nValue := <span style="color: #000000;">3</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgV <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TGet from "</span> + FWDESCRIPTION<br /><br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">RADIO</span> oRad <span style="color: #0000ff;">VAR</span> nValue ;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"&One"</span>, <span style="color: #ff0000;">"&Two"</span>, <span style="color: #ff0000;">"T&hree"</span> _3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">14</span> ;<br /> HELPID <span style="color: #000000;">100</span>, <span style="color: #000000;">101</span>, <span style="color: #000000;">102</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> MsgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">7</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ok"</span> <span style="color: #0000ff;">OF</span> oDlgV <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">ACTION</span> oDlgV:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Cancel"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> oDlgV <span style="color: #0000ff;">ACTION</span> oDlgV:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> CANCEL<br /> <br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgV <span style="color: #0000ff;">CENTERED</span><br /> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">return</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #00C800;">Function</span> Teclas<span style="color: #000000;">(</span>nKey, oBrw, cAlias<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br /> <span style="color: #00C800;">Case</span> nKey == VK_DELETE<br /> <span style="color: #00C800;">if</span> MsgNoYes<span style="color: #000000;">(</span><span style="color: #ff0000;">"¿Está seguro(a) de borrar este registro?"</span>,<span style="color: #ff0000;">"Borrar registro de "</span>+cAlias<span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">EndCase</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------//</span><br /><span style="color: #00C800;">Function</span> lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//tu codigo de validacion</span><br /><span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">)</span>->nombre := <span style="color: #ff0000;">"Nombre de la Cuenta, si existe..."</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> .t.<br /><br /><span style="color: #B900B9;">//----------------------------//No permitir registro sin valores</span><br /><span style="color: #00C800;">Function</span> lDebHabOK<span style="color: #000000;">(</span>nValor<span style="color: #000000;">)</span><br /><span style="color: #00C800;">if</span> nValor = <span style="color: #000000;">0</span><br /> MsgStop<span style="color: #000000;">(</span><span style="color: #ff0000;">"Omision de Valores"</span>,<span style="color: #ff0000;">"Alto"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> .f.<br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> .t.<br /><br /><br /><span style="color: #B900B9;">//ESTAS FUNCIONES SON PARA COLORES PERSONALIZADOS DEL XBROWSE YA PUBLICADAS</span><br /><span style="color: #B900B9;">//No son necesarias a menos que quieras emplear las classes modificadas.</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR BUTTONBAR</span><br /><span style="color: #00C800;">Function</span> ClrMsgBar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span>nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">228</span>,<span style="color: #000000;">150</span><span style="color: #000000;">)</span>,nRGB<span style="color: #000000;">(</span><span style="color: #000000;">167</span>,<span style="color: #000000;">128</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR HEARDERS DEL TXBROWSE</span><br /><span style="color: #00C800;">Function</span> ClrHeader<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">157</span>, <span style="color: #000000;">138</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//VERDECITO</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR FOOTER DEL TXBROWSE</span><br /><span style="color: #00C800;">Function</span> ClrFooter<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">157</span>, <span style="color: #000000;">138</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//VERDECITO</span><br /> <br /> <br /> <span style="color: #B900B9;">//Funciones por cambio a Harbour</span><br /><span style="color: #00C800;">Function</span> DbSkipper<span style="color: #000000;">(</span> x <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> __DbSkipper<span style="color: #000000;">(</span> x <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Function</span> DbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> __DbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Function</span> CurDrive<span style="color: #000000;">(</span> x <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> hb_CurDrive<span style="color: #000000;">(</span> x <span style="color: #000000;">)</span><br /><br /><br /> </div>[/code:225rvcr4] |
xbrowse perdida del focus con bEditValid | Si.
Prueba asi:
[code=fw:3be8rdf6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"InKey.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oGet := Array<span style="color: #000000;">(</span><span style="color: #000000;">3</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> cCad := <span style="color: #ff0000;">"Testing "</span> <span style="color: #B900B9;">// pad("Testing Gets",40)</span><br /> <span style="color: #00C800;">LOCAL</span> nNum := <span style="color: #000000;">0</span><br /> <span style="color: #00C800;">LOCAL</span> dDat := Date<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> oBrw, oCol, cAlias<br /> <span style="color: #00C800;">local</span> n:=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> nTotal1:=<span style="color: #000000;">0</span>, nTotal2:=<span style="color: #000000;">0</span><br /> <span style="color: #00C800;">local</span> aDbf := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"cta"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"scta"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"nombre"</span> , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"debe"</span> , <span style="color: #ff0000;">"n"</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">02</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"haber"</span> , <span style="color: #ff0000;">"n"</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">02</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> aadd<span style="color: #000000;">(</span> aDbf, <span style="color: #000000;">{</span><span style="color: #ff0000;">"concepto"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">00</span><span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> !file<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DATOS.DBF"</span> <span style="color: #000000;">)</span><br /> dbcreate<span style="color: #000000;">(</span> <span style="color: #ff0000;">"datos.dbf"</span>, aDbf <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Endif</span><br /> <br /> <br /><br /> DbUseArea<span style="color: #000000;">(</span>.T.,,<span style="color: #ff0000;">"Datos"</span>,<span style="color: #ff0000;">"Datos"</span>,.F.<span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">if</span> lastrec<span style="color: #000000;">(</span><span style="color: #000000;">)</span> = <span style="color: #000000;">0</span><br /> dbappend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> rlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> field->cta := <span style="color: #ff0000;">"6130380125"</span><br /> field->scta := <span style="color: #ff0000;">"3230"</span><br /> field->nombre := <span style="color: #ff0000;">"NOMBRE CUENTA"</span><br /> dbunlock<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> <br /> <br /> cAlias:=<span style="color: #0000ff;">Alias</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> dbSelectArea<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TGet from "</span> + FWDESCRIPTION <span style="color: #0000ff;">size</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span><br /><br /> oBrw := TXBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oDlg <span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">cAlias</span> := cAlias <br /><br /> oBrw:<span style="color: #000000;">nTop</span> := <span style="color: #000000;">50</span><br /> oBrw:<span style="color: #000000;">nLeft</span> := <span style="color: #000000;">10</span><br /> oBrw:<span style="color: #000000;">nBottom</span> := <span style="color: #000000;">350</span><br /> oBrw:<span style="color: #000000;">nRight</span> := <span style="color: #000000;">450</span><br /><br /> oBrw:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_INSET<br /> oBrw:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_INSET<br /> oBrw:<span style="color: #000000;">lColDividerComplete</span> := .t. <span style="color: #B900B9;">//completa pintado sobre el footer cuando lineas no llenan todo el browse</span><br /><br /> oBrw:<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">30</span> <span style="color: #B900B9;">//Altura cabeceras de col</span><br /> oBrw:<span style="color: #000000;">lFooter</span> := .t. <span style="color: #B900B9;">//Que tendrá footer </span><br /> oBrw:<span style="color: #000000;">nFooterLines</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//Lineas del footer </span><br /> oBrw:<span style="color: #000000;">nFooterHeight</span> := <span style="color: #000000;">24</span> <span style="color: #B900B9;">//Altura del Footer</span><br /> oBrw:<span style="color: #000000;">lRecordSelector</span> := .t. <span style="color: #B900B9;">//poner o no, COL de la flechita de la izq</span><br /><br /><br /> oBrw:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">140</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">229</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// VERDECITO</span><br /> oBrw:<span style="color: #000000;">bClrFooter</span> := oBrw:<span style="color: #000000;">bClrHeader</span><br /> oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// colores para lineas normales</span><br /> oBrw:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">255</span>,<span style="color: #000000;">255</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco</span><br /> oBrw:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco</span><br /><br /> oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLCELL <span style="color: #B900B9;">//solo ilumina la celda actual</span><br /><br /> oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">20</span> <span style="color: #B900B9;">//altura entre lineas</span><br /><br /> oBrw:<span style="color: #000000;">lFastEdit</span> := .t. <br /><br /><br /><br /> <span style="color: #B900B9;">//Aqui uso DbPack() porque es una dbf pequeña y temporal. En grandes usar function de mantenimiento.</span><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->cta <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CTA"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Cta := xVal, <span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_ESCAPE .and. Empty<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Cta<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>__dbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbGoBottom<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">bEditValid</span> := <span style="color: #000000;">{</span>|oGet,oBrwCol| ValCuenta<span style="color: #000000;">(</span>oDlg,oGet,oBrwCol,oCol,oBrw<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Scta <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"SC4"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET<br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Scta := xVal, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->NOMBRE <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"DESCRIPCION DE LA CUENTA"</span> <br /> oCol:<span style="color: #000000;">cFooter</span> = <span style="color: #ff0000;">"BALANCE ---> "</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">nEditType</span> = <span style="color: #000000;">0</span> <span style="color: #B900B9;">//no editable</span><br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//alineado a la derecha</span><br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"DEBITOS"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> oCol:<span style="color: #000000;">lTotal</span> := .t. <span style="color: #B900B9;">//para totalizar cols a report y/o excel</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| TRANSFORM<span style="color: #000000;">(</span>nTotal1,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Haber =<span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span> nTotal1+=<span style="color: #000000;">(</span>Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>-<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE<span style="color: #000000;">)</span>, oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->DEBE := Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || Transform<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CREDITOS"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET<br /> oCol:<span style="color: #000000;">lTotal</span> := .t. <span style="color: #B900B9;">//para totalizar cols a report y/o excel</span><br /> oCol:<span style="color: #000000;">bFooter</span> = <span style="color: #000000;">{</span>|| TRANSFORM<span style="color: #000000;">(</span>nTotal2,<span style="color: #ff0000;">"9,999,999,999.99"</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">nFootStrAlign</span> := <span style="color: #000000;">1</span><br /> oCol:<span style="color: #000000;">bEditWhen</span> := <span style="color: #000000;">{</span>|| <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->Debe =<span style="color: #000000;">0</span> <span style="color: #000000;">}</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span>lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> nTotal2+=<span style="color: #000000;">(</span>Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span>-<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER<span style="color: #000000;">)</span>, oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->HABER := Val<span style="color: #000000;">(</span>xVal<span style="color: #000000;">)</span> <span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> ,<span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">80</span><br /><br /><br /> oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->CONCEPTO <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"CONCEPTO"</span> <br /> oCol:<span style="color: #000000;">nEditType</span> = EDIT_GET <br /> <span style="color: #B900B9;">//Es la ultima columna, agrega nuevo registro en blanco y se va a primer columna,</span><br /> <span style="color: #B900B9;">//solo si la cta y/o valores están OK</span><br /> oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">{</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> RecCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span> == <span style="color: #000000;">0</span>, DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> nKey == VK_RETURN, <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->CONCEPTO := xVal ,<span style="color: #000000;">)</span> ,;<br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span>,<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,;<br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Recno<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>==<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>Reccount<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span> .and. lDebHabOK<span style="color: #000000;">(</span><span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->debe+<span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>->haber<span style="color: #000000;">)</span>, <span style="color: #000000;">(</span>DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>,<span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br /> oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">100</span><br /><br /><br /> oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oBrw:<span style="color: #000000;">bKeyDown</span> :=<span style="color: #000000;">{</span> | nKey | Teclas<span style="color: #000000;">(</span>nKey, oBrw, cAlias<span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /> oDlg:<span style="color: #000000;">oClient</span> := oBrw<br /><br /><span style="color: #B900B9;">//AQUI...</span><br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Text..:"</span> <span style="color: #0000ff;">OF</span> oDlg<br /> @ <span style="color: #000000;">1</span>, <span style="color: #000000;">6</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cCad <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span> <span style="color: #0000ff;">Valid</span> FunValGet<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//COLOR "W/G"</span><br /> @ <span style="color: #000000;">1.8</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Number:"</span> <span style="color: #0000ff;">OF</span> oDlg<br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">6</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> nNum <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999999.99"</span><br /> @ <span style="color: #000000;">2.6</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Date:"</span> <span style="color: #0000ff;">OF</span> oDlg<br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">6</span> <span style="color: #0000ff;">GET</span> oGet<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> dDat <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@E"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>, <span style="color: #000000;">10</span> <span style="color: #B900B9;">// "@D"</span><br /><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oGet<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//AQUI</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">Function</span> FunValGet<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"Validar Get"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Return</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">//--------------------</span><br /><span style="color: #00C800;">Function</span> ValCuenta<span style="color: #000000;">(</span>oDlg,oGet,oBrwCol,oCol,oBrw<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">Local</span> oDlgV,nValue := <span style="color: #000000;">3</span>, oRad<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgV <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TGet from "</span> + FWDESCRIPTION<br /><br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">RADIO</span> oRad <span style="color: #0000ff;">VAR</span> nValue ;<br /> <span style="color: #0000ff;">ITEMS</span> <span style="color: #ff0000;">"&One"</span>, <span style="color: #ff0000;">"&Two"</span>, <span style="color: #ff0000;">"T&hree"</span> _3D <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">150</span>, <span style="color: #000000;">14</span> ;<br /> HELPID <span style="color: #000000;">100</span>, <span style="color: #000000;">101</span>, <span style="color: #000000;">102</span> ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> MsgBeep<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">7</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Ok"</span> <span style="color: #0000ff;">OF</span> oDlgV <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">ACTION</span> oDlgV:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> @ <span style="color: #000000;">3</span>, <span style="color: #000000;">16</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Cancel"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> oDlgV <span style="color: #0000ff;">ACTION</span> oDlgV:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> CANCEL<br /> <br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgV <span style="color: #0000ff;">CENTERED</span><br /> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span><span style="color: #000000;">(</span>.t.<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #00C800;">Function</span> Teclas<span style="color: #000000;">(</span>nKey, oBrw, cAlias<span style="color: #000000;">)</span><br /><span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br /> <span style="color: #00C800;">Case</span> nKey == VK_DELETE<br /> <span style="color: #00C800;">if</span> MsgNoYes<span style="color: #000000;">(</span><span style="color: #ff0000;">"¿Está seguro(a) de borrar este registro?"</span>,<span style="color: #ff0000;">"Borrar registro de "</span>+cAlias<span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbDelete<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #000000;">(</span>cAlias<span style="color: #000000;">)</span>-><span style="color: #000000;">(</span>dbPack<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">EndCase</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------//</span><br /><span style="color: #00C800;">Function</span> lCtaOK<span style="color: #000000;">(</span>oBrw<span style="color: #000000;">)</span><br /><span style="color: #B900B9;">//tu codigo de validacion</span><br /><span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">)</span>->nombre := <span style="color: #ff0000;">"Nombre de la Cuenta, si existe..."</span><br /> oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> .t.<br /><br /><span style="color: #B900B9;">//----------------------------//No permitir registro sin valores</span><br /><span style="color: #00C800;">Function</span> lDebHabOK<span style="color: #000000;">(</span>nValor<span style="color: #000000;">)</span><br /><span style="color: #00C800;">if</span> nValor = <span style="color: #000000;">0</span><br /> MsgStop<span style="color: #000000;">(</span><span style="color: #ff0000;">"Omision de Valores"</span>,<span style="color: #ff0000;">"Alto"</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> .f.<br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">Return</span> .t.<br /><br /><br /><span style="color: #B900B9;">//ESTAS FUNCIONES SON PARA COLORES PERSONALIZADOS DEL XBROWSE YA PUBLICADAS</span><br /><span style="color: #B900B9;">//No son necesarias a menos que quieras emplear las classes modificadas.</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR BUTTONBAR</span><br /><span style="color: #00C800;">Function</span> ClrMsgBar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span>nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">228</span>,<span style="color: #000000;">150</span><span style="color: #000000;">)</span>,nRGB<span style="color: #000000;">(</span><span style="color: #000000;">167</span>,<span style="color: #000000;">128</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR HEARDERS DEL TXBROWSE</span><br /><span style="color: #00C800;">Function</span> ClrHeader<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">157</span>, <span style="color: #000000;">138</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//VERDECITO</span><br /><br /><span style="color: #B900B9;">//-------------------COLOR FOOTER DEL TXBROWSE</span><br /><span style="color: #00C800;">Function</span> ClrFooter<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">{</span> nRGB<span style="color: #000000;">(</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">)</span>, nRGB<span style="color: #000000;">(</span><span style="color: #000000;">157</span>, <span style="color: #000000;">138</span>,<span style="color: #000000;">0</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">//VERDECITO</span><br /> <br /> </div>[/code:3be8rdf6]
Saludos. |
xbrowse perdida del focus con bEditValid | Francisco, Gracias, si de esa forma sirve, porque se va al primer foco que en este caso el browse.
pero tengo un software ERP que tiene miles y miles lineas de programación y esta trabajando en bastantes empresas y eso es empezar a revisar todos
los browser con ese problema, con la versión 11.06 trabaja bien pero con 15.03 la ultima no, y cambiar en miles de lineas no es facil, por
los errores a futuros, no se que hacer. Por que en este momento tengo una estructura solida con el sistema.
No se si exista una forma mas sencilla de indicarle al valid del browse cuando salga del dialogo que tome el control del mismo browse y no se vaya al
primer control,
Muchas Gracias Francisco. |
xbrowse perdida del focus con bEditValid | <!-- l --><a class="postlink-local" href="http://fivetechsupport.com/forums/viewtopic.php?f=3&t=26594&hilit=beditvalid#p147088">viewtopic.php?f=3&t=26594&hilit=beditvalid#p147088</a><!-- l -->
<!-- l --><a class="postlink-local" href="http://fivetechsupport.com/forums/viewtopic.php?f=6&t=28396&hilit=bvalid#p159080">viewtopic.php?f=6&t=28396&hilit=bvalid#p159080</a><!-- l -->
Talvez el Sr. Nages pueda indicarte la solución. |
xbrowse perdida del focus con bEditValid | Francisco
Muchas gracias por el interés, muy amable. |
xbrowse perdida del focus con bEditValid | Aqui hay un ejemplo completo, de Mr. Nages. Explica como usar bEditValid. Puede ser de gran ayuda.
<!-- l --><a class="postlink-local" href="http://fivetechsupport.com/forums/viewtopic.php?f=3&t=29629&hilit=beditvalid#p167765">viewtopic.php?f=3&t=29629&hilit=beditvalid#p167765</a><!-- l -->
Saludos. |
xbrowse picture for string with percentual field | I wish insert a picture with "%" into a column of a xbrowse as this:
[img:ppkpje08]http://www.eoeo.it/wp-content/uploads/2014/11/percent.jpg[/img:ppkpje08]
Note : the final user inser a string (max 10 CR) not a number !!
How I can make to replace the record with percetual symbol at the end if the record is changed ? |
xbrowse picture for string with percentual field | Any solution ? |
xbrowse picture for string with percentual field | Silvio:
Just an idea.
Using the VALID method you can do this:
[code=fw:3gszqqv2]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> cUserVar<br />....<br />....<br />....<br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> aGets<span style="color: #000000;">[</span> <span style="color: #000000;">2</span><span style="color: #000000;">]</span> <span style="color: #0000ff;">VAR</span> cUserVar <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UPDATE</span>;<br /> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@K"</span>;<br /> <span style="color: #0000ff;">VALID</span> ChgStr<span style="color: #000000;">(</span>oDlg<span style="color: #000000;">)</span><br />....<br />....<br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ChgStr<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">IF</span> ! EMPTY<span style="color: #000000;">(</span>ALLTRIM<span style="color: #000000;">(</span>cUserVar<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> cUserVar := ALLTRIM<span style="color: #000000;">(</span>cUserVar<span style="color: #000000;">)</span> + <span style="color: #ff0000;">"%"</span><br /> <span style="color: #00C800;">ENDIF</span><br /> oDlg:<span style="color: #0000ff;">Update</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span>.T.<span style="color: #000000;">)</span><br /> </div>[/code:3gszqqv2]
Regards |
xbrowse picture for string with percentual field | Armando I'm using a xbrowse |
xbrowse picture for string with percentual field | Silvio:
Ouch, I'm not expert in xBrowse class, but I remember xBrowse has POSTEDIT method
then you can use my previous idea with that method.
Regards |
xbrowse picture for string with percentual field | I tried with bOnChange method but it not run ok or I not Know how set the right variable
sample
:bOnChange := { |oCol, uOldVal| MyFuncOnChange( oCol, uOldVal ) } |
xbrowse picture for string with percentual field | [code=fw:2o53mmmd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span> |x| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> x == <span style="color: #00C800;">nil</span>, <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->SCONTI, <span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">)</span>->SCONTI := RemRight<span style="color: #000000;">(</span> x, <span style="color: #ff0000;">"%"</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"%"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> </div>[/code:2o53mmmd] |
xbrowse picture for string with percentual field | thanks... I not Know remright .func.is xharbour ?
perhaps I made some errors because here not run also
When iinsert sample "50+30+3" it not replace the symbol % at the end
[code=fw:15hfnc34]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> aBrowse := <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">"PAITEM"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Codice"</span><span style="color: #000000;">)</span> ,<span style="color: #00C800;">nil</span> ,<span style="color: #000000;">50</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PADESC"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Descrizione"</span><span style="color: #000000;">)</span> ,<span style="color: #00C800;">nil</span> ,<span style="color: #000000;">160</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAQTY"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Quantità"</span><span style="color: #000000;">)</span> ,<span style="color: #ff0000;">"9999"</span> ,<span style="color: #000000;">60</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAMISURA"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Misura"</span><span style="color: #000000;">)</span> ,<span style="color: #00C800;">nil</span> ,<span style="color: #000000;">60</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAUNITARIO"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unitario"</span><span style="color: #000000;">)</span> ,pict_money_Euro ,<span style="color: #000000;">80</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PASCONTO"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"%Sconto"</span><span style="color: #000000;">)</span> , <span style="color: #00C800;">nil</span> ,<span style="color: #000000;">80</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAPROVV"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"%Provv."</span><span style="color: #000000;">)</span> ,<span style="color: #ff0000;">'@ 999.99%'</span> ,<span style="color: #000000;">60</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PAIVA"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Iva"</span><span style="color: #000000;">)</span> ,<span style="color: #ff0000;">"99%"</span> ,<span style="color: #000000;">40</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #ff0000;">"PATOTALE"</span> ,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Importo"</span><span style="color: #000000;">)</span> ,pict_money_Euro ,<span style="color: #000000;">80</span> <span style="color: #000000;">}</span><span style="color: #000000;">}</span><br /><br /><br /><br /> @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ;<br /> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">adialogs</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> DATASOURCE <span style="color: #ff0000;">"TB"</span> ;<br /> COLUMNS aBrowse CELL LINES FOOTERS NOBORDER<br /><br /><br /><br />.....<br /><br /><br /><br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">6</span><span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br /> <span style="color: #000000;">[</span>b<span style="color: #000000;">]</span> :<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span> |x| <span style="color: #00C800;">If</span><span style="color: #000000;">(</span> x == <span style="color: #00C800;">nil</span>, <span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">)</span>->PASCONTO, <span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">cAlias</span><span style="color: #000000;">)</span>->PASCONTO := RemRight<span style="color: #000000;">(</span> x, <span style="color: #ff0000;">"%"</span> <span style="color: #000000;">)</span> + <span style="color: #ff0000;">"%"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><span style="color: #000000;">[</span>/b<span style="color: #000000;">]</span><br /> END<br /><br /><br /><br /><br /> </div>[/code:15hfnc34] |
xbrowse picture for time in datetime field | Hello,
In an xBrowse, I have a datetime field.
I only want to show time in hh:mm:ss, but I tried with picture "@T" and also i get miliseconds, which I don´t want to show.
Please, how can I only show hh:mm and seconds?.
Thank you. Best regards |
xbrowse picture for time in datetime field | Lucas,
Can't you just parse it out using substr()?
James |
xbrowse picture for time in datetime field | Added a TIME-field to my new Xbrowse-sample :
[img:23hbl5ug]http://www.pflegeplus.com/pictures/Xbrtime1..jpg[/img:23hbl5ug]
[code=fw:23hbl5ug]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #B900B9;">// FIELD ("ABC")->TIMESET = C 8 => "10.12.05"</span><br /><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Time"</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">oDataFont</span> := oFont2<br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">oEditFont</span> := oFont2<br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nDataStrAlign</span> := AL_CENTER<br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">{</span> || <span style="color: #000000;">(</span><span style="color: #ff0000;">"ABC"</span><span style="color: #000000;">)</span>->TIMESET <span style="color: #000000;">}</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bPopUp</span> := <span style="color: #000000;">{</span> |o| ColMenu1<span style="color: #000000;">(</span> o, oBrw <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">80</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">11</span> <span style="color: #000000;">]</span>:<span style="color: #000000;">bToolTip</span> := <span style="color: #000000;">{</span>| oBrw, nRow, nCol, nKeyFlag | ;<br /> <span style="color: #00C800;">IF</span><span style="color: #000000;">(</span> oBrw:<span style="color: #000000;">MouseRowPos</span><span style="color: #000000;">(</span>nRow<span style="color: #000000;">)</span> == oBrw:<span style="color: #000000;">nRowSel</span>, ;<br /> <span style="color: #ff0000;">"Change time"</span> + CRLF + ;<br /> <span style="color: #ff0000;">"with left"</span> + CRLF + ;<br /> <span style="color: #ff0000;">"mouseclick"</span>, <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">// ---------</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> COLMENU1<span style="color: #000000;">(</span> oCol, oBrw <span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oPop<br /><br /><span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Add time"</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> NET_RLOCK<span style="color: #000000;">(</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #000000;">(</span><span style="color: #ff0000;">"ABC"</span><span style="color: #000000;">)</span>->TIMESET := TIME<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> NET_ULOCK<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Delete time"</span> ;<br /> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">(</span> NET_RLOCK<span style="color: #000000;">(</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, ;<br /> <span style="color: #000000;">(</span><span style="color: #ff0000;">"ABC"</span><span style="color: #000000;">)</span>->TIMESET := <span style="color: #ff0000;">"--.--.--"</span>, ;<br /> NET_ULOCK<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, ;<br /> oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">RETURN</span> oPop<br /><br /> </div>[/code:23hbl5ug]
best regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xbrowse picture for time in datetime field | Hello,
Thanks UWe but you´re using time(), not datetime() field, which offers time in hh:mm:ss:ms format.
Hope Mr. Nages can reply to his.
Thanks folks. |
xbrowse picture for time in datetime field | Lucas,
You can EXTRACT a timestring from =>[color=#008040:1dv2wmur] [b:1dv2wmur]DateTime() [/b:1dv2wmur][/color:1dv2wmur] to use in xBrowse :
[color=#0000FF:1dv2wmur][b:1dv2wmur]dt := DateTime()
cHours := ALLTRIM(STR( Hour( dt ) )) + ":"
cMinutes := ALLTRIM(STR( Minute( dt ) )) + ":"
cSeconds := ALLTRIM(STR( Secs( dt ) ))
cTime := cHours + cMinutes + cSeconds[/b:1dv2wmur][/color:1dv2wmur]
best regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
xbrowse picture for time in datetime field | Lucas
Consider ADDing the DateTime field and use the Data codeblock to parse up the string ..
Rick Lipkin
[code=fw:32rc3zhr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />ADD oCol <span style="color: #0000ff;">TO</span> oLbxA <span style="color: #00C800;">AT</span> <span style="color: #000000;">1</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">{</span>|x| x := _ChkDateTime<span style="color: #000000;">(</span>oRsCust:<span style="color: #000000;">Fields</span><span style="color: #000000;">(</span><span style="color: #ff0000;">"LastUpdate"</span><span style="color: #000000;">)</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">}</span>;<br /> HEADER <span style="color: #ff0000;">"Last Update"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">100</span><br /><br />...<br />...<br /><br /><span style="color: #B900B9;">//--------------------</span><br /><span style="color: #00C800;">Static</span> Func _CHkDateTime<span style="color: #000000;">(</span> dTime <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Local</span> cTime<br /><br /><span style="color: #00C800;">If</span> empty<span style="color: #000000;">(</span> dTime <span style="color: #000000;">)</span><br /> dTime := <span style="color: #ff0000;">"00/00/0000 00:00 00"</span><br /><span style="color: #00C800;">Endif</span><br /><br /><span style="color: #B900B9;">// dTime = "03/04/2014 12:30 40" // may look different in your case</span><br /><br />cTime := <span style="color: #0000ff;">substr</span><span style="color: #000000;">(</span>dTime,<span style="color: #000000;">12</span>,<span style="color: #000000;">8</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span> cTime <span style="color: #000000;">)</span><br /><br /> </div>[/code:32rc3zhr] |
xbrowse picture for time in datetime field | [quote="lucasdebeltran":13g1g7sh]Hello,
In an xBrowse, I have a datetime field.
I only want to show time in hh:mm:ss, but I tried with picture "@T" and also i get miliseconds, which I don´t want to show.
Please, how can I only show hh:mm and seconds?.
Thank you. Best regards[/quote:13g1g7sh]
If you want to show date and time without milliseconds
use
SET TIME FORMAT TO "HH:MM:SS" |
xbrowse picture for time in datetime field | Hello,
Thank you, but I only want to show Time.
I guessed it was a Smart way.
Finally, I did as the classic way:
[code=fw:197pbc7w]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">LOCAL</span> Dt := <span style="color: #0000ff;">RIGHT</span><span style="color: #000000;">(</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">(</span> cValToChar<span style="color: #000000;">(</span>dTime<span style="color: #000000;">)</span>, <span style="color: #000000;">16</span><span style="color: #000000;">)</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">(</span> Dt <span style="color: #000000;">)</span><br /> </div>[/code:197pbc7w]
Thank you. |
xbrowse picture for time in datetime field | Then please try
oCol:cDataPicture := "hh:mi:ss"
You do not have to make any conversions or use any formulae |
xbrowse picture for time in datetime field | Mr. Nages,
That´s what I was looking for. It Works great.
Thank you very much.
Best regards. |
xbrowse postedition move | Hi everyone!
i have a little xbrowse contribution
now we can select move direction to next cell post edition
open xbrowse.ch
( add )
[code:1666tfnp]
#define MOVE_RIGHT 1
#define MOVE_LEFT 2
#define MOVE_UP 3
#define MOVE_DOWN 4
#define MOVE_NONE 5
#define MOVE_FAST_RIGHT 6
#define MOVE_FAST_LEFT 7
[/code:1666tfnp]
the diference between FAST and other is FAST have fastedit feature when this is activated
when use no FAST with FastEdit activated, the "cursor" go to next cell whatever is editable or not
open xbrowse.prg
( add new data TXBrowse )
[code:1666tfnp]
DATA nMoveType; // 1 Move Right
AS NUMERIC // 2 Move Left
// 3 Move Up
// 4 Move down
// 5 No Move
// 6 Move Right with lFastedit features, only work with lFastEdit := .t.
// 7 Move left with lFastedit features, only work with lFastEdit := .t.
[/code:1666tfnp]
METHOD NEW Txbrowse
( add )
[code:1666tfnp]
::nMoveType := MOVE_FAST_RIGHT
[/code:1666tfnp]
Change all METHOD GoNextCtrl TxBrwose
[code:1666tfnp]
METHOD GoNextCtrl(hWnd) CLASS TXBrowse
local oCol
local aCols
local nCol, nNextPos, n
local lDir := .f.
local nI
local nOldMove
If hWnd != Nil
If ::nLastKey == 9
PostMessage(hWnd, WM_KEYDOWN, VK_RETURN)
Endif
return nil
Endif
if ::nColSel == ::nLastEditCol
::nLastEditCol := 0
if ::nLastKey == VK_DOWN
::Select( 0 )
::GoDown()
::Select( 1 )
elseif ::nLastKey == VK_UP
::Select( 0 )
::GoUp()
::Select( 1 )
else
if ::lFastEdit
DO CASE
CASE ::nMoveType == MOVE_FAST_RIGHT
nNextPos := 0
if ::nColSel < Len( ::aDisplay )
nNextPos := AScan( ::aDisplay, { |i| ::aCols[ i ]:nEditType > 0 }, ::nColSel + 1 )
endif
if nNextPos > 0
if ::IsDisplayPosVisible( nNextPos, .t. )
::nColSel := nNextPos
if ::FullPaint()
::Super:Refresh( .t. ) //::Paint()
else
::DrawLine( .t. )
endif
else
for n := ::nColSel + 1 to nNextPos
::GoRight()
next n
endif
else
::GoLeftMost()
nNextPos := AScan( ::aDisplay, { |i| ::aCols[ i ]:nEditType > 0 } )
if nNextPos > 1
if ::IsDisplayPosVisible( nNextPos, .t. )
::nColSel := nNextPos
::DrawLine( .t. )
else
for n := 2 to nNextPos
::GoRight()
next
endif
endif
if ::lAutoAppend .or. ::nDataRows > ::nRowSel
if ::bPastEof == NIL .and. ::nDataRows = ::nRowSel
MsgStop( "::bPastEof not defined","Fivewin: Class TXBrowse" )
return NIL
else
::Select( 0 )
::GoDown()
::Select( 1 )
endif
endif
endif
CASE ::nMoveType == MOVE_RIGHT
nNextPos := ::nColSel + 1
if !::IsDisplayPosVisible( nNextPos, .t. )
::GoLeftMost()
if ::nDataRows > ::nRowSel
::GoDown()
endif
else
::GoRight()
endif
CASE ::nMoveType == MOVE_FAST_LEFT
nNextPos := ::SelectedCol():nCreationOrder - 1
nI := nNextPos
if nNextPos > 0
while ::aCols[ nI ]:nEditType < 1
if ( --nI ) == 0
exit
endif
enddo
endif
nNextPos := ascan(::aDisplay,{|i| i = nI } )
if nNextPos > 0
if ::IsDisplayPosVisible( nNextPos, .t. )
::nColSel := nNextPos
if ::FullPaint()
::Super:Refresh( .t. ) //::Paint()
else
::DrawLine( .t. )
endif
endif
else
if nI > 0
for n := ::aDisplay[ ::nColSel ] - 1 to nI step -1
::GoLeft()
next n
else
::GoRightMost()
nI := len( ::aCols )
while ::aCols[ nI ]:nEditType < 1
if ( --nI ) == 0
exit
endif
enddo
nNextPos := ascan(::aDisplay,{|i| i = nI } )
if nNextPos > 0
if ::IsDisplayPosVisible( nNextPos, .t. )
::nColSel := nNextPos
::DrawLine( .t. )
else
for n := ::aDisplay[ ::nColSel ] - 1 to nI step -1
::GoLeft()
next n
endif
if ::nDataRows > 1
::GoUp()
endif
endif
endif
endif
CASE ::nMoveType == MOVE_LEFT
nNextPos := ::aDisplay[ ::nColSel ] - 1
if nNextPos > 0
::GoLeft()
else
::GoRightMost()
if ::nRowSel > 1
::GoUp()
endif
endif
CASE ::nMoveType == MOVE_DOWN
if ::lAutoAppend .and. ( ::nLen == 0 .or. ::eof() .or. ::KeyNo() == ::nLen )
if ::bPastEof == NIL .and. ::nDataRows = ::nRowSel
MsgStop( "::bPastEof not defined","Fivewin: Class TXBrowse" )
return NIL
else
::Select( 0 )
::GoDown()
::Select( 1 )
endif
else
::GoDown()
::refresh()
endif
CASE ::nMoveType == MOVE_UP
::GoUp()
::refresh()
ENDCASE
else
nOldMove := ::nMoveType
if ::nMoveType == MOVE_FAST_LEFT .or. ::nMoveType == MOVE_FAST_RIGHT
::nMoveType := MOVE_NONE
endif
DO CASE
CASE ::nMoveType == MOVE_RIGHT
::GoRight()
::refresh()
CASE ::nMoveType == MOVE_LEFT
::GoLeft()
::refresh()
CASE ::nMoveType == MOVE_DOWN
::GoDown()
::refresh()
CASE ::nMoveType == MOVE_UP
::GoUp()
::refresh()
ENDCASE
::nMoveType := nOldMove
endif
endif
endif
return nil
[/code:1666tfnp]
sample...
[code:1666tfnp]
#include "FiveWin.ch"
#include "xbrowse.ch"
function main()
local aArray1 := {}
local oWnd, ;
oMenu,;
oBrw
local nI
for nI = 1 to 20
aadd( aArray1, { "Row:"+StrZero(nI,2)+" Col:01",;
"Row:"+StrZero(nI,2)+" Col:02",;
"Row:"+StrZero(nI,2)+" Col:03",;
"Row:"+StrZero(nI,2)+" Col:04",;
"Row:"+StrZero(nI,2)+" Col:05",;
"Row:"+StrZero(nI,2)+" Col:06" } )
next
menu oMenu
menuitem "Movimientos"
menu
menuitem "MOVE_RIGHT" action oBrw:nMoveType := MOVE_RIGHT when oBrw:nMoveType != MOVE_RIGHT
menuitem "MOVE_LEFT" action oBrw:nMoveType := MOVE_LEFT when oBrw:nMoveType != MOVE_LEFT
menuitem "MOVE_UP" action oBrw:nMoveType := MOVE_UP when oBrw:nMoveType != MOVE_UP
menuitem "MOVE_DOWN" action oBrw:nMoveType := MOVE_DOWN when oBrw:nMoveType != MOVE_DOWN
menuitem "MOVE_NONE" action oBrw:nMoveType := MOVE_NONE when oBrw:nMoveType != MOVE_NONE
menuitem "MOVE_FAST_RIGHT" action oBrw:nMoveType := MOVE_FAST_RIGHT when oBrw:nMoveType != MOVE_FAST_RIGHT
menuitem "MOVE_FAST_LEFT" action oBrw:nMoveType := MOVE_FAST_LEFT when oBrw:nMoveType != MOVE_FAST_LEFT
endmenu
menuitem "FastEdit"
menu
menuitem "Activado" action oBrw:lFastEdit:=.t. when !oBrw:lFastEdit
menuitem "Desactivado" action oBrw:lFastEdit:=.f. when oBrw:lFastEdit
endmenu
endmenu
define window oWnd title "test" menu oMenu
oBrw:= txbrowse():new( oWnd )
oBrw:nRowHeight := 25
oBrw:nColDividerStyle := LINESTYLE_BLACK
oBrw:nRowDividerStyle := LINESTYLE_BLACK
oBrw:SetArray( aArray1 )
aeval( oBrw:aCols, {| o | o:nEditType := 1, o:bPopUp := { |o| ColMenu( o ) } } )
oBrw:CreateFromCode()
oWnd:oClient := oBrw
ACTIVATE window oWnd
return nil
static function ColMenu( ocol )
local oPop
MENU oPop POPUP 2007
MenuAddItem( "Edit", ,oCol:nEditType > 0, .t., ;
{ |oItem| oCol:nEditType := If( oCol:nEditType > 0, 0, 1 ), ;
oItem:SetCheck( oCol:nEditType > 0 ), ;
oCol:oBrw:SetFocus() } )
ENDMENU
return oPop
[/code:1666tfnp] |
xbrowse print/report method? | All,
Does anyone have a report or print method for xbrowse?
Thanks,
Randal |
xbrowse print/report method? | wich version you have? |
xbrowse print/report method? | Sorry there's not in new version , try it please
[code:29ehpuw2]
METHOD Print( lPreview, lModal, cTitle ) CLASS TXBrowse
local oPrn, oRep, oCol
local aCols
local xValue
local cAlias
local nFor, nLines, nLine, nBookMark
DEFAULT lPreview := .t.,;
lModal := .f.,;
cTitle := ::oWnd:cCaption
If Empty( cTitle )
cTitle := "No Title"
Endif
If lPreview
If lModal
PRINTER oPrn NAME cTitle PREVIEW MODAL
else
PRINTER oPrn NAME cTitle PREVIEW
Endif
else
PRINTER oPrn NAME cTitle
Endif
If oPrn:hDC == 0
return .f.
Endif
If !Empty( ::cAlias )
cAlias := DbSelectArea( ::cAlias )
Endif
REPORT oRep TITLE "*** " + cTitle + " ***", "" ;
HEADER DToC( Date() ) + "-" + Left(Time(), 5), "" RIGHT ;
FOOTER "#: " + Str( oRep:nPage, 3 ) CENTER;
TO DEVICE oPrn
aCols := ::GetVisibleCols()
for nFor := 1 to len( aCols )
If !aCols[nFor]:lHide
oCol := oRep:AddColumn( TrColumn():New( { FInfo1(aCols, nFor) } ,,;
{ FInfo2(aCols, nFor) },,,,,,,,,, oRep ) )
xValue := Eval(aCols[nFor]:bStrData)
nLines := MlCount(xValue, 250)
oCol:nPad := aCols[nFor]:nDataStrAlign + 1
If nLines > 1
oCol:aData := Array(nLines)
oCol:aPicture := Afill(Array(nLines), "")
For nLine := 1 to nLines
oCol:aData[nLine] := FInfo3(aCols, nFor, nLine)
Next
Endif
Endif
next
ENDREPORT
nBookMark := Eval( ::bBookMark )
If ::aArrayData != nil .and. len( ::aArrayData ) > 0
::nArrayAt := 1
oRep:bSkip := { || ::nArrayAt++ }
ACTIVATE REPORT oRep WHILE ::nArrayAt <= len( ::aArrayData ) ON END ::nArrayAt := 1
else
ACTIVATE REPORT oRep
Endif
Eval(::bBookMark, nBookMark )
If !Empty( cAlias )
DbSelectArea( cAlias )
Endif
return .t.
[/code:29ehpuw2] |
xbrowse print/report method? | Silvio,
I have the latest version 7.11. Thanks for the code, I'll give this a try.
Best Regards,
Randal |
xbrowse print/report method? | Randal
I wait your comment |
xbrowse print/report method? | Silvio,
I found finfo1 and finfo2 in the browse.prg. Where can I find finfo3 function?
Thanks,
Randal |
xbrowse problem | hello! xbrowse fwh0802 oBrw:Refresh() not work. After oBrw:Delete() if i use oBrw:Refresh() the record deleted still display in browse.
If i use oBrw:Delete(),oBrw:GoTop() and oBrw:Refresh() work great.
Thanks. |
xbrowse problem | Wanderson
Add this definition to your browser
oBrw:bBookMark := {| n | iif( n == nil,(MYALIAS)->(RecNo()), (MYALIAS)->(dbgoto(n)) ) }
When you delete add the folowing
IF OBRW # NIL
OBRW:skip(1)
OBRW:skip(0)
IF oBrw:eof()
OBRW:skip(-1)
OBRW:skip(0)
ENDIF
ENDIF
oBrw:refresh()
oBrw:SETFOCUS()
HTH
Richard! |
xbrowse problem | Hi All
This code work
oCol := oLbx:AddCol()
oCol:AddResource("GREEN")
oCol:AddResource("RED")
oCol:cHeader := "Started"
oCol:bBmpData := { || iif(oProject:prjstart, 1, 2) }
oCol:bStrData := { || iif( oProject:prjstart, "Yes", "No ")}
oCol:bEditValue := { || oProject:prjstart }
oCol:nDataStyle := oCol:DefStyle( AL_RIGHT, .T.)
oCol:nEditType := EDIT_LISTBOX
oCol:aEditListTxt := { "Yes", "No"}
oCol:aEditListBound := { TRUE, FALSE }
oCol:bOnPostEdit := {|o, v| oProject:prjstart := v ,oProject:save(),oLbx:Refresh() }
but this code does not
oCol := oLbx:AddCol()
oCol:cHeader := "Started"
oCol:SetCheck( { "GREEN", "RED" }, {|o, v| (oProject:prjstart := v) } )
oCol:bStrData := { || If( oProject:prjstart, "Yes", "No" ) }
oCol:nDataStrAlign := AL_RIGHT
//-------------------------------------------------------------------------------------//
Another odd thing is when I select the dropdown listbox (yes , no) as soon as I move the
mouse to make a selection the values in the cells above and below disappear but refresh when
I double click on either option.
Cheers
Colin |
xbrowse problem | This code works
[code=fw:2mqqazxe]<div class="fw" id="{CB}" style="font-family: monospace;"> <br />WITH OBJECT oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">'Header'</span><br /> :<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">{</span> || oDbf:<span style="color: #000000;">Married</span> <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">SetCheck</span><span style="color: #000000;">(</span> <span style="color: #000000;">{</span> <span style="color: #ff0000;">'RED'</span>, <span style="color: #ff0000;">'GREEN'</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> |o,v| oDbf:<span style="color: #000000;">Married</span> := v, oDbf:<span style="color: #000000;">Save</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span>, <span style="color: #000000;">{</span> <span style="color: #ff0000;">'Yes'</span>, <span style="color: #ff0000;">'No'</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> END<br /> </div>[/code:2mqqazxe] |
xbrowse problem | Mr G. N. Rao.
Thank you for your help.
Cheers
Colin |
xbrowse problem | [quote="Colin Haig":ucp42zu7]
Another odd thing is when I select the dropdown listbox (yes , no) as soon as I move the
mouse to make a selection the values in the cells above and below disappear but refresh when
I double click on either option.
Colin[/quote:ucp42zu7]
This is a problem since Kinetic scrolling was introduced in FWH908.
If we comment out the line
[code=fw:ucp42zu7]<div class="fw" id="{CB}" style="font-family: monospace;"> TrackMouseEvent<span style="color: #000000;">(</span> ::<span style="color: #000000;">hWnd</span>, TME_LEAVE <span style="color: #000000;">)</span></div>[/code:ucp42zu7]
in the METHOD MouseMove(), this problem is solved.
But this may have adverse effect on the Kinetic scrolling logic.
Mr. Antonio may please advise. The above problem can be seen in the \fwh\samples\mallorca.prg |
xbrowse problem | Rao,
We are going to review it asap, thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
xbrowse problem | This is a working fix ( though definitely not an elegant one), for versions from FWH908 onwards. This fix can be safely used till FiveWin provides the right fix.
[code=fw:1nl3r8ie]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> <span style="color: #0000ff;">Paint</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> TXBrowse<br /><br /> <span style="color: #00C800;">local</span> ...<br /> <span style="color: #00C800;">local</span> ,,,<br /> <span style="color: #00C800;">local</span> aInfo <span style="color: #B900B9;">//:= ::DispBegin() // Comment out ::DispBegin() here </span><br /> <span style="color: #00C800;">local</span> ...<br /> <span style="color: #00C800;">local</span> ...<br /><br /><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">SelectedCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #000000;">oEditLbx</span> != <span style="color: #00C800;">nil</span> <span style="color: #B900B9;">// inserted</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <span style="color: #B900B9;">// inserted</span><br /> <span style="color: #00C800;">endif</span> <span style="color: #B900B9;">// inserted</span><br /> aInfo := ::<span style="color: #000000;">DispBegin</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// inserted </span><br /><br /> <span style="color: #B900B9;">// Paint Background // original code</span><br /> aRect := ::<span style="color: #000000;">DataRect</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// original code</span><br /> </div>[/code:1nl3r8ie] |
xbrowse problem (Fixed) | Hello friends of the forum
I'm doing a consultation, I have a GET and GET validator that populates a temporary table, on which he works and xbrowse the problem.
Here is the error:
[quote:u0buzqzg]
Application
===========
Path and name: D:\Proyectos\Inventa\Inventa.exe (32 bits)
Size: 1,195,008 bytes
Time from start: 0 hours 0 mins 29 secs
Error occurred at: 09/01/2010, 11:48:49
Error description: Error DBCMD/2001 Area de trabajo no usada: DBSKIPPER
Args:
Stack Calls
===========
Called from: => DBSKIPPER(0)
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:SETRDD(3387)
Called from: .\source\classes\XBROWSE.PRG => (b)TXBROWSE:TXBROWSE(329)
Called from: => TXBROWSE:SKIP(0)
Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:LBUTTONDOWN(2932)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TXBROWSE:HANDLEEVENT(1453)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: prg\inv_mov.prg => CONSULTAMDS(1577)
Called from: prg\inv_mov.prg => VAL_ARTICULO(883)
Called from: prg\inv_mov.prg => (b)MOVI_AGREDIT(848)
Called from: .\source\classes\TGET.PRG => TGET:LVALID(1199)
Called from: .\source\classes\CONTROL.PRG => TGET:FWLOSTFOCUS(924)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1432)
Called from: .\source\classes\TGET.PRG => TGET:HANDLEEVENT(588)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => SYSREFRESH(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:KEYCHAR(731)
Called from: .\source\classes\TGET.PRG => TGET:KEYCHAR(1107)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1453)
Called from: .\source\classes\TGET.PRG => TGET:HANDLEEVENT(588)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => DIALOGBOX(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(273)
Called from: prg\inv_mov.prg => MOVI_AGREDIT(867)
Called from: prg\inv_mov.prg => (b)IN_MOVI(185)
Called from: .\source\classes\BUTTON.PRG => TBUTTON:CLICK(176)
Called from: .\source\classes\CONTROL.PRG => TBUTTON:HANDLEEVENT(1411)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => SENDMESSAGE(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:COMMAND(407)
Called from: => TWINDOW:HANDLEEVENT(0)
Called from: .\source\classes\DIALOG.PRG => TDIALOG:HANDLEEVENT(928)
Called from: .\source\classes\WINDOW.PRG => _FWH(3333)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE(952)
Called from: prg\Inventa.prg => MAIN(214)
[/quote:u0buzqzg]
The code I'm using:
[code=fw:u0buzqzg]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oWnd <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"DLG_BS_MULT"</span><br /><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> scCad_Busca <span style="color: #0000ff;">ID</span> <span style="color: #000000;">650</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">UPDATE</span> ;<br /> <span style="color: #0000ff;">VALID</span> Val_Cod_Cons<span style="color: #000000;">(</span> oLbx_Busca, cGrupo <span style="color: #000000;">)</span> && fills the contents <span style="color: #0000ff;">of</span> the table<br /><br /> WITH OBJECT <span style="color: #000000;">(</span> oLbx_Busca := TXBrowse<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">(</span> oWnd <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">CreateFromResource</span><span style="color: #000000;">(</span> <span style="color: #000000;">651</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">cAlias</span> := <span style="color: #ff0000;">"BSECUEN"</span><br /> :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_FORECOLOR<br /> :<span style="color: #000000;">lColDividerComplete</span> := .T.<br /> :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /> :<span style="color: #000000;">lAllowRowSizing</span> := .F.<br /> :<span style="color: #000000;">lRecordSelector</span> := .F.<br /> :<span style="color: #000000;">lAllowColHiding</span> := .F.<br /> :<span style="color: #000000;">lAllowRowSizing</span> := .F.<br /> :<span style="color: #000000;">lHScroll</span> := .F.<br /><br /> WITH OBJECT <span style="color: #000000;">(</span> oCol := :<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Detalle"</span><br /> :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">{</span>|| BSECUEN->ARTI_DESCR <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">250</span><br /><br /> :<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br /> END<br /><br /> WITH OBJECT <span style="color: #000000;">(</span> oCol := :<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"Codigo"</span><br /> :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">{</span>|| BSECUEN->ARTI_CODIG <span style="color: #000000;">}</span><br /> :<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">134</span><br /> <br /> :<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br /> END<br /> <br /> END<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oWnd <span style="color: #0000ff;">CENTERED</span><br /> </div>[/code:u0buzqzg] |
xbrowse problem (Fixed) | The error indicates that either the alias is invalid or the database is not open.
James |
xbrowse problem (Fixed) | James, Thanks for your time.
In effect, this is the error reported.
The problem is that if I close the table and it does when you start the process, it does when you move to another item in the dialogue, and return to xbrowse clicking, more than once.
created a temporary table to be filled with the data to see.
[code=fw:29qgg9b5]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">IF</span> !FILE<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TEMP<span style="color: #000000;">\I</span>N_SEC.DBF"</span> <span style="color: #000000;">)</span><br /> DBCREATE<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TEMP<span style="color: #000000;">\I</span>N_BS_SEC"</span>, aStruc, <span style="color: #ff0000;">"DBFCDX"</span>, .t., <span style="color: #ff0000;">"BSECUEN"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ELSE</span><br /> BSECUEN-><span style="color: #000000;">(</span>__DBZap<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">ENDIF</span><br /> </div>[/code:29qgg9b5] |
xbrowse problem (Fixed) | I'm not sure what you are trying to do.
Are you creating a browse with a dbf, then creating a temp dbf from the open dbf, then closing the original dbf and opening the temp dbf using the same alias and the same browse?
If so, the browse is going to error out when the original dbf is closed.
Can you use scopes instead of a temp dbf?
Or, you might try disabling the browse before you close the original dbf, then closing the dbf and opening the new temp dbf, then enabling the browse. This might prevent the error.
If you are trying to do something else, then please explain.
Regards,
James |
xbrowse problem (Fixed) | I'm working with a MySQL database, the query request, and she filled the temporary table.
And the solution you found, is to leave open the temporary table as the program is open.
This function is called from dialogue in which you request a product code. Maybe it just convenional, but until you master the datasets using these patches
Regards, James |
xbrowse puede soportar que en una CELDA tenga varias C y F? | Hola.
xbrowse puede soportar q una CELDA posea varias columnas y filas?
<!-- m --><a class="postlink" href="http://1drv.ms/1ygXJAK">http://1drv.ms/1ygXJAK</a><!-- m -->
gracias. |
xbrowse puede soportar que en una CELDA tenga varias C y F? | Not now.
I am considering adding this facility |
xbrowse puede soportar que en una CELDA tenga varias C y F? | [quote="nageswaragunupudi":narr45kf]Not now.
I am considering adding this facility[/quote:narr45kf]
Gracias! |
xbrowse question | Hello
I start using xbrowse and i see a little problem:
<!-- m --><a class="postlink" href="http://img143.imageshack.us/my.php?image=xbrwmv3.jpg">http://img143.imageshack.us/my.php?image=xbrwmv3.jpg</a><!-- m -->
Is it normal?
Fwh 8.01
Thanks.
Wanderson |
xbrowse question | Hello Wanderson
I add this in xBrowse.prg
// nAdjColumn is the colums to expand
[color=green:3ipgbalg]DATA nAdjColumn AS NUMERIC [/color:3ipgbalg]
METHOD Adjust() CLASS TXBrowse
local nFor, nLen, nHeight, nStyle
[color=green:3ipgbalg] Local nTot := 0
LOcal nMaxWidth := ::nWidth() - 5[/color:3ipgbalg]
nLen := len( ::aCols )
nHeight := 0
::GetDC()
for nFor := 1 to nLen
::aCols[ nFor ]:Adjust()
[color=green:3ipgbalg] IIF( ::nAdjColumn > 0 , nTot += ::aCols[ nFor ]:nWidth ,)[/color:3ipgbalg]
next
[color=green:3ipgbalg]IIF( ::nAdjColumn > 0 , ::aCols[::nAdjColumn ]:nWidth += nMaxWidth - nTot,)[/color:3ipgbalg]
::ReleaseDC() |
xbrowse question | [quote="Maurizio":2eregjsx]Hello Wanderson
I add this in xBrowse.prg
// nAdjColumn is the colums to expand
[color=green:2eregjsx]DATA nAdjColumn AS NUMERIC [/color:2eregjsx]
METHOD Adjust() CLASS TXBrowse
local nFor, nLen, nHeight, nStyle
[color=green:2eregjsx] Local nTot := 0
LOcal nMaxWidth := ::nWidth() - 5[/color:2eregjsx]
nLen := len( ::aCols )
nHeight := 0
::GetDC()
for nFor := 1 to nLen
::aCols[ nFor ]:Adjust()
[color=green:2eregjsx] IIF( ::nAdjColumn > 0 , nTot += ::aCols[ nFor ]:nWidth ,)[/color:2eregjsx]
next
[color=green:2eregjsx]IIF( ::nAdjColumn > 0 , ::aCols[::nAdjColumn ]:nWidth += nMaxWidth - nTot,)[/color:2eregjsx]
::ReleaseDC()[/quote:2eregjsx]
Thank you Maurizio, is mutch better now but persist a little problem with a focused record
<!-- m --><a class="postlink" href="http://img156.imageshack.us/my.php?image=xbrweu3.jpg">http://img156.imageshack.us/my.php?image=xbrweu3.jpg</a><!-- m --> |
xbrowse question? | Dear All,
I try to create small program to see the index expression. It has 3 columns in array but it shows 4 columns in the xbrowse as picture.
[url=https://ibb.co/dD35hk:28xxq9ns][img:28xxq9ns]https://preview.ibb.co/mgawoQ/Index.png[/img:28xxq9ns][/url:28xxq9ns]
What is the matter?
[code=fw:28xxq9ns]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><br /><span style="color: #00C800;">Function</span> main<span style="color: #000000;">(</span> cTable <span style="color: #000000;">)</span><br /><span style="color: #00C800;">local</span> lStart, aIndexKey, aIndex <br /><span style="color: #00C800;">local</span> oDlg, oBrw, oBtn, oSay, oFont<br /><span style="color: #00C800;">local</span> cPath, aDBF, n, x<br /><br /><span style="color: #00C800;">Default</span> cTable := <span style="color: #ff0000;">''</span><br /><br />REQUEST DBFCDX, DBFFPT<br /><br />cTable += iif<span style="color: #000000;">(</span>upper<span style="color: #000000;">(</span><span style="color: #0000ff;">right</span><span style="color: #000000;">(</span>cTable,<span style="color: #000000;">4</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span>=<span style="color: #ff0000;">'.DBF'</span>,<span style="color: #ff0000;">''</span>,<span style="color: #ff0000;">'*.DBF'</span><span style="color: #000000;">)</span><br /><br />cPath := curdrive<span style="color: #000000;">(</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">':<span style="color: #000000;">\'</span>+curdir()+'</span>\<span style="color: #ff0000;">'<br />aDBF := Directory(cPath+cTable)<br /><br />if !empty(aDBF)<br /> lStart := .T.<br />else <br /> MsgWait('</span>Table : <span style="color: #ff0000;">'+cTable+'</span> does not exist<span style="color: #ff0000;">',,1)<br /> lStart := .F.<br />end<br /><br />if lStart<br /> aIndexKey := {}<br /> for n := 1 to len(aDBF)<br /> cTable := left(aDBF[n][1],len(aDBF[n][1])-4)<br /> if file(cPath+cTable+'</span>.CDX<span style="color: #ff0000;">')<br /> DbUseArea( .T., '</span>DBFCDX<span style="color: #ff0000;">', cTable, '</span>TMP<span style="color: #ff0000;">', .T., .T. )<br /> DbSetIndex( cTable )<br /> aIndex := IndexInfo(cTable)<br /> TMP->(DbCloseArea())<br /> for x := 1 to len(aIndex)<br /> aadd( aIndexKey, { aIndex[x][1], aIndex[x][2], aIndex[x][3] } )<br /> next <br /> end<br /> next<br /><br />DEFINE FONT oFont NAME '</span>Tahoma<span style="color: #ff0000;">' SIZE 0, -14 <br /><br />DEFINE DIALOG oDlg FROM 0, 0 TO 500, 900 TITLE '</span><span style="color: #0000ff;">Index</span> Table<span style="color: #ff0000;">' PIXEL FONT oFont<br /> oDlg:lHelpIcon := .F.<br /><br /> @ 2, 2 XBROWSE oBrw ARRAY aIndexKey ;<br /> COLUMNS 1, 2, 3 ;<br /> HEADERS '</span>Table<span style="color: #ff0000;">', '</span>Tag<span style="color: #ff0000;">', '</span>Expression<span style="color: #ff0000;">' ;<br /> COLSIZES 100, 100, 543 ;<br /> SIZE 447, 247 ;<br /> PIXEL ;<br /> oDlg <br /> <br /> oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW<br /> oBrw:nRowDividerStyle := LINESTYLE_LIGHTGRAY<br /> oBrw:nColDividerStyle := LINESTYLE_LIGHTGRAY<br /> oBrw:nHeaderHeight := 26<br /> oBrw:nRowHeight := 24<br /> oBrw:lHScroll := .F.<br /> oBrw:lVScroll := .T.<br /> oBrw:nStretchCol := STRETCHCOL_LAST<br /> oBrw:lAllowRowSizing := .F.<br /><br /> oBrw:CreateFromCode() <br /> <br /> oDlg:oClient := oBrw <br /><br />ACTIVATE DIALOG oDlg CENTER<br /><br />oFont:End()<br />end<br />return nil<br /><br />*---------------------------*<br />Function IndexInfo(cTable)<br />local aOrders := {}<br />local j, n<br /><br />n := OrdCount()<br />FOR j:=1 TO n<br /> aadd( aOrders, { iif(j=1,cTable,'</span><span style="color: #ff0000;">'), OrdName(j) , UPPER(OrdKey(j)) } )<br />NEXT</span></div>[/code:28xxq9ns]
Thank you in advance for any help and suggestion. |
xbrowse question? | In the definition of xbrowse please see this part of the code:
[code=fw:3skzanoh]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">PIXEL</span> ;<br /> oDlg <br /> </div>[/code:3skzanoh]
Please change it as
[code=fw:3skzanoh]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">PIXEL</span> ;<br /> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #B900B9;">// add OF before oDlg</span><br /> </div>[/code:3skzanoh] |
xbrowse question? | Dear Mr.Rao,
Thank you so much and apologize for stupid question.
Regards,
Dutch |
xbrowse questions | Hi All
I am just starting to use xbrowse and have some questions -
I am using cell editing - when I hit enter on a cell that has data it turns blue over the data and
I have to use the left arrow key to set the cursor back to first position - I would like to hit enter and be at
the first letter of the data ready to edit.
I am using a function in the bOnPostEdit to check if the data entered is not duplicated , if it is duplicated - I make the
cell empty - I would like to stay in the cell so the user can re enter some more data but it always goes to the next
column - I have tried oLbx:SelectCol(1) - in Hernans twbrowse I used oLbx:GoToCol(1)
Thanks
Colin |
xbrowse questions | Hi All
Have resolved both questions.
Cheers
Colin |
xbrowse questions | Hello Colin,
I'm working on a new Update of the xBrowse-Tools Release 5.0a
Many new Function are added like Support of the new Gradient-Background and Multiline-Headers.
I think it will be very helpful for You, starting with xBrowse and Design the different Parts
of a Browser like Background, Header, Footer ....
I hope, it will be finished for Download end of the week.
Select Header-Size and Colors
[img:1zstjczc]http://www.pflegeplus.com/pictures/XBR1.jpg[/img:1zstjczc]
Select Header-Style ( You can select 1 of 4 predefined Styles )
You can define the Text and the Column-Size for the Preview.
[img:1zstjczc]http://www.pflegeplus.com/pictures/XBR2.jpg[/img:1zstjczc]
Preview
[img:1zstjczc]http://www.pflegeplus.com/pictures/XBR3.jpg[/img:1zstjczc]
New Folder-Page : Gradient-Background
[img:1zstjczc]http://www.pflegeplus.com/pictures/XBR4.jpg[/img:1zstjczc]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.