MMCC's PL/B notes Notes home Intro History Article index v1.10 |
509 Center Bay City, Michigan Sales (989) 892-9242             Support (989) 686-8860 WINDOW Object Notes
|
WINDOW Object(Also see Window Split Screen page.)
The WINDOW object is the base on which everything else is built. Most of the things dealing with windows is relatively straight forward. Here are some things we do in a standard fashion.
HIDING THE WINDOW
Sometimes we just want a window to get out of the way. Perhaps we've put up another window on top and want the first layer to be inactive. Here are some ways we do that.
- VISIBLE PROPERTY
You can set the window visibility property to 0 and that will hide the window for sure. The problem is that a window is a collection. When you set the window to invisible, all objects on the window are also set invisible. When you later bring it back, everything comes back.
Where that gets you is in cases where you are selectively setting visibility for various objects on the window. Perhaps you have a number of buttons and you turn them on and off depending on what the user is doing.
If this is not a problem then the visibility thing works well.
- DISABLE
If you want the window to still be visible but not active you can do a DISABLEITEM to the window itself. Same problem here as with visibility. When you ENABLEITEM to get it back, ALL of the visible objects will be enabled. You might have to reset some individual objects.
- SHOW METHOD
A really NICE technique is to use the "SHOW" method for a Window. This can make the whole thing just disappear and later bring it back with no change to any properties.
There are a number of variations to the SHOW method. The two that we use the most are:The $SW values are defined in the PLBMETH.INC module provided by Sunbelt.
- {windowname}.SHOW USING *MODE=$SW_HIDE
- {windowname}.SHOW USING *MODE=$SW_SHOW
- {windowname}.SHOW USING *MODE=$SW_SHOWMAXIMIZED
- etc. see PLBMETH.INC
There was a problem at one point getting to the main window. That's the window you see when you do a WINSHOW. It's where KEYIN/DISPLAY instructions work.
In 8.6 a new object called MAINWINDOW was defined to gives access to the methods and properties for the default window. We've not tried this since most of the time we're working with the window object of the PLFORM. An example of MAINWINDOW from the Sunbelt web board is:wndMainWindow MAINWINDOW wndMainWindow.Show USING *Mode=$SW_SHOWMAXIMIZEDThere is also an old setmode that people once used:SETMODE *FULLSCR={ON|OFF|MAX|MIN|ABSOFF}From the PLB on-line reference:
- The ON mode enables the full screen mode, allowing a program window to cover the full screen when an operator selects the window maximize control. The current background color specified with *BGCOLOR is used when the screen is expanded. The *FULLSCR control does not change the current window size. This is the default mode.
- The OFF mode disables the maximize control.
- The MAX mode maximizes the window under program control. The operator cannot shrink the window.
- The MIN mode returns the window to the default size under program control.
- The ABSOFF mode disables the maximize box button for the main window. Executing any of the other FULLSCR modes enables the maximize box button.
v1.10 |
Send e-mail to MMCC. |