FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Codejock RibbonBar primeras pruebas
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 08:23 PM
Hemos estado haciendo algunas pruebas usando el control RibbonBar de Codejock :-)

Aqui teneis una primer test.

test.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

聽 聽local oWnd, oAct, oRb, oTabFiles, oTabEdit, oTabBuild

聽 聽DEFINE WINDOW oWnd

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

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

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

聽 聽oTabFiles = oRb:InsertTab( 0, "&Files" ) 聽 
聽 聽oTabEdit 聽= oRb:InsertTab( 1, "&Edit" ) 聽 
聽 聽oTabBuild = oRb:InsertTab( 2, "&Build" ) 聽 
聽 聽
聽 聽ACTIVATE WINDOW oWnd

return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 09:29 PM
Encontre una forma de agregar grupos :-)

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

  local oWnd, oAct, oRb, oTabFiles, oTabEdit, oTabBuild

  DEFINE WINDOW oWnd

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

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

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

  oTabFiles = oRb:InsertTab( 0, "&Files" )  
  oTabEdit  = oRb:InsertTab( 1, "&Edit" )  
  oTabBuild = oRb:InsertTab( 2, "&Build" )  
 
  oTabFiles:Groups:AddGroup( "Test 1", 0 )  
  oTabFiles:Groups:AddGroup( "Test 2", 1 )  
 
  ACTIVATE WINDOW oWnd

return nil


Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 09:30 PM

Daniel,

Muy bueno!

Gracias! :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 09:38 PM

Aqui hay un ejemplo en VB para revisar codigo:

viewtopic.php?p=15416sid=be973c77d3c95fadb645576e242d823e#p15416

&

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 09:47 PM
A帽adiendo botones a un Grupo! :-)

Code (fw): Select all Collapse
#include "FiveWin.ch"

#define xtpControlButton 聽1

function Main()

聽 聽local oWnd, oAct, oRb, oTabFiles, oTabEdit, oTabBuild, oGroup1

聽 聽DEFINE WINDOW oWnd

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

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

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

聽 聽oTabFiles = oRb:InsertTab( 0, "&Files" ) 聽 
聽 聽oTabEdit 聽= oRb:InsertTab( 1, "&Edit" ) 聽 
聽 聽oTabBuild = oRb:InsertTab( 2, "&Build" ) 聽
聽 聽
聽 聽oGroup1 = oTabFiles:Groups:AddGroup( "Test 1", 0 ) 聽 
聽 聽oTabFiles:Groups:AddGroup( "Test 2", 1 ) 聽 

聽 聽oGroup1:Add( xtpControlButton, 0, "First" )
聽 聽oGroup1:Add( xtpControlButton, 1, "Second" )
聽 聽oGroup1:Add( xtpControlButton, 2, "Third" )
聽 聽
聽 聽ACTIVATE WINDOW oWnd

return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 10:07 PM
Otros controles

Code (fw): Select all Collapse
#include "FiveWin.ch"

#define xtpControlError 聽 聽 聽 聽 聽 聽 0
#define xtpControlButton 聽 聽 聽 聽 聽 聽1
#define xtpControlPopup 聽 聽 聽 聽 聽 聽 2
#define xtpControlButtonPopup 聽 聽 聽 3
#define xtpControlSplitButtonPopup 聽4
#define xtpControlComboBox 聽 聽 聽 聽 聽5
#define xtpControlEdit 聽 聽 聽 聽 聽 聽 聽6
#define xtpControlCustom 聽 聽 聽 聽 聽 聽7
#define xtpControlLabel 聽 聽 聽 聽 聽 聽 8
#define xtpControlCheckBox 聽 聽 聽 聽 聽9
#define xtpControlGallery 聽 聽 聽 聽 聽 10
#define xtpControlRadioButton 聽 聽 聽 11

function Main()

聽 聽local oWnd, oAct, oRb, oTabFiles, oTabEdit, oTabBuild, oGroup1, oGroup2

聽 聽DEFINE WINDOW oWnd

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

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

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

聽 聽oTabFiles = oRb:InsertTab( 0, "&Files" ) 聽
聽 聽oTabEdit 聽= oRb:InsertTab( 1, "&Edit" ) 聽
聽 聽oTabBuild = oRb:InsertTab( 2, "&Build" ) 聽
聽 聽
聽 聽oGroup1 = oTabFiles:Groups:AddGroup( "Test 1", 0 ) 聽
聽 聽oGroup2 = oTabFiles:Groups:AddGroup( "Test 2", 1 ) 聽

