Custom Controls

 

OLE Container

 

OLECON is a light weight Ole container implemented as a custom control. It allows to host OCXs in a PowerBASIC application.

 

To use it, include the OLECON.INC file in your program and initialize it with a call to the OC_WinInit function, that registers the OC_WIN32 class, making it available to be used with CONTROL ADD (DDT style) or CreateWindowEx (SDK style).

 

Graphic Control (GDI+)

 

GRAPHCTX is a graphic control for pictures, text and graphics. It can be used both with SDK windows and DDT dialogs. You can use both GDI and GDI+ to draw graphics and text and to load and manipulate images.

 

This control features persistence and uses a virtual buffer (set initially equal to the size of the control when it is created) to allow to display images bigger than the size of the control. Scrollbars are automatically added when the size of the virtual buffer is bigger than the size of the control and removed when unneeded. It also features keyboard navigation and sends command messages to the parent window or dialog when the Return or Escape keys are pressed, and notification messages for mouse clicks.

 

To use the control, include the GRAPHCTX.INC file in your program and initialize it with a call to the InitGraphCtx function, that registers the GRAPHCTX class, making it available to be used with CONTROL ADD (DDT style) or CreateWindowEx (SDK style).

 

Image Control (GDI+)

 

GdipImageCtx is an image control based on GDI+. The images can be rendered using its actual size or can be resized to fit the width or the height of the window. Resizing is done automatically by the control.

 

To use the control, include the GdipImageCtx.inc file in your program and initialize it with a call to the InitGdipImageCtx function, that registers the GDIPIMAGECTX class, making it available to be used with CONTROL ADD (DDT style) or CreateWindowEx (SDK style).

 

Image Control (FreeImage)

 

FreeImageCtx is an image control based on FreeImage. The images can be rendered using its actual size or can be resized to fit the width or the height of the window. Resizing is done automatically by the control.

 

To use the control, include the FreeImageCtx.inc file in your program and initialize it with a call to the InitFreeImageCtx function, that registers the FREEIMAGECTX class, making it available to be used with CONTROL ADD (DDT style) or CreateWindowEx (SDK style).

 

Group Line Control (Themed)

 

GroupLineCtx is a theme aware group line control that adds a line to your static text. It is based in CGroupLine, a custom control by Warren D. Stevens. The control looks similar to the controls used in Office 2003 (see Tools->Options in Word or Excel). It is called GroupLine because it is very similar to the standard GroupBox. The GroupLine control looks very much like the top edge of a GroupBox, and the purpose of both controls is to present dialog controls in logical groups. The difference is that the GroupLine is only the top Line of the GroupBox.

 

GroupLine provides a nice way to bundle controls into logical groups (the whole point of a group control), but without the downside of the GroupBox (i.e. wasting valuable dialog real estate, on the left, right and bottom).

 

Text can be left, center or right aligned.
The horizontal line takes up the remainder of the room in the control (a small gap is left between the text and line).
Theme support is set to "Automatic" by default. You can disable theming calling the GroupLineCtx_DisableTheming function.
Windows XP draws standard GroupBoxes with themes the same way when enabled as when they are disabled. This seemed like an odd behaviour, so GroupLineCtx draws the disabled state with grayed-out text.
If the control is not theme-enabled or you use it in a non-XP version of Windows, it will be drawn using a classic Windows 2D appearance.

 

To use the control, include GroupLineCtx.inc in your program and initialize it with a call to the InitGroupLineControlCtx procedure, that registers the GROUPLINECTX class, making it available to be used with CONTROL ADD (DDT style) or CreateWindowEx (SDK style).

 

XPButton (Themed)

 

Theme aware XP push button that can also act as a toggle button and display an icon or bitmap.

 

Draws a themed button in Windows XP, using the functions available in UxTheme.dll, or a button with classic appearance in other versions of Windows, using GDI functions.

 

Allows up to three images per button (for normal, hot and disabled states). If you want a button with a centered image and no text, use the XPBI_CENTERCENTER flag in the XPButton_SetImagePos function.

 

Can be used as a toggle button setting this flag with the XPButton_SetToggle function.

 

Images and font are owned and destroyed by the control unless you specify TRUE in the optional fDontOwn parameter of the various functions to set an image and in the XPButton_SetFont function.

 

Valid XHTML 1.0 Transitional