Language Reference Guide : 4. System Classes : FrameExec Class : IsMaximized Attribute
 
Share this page                  
IsMaximized Attribute
Data Type: smallint
4GL Access: RW
Reflects at runtime the actual state that a frame is in at the time the attribute is interrogated. Setting it maximizes the frame if it is not already, filling the entire screen, until the user clicks the restore icon in the frame's title bar or the program changes the value to FALSE. The frame will then revert to normal size as defined by the FrameExec.
Valid values include:
TRUE
Specifies that the frame should be displayed as maximized. If the frame is already maximized, there is no visible change.
FALSE
Specifies that the frame, if currently maximized, should be displayed in its normal restored state. If not currently maximized, there is no visible change.
Note:  The maximization or restoration of the frame is done after the 4GL activation block completes in which the IsMaximized value is set. Trying to determine frame dimensions after setting IsMaximized but before the 4GL activation block completes returns the values before IsMaximized was set. If you need the new frame dimensions after setting IsMaximized before completing the same 4GL activation block, send a UserEvent from within that block to determine the new frame dimensions.
See also FrameSource.IsMaximized (see IsMaximized Attribute).
How to Change the IsMaximized Setting at Runtime
For example, you code a frame with a toggle field that, when the user checks it, sets the IsMaximized attribute to TRUE. The default setting for this toggle field is FALSE. When the frame is run, it opens to the size based on the values specified in the FrameSource. When the user checks the toggle field, the frame is maximized. When the user clears the toggle field, the frame reverts back to its normal unmaximized state.
The default setting for the FrameSource.IsMaximized (see IsMaximized Attribute) is then set to TRUE. When the frame is run, it starts up maximized. If the user clears the toggle field, the frame reverts back to its specified normal size. When the frame’s toggle field is checked, the frame is maximized.
How to Change the IsMaximized Setting While a Frame is Invisible
For example, you create a frame with a button field labeled "Invisible and maximize" and named "invisible." When a user clicks the button, it runs the following code:
initialize=
{
}
on click invisible =
{
curframe.WindowVisibility = WV_INVISIBLE;
curframe.SendUserEvent(eventname = 'domaximize', delay = 4);
}
on userevent 'domaximize' =
{
curframe.isMaximized = TRUE;
tgl = curframe.IsMaximized;
curframe.SendUserEvent(eventname = 'dovisible', delay = 4);
}
on userevent 'dovisible' =
{
curframe.Trace('dovisible');
curframe.WindowVisibility = WV_VISIBLE;
}
When the frame is run and the user clicks the "invisible" button, the unmaximized frame disappears. A few seconds later the frame appears in the maximized state.
How to Execute an Openframe Using a With Clause to Set the IsMaximized Attribute
You code a frame named "main." It contains a button field labeled "Call Myself Maximized" named "cf" that, when clicked, runs the following code:
initialize=
{
}
on click cf =
{
openframe main with IsMaximized = TRUE;
}
When the frame is run and the user clicks the "cf" button, a new copy of the same frame appears maximized.