Monthly Archives: May 2013

Date and Time Picker controls

Another Windows Common Control exposed by OpenInsight 10 is the Date and Time Picker (DTP) control. This presents a simple interface for a user to enter date and/or time information in a standard or custom format.  It also provides an option to display a drop-down calendar for picking a date.

Date and Time Picker control

Date and Time Picker control

Date and Time Picker control with calendar

Date and Time Picker control with calendar

It supports the following properties:

  • CALALIGN
  • CALBACKCOLOR
  • CALFONT
  • CALFORECOLOR
  • CALMONTHBACKCOLOR
  • CALTITLEBACKCOLOR
  • CALTITLEFORECOLOR
  • CALTRAILINGFORECOLOR
  • CHECK
  • CHECKBOX
  • CUSTOMFORMAT
  • FORMAT
  • IDEALSIZE
  • MAXVALUE
  • MINVALUE
  • UPDOWN
  • VALUE

It supports the following method:

  • CLOSECAL

And the following events:

  • CHAR
  • CHANGED
  • CLOSEUP
  • DROPDOWN
  • GOTFOCUS
  • LOSTFOCUS

CALALIGN property

This property controls the alignment of the drop-down calendar and can be one of the following values:

  • “L” (Left – the default)
  • “R” (Right)

CALBACKCOLOR property

This property is an RGB color value that specifies the background color displayed between months of the drop-down calendar.  Setting this property has no effect if visual styles are enabled.

CALFONT property

This property specifies the font of the drop-down calendar – it has the same structure as the regular OpenInsight FONT property.  Setting this property has no effect if visual styles are enabled.

CALFORECOLOR property

This property is an RGB color value that specifies the text color of the drop-down calendar. Setting this property has no effect if visual styles are enabled.

CALMONTHBACKCOLOR property

This property is an RGB color value that specifies the background color displayed within the month of the drop-down calendar.  Setting this property has no effect if visual styles are enabled.

CALTITLEBACKCOLOR property

This property is an RGB color value that specifies the background color displayed in the title of the drop-down calendar.  Setting this property has no effect if visual styles are enabled.

CALTITLEFORECOLOR property

This property is an RGB color value that specifies the text color displayed in the title of the drop-down calendar.  Setting this property has no effect if visual styles are enabled.

CALTRAILINGFORECOLOR property

This property is an RGB color value that specifies the text color used to display the header day and trailing day text in the drop-down calendar.  Setting this property has no effect if visual styles are enabled.

CHECK property

This is a boolean value that specifies if the DTP checkbox is ticked.  It only applies if the DTP control contains a checkbox (see the CHECKBOX property below).

CHECKBOX property

This is a boolean value that specifies if a checkbox is shown within the DTP control. Normally the DTP control always contains a date/time value (i.e. it is never considered empty).  However if a checkbox is shown then it is only considered to contain a valid date/time if the checkbox is ticked (see the CHECK property above).

CUSTOMFORMAT property

By default the format of the date and time displayed by the DTP control is one of the standard formats as defined in the user’s Windows environment settings:

Windows date and time settings

Windows date and time settings

The FORMAT property (see below) can be used to specify one of these.

However, it is possible to use a custom format and this can be set using either a standard Windows format string or a standard Revelation Date and Time IConv/Oconv format (“D”, “DT”  and “MT”) which sets the underlying Windows format appropriately.

e.g.  “D4/E” will be translated to “dd/MM/yyyy” and so on.

FORMAT property

This property specifies the format of the date and time displayed in the control and can be one of the following values:

  • “0” – Custom format (set when using the CUSTOMFORMAT property – don’t set this yourself!)
  • “1” – Windows Long Date format
  • “2” – Windows Short Date format
  • “3” – Windows Time format

IDEALSIZE property

This get-only property returns the size needed to display the control without any clipping as an @fm-delimited array:

<1> Ideal width in pixels
<2> Ideal height in pixels

MAXVALUE property

Specifies the maximum date and time that can be entered in the control. This is a standard Revelation DateTime format of:

<date> : "." : <time>

Where date is the number of days elapsed since 31/12/1967, and time is the fraction (percentage) of the day that has elapsed.

MINVALUE property

Specifies the minimum date and time that can be entered in the control. This is a standard Revelation DateTime format of:

<date> : "." : <time>

Where date is the number of days elapsed since 31/12/1967, and time is the fraction (percentage) of the day that has elapsed.

UPDOWN property

By default the DTP control displays a button to access a drop-down month calendar for modifying the date.  Setting this property to TRUE (“1”) displays a Windows UpDown control to modify date-time values instead.

Date and Time Picker with an UpDown control

Date and Time Picker with an UpDown control

VALUE property

This property specifies the current value of the DTP control in the standard Revelation DateTime format of:

<date> : "." : <time>

