TBarTabs Tamaño de los tabs

Post Reply
User avatar
rterraz
Posts: 182
Joined: Wed Nov 08, 2006 11:44 pm
Location: Argentina

TBarTabs Tamaño de los tabs

Post by rterraz »

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
User avatar
Antonio Linares
Site Admin
Posts: 42513
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: TBarTabs Tamaño de los tabs

Post by Antonio Linares »

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
User avatar
rterraz
Posts: 182
Joined: Wed Nov 08, 2006 11:44 pm
Location: Argentina

Re: TBarTabs Tamaño de los tabs

Post by rterraz »

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
User avatar
Antonio Linares
Site Admin
Posts: 42513
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 73 times
Contact:

Re: TBarTabs Tamaño de los tabs

Post by Antonio Linares »

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
Post Reply