The HelpAbout button in the ARG CommandBars example uses a “messagebox” to display the copyright and contact details. I wanted to use a form as the “messagebox” displays the standard windows title. Also I wanted extra functionality, to allow a single click to open the current email program, and also to take the Employee to my web site.
The click event for the button is Part of the “Ribbon” collection and can be accessed two ways. I intend to try and produce a map to show how to navigate the CommandBars Manager or the Visual FoxPro form property dialogue.
For now right click on CommandBars Manager and select Builder… On the dialogue select the “CommandBars (Collection)”. On the next dialogue select “Controls (Collection). The last Menu itme should show the Help Icon. Select this and scroll down the right hand window to find the “OnClick()” method.
I placed the following code in the “On Click() text box.
After getting the Ribbon Working and opening some forms I noticed that the title bars on the new forms did not match the title bar of the application. How to get the titles to change. Finally thanks to some suggestions by Tracy Pearson and Dave Crozier on the ProFox lists http://leafe.com/archives/search/profox
Example of the different Title Bars below:
I created a form class with images for the bar, the form icon and buttons for the Close, Zoom and Minimise Buttons,
These are adjusted in the resize event of the form.
Picture of Base Form Class below
I liked the idea of a recent files list showing when the Office Button is clicked. But decided that a better use would be to allow the logged in user to see a list of the most recent purchase orders he/she has created. I first investigated the examples to find out how the “recent files list” is created. I found that the code to create it is in the CommandManager OfficeButton method ”
OnBuildRecentFileList” which defines an array (taItems) as an array with [n,5] elements, where n = the number of lines to display.
The elements hold horizontally:
- 1 = 0
- 2 = “&1 Recent file – 1
- 3 = “Messagebox(“Recent file 1″)
- 4 = “Recent File 1″
- 5 = 0
I concluded that the elements of the array that I was interested in were 2, 3 and 4.
2 holds the text shown in the list. 3 holds an executable script performed when clicked. (The OnClick event), 4 holds the contents of the tooltip.
So now to make all this work. What did I need to achieve.
- Use the Office Button to display the most recent Purchase Order Numbers and make the number of Purchase Order’s shown be adjustable.
- Create form accessible by clicking “Options” after clicking the Office Start Button. Place a spinner on the form to adjust the number shown.
- Store number in a preferences table.
- Amend the code in the onBuildRecentFileList of the OfficeMenu in the main Form.
Use The QuickAccessToolBar for shortcuts to the employees most used forms.
The Ribbon menu allows three things that could give more room to display forms with a large amount of data. I.e. The ribbon can be minimised. The QuickAccessToolbar shortcuts can be customised to be below the Title Bar. The shortcuts in the ribbon can be added to the QuickAccessToolbar.
So how could I achieve this? Then I thought the number of shortcuts on the QuickAccessToolbar needs to be controlled by both the Employee and the Administrator. Easy. Create a table with fields that hold the Employee’s code, The text to show in the Customise Quick Access dropdown, The path to the icon displayed, Whether the shortcut can be added as the application is opened and whether the Customise dropdown shows it ticked (and if not ticked don’t show the icon).
I then created a form to be used by the Administrator to control this. Ticked a few boxes, and placed the following code into the Init of the main form.
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
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.
I have been looking for some time at a replacement for my Treeview Menu System.
Looking at VfpX I came across an interesting idea for an Office 2007 type Ribbon Menu.
Experimenting with this I liked the idea but the control did not appear to be far enough ahead in its design for me to work with it but showing it to the Client I am currently working with gave the immediate response of “I Like it” “Can I have it tomorrow”.
More research and I came across ArgCommandBars control by Alex Grigorjev. Downloading and running the trial showed it to be what I wanted but was it going to be easy to incorporate into my application. Showing this to a large group of my Clients Employees gave a resounding “Yes” to the idea and the Client was happy to pay for any learning curve and the initial cost of the control.
Experimentation showed that the learning curve was steep but some questions to Alex brought quick responses so I went ahead and purchased the control.
Firstly I went through the Faq’s on ArgCommandBars web page and watched the video produced by Andrew MacNeill.
I found it quite easy to use the “CommandBarManager Builder” and quickly produced a reasonable ribbon menu to demonstrate to my client.
Ideas were coming for improvements and I was eager to incorporate them.
More to follow soon, watch this space…