Define Window, Release Windows, Activate Window, Deactivate Window, Hide Window, Show Window, Move Window, Modify Window
This group of commands lets you work with windows the Xbase way. Many of their capabilities have been superseded by use of properties and methods, though some still require these commands.
Usage |
DEFINE WINDOW WindowName FROM nTop, nLeft TO nBottom, nRight | AT nTop, nLeft SIZE nHeight, nWidth [ IN [ WINDOW ] ContainerWindow | IN SCREEN | IN DESKTOP | IN MACDESKTOP ] [ NAME ObjectName ] [ FONT cFontName [, nFontSize ] ] [ STYLE cFontStyle ] [ TITLE cWindowTitle ] [ FOOTER cWindowFooter ] [ HALFHEIGHT ] [ DOUBLE | PANEL | SYSTEM | NONE ] [ CLOSE | NOCLOSE ] [ GROW | NOGROW ] [ FLOAT | NOFLOAT ] [ MDI | NOMDI ] [ MINIMIZE | NOMINIMIZE ] [ ZOOM | NOZOOM ] [ SHADOW | NOSHADOW ] [ FILL cFillChar | FILL FILE FillFileName ] [ ICON FILE IconFileName ] [ COLOR SCHEME nColorScheme | COLOR PAIR ColorPairs ] |
Clause |
Property |
Meaning |
FROM - TO, AT - SIZE |
The size of the window. |
|
FONT |
The font and size for the window. |
|
STYLE |
FontBold, FontItalic, FontOutline, FontShadow, FontStrikethru, FontUnderline |
Font attributes for the window. |
TITLE |
The caption that appears in the window's title bar. |
|
HALFHEIGHT |
Should the window have a half-height title bar? |
|
DOUBLE, PANEL, SYSTEM, NONE |
The type and size of the window border. |
|
CLOSE, NOCLOSE |
Can the window be closed by double-clicking in the Close box? |
|
GROW, NOGROW |
Can the window be resized? |
|
FLOAT, NOFLOAT |
Can the window be moved? |
|
MDI, NOMDI |
Does the window behave like an MDI window? |
|
MINIMIZE, NOMINIMIZE |
Can the user minimize the window? |
|
ZOOM, NOZOOM |
Can the user maximize the window? |
|
FILL FILE |
The bitmap used as wallpaper. |
|
ICON FILE |
The icon to use when the window is minimized. |
|
COLOR SCHEME, COLOR |
The colors for the window. |
Usage |
RELEASE WINDOWS WindowList | SCREEN |
Watch out for the SCREEN clause—RELEASE WINDOW SCREEN attempts to shut down VFP, even if it's issued in a top-level form. |
Usage |
ACTIVATE WINDOW WindowNameList | ALL | SCREEN [ IN [ WINDOW ] ContainerWindow | IN SCREEN | IN MACDESKTOP ] [ BOTTOM | TOP | SAME ] [ NOSHOW ] DEACTIVATE WINDOW WindowNameList | ALL SHOW | HIDE WINDOW WindowNameList | ALL | SCREEN [ IN [ WINDOW ] ContainerWindow | IN SCREEN | IN MACDESKTOP ] [ BOTTOM | TOP | SAME ] [ SAVE ] [ REFRESH ] |
Usage |
MOVE WINDOW WindowName TO nNewTop, nNewLeft | BY nRows, nCols | CENTER MODIFY WINDOW WindowName | SCREEN [ FROM nTop, nLeft [ TO nBottom, nRight ] | AT nTop, nLeft [ SIZE nHeight, nWidth ] ] [ FONT cFontName [, nFontSize ] ] [ STYLE cFontStyle ] [ TITLE cWindowTitle ] [ HALFHEIGHT ] [ DOUBLE | PANEL | SYSTEM | NONE ] [ CLOSE | NOCLOSE ] [ GROW | NOGROW ] [ FLOAT | NOFLOAT ] [ MINIMIZE | NOMINIMIZE ] [ ZOOM | NOZOOM ] [ SHADOW | NOSHADOW ] [ FILL FILE FillFileName ] [ ICON FILE IconFileName ] [ COLOR SCHEME nColorScheme | COLOR PAIR ColorPairs ] |
Example |
* Let's try doing things the old way and the OOP way DEFINE WINDOW test FROM 5,5 TO 15,50 DOUBLE ; TITLE "Test Window" FLOAT GROW ZOOM MINIMIZE CLOSE ACTIVATE WINDOW test * now change some attributes MODIFY WINDOW test NOFLOAT NOCLOSE TITLE "Whaddaya think?" MOVE WINDOW test TO 10,8 RELEASE WINDOW Test * Here's the OOP way DEFINE WINDOW test FROM 5,5 TO 15,50 DOUBLE ; TITLE "Test Window" FLOAT GROW ZOOM MINIMIZE CLOSE ; NAME oTest oTest.Show() * now change some attributes oTest.Movable = .F. oTest.Closable = .F. oTest.Caption = "Whaddaya Think?" oTest.Top = 10 oTest.Left = 8 oTest.Release() |
See Also |
AutoCenter, BackColor, BorderStyle, BorderWidth, Caption, Clear Windows, Closable, ColorScheme, FontBold, FontItalic, FontName, FontOutline, FontShadow, FontSize, FontStrikethru, FontUnderline, ForeColor, Form, HalfHeightCaption, Height, Hide, Icon, Left, MaxButton, MDIForm, MinButton, Movable, Release, ScaleMode, _Screen, Show, Top, Visible, Width |