FRAME Statement
Syntax:
FRAME text, id, x, y, width, height[, style[, framectl]]
data-definitions
[ BEGIN
window-definition
.
.
.
END ]
The FRAME statement defines a frame window. The statement defines the title,
identifier, position, and dimensions of the frame window, as well as the
window style. The FRAME statement is most often used in a WINDOWTEMPLATE
statement, and typically, only one FRAME statement is used. The FRAME statement,
in turn, typically contains at least one WINDOW statement that defines the
client window belonging to the frame window.
The frame window has no default style. You must use the framectl field
to define additional frame controls, such as a title bar and system menu,
to be created when the frame window is created. If the text field is not
empty, the statement automatically adds a title-bar control to the frame
window, whether or not you specify the FCF_TITLEBAR style. Frame controls
are given default styles and control identifiers depending on their class.
For example, a title-bar control receives the identifier FID_TITLEBAR.
text
Specifies the title of the frame window. This
field must contain zero or more characters enclosed in double quotation
marks. Character values must be in the range 1 through 255. If a double
quotation mark is required in the name, you must include the double quotation
mark twice.
id
Specifies the window identifier. This
value must be a signed integer in the range -32768 through 32767, an unsigned
integer in the range of 1 through 65535, or a simple expression that evaluates
to a value in these ranges.
x
Specifies the x-coordinate of the lower-left
corner of the window. This value must be a signed integer in the range
-32768 through 32767 or an expression consisting of integers and the addition
(+) or subtraction (-) operator. The coordinate is assumed to be in dialog
units and is relative to the origin of the dialog box, window, or control
containing the specified window.
y
Specifies the y-coordinate of the lower-left
corner of the window. This value must be a signed integer in the range
-32768 through 32767 or an expression consisting of integers and the addition
(+) or subtraction (-) operator. The coordinate is assumed to be in dialog
units and is relative to the origin of the dialog box, window, or control
containing the specified window.
width
Specifies the width of the window. This
value must be an integer in the range 0 through 65535 or an expression consisting
of integers and the addition (+) or subtraction (-) operator. The width
is in n-character units.
height
Specifies the height of the window.
This value must be a integer in the range 0 through 65535 or an expression
consisting of integers and the addition (+) or subtraction (-) operator.
The height is in 1/8-character units.
style
Specifies the frame and window styles.
This value can be a combination of frame styles. You can use the bitwise
OR (|) operator to combine styles.
framectl
Specifies the styles of frame controls
belonging to the frame window. This value can be a combination of the styles
specified in the "Frame-Control Styles" table in the Presentation Manager
Programmers Reference. You can use the bitwise OR (|) operator to combine
styles.
data-definitions
Specifies a CTLDATA and/or
PRESPARAMS statement. These statements define control and presentation
data for the frame window. For more information, see CTLDATA
Statement and PRESPARAMS Statement.
window-definition
Specifies a WINDOW statement
or any one of several predefined control statements. These statements define
the style, position, and dimensions of windows or controls in the frame
window.
Comments
The FRAME statement can actually contain any combination of CONTROL, DIALOG,
and WINDOW statements. Typically, a FRAME statement contains one WINDOW
statement.
Example
This example creates a standard frame window, with a title bar, a system
menu, minimize and maximize boxes, and a vertical scroll bar. The FRAME
statement contains a WINDOW statement defining the client window belonging
to the frame window.
WINDOWTEMPLATE 1BEGIN
FRAME "My Window", 1, 10, 10, 320, 130, 0,
FCF_STANDARD | FCF_VERTSCROLL
BEGIN
WINDOW "", FID_CLIENT, 0, 0, 0, 0, "MyClientClass"
END
END
[Back: FONT Statement]
[Next: GROUPBOX Statement]