Nuevo Grupo en Ribbonbar (Solucionado)

Nuevo Grupo en Ribbonbar (Solucionado)

Postby cnavarro » Sun May 05, 2013 7:44 pm

Buenas tardes

He intentado sin éxito realizar dos grupos en un TRibbonBar del ancho total del TRibbonBar uno debajo de otro

1.- Si defino los TRBGroup() mediante comando con fila, columna y su correspondiente ancho y alto, al definir el segundo, simplemente, copiando el código anterior y modificando solo su fila para que aparezca debajo del anterior me da un error en la clase, que adjunto:

Code: Select all  Expand view

   Time from start: 0 hours 0 mins 2 secs
   Error occurred at: 05/05/2013, 21:04:24
   Error description: Error BASE/1004  Message not found: NIL:NGROUPSEPARATION
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => __ERRRT_SBASE( 0 )
   Called from: ../../../tobject.prg => NIL:ERROR( 0 )
   Called from: ../../../tobject.prg => (b)HBOBJECT( 0 )
   Called from: ../../../tobject.prg => NIL:MSGNOTFOUND( 0 )
   Called from: ../../../tobject.prg => NIL:NGROUPSEPARATION( 0 )
   Called from: .\source\classes\TRBGROUP.PRG => TRBGROUP:CALPOS( 862 )
   Called from: .\source\classes\TRBGROUP.PRG => TRBGROUP:PAINT( 537 )
   Called from: .\source\classes\TRBGROUP.PRG => (b)TRBGROUP( 97 )
   Called from: .\source\classes\TRBGROUP.PRG => TRBGROUP:DISPLAY( 0 )
   Called from: .\source\classes\TRIBBON.PRG => (b)TRIBBONBAR_RESIZE( 1288 )
   Called from:  => AEVAL( 0 )
   Called from: .\source\classes\TRIBBON.PRG => TRIBBONBAR:RESIZE( 1288 )
   Called from: .\source\classes\TRIBBON.PRG => TRIBBONBAR:SETOPTION( 1146 )
   Called from: .\source\classes\TRIBBON.PRG => TRIBBONBAR:LBUTTONDOWN( 1029 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1687 )
   Called from: .\source\classes\TRIBBON.PRG => TRIBBONBAR:HANDLEEVENT( 1182 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3159 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 980 )
   Called from: Prueba.prg => MAIN( 309 )
 


2.- Si los defino mediante el Metodo ADDGroup de la clase TRibbonBar, no me respeta el ancho de los grupos que defino y me los realiza poniendo el ancho por defecto, muy pequeños y uno al lado del otro. He intentado mediante SetSize modificar sus dimensiones sin resultado.

3.- Por otra parte he intentado hacerlo creando el primero mediante comando y el segundo mediante ADDGroup() y, en este caso, el primero me lo pinta sin respetar el ancho definido en el comando, muy pequeño, igual que el anterior caso, y el segundo debajo y a su derecha con un ancho que no es el que se define en el ADDGroup y con un alto que calcula pero sin llegar a ocupar todo el TRibbonBar.

He de decir que si solo defino un Group mediante comando me lo pinta correctamente ocupando todo el ancho del TRibbon

Que estoy haciendo mal?

Gracias anticipadas
FWH 12.03 + Harbour + BCC 5.82
Last edited by cnavarro on Thu May 09, 2013 5:59 pm, edited 1 time in total.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Nuevo Grupo en Ribbonbar

Postby Antonio Linares » Mon May 06, 2013 9:06 am

Cristobal,