聽 聽oGroup1:Add( xtpControlButton, 0, "First" )
聽 聽oGroup1:Add( xtpControlButton, 1, "Second" )
聽 聽oGroup1:Add( xtpControlButton, 2, "Third" )
聽 聽
聽 聽oGroup2:Add( xtpControlEdit, 0, "A Get" )
聽 聽oGroup2:Add( xtpControlLabel, 1, "A Label" )
聽 聽oGroup2:Add( xtpControlCheckBox, 2, "A CheckBox" )
聽 聽
聽 聽ACTIVATE WINDOW oWnd

return nil


Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 10:59 PM
Modificando las propiedades de los controles :-)

Code (fw): Select all Collapse
#include "FiveWin.ch"

#define xtpControlError             0
#define xtpControlButton            1
#define xtpControlPopup             2
#define xtpControlButtonPopup       3
#define xtpControlSplitButtonPopup  4
#define xtpControlComboBox          5
#define xtpControlEdit              6
#define xtpControlCustom            7
#define xtpControlLabel             8
#define xtpControlCheckBox          9
#define xtpControlGallery           10
#define xtpControlRadioButton       11

function Main()

   local oWnd, oAct, oRb, oTabFiles, oTabEdit, oTabBuild
   local oGroup1, oGroup2, oButton1, oButton2

   DEFINE WINDOW oWnd

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

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

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

   oTabFiles = oRb:InsertTab( 0, "&Files" )  
   oTabEdit  = oRb:InsertTab( 1, "&Edit" )  
   oTabBuild = oRb:InsertTab( 2, "&Build" )  
   
   oGroup1 = oTabFiles:Groups:AddGroup( "Test 1", 0 )  
   oGroup2 = oTabFiles:Groups:AddGroup( "Test 2", 1 )  

   oButton1 = oGroup1:Add( xtpControlButton, 1, "First" )
   oButton2 = oGroup1:Add( xtpControlButton, 2, "Second" )

   oButton1:Caption = "FiveWin power!"
   oButton1:TooltipText = "Ribbonbar for FWH"
   
   ACTIVATE WINDOW oWnd

return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 11:13 PM
Inspeccionando facilmente las propiedades de CodeJock desde Microsoft Word (VBA) para aprenderlas :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 11:55 PM
option button:
Code (fw): Select all Collapse
   oGroup1 = oTabFiles:Groups:AddGroup( "Test 1", 0 ) 
   oGroup1:ShowOptionButton = .T.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 01:03 AM
Ejecutando una acci贸n desde un control :-)

Code (fw): Select all Collapse
#include "FiveWin.ch"

#define xtpControlError              0
#define xtpControlButton             1
#define xtpControlPopup              2
#define xtpControlButtonPopup        3
#define xtpControlSplitButtonPopup   4
#define xtpControlComboBox           5
#define xtpControlEdit               6
#define xtpControlCustom             7
#define xtpControlLabel              8
#define xtpControlCheckBox           9
#define xtpControlGallery           10
#define xtpControlRadioButton       11

function Main()

   local oWnd, oAct, oRb, oTabFiles, oTabEdit, oTabBuild
   local oGroup1, oGroup2, oButton1, oButton2, aButtons := {}

   DEFINE WINDOW oWnd

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

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

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

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

   oTabFiles = oRb:InsertTab( 0, "&Files" )  
   oTabEdit  = oRb:InsertTab( 1, "&Edit" )  
   oTabBuild = oRb:InsertTab( 2, "&Build" )  
   
   oGroup1 = oTabFiles:Groups:AddGroup( "Test 1", 0 ) 
   oGroup1:ShowOptionButton = .T.
    
   oGroup2 = oTabFiles:Groups:AddGroup( "Test 2", 1 )  

   oButton1 = oGroup1:Add( xtpControlButton, 1, "First" )
   oButton2 = oGroup1:Add( xtpControlButton, 2, "Second" )

   AAdd( aButtons, oButton1 )
   AAdd( aButtons, oButton2 )

   oButton1:Caption = "FiveWin power!"
   oButton1:TooltipText = "Ribbonbar for FWH"
   
   ACTIVATE WINDOW oWnd
      
return nil

function RibbonBarEvent( cEvent, aParams, pParams, aButtons )

   do case
      case cEvent == "Execute" .and. Len( aButtons ) > 0
           do case 
              case aButtons[ 1 ]:hObj == aParams[ 1 ]
                   MsgInfo( "Button 1" )
                   
              case aButtons[ 2 ]:hObj == aParams[ 1 ]
                   MsgInfo( "Button 2" )
           endcase        
   endcase        
   
return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 244
Joined: Fri Oct 28, 2005 06:29 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 01:28 AM

Antonio:

Estoy tratando de compilar tu ejemplo pero tengo este error:

