Codejock RibbonBar primeras pruebas

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Codejock RibbonBar primeras pruebas

Post by Antonio Linares »

Un primer boceto de un diseñador visual de RibbonBar. La idea es diseñar interactivamente el RibbonBar y que genere automaticamente su codigo fuente:

RibonBar.prg

Code: Select all

#include "FiveWin.ch"

static oRb

function Main()

   local oWnd, oAct, oMenu, aControls := {}

   DEFINE WINDOW oWnd TITLE "Visual RibbonBar"

   @ 0, 0 ACTIVEX oAct PROGID "Codejock.CommandBarsFrame.12.1.1" OF oWnd SIZE 0, 0

   oAct:bOnEvent = { | cEvent, aParams, pParams | RibbonBarEvent( cEvent, aParams, pParams, aControls ) }

   oAct:Do( "AttachToWindow", oWnd:hWnd )

   oRb = oAct:Do( "AddRibbonBar", "fwh" )

   oMenu = oRb:Controls:Add( 2, 0, "Menu" )
   oMenu:Flags = 1  && xtpFlagRightAlign

   oTabs = oMenu:CommandBar:Controls:Add( 2, 0, "Tabs" )
   AAdd( aControls, oTabs:CommandBar:Controls:Add( 1, 3000, "Add" ) )

   oGroups = oMenu:CommandBar:Controls:Add( 3, 0, "Groups" )
   AAdd( aControls, oGroups:CommandBar:Controls:Add( 1, 4000, "Add" ) )

   ACTIVATE WINDOW oWnd

return nil

function RibbonBarEvent( cEvent, aParams, pParams, aControls )

   local oTab 

   static nTab := 1, nGroup := 1

   do case
      case cEvent == "Execute" .and. Len( aControls ) > 0
           do case
              case aControls[ 1 ]:hObj == aParams[ 1 ]
                   oTab = oRb:InsertTab( nTab, "Tab " + AllTrim( Str( nTab++ ) ) )
                   oTab:Selected = .T.

              case aControls[ 2 ]:hObj == aParams[ 1 ]
                   MsgInfo( "Insert Group" )

           endcase
   endcase
   
return nil             
 
Image
regards, saludos

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

Re: Codejock RibbonBar primeras pruebas

Post by Antonio Linares »

Visual RibbonBar: dinamicamente anadiendo Tabs y Grupos

RibbonBar.prg

Code: Select all

#include "FiveWin.ch"

static oRb

function Main()

   local oWnd, oAct, oMenu, aControls := {}

   DEFINE WINDOW oWnd TITLE "Visual RibbonBar"

   @ 0, 0 ACTIVEX oAct PROGID "Codejock.CommandBarsFrame.12.1.1" OF oWnd SIZE 0, 0

   oAct:bOnEvent = { | cEvent, aParams, pParams | RibbonBarEvent( cEvent, aParams, pParams, aControls ) }

   oAct:Do( "AttachToWindow", oWnd:hWnd )

   oRb = oAct:Do( "AddRibbonBar", "fwh" )

   oMenu = oRb:Controls:Add( 2, 0, "Menu" )
   oMenu:Flags = 1  && xtpFlagRightAlign

   oTabs = oMenu:CommandBar:Controls:Add( 2, 0, "Tabs" )
   AAdd( aControls, oTabs:CommandBar:Controls:Add( 1, 3000, "Add" ) )

   oGroups = oMenu:CommandBar:Controls:Add( 3, 0, "Groups" )
   AAdd( aControls, oGroups:CommandBar:Controls:Add( 1, 4000, "Add" ) )

   ACTIVATE WINDOW oWnd

return nil

function RibbonBarEvent( cEvent, aParams, pParams, aControls )

   local oTab 

   do case
      case cEvent == "Execute" .and. Len( aControls ) > 0
           do case
              case aControls[ 1 ]:hObj == aParams[ 1 ]
                   oTab = oRb:InsertTab( oRb:TabCount + 1, "Tab " + AllTrim( Str( oRb:TabCount + 1 ) ) )
                   oTab:Selected = .T.

              case aControls[ 2 ]:hObj == aParams[ 1 ]
                   if oRb:TabCount > 0 
                      oRb:SelectedTab:Groups:AddGroup( "&Group", Len( oRb:SelectedTab:Groups ) + 1 )
                   endif 

           endcase
   endcase
   
return nil             
 
regards, saludos

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

Re: Codejock RibbonBar primeras pruebas

Post by Antonio Linares »

Visual RibbonBar: version mejorada

RibbonBar.prg

Code: Select all

#include "FiveWin.ch"

static oRb

