DEFINE A SPLITCHILD WINDOW

 

Creates a SPLITCHILD Window Definition

 

 

Description:

 

A Window definition creates a Windows Graphics User Interface (GUI) Window object. This is a system of interactive visual components used by computer programs to display information and allow interaction with users of the computer program

 

A SPLITCHILD Window is defined in an HMG program as being a component of a SPLITBOX Control which is being "hosted" within a Window. The SPLITCHILD Window can only be defined within a SPLITBOX Control

 

Unlike the other types of Control that can be contained within a SPLITBOX, the SPLITCHILD Window can contain a number of Controls which belong exclusively to that SPLITCHILD Window

 

The image below demonstrates a MAIN Window which is acting as a host for a SPLITBOX Control. This contains a LISTBOX Control (Choice 1 to 5) and to the right a virtually dimensioned SPLITCHILD Window which contains four Controls. The LABEL and BUTTON Controls below the SPLITBOX are defined as components of the MAIN Window and are seperate entities from those contained within the SPLITBOX Control and its' SPLITCHILD Window

 

SPLITCHILD Window

 

Syntax:

 

DEFINE WINDOW            <cParentWindowName>

 

    [ ... Other Parent Window Properties (eg. ROW, COL etc) ... ]

 

    WINDOWTYPE           MAIN | STANDARD | CHILD

 

    [ ... Other Parent Window Properties (eg. ONINIT etc) ... ]

 

    DEFINE SPLITBOX

 

        [ ... Other SPLITBOX Controls (eg. LISTBOX, GRID, EDITBOX, TREE, BROWSE, COMBOBOX and/or TOOLBAR) ... ]

 

        DEFINE WINDOW        <cSplitChildWinName>

            [ WIDTH          <nWidth> ]

            [ HEIGHT         <nHeight> ]

            [ VIRTUALWIDTH   <nVirtualWidth> ]

            [ VIRTUALHEIGHT  <nVirtualHeight> ]

            [ TITLE          <cWinTitle> ]

 

            WINDOWTYPE       SPLITCHILD

 

            [ FONTNAME       <cFontName> ]

            [ FONTSIZE       <nFontSize> ]

            [ TITLEBAR       <lValue> ]

            [ CURSOR         <cCursorName> ]

            [ GRIPPERTEXT    <cGripperText> ]

            [ BREAK          <lValue> ]

            [ FOCUSED        <lValue> ]

            [ ONPAINT        <ProcName | bBlock> ]

            [ ONGOTFOCUS     <ProcName | bBlock> ]

            [ ONLOSTFOCUS    <ProcName | bBlock> ]

            [ ONSCROLLUP     <ProcName | bBlock> ]

            [ ONSCROLLDOWN   <ProcName | bBlock> ]

            [ ONSCROLLLEFT   <ProcName | bBlock> ]

            [ ONSCROLLRIGHT  <ProcName | bBlock> ]

            [ ONHSCROLLBOX   <ProcName | bBlock> ]

            [ ONVSCROLLBOX   <ProcName | bBlock> ]

 

            [ ... Other SPLITCHILD Window Control Definitions (eg. LABEL) ... ]

 

        END WINDOW    // SPLITCHILD Window!

 

        [ ... Other SPLITBOX Controls (eg. LISTBOX, GRID, EDITBOX, TREE, BROWSE, COMBOBOX and/or TOOLBAR) ... ]

 

    END SPLITBOX

 

    [ ... Other PARENT Window Control Definitions (eg. LABEL) ... ]

 

END WINDOW    // PARENT Window!

 

Notes:

  1. SPLITCHILD Windows can only be defined within a SPLITBOX Control

  2. The order in which properties are declared before and after the WINDOWTYPE SPLITCHILD declaration is important. If any of the properties available for this type of Window are used, they should be declared before or after declaring WINDOWTYPE SPLITCHILD as per the order shown in the Syntax section above or the program may fail to compile (build)

  3. The ROW and COL Properties for any Control that is included within a SPLITBOX should not be used when defining the control. Their placement within the SPLITBOX is managed internally by the program and their placement can be managed by users with the a gripper bar located on the Control's left side

  4. WIDTH and HEIGHT. If either of these properties is not specified during the SPLITCHILD Window defnition a default value is used;

    • WIDTH - this will be set to the maximum width of the display screen for the host Window minus the width of any other Controls defined in the SPLITBOX

    • HEIGHT - this will be set to the maximum height of the display screen for the host Window minus the height of the titlebar and any other Controls defined in the SPLITBOX

  5. VIRTUALWIDTH and VIRTUALHEIGHT. The values for these properties must be greater than the values set for their respective WIDTH and HEIGHT Properties

  6. A parent window that contains a SPLITBOX Control or a TOOLBAR Control cannot be virtually dimensioned. However, a TOOLBAR Control can be included within a virtually dimensioned SPLITCHILD Window

  7. You will note that the text of the TITLEBAR of the SPLITCHILD Window is light grey. During testing, it was noted that if the NOCAPTION Property of the SPLITCHILD Window is changed once using THISWINDOW | <FormName>.NOCAPTION := .F., the text changes to black and stands out more clearly. However, if you then either change or query the value, it reverts to light grey text!

  8. VSCROLLBAR and HSCROLLBAR. These are pre-defined controls that are "built in" when a virtually dimensioned Window is declared that includes the capability to scroll vertically and/or horizontally

  9. The original version of the help file for this item can be viewed here