Descripci贸n del error: Error BASE/1004 Class: 'NUMERIC' has no exported method: INSERTTAB
Args:
[ 1] = N 21194560
[ 2] = N 0
[ 3] = C &Files

Pila de llamadas

LLamada de INSERTTAB(0) ->
LLamada de MAIN(34) -> codejock.prg

EL ocx lo he registrado, pero donde debe estar?
Tienes idea de cual es el problema? Uso xHarbour.

Muchas gracias.

Alejandro Cebolido

Buenos Aires, Argentina
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 05:57 AM
Imagenes en Botones
Con soporte para Alpha Channel



Code (fw): Select all Collapse
#include "FiveWin.ch"

#define xtpControlError              0
#define xtpControlButton             1
#define xtpControlPopup              2
#define xtpControlButtonPopup        3
#define xtpControlSplitButtonPopup   4
#define xtpControlComboBox           5
#define xtpControlEdit               6
#define xtpControlCustom             7
#define xtpControlLabel              8
#define xtpControlCheckBox           9
#define xtpControlGallery           10
#define xtpControlRadioButton       11

#define xtpImageNormal               0
#define xtpImageDisabled             1
#define xtpImageHot                  2
#define xtpImageChecked              3
#define xtpImagePressed              4

function Main()  

   local oWnd, oAct, oRb, oTabFiles, oTabEdit, oTabBuild, oIcons
   local oGroup1, oGroup2, oButton1, oButton2, aButtons := {}
   local oButton3, oButton4, oBmp1, oBmp2, oBmp3

   DEFINE WINDOW oWnd

   
  obmp1 := TBitmap():Define( , "..\bitmaps\16x16\new2.bmp", oWnd )
  obmp2 := TBitmap():Define( , "..\bitmaps\16x16\open2.bmp", oWnd ) 
  obmp3 := TBitmap():Define( , "..\bitmaps\alphabmp\explorer.bmp", oWnd ) 


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


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

   oAct:Do( "AttachToWindow", oWnd:hWnd )
   
   oIcons := oAct:Do( "icons" )
   
   oIcons:AddBitmap( oBmp1:hBitmap,1,xtpImageNormal,.f. ) 
   oIcons:AddBitmap( oBmp2:hBitmap,2,xtpImageNormal,.f. ) 
   oIcons:AddBitmap( oBmp3:hBitmap,3,xtpImageNormal,.t. ) // 4th param, Bool to Alpha Channel Support
   oIcons:LoadBitmap( "..\bitmaps\32x32\edit.bmp",4, xtpImageNormal) 
 
   oAct:Hide()

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

   oTabFiles = oRb:InsertTab( 0, "&Files" )  
   oTabEdit  = oRb:InsertTab( 1, "&Edit" )  
   oTabBuild = oRb:InsertTab( 2, "&Build" )  
   
   oGroup1 = oTabFiles:Groups:AddGroup( "Test 1", 0 )
   oGroup1:ShowOptionButton = .T.
   
   oGroup2 = oTabFiles:Groups:AddGroup( "Test 2", 1 )  

   oButton1 = oGroup1:Add( xtpControlButton, 2, "First" )
   oButton2 = oGroup1:Add( xtpControlButton, 1, "Second" )
   
   oButton3 = oGroup2:Add( xtpControlButton, 4, NIL ) 
   oButton4 = oGroup2:Add( xtpControlButton, 3, NIL )
   oButton4:SetIconSize( 64,64 )
   oButton4:Width = 70
   oButton4:Height = 70
    
   
   
   AAdd( aButtons, oButton1 )
   AAdd( aButtons, oButton2 )

   oButton1:Caption = "FiveWin power!"
   oButton1:TooltipText = "Ribbonbar for FWH"
   
   ACTIVATE WINDOW oWnd
     
return nil

function RibbonBarEvent( cEvent, aParams, pParams, aButtons )

   do case
      case cEvent == "Execute" .and. Len( aButtons ) > 0
           do case
              case aButtons[ 1 ]:hObj == aParams[ 1 ]
                   MsgInfo( "Button 1" )
                   
              case aButtons[ 2 ]:hObj == aParams[ 1 ]
                   MsgInfo( "Button 2" )
           endcase        
   endcase        
   
return nil
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 08:18 AM

Daniel,

Simplemente genial :-)

Enhorabuena!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 08:21 AM

Alejandro,

Que versi贸n de FWH est谩s usando ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 682
Joined: Tue Feb 14, 2006 09:48 AM
Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 09:14 AM

Daniel, Antonio impresionante.

Saludos desde Mallorca
Biel Maim贸
http://bielsys.blogspot.com/