Codejock RibbonBar primeras pruebas

Re: Codejock RibbonBar primeras pruebas

Postby Antonio Linares » Fri Apr 03, 2009 3:13 pm

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  Expand view  RUN

#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: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Codejock RibbonBar primeras pruebas

Postby Antonio Linares » Fri Apr 03, 2009 5:53 pm

Visual RibbonBar: dinamicamente anadiendo Tabs y Grupos

RibbonBar.prg
Code: Select all  Expand view  RUN

#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: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Codejock RibbonBar primeras pruebas

Postby Antonio Linares » Fri Apr 03, 2009 7:14 pm

Visual RibbonBar: version mejorada

RibbonBar.prg
Code: Select all  Expand view  RUN

#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Codejock RibbonBar primeras pruebas

Postby Rossine » Fri Apr 03, 2009 8:12 pm

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.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Postby Rossine » Fri Apr 03, 2009 9:18 pm

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.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Postby Antonio Linares » Fri Apr 03, 2009 11:28 pm

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Codejock RibbonBar primeras pruebas

Postby Rossine » Fri Apr 03, 2009 11:39 pm

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.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Postby Antonio Linares » Fri Apr 03, 2009 11:43 pm

bien! :-)
regards, saludos

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

Re: Codejock RibbonBar primeras pruebas

Postby Antonio Linares » Fri Apr 03, 2009 11:44 pm

Rossine,

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

Que contiene el fichero ? Ponlo aqui
regards, saludos

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

Re: Codejock RibbonBar primeras pruebas

Postby Rossine » Sat Apr 04, 2009 12:43 am

Obrigado, Regards, Saludos

Rossine.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Postby Antonio Linares » Sat Apr 04, 2009 1:33 am

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

RibonBar.prg
Code: Select all  Expand view  RUN

#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Codejock RibbonBar primeras pruebas

Postby Rossine » Sat Apr 04, 2009 5:49 pm

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.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Postby Antonio Linares » Sat Apr 04, 2009 6:52 pm

Rossine,

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

Tenemos que localizar de donde proceden.
regards, saludos

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

Re: Codejock RibbonBar primeras pruebas

Postby Rossine » Sun Apr 05, 2009 7:06 pm

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.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

Re: Codejock RibbonBar primeras pruebas

Postby Rossine » Mon Apr 06, 2009 12:26 am

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  Expand view  RUN


exit procedure SAIDA

 oAct:end()
 
Obrigado, Regards, Saludos

Rossine.

Harbour and Harbour++
Rossine
 
Posts: 344
Joined: Tue Oct 11, 2005 11:33 am

PreviousNext

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: cmsoft and 55 guests