La RibbonBar de FWH está diseñada para usar grupos uno a la derecha del otro, no debajo :-(
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41440
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Nuevo Grupo en Ribbonbar

Postby cnavarro » Mon May 06, 2013 2:41 pm

Gracias por la aclaracion Antonio
Sigo probando los controles que no habia usado aun.
Un saludo
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Nuevo Grupo en Ribbonbar

Postby cnavarro » Thu May 09, 2013 6:39 am

Antonio, buenos dias
Al margen de la colocacion de los grupos:
Mirando la clase he visto que el error se produce porque la DATA nSeparation no está definida (aparece comentada al comienzo de la definicion de la CLASE)
Sin embargo, luego aparece en el METHOD CalcPos (linea 976 en mi version FWH 12.03)

METHOD CalcPos() CLASS TRibbonBar

local n, j

::ASizes := {}
AFill( ::aLeft, 0 )

for n = 1 to Len( ::aDialogs )
AAdd( ::aSizes, If( ::aVisible[ n ], GetTextWidth( 0, StrTran( ::aPrompts[ n ], "&", "" ), ::oFont:hFont ) + TXTLPAD + TXTRPAD, 0) )
next

if Len( ::aLeft ) > 0
::aLeft[ ::nOffSet ] = ::nLeftMargin
endif

for n = ::nOffSet + 1 to Len( ::ASizes )
::aLeft[ n ] = ::aLeft[ n - 1 ] + ::aSizes[ n - 1 ] + If( ::aVisible[n - 1 ], ::nSeparation, 0 )
next

return nil

Y tendría que ser ::hSeparation o ::nSeparation() (es lo mismo) o ::nGroupSeparation, tengo dudas, cuál sería?
Aprovecho para consultarte cómo puedo cambiar el color del texto de las pestañas de los aPrompts ?
Gracias anticipadas y un saludo
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Nuevo Grupo en Ribbonbar

Postby cnavarro » Thu May 09, 2013 7:02 am

El color del texto ya está casi solucionado
oBar:aClrTabTxt[ nPos ] = { || RGB( 100, 100, 100 ) }

Por cierto, donde está documentado estos indicadores < > o hay algun otro ejemplo?

Code: Select all  Expand view

  bPaintTxt  :=   <     | oSelf |
                    local hOldFont, nClrTxt, nOldClr, nMode
                    hOldFont  = SelectObject( hDCMem, oSelf:oFont:hFont  )
                    if ValType( oSelf:aClrTabTxt[ nPrompt ] ) == "N"
                       nClrTxt = oSelf:aClrTabTxt[ nPrompt ]
                    elseif ValType( oSelf:aClrTabTxt[ nPrompt ] ) == "B"
                       nClrTxt = Eval( oSelf:aClrTabTxt[ nPrompt ], oSelf )
                    else
                       nClrTxt = CLRTEXT
                    endif
                    if nPrompt == oSelf:nStart
                       nClrTxt = CLR_WHITE
                    endif                      
                    nOldClr   = SetTextColor( hDCMem, if( oSelf:aEnable[ nPrompt ], nClrTxt, GetSysColor( COLOR_GRAYTEXT ) ) )
                    nMode     = SetBkMode( hDCMem, TRANSPARENT )
                   
                    DrawText( hDCMem, oSelf:aPrompts[ nPrompt ], { nRow+2, nCol, nRow + oSelf:nHeightFld+1, nCol + oSelf:aSizes[ nPrompt ] }, ;
                                       nOr( DT_SINGLELINE, DT_VCENTER, DT_CENTER, DT_NOPREFIX ) )
                    SetBkMode(hDCMem, nMode )
                   
                    SetTextColor( hDCMem, nOldClr )
                    SelectObject( hDCMem, hOldFont  )
                    return nil
                    >
   
   Eval( bPaintTxt, Self )

 


Gracias
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Nuevo Grupo en Ribbonbar

Postby Antonio Linares » Thu May 09, 2013 9:12 am

Cristobal,

Son codeblocks programados como si fuesen una función de múltiples lineas.

Harbour usa permite usar la típica notacion { || ... } mientras que en xHarbour usan < || ... >. Personalmente prefiero usar la sintaxis de Harbour pues me parece más coherente. En xhb.ch de Harbour se simula el reconocimiento de < y > para Harbour en estos codeblocks multilíneas.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41440
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Nuevo Grupo en Ribbonbar

Postby cnavarro » Thu May 09, 2013 9:49 am

Gracias Antonio
Lo habia entendido, pero lo que llamo la atencion fue la posibilidad de definir variables locales, etc, y queria investigar sobre el tema.

En cuanto a mi post anterior sobre el METHOD CalcPos, puedes decirme algo?
Gracias por todo
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6504
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Nuevo Grupo en Ribbonbar

Postby Antonio Linares » Thu May 09, 2013 2:10 pm

Cristobal,

Aunque la DATA nSeparation está comentada, está implementada más abajo como método SETGET:

Code: Select all  Expand view
METHOD nSeparation( nValue ) CLASS TRibbonBar

   if nValue != NIL
      ::hSeparation := nValue
      ::Default()
      ::Refresh()
   endif

return ::hSeparation
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41440
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 44 guests