Page 1 of 2
Codejock Shortcutbar
Posted: Tue Aug 20, 2013 2:54 am
by unixkd
Hi all,
anybody using Codejock Shortcutbar out there ?
Donnay sample on this control gives error at compilation. I use Xbase++ 1.9 SL1 and express 257.
Thanks
Joe
Re: Codejock Shortcutbar
Posted: Tue Aug 20, 2013 3:41 am
by skiman
Hi,
I tried it in the past. Better solution is to look at the samples pbstack and outlookbar in the samples. This is pure eXPress++ and works without a problem.
Re: Codejock Shortcutbar
Posted: Tue Aug 20, 2013 3:52 am
by Tom
Hi, Joe.
You need to place the version number of the Codejock installation you have in there, around line 17:
Code: Select all
#define shortcutbarCLSID 'Codejock.ShortCutBar.a.b.c' // a.b.c is your version number, like 14.0.0
You can retrieve the version number by checking the names of the OCX files. It's at the end, right before the suffix.
This is what you should get then:
Re: Codejock Shortcutbar
Posted: Tue Aug 20, 2013 4:18 am
by unixkd
Hi Tom
Please send post your sample code for me.
Joe
Re: Codejock Shortcutbar
Posted: Tue Aug 20, 2013 4:21 am
by Tom
Hi, Joe.
It's "MAIN.PRG" from <eXpressInstallation>\Samples\Codjock\Shortcutbar.
Re: Codejock Shortcutbar
Posted: Tue Aug 20, 2013 4:53 am
by unixkd
Thanks Tom,
There is another sample under xcodejock\samples folder that is not working, that was the one I was looking into.
Joe.
Re: Codejock Shortcutbar
Posted: Tue Aug 20, 2013 5:41 am
by Tom
Hi, Joe.
Got it.
Put this code in there, right at the beginning of "main", behind the definition of the locals:
Code: Select all
CJ_Version('a.b.c') // i.e. CJ_Version('14.0.0')
Re: Codejock Shortcutbar
Posted: Tue Aug 20, 2013 5:50 am
by Tom
Add: XCodejock needs to know the version number of the Codejock installation you have - and all samples aswell. One way to acchieve this is to set an environment var which contains the number: SET CODEJOCK VERSION=a.b.c. Remember Windows 7 and higher will not create persistent environment vars if you do this at the command prompt or in an AUTOEXEC file, so you need to put this into the registry, otherwise it will be left if you close the command prompt. All samples should run then, without recompiling. A little more elegant is to set the version number inside the code, which will guarantee the execution of your apps at the customer's sites.
Re: Codejock Shortcutbar
Posted: Tue Aug 20, 2013 10:56 am
by unixkd
CJshortcutbarLoadBitMap command accept <cFilename.bmp> , any function to convert a resource ID to a <cFilename.bmp> for this command ?
Thanks.
Joe
Re: Codejock Shortcutbar
Posted: Thu Aug 22, 2013 4:56 pm
by Auge_Ohr
unixkd wrote:CJshortcutbarLoadBitMap command accept <cFilename.bmp> , any function to convert a resource ID to a <cFilename.bmp> for this command ?
Codejock does have Imagelist where you can load from Resource.
Code: Select all
::oImageList := XbpActiveXControl():new( ::drawingArea, , { 0, 0}, { 0, 0} )
*d*::oImageList:CLSID := "{8ACA76B7-6CF3-4344-9686-6110DCDEA99A}"
::oImageList:CLSID := "Codejock.ImageManager"+HX_VERSION()
::oImageList:create()
this Sample use o:LoadIconFromResource but it work same Way with o:LoadBitmapFromResource
remember Icon most have different Size-Icon-Set and are better for resize than single Bitmap with fixed Size
Code: Select all
METHOD VOBWORK:InitImgList()
LOCAL i,iMax
LOCAL nHandle
LOCAL oIcons
LOCAL nResource
LOCAL nCommand
LOCAL aIcon := ICON2DIM()
//
// now load Icon from Resource DLL
//
nHandle := GetModuleHandleA( "MyResource.DLL" )
//
// get Property "Icons" from Codejock.ImageManager
//
oIcons := ::oImageList:getProperty("Icons")
iMax := LEN(aIcon)
FOR i := 1 TO iMax
nResource := aIcon[i,2] // using #define ID_FILE_NEW
nCommand := aIcon[i,2] // both are the same
oIcons:LoadIconFromResource( nHandle ,; // handle for Resource DLL
nResource ,; // Specifies the image to load in the resources of the module.
nCommand ,; // The id that will be used to identify the icon in the collection
xtpImageNormal ) // of icons.
NEXT
IF ::oImageList:Icons:Count() == 0
MSGBOX("Icons "+LTRIM(STR(::oImageList:Icons:Count()))+" can not continue with ICON")
ENDIF
RETURN self
after load Resource Imagelist can be used this Way
Code: Select all
::oShortGlob := CreateObject( "Codejock.ShortcutBarGlobalSettings"+HX_VERSION() )
::oShortGlob:Office2007Images := zPath+"Styles\"+"Office2007Blue.dll"
::oShortGlob:ResourceFile := zPath+"Styles\"+"SuitePro.ResourceDe.dll"
::oShortCut := XbpActiveXControl():new( ::drawingArea,, aPos,aSize )
* ::oShortCut:CLSID := "{F791DF43-12A6-4C5B-AE46-671E888FD79F}"
::oShortCut:CLSID := "Codejock.ShortcutBar"+HX_VERSION()
::oShortCut:License := "..."
::oShortCut:UserEvents := .F.
::oShortCut:create()
::oShortCap := XbpActiveXControl():new( ::drawingArea,, aPos,{0,0} )
* ::oShortCap:CLSID := "{FF5A8E61-133A-4C43-BE5D-732D3F6CCCFB}"
::oShortCap:CLSID := "Codejock.ShortcutCaption"+HX_VERSION()
::oShortCap:License := "..."
::oShortCap:UserEvents := .F.
::oShortCap:create()
::oShortCut:VisualTheme := xtpShortcutThemeOffice2007
::oShortCut:Icons := ::oImageList:Icons
::oShortCut:Item(0):IconId := ID_CALENDAR
::oShortCut:Item(1):IconId := ID_ERFASSUNG
::oShortCut:Item(2):IconId := ID_ARBEIT
::oShortCut:Item(3):IconId := ID_FAKTURA
::oShortCut:Item(4):IconId := ID_KUNDEN
::oShortCut:Item(5):IconId := ID_IMOBILIE
::oShortCut:Item(6):IconId := ID_ARTIKEL
::oShortCut:Item(7):IconId := ID_UMSATZ
::oShortCut:Item(8):IconId := ID_TOOLS

- HX_ShortCutBar.PNG (32.84 KiB) Viewed 15537 times