Idea 1 – The Office Button

The Office Button looked quite good with the Fox’s head but didn’t really fit in with my Client so I decided to try to replace it with the clients logo. So the first job was to create a button that looked better than the Clients logo. I came across a product called Axialis IconWorkshop and with the trial soon produced a good looking icon and .png file.

Icon created using Axialis IconWorkshop

Icon created using Axialis IconWorkshop

Now to place this on the Office Button. Easier said than done. Nowhere in the Samples was an example so try the help.

Oh dear Help does not work, the left hand pane had the treview OK but the right hand pane had an Internet Explorer type “Unable to display page” type message. Tried running as Administrator without success then decide to look at the Help Executables properties. A message popped up to say that I.E. was blocking it. Did I want to unblock it? Answered yes and help now works so something to do with the new security settings in I.E.7.0 I suppose. Why did the security warning not pop up when I first tried to run the Help?

Looked through the help but no success so: what is the support like. Email to Alex using the support link on the site.

14th July 01:14 am.

Is it possible to change the image on the Office Button from a fox to something else and if so how can you do it.

Reply 14th July 4:47pm

The “Ribbon.OfficeMenu.Image.Picture” property specifies the image that appears on the Office Button. If not specified, the icon of the form appears.

You can use builder: right-click on the Ribbon, choose “Edit” and select the OfficeMenu object, then right-click again and choose “Builder…”. See the Picture property on the “Property Browser”.

Further Question 13th July 9:51pm

The “Ribbon.OfficeMenu.Image.” object does not appear to have a picture property, however “ThisForm.Ribbon.OfficeMenu.Picture” appears to be valid. In the Debug Window “Ribbon.OfficeMenu.Image” Shows (Object).

Following your instructions looking in the debug window shows the “ThisForm.Ribbon.OfficeMenu.Picture” To have the path and filename of the image. Removing the property with the builder and then putting ThisForm.Ribbon.OfficeMenu.Picture = "\Path to image files\OfficeButton.bmp" at the end of the code in the init of the form also shows up the same in the Debugger. But neither option shows the picture. Does it need to be a particular type (Ico, Jpg, Gif, Png, Bmp) I have tried all, or does it have to be a particular size in pixels. Am I doing the right thing I am using the frmRibbon example to work on.

Reply July 16th 12:38 am

Sorry, I forgot to say, the Image object is available at design-time only. At run-time you can set/change the image using the SetPicture method of the OfficeMenu object (the same for other command bar controls: buttons, menu items…). Office menu picture should be 32×32 pixels icon, bitmap or png file.

I am not able to get this to work so a bit further experimentation and I found that. As I was using the “Attach to screen” option I could simply set the _Screen.Icon path to \Path to image files\OfficeButton.Ico and it produced the result I wanted.

<Picture>

Reply 18th July 1:01 pm

The “Ribbon.OfficeMenu.Image.” object does not appear to have a picture property, however “ThisForm.Ribbon.OfficeMenu.Picture” appears to be valid. In the Debug Window “Ribbon.OfficeMenu.Image” Shows (Object).

Following your instructions looking in the debug window shows the “ThisForm.Ribbon.OfficeMenu.Picture” To have the path and filename of the image. Removing the property with the builder and then putting ThisForm.Ribbon.OfficeMenu.Picture = "\Path to image files\OfficeButton.bmp" at the end of the code in the init of the form also shows up the same in the Debugger. But neither option shows the picture. Does it need to be a particular type (Ico, Jpg, Gif, Png, Bmp) I have tried all, or does it have to be a particular size in pixels. Am I doing the right thing I am using the frmRibbon example to work on.

I achieved this finally by putting the following code (from the ArgCommandBars Support page) into the BeforeOpenTables of the Main Form Data

Question to Alex 14th July 6:26 pm

I have used the Ribbon Menu Example and have edited it to give me what I want and that works OK although there are some properties which don’t seem to behave the way I would like. However when I run the form it always comes up with a message box which says:

Command Bars Library v.7.0
Copyright (c) 2004-2009 Alex R, Grigorjev, ARG Software design Lab.
All Rights reserved

This Product is licensed to:

                Peter Hart
                Peter Hart Computers

License ID: XXX-9999-99x9x9

I have placed the linesĀ  (Please note that actual licence no have been replaced by “x”)

Public xxxxxxxx
xxxxxxxx = .T.
*!*         xxxxxxxx = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Just before the #define __CBM__ CBM code

And tried also with line 2 commented and line 3 uncommented.

I could not find the argcommandbars.reg in the private folder.

Reply 16th July 1:01pm

The ARGCommandBars.reg file is located in the Private folder of the CommandBarsLicense.zip archive.

In regard to the copyright notice. The public variable should be defined before the Init event of the CBM object fires. For example, you can define it in your main program and then run a form that uses command bars. For more information, please, check the “Distributing your applications” article in the Knowledge Base on my web site. Note, you have to login first to be able to see and read that article.

I finally achieved what I wanted by putting the following code into the BeforeOpenTables of the Main Forms Data Environment.

(Code taken from ArgCommandBars Support page.)

(For example, assume the GUID of your license is “ABCDEFGH-ABCD-ABCD-ABCD-0123456789AB”:)

Public _ABCDEFGH
_ABCDEFGH = "ABCDEFGH-ABCD-ABCD-ABCD-0123456789AB"