Codejock Shortcutbar

This forum is for eXpress++ general support.
Message
Author
User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Codejock Shortcutbar

#1 Post 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

skiman
Posts: 1199
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Codejock Shortcutbar

#2 Post 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.
Best regards,

Chris.
www.aboservice.be

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Codejock Shortcutbar

#3 Post 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:
Attachments
shortcut.jpg
shortcut.jpg (71.71 KiB) Viewed 15582 times
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: Codejock Shortcutbar

#4 Post by unixkd »

Hi Tom

Please send post your sample code for me.

Joe

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Codejock Shortcutbar

#5 Post by Tom »

Hi, Joe.

It's "MAIN.PRG" from <eXpressInstallation>\Samples\Codjock\Shortcutbar.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: Codejock Shortcutbar

#6 Post 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.

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Codejock Shortcutbar

#7 Post 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')
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
Tom
Posts: 1234
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: Codejock Shortcutbar

#8 Post 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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
unixkd
Posts: 579
Joined: Thu Feb 11, 2010 1:39 pm

Re: Codejock Shortcutbar

#9 Post by unixkd »

CJshortcutbarLoadBitMap command accept <cFilename.bmp> , any function to convert a resource ID to a <cFilename.bmp> for this command ?

Thanks.

Joe

User avatar
Auge_Ohr
Posts: 1428
Joined: Wed Feb 24, 2010 3:44 pm

Re: Codejock Shortcutbar

#10 Post 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
HX_ShortCutBar.PNG (32.84 KiB) Viewed 15533 times
greetings by OHR
Jimmy

Post Reply