Window Properties:

 

The following Window Properties are available to use when defining the SPLITCHILD Window

 

Name Data Type Control Description
WIDTH Numeric D, R, W Sets the width of the Window
HEIGHT Numeric D, R, W Sets the height of the Window
VIRTUALWIDTH Numeric D Sets the virtual width of the Window
VIRTUALHEIGHT Numeric D Sets the virtual height of the Window
WINDOWTYPE N/A D Defines which style of Window to create
FONTNAME Character D Sets the default font to use on any Window elements and any controls that don't have their own specific FONTNAME defined
FONTSIZE Numeric D Sets the default font size to use on any Window elements and any controls that don't have their own specific FONTSIZE defined
TITLEBAR Logical D Specifies if the Window should include a titlebar at the top of the window
CURSOR Character D Specifies the file name of the mouse cursor to use with the Window
GRIPPERTEXT Character D Specifies the text string to include within the gripperbar
BREAK Logical D When used, this changes the alignment of the SPLITBOX from horizontal to vertical
FOCUSED Logical D When used, this places the SPLITCHILD Window in focus when the program launches

 

Each of the following Window Properties are available after the SPLITCHILD Window has been defined

 

Name Data Type Control Description
FOCUSEDCONTROL Character R Gets the name of the control that is currently in focus within a Window
NAME Character R Returns the name defined for the Window
HANDLE Numeric R Returns the operating system Window handle number
INDEX Numeric R Returns the program's Window index number. Please refer to notes in the associated Help documentation
CLIENTAREAHEIGHT Numeric R Returns a numeric value indicating of height of the work area within the Window
CLIENTAREAWIDTH Numeric R Returns a numeric value indicating of width of the work area within the Window
NOCAPTION Logical R, W Enables and disables the Window Titlebar. Please refer to notes in the associated Help documentation
ENABLED Logical R, W Enables and disables the Window
HSCROLL Logical R, W Enables and disables the Horizontal Scroll Bar Control on a virtually dimensioned Window
VSCROLL Logical R, W Enables and disables the Vertical Scroll Bar Control on a virtually dimensioned Window
ALPHABLENDTRANSPARENT Numeric W Sets the level of transparency of a Window
BACKCOLORTRANSPARENT Array W Sets the Window's background transparency colour

 

D - Properties of this type can be used when defining a Window

R - Properties of this type can only be accessed (read) after the Window has been defined

W - Properties of this type can be changed (write) after the Window has been defined

 

See GETPROPERTY and SETPROPERTY functions for further infomation on accessing or changing properties or use semi-OOP syntax

 

Windows Event Properties:

 

Each of the following Windows Event Properties are available to use when defining the SPLITCHILD Window. When used, they contain the name of a procedure to run or a code block to evaluate if that event occurs;

 

Event Description
ONPAINT Should execute when the Window is painted. Testing shows erratic and unpredictable behaviour! Activates on EVERY paint (label, text ANYTHING)
ONGOTFOCUS Runs each time the program Window gains focus
ONLOSTFOCUS Runs each time the program Window loses focus
ONSCROLLUP Runs once for every click on the vertical scroll up arrow
ONSCROLLDOWN Runs once for every click on the vertical scroll down arrow
ONSCROLLLEFT Runs once for every click on the horizontal scroll left arrow
ONSCROLLRIGHT Runs once for every click on the horizontal scroll right arrow
ONHSCROLLBOX Runs once for each click within horizontal scroll box or once after dragging and releasing the horizontal scroll box. Menu appears when right mouse button clicked.
ONVSCROLLBOX Runs once for each click within vertical scroll box or once after dragging and releasing the vertial scroll box. Menu appears when right mouse button clicked.

 

Windows Methods:

 

Each of the following Methods can be used to perform an action that accesses, changes or modifies the Window;

 

Method Description
CAPTURE Captures a screenshot of the Window as a bitmap file (.BMP) which can be saved
PRINT Prints a screenshot of the Window
SHOW Makes the Window visible on screen after activation
HIDE Hides the Window from the screen after activation
CENTER Centers the Window on the desktop screen. Whilst this Method will work on a SPLITCHILD Window, its' behaviour may to unpredictable!
MAXIMIZE Maximises the SPLITCHILD Window to take up the entire SPLITBOX. Whilst this Method will work on a SPLITCHILD Window, its' behaviour may to unpredictable!
MINIMIZE Minimises the SPLITCHILD Window to the left, bottom corner of the SPLITBOX. Whilst this Method will work on a SPLITCHILD Window, its' behaviour may to unpredictable!
RESTORE Restores a SPLITCHILD Window to its' original position within the SPLITBOX. Whilst this Method will work on a SPLITCHILD Window, its' behaviour may to unpredictable!
SETFOCUS Sets focus onto the Window
REDRAW Redraws the Window?

 

Windows Commands:

 

There are no (known) Window Commands that can be used to perform an action with or on the SPLITCHILD Window

 

Sample Code:

 

Sample code to view the definition of a MAIN Window that hosts a SPLITBOX Control which also contains a SPLITCHILD Window can be found here

 

An additional example program worth viewing can also be found here