Alguém que usa Hwgui do SVN, tem um exemplo de uso do campo lógico no browse ?
Eu tenho aqui, mas só vai no windows, usando BrowseEx, porém o BrowseEx só funciona no windows, tá engessado no windows e estou fazendo uns testes compilando meu sistema 100% no Linux.
O Alexander até me explicou, mas eu não entendi muito bem, tentei fazer aqui e deu erro.
Código: Selecionar todos
Hello,
there are, at least, two ways to do this.
The first one - using the HColumn():aBitmaps array of pairs { bCondition, oBmp } - if a result of bCondition is .t., the appropriate bitmap is drawn. See the example in samples/a.prg, Openabout() function.
The second - using of HPaintCB class, see the tutorial, "Advanced using of controls"/Browse:
oBrw:aColumns[1]:oPaintCB := HPaintCB():New()
oBrw:aColumns[1]:oPaintCB:Set( PAINT_LINE_ALL, bCol1 )
In that sample the bCol1 codeblock draws a gradient background only, but you can draw there all what you need, including the bitmap.
Código: Selecionar todos
Both options are intended to display the checkbox. To change it you may use few other ways. One of them, via the oBrw:bKeyDown, is in a.prg. If you want to change the field by mouse doubleclick or enter, you need to use the bEnter block, something like this:
Local bEnter := {|o,nc|
IF nc == 1 // nc is a column number
o:aArray[ o:nCurrent,1 ] := !o:aArray[ o:nCurrent,1 ]
// Or, for a dbf browse:
// ( o:alias ) -> (rlock()) // if in shared mode
// ( o:alias ) -> SomeField := !( o:alias ) -> SomeField
// ( o:alias ) -> (dbUnlock())
o:RefreshLine()
ENDIF
RETURN .T.
}
...
oBrw:bEnter := bEnter
What about displaying checkbox, using the HPaintCB, see the tutorial, "Advanced using of controls", "Browse of bitmaps", bCol2 codeblock. To change it, you may use the same trick with bEnter.
Itamar M. Lins Jr.

