Page 1 of 7
Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 8:23 pm
by Antonio Linares
Hemos estado haciendo algunas pruebas usando el control RibbonBar de Codejock

Aqui teneis una primer test.
test.prg
Code: Select all | Expand
#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

Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 9:29 pm
by Daniel Garcia-Gil
Encontre una forma de agregar grupos

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

Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 9:30 pm
by Antonio Linares
Daniel,
Muy bueno!
Gracias!

Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 9:38 pm
by Antonio Linares
Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 9:47 pm
by Antonio Linares
Añadiendo botones a un Grupo!

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

Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 10:07 pm
by Daniel Garcia-Gil
Otros controles
Code: Select all | Expand
#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

Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 10:59 pm
by Antonio Linares
Modificando las propiedades de los controles

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

Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 11:13 pm
by Antonio Linares
Inspeccionando facilmente las propiedades de CodeJock desde Microsoft Word (VBA) para aprenderlas


Re: Codejock RibbonBar primeras pruebas
Posted: Tue Mar 31, 2009 11:55 pm
by Antonio Linares
option button:
Code: Select all | Expand
oGroup1 = oTabFiles:Groups:AddGroup( "Test 1", 0 )
oGroup1:ShowOptionButton = .T.

Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 1:03 am
by Antonio Linares
Ejecutando una acción desde un control

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

Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 1:28 am
by TecniSoftware
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.
Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 5:57 am
by Daniel Garcia-Gil
Imagenes en Botones
Con soporte para Alpha Channel

Code: Select all | Expand
#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
Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 8:18 am
by Antonio Linares
Daniel,
Simplemente genial

Enhorabuena!
Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 8:21 am
by Antonio Linares
Alejandro,
Que versión de FWH estás usando ?
Re: Codejock RibbonBar primeras pruebas
Posted: Wed Apr 01, 2009 9:14 am
by Biel EA6DD
Daniel, Antonio impresionante.