Tipswip   >   Windows   >   Windowsizelocation   >   Object Class
WINDOW SIZES OBJECT CLASS
This section lists the methods in the object class "oWindowSizes"
This "oWindowSizes" object class is responsible for keeping track of all the windows the user has closed, and the date/location/size they were last closed. When a window is opened this object is responsible for setting it to the exact same size and location that it was last closed by the user. This object is also responsible for the "open windows toolbar" along the bottom of the screen. The "open windows toolbar" has an icon for each window instance that is currently open. Users can click on the icon to bring the window instance to the front.
When a new user signs in, this object is notified by way of the $signinNewUser() method. This object gets the latest "Windows Used List" from the user's profile. The list is loaded into "cwUsed", a class variable in this object.
When a window is opened, the window's $construct asks this object to $setWindowSize.
$setWindowSize checks "cwUsed" to see if the user has opened the window instance before, if so,
using "pWinRef" the method sets the window size and location to the size and location last closed by the user. If not found,
$setWindowSize opens the window to the default size and location.
$setWindowSize uses "CheckAndSizeToFit" to make sure the window fits within the boundaries of the monitor currently used by the user. If it doesn't, "CheckAndSizeToFit" does its best to move and if necessary adjusts the size of the window so it doesn't exceed the boundaries of the current monitor.
When a window is closed, the window's $destruct informs this object by way of "$SaveWindowSize".
Based on the window instance name "$SaveWindowSize" checked the "cwUsed" list, if found it updates it, if not it adds a new row to the list.
When the user signs off, the signoff method gets the up to date "Windows Used List" from this object using "$retWindowsUsedList". It updates the user profile and saves it to the data file.RETURN WINDOWS USED LIST
This method returns the windows used list to the calling method. The windows used list "cwUsed" is a class variable stored in this object class.
After signing in the windows used list is loaded from the user's profile The list is updated during the session. When the user closes the application
The updated Windows Used list is obtained from this object class, and the user's profile is updated.SAVE WINDOW SIZE
This method is called by the $destruct of every window instance. This method checks to see if the window instance name already exists in the windows used list. If so, the old records is updated with the size and location of that window on closing. If not a new records is added to the list with the size and location on closing the window.
I have a toolbar along the bottom of the window with icons representing each open window. This object class is responsible for the toolbar. This method removes the window's icon from the toolbar.SET MAIN MENU WINDOW SIZE
This method is called by the $construct of the Main Menu window instance. It is only used by the Main Menu. It sets the Main Menu size to cover a good part of the screen so that other windows can be "hidden" behind the Main Menu, keeping the screen uncluttered for the user.SET WINDOW SIZE
When a window is opened, the window's $construct asks this object to $setWindowSize.
$setWindowSize checks "cwUsed" to see if the user has opened the window instance before, if so, using prWin the method sets the window size and location to the size and location last closed by the user. If not found, $setWindowSize opens the window to the default size and location.
$setWindowSize used "CheckAndSizeToFit" to make sure the window fits within the boundaries of the monitor currently used by the user. If it doesn't "CheckAndSizeToFit" does its best to moves and if necessary adjusts the size of the window so it doesn't exceed the boundaries of the current monitor.SIGN IN NEW USER
When a new user signs in, this object is notified by way of the $SignInNewUser() method. This object gets the latest "Windows Used List" from the user's profile. The list is loaded into "cwUsed", a class variable in this object.
If the list is empty, then a windows used list is defined and loaded into "cwUsed"CHECK AND SIZE TO FIT
After $setWindowSize has set the window size and location it calls this method to make sure the proposed size and location fits on the current monitor. If it won't fit within the boundaries this method moves and if necessary resizes the window to fit within the boundaries.