function Main()

   local oWnd, oAct, oMenu, aControls := {}

   DEFINE WINDOW oWnd TITLE "Visual RibbonBar"

   @ 0, 0 ACTIVEX oAct PROGID "Codejock.CommandBarsFrame.12.1.1" OF oWnd SIZE 0, 0

   oAct:bOnEvent = { | cEvent, aParams, pParams | RibbonBarEvent( cEvent, aParams, pParams, aControls ) }

   oAct:Do( "AttachToWindow", oWnd:hWnd )

   oRb = oAct:Do( "AddRibbonBar", "fwh" )

   oMenu = oRb:Controls:Add( 2, 0, "Menu" )
   oMenu:Flags = 1  && xtpFlagRightAlign

   oTabs = oMenu:CommandBar:Controls:Add( 2, 0, "Tabs" )
   AAdd( aControls, oTabs:CommandBar:Controls:Add( 1, 3000, "Add" ) )

   oGroups = oMenu:CommandBar:Controls:Add( 3, 0, "Groups" )
   AAdd( aControls, oGroups:CommandBar:Controls:Add( 1, 4000, "Add" ) )

   ACTIVATE WINDOW oWnd

return nil

function RibbonBarEvent( cEvent, aParams, pParams, aControls )

   local oTab 

   do case
      case cEvent == "Execute" .and. Len( aControls ) > 0
           do case
              case aControls[ 1 ]:hObj == aParams[ 1 ]
                   oTab = oRb:InsertTab( oRb:TabCount + 1, "Tab " + AllTrim( Str( oRb:TabCount + 1 ) ) )
                   oTab:Selected = .T.

              case aControls[ 2 ]:hObj == aParams[ 1 ]
                   if oRb:TabCount > 0
                      oRb:SelectedTab:Groups:AddGroup( "Group " + AllTrim( Str( oRb:SelectedTab:Groups:GroupCount + 1 ) ),;
                                                       oRb:SelectedTab:Groups:GroupCount + 1 )
                   endif   

           endcase
   endcase
   
return nil             
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
Rossine
Posts: 343
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Post by Rossine »

Olá Antonio,

Agora consigo compilar e excutar todos os exemplos codejock com harbour + msvc :D

Obrigado a todos, principalmente a equipe harbour :D :D
Obrigado, Regards, Saludos

Rossine.

xHarbour comercial (xAcc) -> Testando harbour + bcc / msvc
fwh 9.05
Windows XP SP2
Rossine
Posts: 343
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Post by Rossine »

Olá Antonio,

Se você der um "duplo click" no "SystemButton" o sistema abandona. No caso do harbour gera o arquivo "hb_out.log".
Obrigado, Regards, Saludos

Rossine.

xHarbour comercial (xAcc) -> Testando harbour + bcc / msvc
fwh 9.05
Windows XP SP2
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Codejock RibbonBar primeras pruebas

Post by Antonio Linares »

Rossine,

> Agora consigo compilar e excutar todos os exemplos codejock com harbour + msvc

Cual era el problema ? Como lo has solucionado ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Rossine
Posts: 343
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Post by Rossine »

Olá Antonio,

Eu atualizei a minha versão do harbour (svn) e onde estava "Codejock.CommandBarsFrame.12.1.1" mudei para "Codejock.CommandBarsFrame.13.0.0" :D
Obrigado, Regards, Saludos

Rossine.

xHarbour comercial (xAcc) -> Testando harbour + bcc / msvc
fwh 9.05
Windows XP SP2
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Codejock RibbonBar primeras pruebas

Post by Antonio Linares »

bien! :-)
regards, saludos

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

Re: Codejock RibbonBar primeras pruebas

Post by Antonio Linares »

Rossine,

> No caso do harbour gera o arquivo "hb_out.log".

Que contiene el fichero ? Ponlo aqui
regards, saludos

Antonio Linares
www.fivetechsoft.com
Rossine
Posts: 343
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Post by Rossine »

Olá Antonio,

Pode baixá-lo daqui: http://rapidshare.com/files/217156054/hb_out.log.html
Obrigado, Regards, Saludos

Rossine.

xHarbour comercial (xAcc) -> Testando harbour + bcc / msvc
fwh 9.05
Windows XP SP2
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Codejock RibbonBar primeras pruebas

Post by Antonio Linares »

Visual RibbonBar: Añadiendo controles (botones), desarrollado conjuntamente con Daniel :-)

RibonBar.prg

Code: Select all

#include "FiveWin.ch"

#define xtpControlButton     1

static oRb

