FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour TBarTabs TamaƱo de los tabs
Posts: 182
Joined: Wed Nov 08, 2006 11:44 PM
TBarTabs TamaƱo de los tabs
Posted: Mon Sep 19, 2016 04:06 PM

Hola ,estoy usando TbarTabs y necesito agrandar los tabuladores.
Alguien sabe como hacerlo?. Intente pasar argumentos ( ancho y Alto ) a la Ttabs que llama la clase pero no funciona
Muchas gracias

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TBarTabs TamaƱo de los tabs
Posted: Tue Sep 20, 2016 10:58 AM

Prueba a modificar:

oTabs:aSizes[ nTab ] := nNuevoAncho
...
oTabs:Refresh()

tendrƔs que hacerlo para cada una de los tabs

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 182
Joined: Wed Nov 08, 2006 11:44 PM
Re: TBarTabs TamaƱo de los tabs
Posted: Tue Sep 20, 2016 02:54 PM
hola Antonio ,gracias por responder

Estuve probando y lo que me dices anda bien para modificar el ANCHO de los tabuladores pero no el ALTO que es lo que necesito porque el height que trae por defectos es de 14 pixels y no se ven muy bien en pantallas complejas.
Intente pasar el parƔmetro desde la clase TbarTab pero no lo toma.
Investigando la clase Ttab encuentro que hay un define BARHEIGHT que lo fija en 17 pixels y no hay forma de modificarlo desde afuera.
Lo que hice fue introducir una pequeƱa modificacion en la Tbar que es esta:

#define BARHEIGHT 30 // estaba originalmente en 17

EN EL METODO PAINTTAB()

// esto modifica la ubicacion vertical del texto del tab
do case
case ::nOrientation <= OR_BOTTOM

DrawTextEx( ::hDC, cPrompt ,;
{ If( LargeFonts(), 1, 8 + If( ::nOrientation == OR_TOP, 1,0 ) ),;
nStart + 15 + nBmpWidth, ;
::nHeight, nStart + 20 + nWidth - 15 },;
nOr( DT_LEFT, DT_VCENTER ) )


/* codigo original
DrawTextEx( ::hDC, cPrompt ,;
{ If( LargeFonts(), 1, 1 + If( ::nOrientation == OR_TOP, 1,0 ) ),;
nStart + 15 + nBmpWidth, ;
::nHeight, nStart + 20 + nWidth - 15 },;
nOr( DT_LEFT, DT_VCENTER ) )
*/

// esto modifica la ubicacion vertical del BMP

if ::nOrientation <= OR_BOTTOM
TransBmp( hBmp, nBmpWidth( hBmp ), nBmpHeight( hBmp ), /* RGB( 255, 0, 255 ) */ nZeroZeroClr, ::hDC,;
nStart + 12, If( ::nOrientation == OR_TOP, 8, 0 ), 16, 16 )

/* codigo original
TransBmp( hBmp, nBmpWidth( hBmp ), nBmpHeight( hBmp ), /* RGB( 255, 0, 255 )
nStart + 12, If( ::nOrientation == OR_TOP, 1, 0 ), 16, 16 )
*/

SerĆ­a interesante poder modificar el BARHEIGHT de la clase con un parametro para poder hacer el cambio sin tocar la clase.
el oTab:aSizes solo guarda el ancho del tab pero no el alto
muchas gracias
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: TBarTabs TamaƱo de los tabs
Posted: Tue Sep 20, 2016 07:42 PM

la Clase Ttabs usa bitmaps para pintar los tabs, luego para que se vean bien en otros tamaƱos tendrias que proporcionar
tus propias funciones que devuelvan los bitmaps a usar.

Tienes que proporcionar estas funciones:

  hBmpSel    = bmp_TabSel()
  hBmpSelL   = bmp_TabSelL()
  hBmpSelR   = bmp_TabSelR()
  hBmpUnSel  = bmp_TabUnSel()
  hBmpUnSL   = bmp_TabUnSL()
  hBmpUnSR   = bmp_TabUnSR()

  hBmpSelV   = bmp_TabSelV()
  hBmpSelLV  = bmp_TabSelLV()
  hBmpSelRV  = bmp_TabSelRV()
  hBmpUnSelV = bmp_TabUnSelV()
  hBmpUnSLV  = bmp_TabUnSLV()
  hBmpUnSRV  = bmp_TabUnSRV()
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion