FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Trocar o header de xbrowse
Posts: 344
Joined: Tue Oct 11, 2005 11:33 AM
Trocar o header de xbrowse
Posted: Fri Feb 13, 2009 02:20 PM
Olá,

É possível trocar o nome de uma coluna (cHeader) em tempo de execução do xbrowse ?

define dialog ...

oBrw := TXBrowse():New( odlg )

oBrw:bChange  := { ||  MUDA_HEADER( oBrw ) }

oBrw:aCol[1]:cHeader := "Teste"

oBrw:createFromCode()

activate dialog odlg

return NIL

function MUDA_HEADER( oBrw )

oBrw:aCol[1]:cHeader := "Novo titulo"

&& oBrw:refresh()  <<-- Preciso dar um refresh somente no "Header" que foi mudado

return NIL
Obrigado, Regards, Saludos



Rossine.



Harbour and Harbour++
Posts: 344
Joined: Tue Oct 11, 2005 11:33 AM
Re: Trocar o header de xbrowse
Posted: Sun Feb 15, 2009 03:07 PM
Olá Antonio,

Eu resolvi este problema, criando novos métodos para xbrowse :-) Seria interessante que xbrowse tivesse isto:

Abaixo explicos minhas implementações:

em CLASS TXBrowse acrescente:

Code (fw): Select all Collapse
<ol><li style="" class="li1"> </li><li style="" class="li2">METHOD HeaderRow()    INLINE ::BrwHeight() - ::HeaderHeight() + 1    </li><li style="" class="li1">METHOD RefreshHeaders()    INLINE If( Empty( ::nHeaderHeight ),,AEval( ::aCols, { | oCol | oCol:RefreshHeader() } ) )</li><li style="" class="li2"> </li></ol>


em CLASS TXBrwColumn acrescente:

Code (fw): Select all Collapse
<ol><li style="" class="li1"> </li><li style="" class="li2">METHOD RefreshHeader()</li><li style="" class="li1"> </li><li style="" class="li2">//----------------------------------------------------------------------------// </li><li style="" class="li1"> </li><li style="" class="li2">METHOD RefreshHeader() CLASS TXBrwColumn</li><li style="" class="li1"> </li><li style="" class="li2">if ! Empty( ::oBrw:nHeaderHeight ) .and. ::IsVisible()</li><li style="" class="li1">      ::PaintHeader(2,nil,::oBrw:HeaderHeight-4)</li><li style="" class="li2">endif</li><li style="" class="li1"> </li><li style="" class="li2">return nil</li><li style="" class="li1"> </li><li style="" class="li2"> //----------------------------------------------------------------------------//</li><li style="" class="li1"> </li></ol>


Com isto posso atualizar somente os Headers :-)
Obrigado, Regards, Saludos



Rossine.



Harbour and Harbour++

Continue the discussion