function Main()

   local oWnd, oAct, oMenu, oGroups, oControls, aControls := {}

   DEFINE WINDOW oWnd TITLE "Visual RibbonBar"

   @ 0, 0 ACTIVEX oAct PROGID "Codejock.CommandBarsFrame.12.1.1" OF oWnd SIZE 0, 0

   oAct:bOnEvent = { | cEvent, aParams, pParams | RibbonBarEvent( cEvent, aParams, pParams, aControls ) }

   oAct:Do( "AttachToWindow", oWnd:hWnd )

   oRb = oAct:Do( "AddRibbonBar", "fwh" )

   oMenu = oRb:Controls:Add( 2, 0, "Menu" )
   oMenu:Flags = 1  && xtpFlagRightAlign

   oTabs = oMenu:CommandBar:Controls:Add( 2, 0, "Tabs" )
   AAdd( aControls, oTabs:CommandBar:Controls:Add( 1, 3000, "Add" ) )

   oGroups = oMenu:CommandBar:Controls:Add( 3, 0, "Groups" )
   AAdd( aControls, oGroups:CommandBar:Controls:Add( 1, 4000, "Add" ) )

   oControls = oMenu:CommandBar:Controls:Add( 3, 0, "Controls" )
   AAdd( aControls, oControls:CommandBar:Controls:Add( 1, 5000, "Add Button" ) )

   ACTIVATE WINDOW oWnd

return nil

function RibbonBarEvent( cEvent, aParams, pParams, aControls )

   local oTab, oGroup, oControl 

   do case
      case cEvent == "Execute" .and. Len( aControls ) > 0
           do case
              case aControls[ 1 ]:hObj == aParams[ 1 ]
                   oTab = oRb:InsertTab( oRb:TabCount + 1, "Tab " + AllTrim( Str( oRb:TabCount + 1 ) ) )
                   oTab:Id = oRb:TabCount
                   oTab:Selected = .T.

              case aControls[ 2 ]:hObj == aParams[ 1 ]
                   if oRb:TabCount > 0
                      oGroup = oRb:SelectedTab:Groups:AddGroup( "Group " + AllTrim( Str( oRb:SelectedTab:Groups:GroupCount + 1 ) ),;
                               ( oRb:SelectedTab:Index * 10 ) + oRb:SelectedTab:Groups:GroupCount + 1 )
                   endif   

              case aControls[ 3 ]:hObj == aParams[ 1 ]
                   if oRb:SelectedTab:Groups:GroupCount > 0
                      oGroup = oRb:FindGroup( ( oRb:SelectedTab:Index * 10 ) + oRb:SelectedTab:Groups:GroupCount )
                      oControl = oGroup:Add( xtpControlButton, 1, nil )
                      oControl:Caption = "Button " + AllTrim( Str( oGroup:Count ) )
                   endif   

           endcase
   endcase
   
return nil             
 
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
Rossine
Posts: 343
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Post by Rossine »

Olá Antonio,

Ao sair dos exemplos, é gerado o arquivo "HB_OUT.LOG". Mesmo WEBEXP.PRG gera este arquivo. Seria possível você testar estes exemplos com HARBOUR + MSVC ?
Obrigado, Regards, Saludos

Rossine.

xHarbour comercial (xAcc) -> Testando harbour + bcc / msvc
fwh 9.05
Windows XP SP2
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Codejock RibbonBar primeras pruebas

Post by Antonio Linares »

Rossine,

Aparecen bloques de memoria sin liberar. Ocurre igual usando Borland.

Tenemos que localizar de donde proceden.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Rossine
Posts: 343
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Post by Rossine »

Olá Antonio,

Como faço para gerar a ultima versão do harbour (svn) para BCC ? Mudei "set HB_COMPILER=msvc" para "set HB_COMPILER=bcc" e coloquei em meu arquivo BAT esta variavel "set CC_DIR=c:\bcc55" mas ocorrem erros na compilação. Você pode me ajudar ?

Obs: Tentei usar o binário que você distribui "harbour.exe" só que está faltando a lib "hbwin.lib".
Obrigado, Regards, Saludos

Rossine.

xHarbour comercial (xAcc) -> Testando harbour + bcc / msvc
fwh 9.05
Windows XP SP2
Rossine
Posts: 343
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Post by Rossine »

Olá Antonio,

Eu baixei o harbour.exe de fevereiro e nela tem o arquivo hbwin.lib. Mesmo compilando com bcc é gerado o arquivo hb_out.log :?

Será que ao sair do programa não é preciso finalizar a codejock não ? Tipo:

Code: Select all


exit procedure SAIDA

 oAct:end()
 
Obrigado, Regards, Saludos

Rossine.

xHarbour comercial (xAcc) -> Testando harbour + bcc / msvc
fwh 9.05
Windows XP SP2
Post Reply