Continuing with the recent focus on Button controls, this time we’re going to take a look at another new Button feature: Split-Buttons.
Following on from the previous post on Label controls another new item we’ve added to OpenInsight is the Hyperlink control, which is essentially a specialized Label control that allows you to implement clickable links on your forms.
Barring HTML rendering it supports all the other properties of a Label control as well as adding a few others:
If this property is TRUE then the control ensures the text is underlined when the mouse hovers over it.
This property contains the command string to execute when the link is (single) clicked. it can be any valid Windows command string (internally it is passed to the Windows ShellExecutefunction).
Note that that the CLICK and DBLCLK events are still fired as normal even if the LINK property is blank, so you still have full control over the hyperlink target.
This specifies the cursor to use when the mouse is over the link text. It defaults to the standard “hand” cursor but can be set in the same way as the normal OpenInsight CURSOR property.
When the command string in the LINK property is executed the result of the operation (as returned from the ShellExecute function) is placed in the LINKRESULT property for further examination if you wish (ShellExecute normally returns a value < 32 if there is a problem executing a command).
If this property is TRUE the link will be displayed using the VISITEDFORECOLOR property when it has been clicked at least once.
This property specifies the color to use for visited links (i.e. those that have been clicked and have a SHOWVISITED property of TRUE).
The Hyperlink control also supports a new GO method that executes the contents of the LINKproperty as though it had been clicked. The return value from this method is the same as the value returned in the LINKRESULT property.
(Disclaimer: This article is based on preliminary information and may be subject to change in the final release version of OpenInsight 10).
Perhaps one of the controls most in need of a face-lift in OpenInsight is the Button (a.k.a PUSHBUTTON) control, and in this post we’ll take a look at some of the new features we’ve added to it for version 10.
Buttons in OpenInsight have always supported background images and version 10 is no different. However we’ve extended the number of image states from 6 to 10 to give you a few more options if you want to use them:
Of course you don’t have to supply all of these images – the system will attempt to pick the closest match based on the IMAGECOUNT supplied. Access to the image properties is exposed via the normal Image API with the exception of the IMAGENUMBER property which is managed automatically depending on the button state.
One of the biggest drawbacks with using buttons in previous versions of OpenInsight is that images have only ever been applied to the background as a whole. In order to create a button with an icon (or glyph, as we’ll refer to it henceforth) it has always been necessary to provide an image file with the entire button background drawn on it as well as the required glyph and text. This makes it very difficult to provide a solution that looks good across different color schemes and visual styles, and it also makes any sort of runtime customization problematic too.
For version 10 a new API has been added for buttons called the “Glyph API”. This allows you to specify an image for the button that is drawn on top of the normal background like so:
It is exposed via the following properties:
These properties are very similar to their counterparts in the normal Image API with the exception of the following Button-glyph specific ones:
GLYPHLAYOUT property
This property specifies how the glyph is laid out in relation to the text, and can be one of the following values:
GLYPHSPACING property
This property is simply the number of pixels between the glyph and the text.
Where’s the GLYPHNUMBER property?
Just as the Button Image API has no IMAGENUMBER property there is no correspondingGLYPHNUMBER property either – this is because you can provide more than one image for a glyph and the system will automatically select one for you based on the button state (just like with background images). These states are:
Note that if you don’t supply a disabled Glyph image and you disable the button the system will draw a grayed version of the glyph for you:
Flat “toolbar” style buttons are supported by the boolean FLAT property. I.e. the actual background is not painted until the mouse is moved over the button.
The button BACKCOLOR property fully supports custom colors and generates a set of matching 3D highlight and shadow colors to use when rendering.
The FORECOLOR property also makes a welcome return and is now respected regardless of the visual style in use.
Like the updated Label control the Button now supports the following new properties when the button is in the “hot” state (i.e. the mouse is moving over it):
It also supports the new MOUSEOVER event so you can easily track mouse movements without having to resort to using WINMSG events.
A TEXTORIGIN property is provided that allows you to specify the exact XY position that you wish the text to be drawn at in a similar manner to the GLYPHORIGIN property. Horizontal text alignment is also supported by the TEXTALIGN property.
(Disclaimer: This article is based on preliminary information and may be subject to change in the final release version of OpenInsight 10).
Continuing with the recent focus on Button controls, this time we’re going to take a look at another new Button feature: Split-Buttons.
This button style was introduced with Windows Vista (*) and basically divides the button into two parts: The main part behaves like a normal push-button and fires a CLICK event when pressed, whilst the other part (normally drawn with a down arrow) fires a DROPDOWN event instead of a CLICK (if a context menu is linked to the button then this is displayed instead).
Split-Button support in OpenInsight 10 is exposed via the following properties:
To enable Split-Button functionality the SPLITBUTTON property can be set to one of the following values:
Setting the SPLITBUTTON property to NULL (“”) removes the Split-Button styling from the control.
This property specifies the size in pixels of the arrow part of the control.
The functionality of a Split-Button can be changed by the SPLITSEPARATOR property. By default the property is TRUE (“1”), but when set to FALSE (“0”) the line between the two parts of the button is removed and the entire button then behaves as a “drop-down button” – i.e. clicking the button displays a context menu or fires a DROPDOWN event.
For those of you who really can’t help customizing as much as possible the Split-Button also supports an API to allow you to change the default down arrow in the drop-down part of the control. This is the “Split-Glyph API” and mirrors most of the normal Button control “Glyph API” described previously. The only difference is the name of the properties – they are all prefixed with “SPLIT”, i.e.
(*) Although Microsoft only introduced Split-Buttons into Windows with the release of Vista, (and then only with visual styles enabled) it should be noted that the OpenInsight Split-Button issupported on XP as well, even running under the Windows Classic theme.
(Disclaimer: This article is based on preliminary information and may be subject to change in the final release version of OpenInsight 10).
One of the new features added to the SYSTEM object is the “IDLEPROC queue”. This is an enhancement to the existing IDLEPROC property as it allows you to queue multiple requests via the new SYSTEM ADDIDLEPROC method like so:
* // Run a process in the future
procID = "RUN_SOME_PROCESS"
procArg = "42"
procTime = "12:00:00" ; * // midday
procDate = oconv( date() + 1, "D4/" ) ; * // tommorrow
call exec_Method( "SYSTEM", "ADDIDLEPROC", procID, procArg, procTime, procDate )
* // Run a process ASAP...
procID = "RUN_SOME_OTHER_PROCESS"
procArg = "X43"
procTime = "" ; * // ASAP
procDate = "" ; * // ASAP
call exec_Method( "SYSTEM", "ADDIDLEPROC", procID, procArg, procTime, procDate )
The contents of the queue can be examined via the new SYSTEM IDLEPROCQUEUE property:
ipQ = get_Property( "SYSTEM", "IDLEPROCQUEUE" ) xCount = fieldCount ( ipQ, @fm ) for x = 1 to xCount ip = ipQ<x> procID = ipQ<0,1> procArg = ipQ<0,2> procTime = ipQ<0,3> procDate = ipQ<0,4> next
The normal IDLEPROC property works just as it always has done with the following caveats:
(Disclaimer: This article is based on preliminary information and may be subject to change in the final release version of OpenInsight 10).
Page 16 of 24