Codejock RibbonBar first tests

Codejock RibbonBar first tests

Postby Antonio Linares » Tue Mar 31, 2009 8:21 pm

We have been doing some tests using the Codejock RibbonBar control :-)

Here you have a first test.

test.prg
Code: Select all  Expand view  RUN

#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
 

Image
regards, saludos

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

Re: Codejock RibbonBar first tests

Postby nageswaragunupudi » Tue Mar 31, 2009 8:36 pm

Excellant !!!!
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Codejock RibbonBar first tests

Postby Otto » Tue Mar 31, 2009 8:59 pm

Hello Antonio,

this is looking good.
Which product from Codejock do we need to buy to get this functionality.
Thanks in advance
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6338
Joined: Fri Oct 07, 2005 7:07 pm

Re: Codejock RibbonBar first tests

Postby Antonio Linares » Tue Mar 31, 2009 9:14 pm

Otto,

You can download the demo version from Codejock to do these tests :-)
regards, saludos

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

Re: Codejock RibbonBar first tests

Postby Daniel Garcia-Gil » Tue Mar 31, 2009 9:22 pm

I found the way to add groups :-)

Code: Select all  Expand view  RUN
#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


Image
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Codejock RibbonBar first tests

Postby Antonio Linares » Tue Mar 31, 2009 9:22 pm

Daniel,

very good! :-)

Thanks!
regards, saludos

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

Re: Codejock RibbonBar first tests

Postby Antonio Linares » Tue Mar 31, 2009 9:37 pm

regards, saludos

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

Re: Codejock RibbonBar first tests

Postby Antonio Linares » Tue Mar 31, 2009 9:46 pm

Adding buttons to a Group! :-)

Code: Select all  Expand view  RUN

#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
 

Image
regards, saludos

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

Re: Codejock RibbonBar first tests

Postby Daniel Garcia-Gil » Tue Mar 31, 2009 10:06 pm

Other controls

Code: Select all  Expand view  RUN
#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


Image
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: Codejock RibbonBar first tests

Postby Antonio Linares » Tue Mar 31, 2009 10:08 pm

Great! :-)

We are moving forward very quickly :-)
regards, saludos

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

Re: Codejock RibbonBar first tests

Postby Antonio Linares » Tue Mar 31, 2009 10:58 pm

Managing the controls properties :-)

Code: Select all  Expand view  RUN

#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
 

Image
regards, saludos

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

Re: Codejock RibbonBar first tests

Postby Antonio Linares » Tue Mar 31, 2009 11:07 pm

Easily inspecting CodeJock properties from Microsoft Word (VBA) to learn about it :-)

Image
regards, saludos

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

Re: Codejock RibbonBar first tests

Postby Antonio Linares » Tue Mar 31, 2009 11:54 pm

option button:
Code: Select all  Expand view  RUN

   oGroup1 = oTabFiles:Groups:AddGroup( "Test 1", 0 )
   oGroup1:ShowOptionButton = .T.
 

Image
regards, saludos

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

Re: Codejock RibbonBar first tests

Postby Antonio Linares » Wed Apr 01, 2009 12:59 am

Executing an action from a control :-)

Code: Select all  Expand view  RUN

#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
 

Image
regards, saludos

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

Re: Codejock RibbonBar first tests

Postby Daniel Garcia-Gil » Wed Apr 01, 2009 5:56 am

Image on Button
Alpha Channel Support too

Image

Code: Select all  Expand view  RUN
#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

 
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Willi Quintana and 48 guests