Aquí dejo el código para que me puedan echar una mano para resolver-lo.
También, añado otra pregunta, el parámetro lAllWidth de la classe FOLDER funciona ? por defecto esta en .T. y las pestañas de los tabs son del tamaño del texto.
#include "FiveWin.ch"
#include "InKey.ch"
#include "xbrowse.ch"
#include "ribbon.ch"
#include "SQLRDD.CH"
#include "mysql.ch" // Needed if you plan to use native connection to MySQL
#include "pgs.ch" // Needed if you plan to use native connection to Postgres
REQUEST DBFCDX
STATIC cState := ""
Function Main()
Local oWnd, oRBar,oBtn,oGBtn:={}
Local aGrups[3],nHSqlRdd
Local cServer:= "XXXXX"
Local cDatabase:="XXXXX"
Local cUser:="XXXX"
Local cPassword:= "XXXX"
// Iniciar llibreries
IniciarRdd( )
// Treballem amb Sql
SR_SetGoTopOnScope(.f.)
SR_USEDELETEDS(.T.)
// Cadena de Connecci¢ amb la base de dades.
cConnString:= "driver=SQL Server;network=dbmssocn;"
cConnString+= "server="+cServer+";"
cConnString+= "database="+cDatabase+";"
cConnstring+= "uid="+cUser+";"
cConnString+= "pwd="+cPassword+";"
nHSqlRdd:= SR_AddConnection( CONNECT_ODBC , cConnString, , , , .T. )
If nHSqlRdd > 0
RddSetDefault("SQLRDD")
DBUSEAREA(.T.,"SQLRDD","CLIE0110")
DbSetOrder(1)
DbGotop()
DEFINE WINDOW oWnd TITLE "New TXBrowse class (only for FWH)" MDI MENUINFO 3
oWnd:oMenu:End()
// Creaci¢ Objecte Ribbon,
oRBar:= TRibbonBar():New( oWnd , {"tab1","tab2","tab3"} , , , , 132 , 25 )
// Bot¢ inici amb el Menu Complert.
@ 4,4 RBBTN oBtn PROMPT "INICI" OF oRBar SIZE 50,20 POPUP MENU BuildMenu( oWnd )
oBtn:lBalloon:= .T.
oBtn:ResetBorder()
ADD GROUP aGrups[1] RIBBON oRBar TO OPTION 1 PROMPT "GRUP1"
Aadd(oGBtn,NIL)
oGBtn[-1]:= aGrups[1]:AddButton( 5 , 5 , 50 , 70 , "Incremental" ,{|| Incremental( oWnd ) } ,,,,,,,)
ADD GROUP aGrups[2] RIBBON oRBar TO OPTION 2 PROMPT "GRUP2"
Aadd(oGBtn,NIL)
oGBtn[-1]:= aGrups[2]:AddButton( 5 , 5 , 50 , 70 , "yyyy" ,{|| MsgInfo("2")} ,,,,,,,)
ADD GROUP aGrups[3] RIBBON oRBar TO OPTION 3 PROMPT "GRUP3"
Aadd(oGBtn,NIL)
oGBtn[-1]:= aGrups[3]:AddButton( 5 , 5 , 50 , 70 , "ZZZZ" ,{|| MsgInfo("3")} ,,,,,,,)
ACTIVATE WINDOW oWnd
EndIf
Return Nil
function BuildMenu( oWnd )
local oMenu
MENU oMenu POPUP 2007
MENUITEM "Browse RDD data"
MENU
MENUITEM "Incremental Seek and Inset style" ;
ACTION Incremental( oWnd )
ENDMENU
ENDMENU
Return oMenu
STATIC FUNCTION Incremental( oWnd )
local oChild, oBrw,oFld,oRect, oCol
DEFINE WINDOW oChild TITLE "Proves amb SQLRDD" MDICHILD OF oWnd
oRect:= oChild:GetCliRect()
// Creem els Tabs de l'Actualitzador.
oFld:= TFolder():New( 0 , 0 , {"BROWSE","FORMULARI"} , , oChild , , , , .T. , , oRect:nWidth() , oRect:nHeight() ,, .T. ,,)
@ 30,10 XBROWSE oBrw ALIAS "CLIE0110" SIZE oRect:nWidth()-20 , oRect:nHeight()-50 OF oFld:aDialogs[1] PIXEL CELL LINES
oCol:= oBrw:AddCol()
oCol:cHeader := "Codi"
oCol:bStrData := FieldBlock("COD_CLIENT")
oCol:= oBrw:AddCol()
oCol:cHeader := "Nom Fiscal"
oCol:bStrData := FieldBlock("NOM_F")
oBrw:CreateFromCode()
oChild:oClient := oBrw
ACTIVATE WINDOW oChild ON INIT oBrw:SetFocus()
RETURN NIL
Function IniciarRdd( )
// Llibreries SQLRDD
REQUEST SQLRDD // SQLRDD should be linked in
REQUEST SQLEX // SQLRDD Extreme should be linked in
REQUEST SR_ODBC // Needed if you plan to connect with ODBC
REQUEST SR_MYSQL // Needed if you plan to use native connection to MySQL
REQUEST SR_PGS // Needed if you plan to use native connection to Postgres
SR_USEDELETEDS(.T.)
Return Nil
Me estoy iniciando en FWH siento todas mis consultas, y agradezco su ayuda.
Muchas gracias por adelantado.