Where date is the number of days elapsed since 31/12/1967, and time is the fraction (percentage) of the day that has elapsed.

While the TEXT property is supported the VALUE property should be used to access the DTP date-time values to avoid possible complications with custom formatting strings.

CLOSECAL method

This method simply closes a dropped-down month calendar. It takes no arguments.

call exec_Method( ctrlEntID, "CLOSECAL" )

Further reading

More information on the Date and Time Picker control can be found on the MSDN site here,

(Disclaimer: This article is based on preliminary information and may be subject to change in the final release version of OpenInsight 10).

Up-Down controls

The Up-Down control is a Windows Common Control that is basically a simplified scrollbar used to increment and decrement values such as a scroll position or numeric values in a linked control (a.k.a the “buddy” control).

Up-Down control  with EditLine buddy

Up-Down control with an EditLine buddy (i.e. a “spin-control”)

It supports the following properties:

  • ALIGN
  • ARROWKEYS
  • AUTOUPDATEBUDDY
  • BUDDY
  • HEXADECIMAL
  • HORIZONTAL
  • HOTTRACK
  • INCREMENT
  • RANGE
  • SHOWTHOUSANDS
  • VALUE
  • WRAP

And the following events:

  • GOTFOCUS
  • HSCROLL
  • LOSTFOCUS
  • VSCROLL

ALIGN property

This property controls the position of the Up-Down control relative to its buddy control. It can be one of the following values:

  • Null (empty)
  • “L” – left
  • “R” – right

If set to “R” the control positions itself to the right of its buddy control as per the image above (the width of the buddy control is shortened automatically to accommodate this).  If set to “L” the Up-Down control is positioned to the left instead, and the buddy control is re-sized and re-positioned accordingly.

ARROWKEYS property

This is a boolean property. Setting it to TRUE (“1”) causes the buddy control to respond to the Up and Down arrow keys to increment and decrement the VALUE of the Up-Down control.

AUTOUPDATEBUDDY property

This is a boolean property. Setting it to TRUE (“1”) causes the Up-Down control to set the text of its buddy control when it’s own VALUE property changes.

BUDDY property

This property specifies the fully-qualified name of a control (usually an EDITLINE) to associate with the Up-Down control (i.e. it sets the “buddy control”).

HEXADECIMAL property

This is a boolean property. Setting it to TRUE (“1”) causes the Up-Down control to update its buddy control with a hexadecimal string rather than a decimal one.

HORIZONTAL property

This is a boolean property. Setting it to TRUE (“1”) causes the Up-Down control to render it’s arrows left and right rather than up and down.

HOTTRACK property

This a boolean property, Setting it to TRUE (“1”) causes the arrows on the Up-Down control to be highlighted as the mouse passes over them.

INCREMENT property

This property specifies the amount by which the VALUE changes when the buttons are clicked.  By default this property is “1”.

RANGE property

This property is an @fm-delimited array of two integers containing the lower and upper limits of the Up-Down control.

<1> Low limit
<2> High Limit

The VALUE property must be between these two values.

SHOWTHOUSANDS property

This a boolean property, Setting it to TRUE (“1”) shows a “thousands-separator” (a comma) for every three decimal digits when displaying the VALUE in a buddy control.

VALUE property

This property specifies the current position of the Up-Down control.

WRAP property

This a boolean property, Setting it to TRUE (“1”) causes the VALUE to “wrap” if it is incremented or decremented beyond its RANGE.

Further reading

More information on the Up-Down control can be found on the MSDN site here,

(Disclaimer: This article is based on preliminary information and may be subject to change in the final release version of OpenInsight 10).

Taskbar Integration – Progress Bars

One of the most useful features introduced with the Windows 7 taskbar was the ability to display progress information directly on your form’s taskbar button.  OpenInsight 10 exposes this functionality via two new WINDOW properties:

  • PROGRESSVALUE
  • PROGRESSSTATE

PROGRESSVALUE Property

This is a simple @fm-delimited array composed of two fields that contain the current progress value (i.e. the proportion complete) and the maximum progress value (i.e. the value when completed).

Example:

Progress Bar 50% complete

PROGRESSVALUE of 50,100

Note that this property is set-only.

PROGRESSSTATE Property

This property specifies the appearance of the progress bar. It can be one of the following values:

  • “0” – No progress Information
  • “1” – Normal (green)
  • “2” – Error (red)
  • “3” – Paused (yellow)
  • “4” – Indeterminate (this results in a marquee-style effect)

Example:

Progress Bar Error

PROGRESSSTATE of 2

Progress Bar Paused

PROGRESSSTATE of 3

Note that this property is set-only.

Further reading

More information on taskbar Progress Bars can be found here, along with some guidelines on their usage here.

(Disclaimer: This article is based on preliminary information and may be subject to change in the final release version of OpenInsight 10).