LWindow is a PowerPlant class that defines window behavior.
Methods :
The methods in this class are:
Data Members:
The data members in this class are:
Operation:
LWindow is a complex class that derives from many other classes. Many of the member functions in LWindow are for internal use only, and you shouldn't have to call them directly.
For more information on working with the LWindow class, refer to The PowerPlant Book.
Source files:
Ancestors:
Purpose:
The constructor creates objects from the passed-in parameters.
Access:
Prototype:
LWindow();
LWindow( const SWindowInfo &inWindowInfo);
LWindow( ResIDT inWINDid,
UInt32 inAttributes,
LCommander *inSuper );
LWindow( LStream *inStream );Parameters:
These constructors have the following parameters:
Purpose:
The destructor destroys the object.
Access:
Prototype:
virtual ~LWindow();
Purpose:
Activate a Window. This is an override of Activate() in LPane.
Purpose:
This is called when a Window is being activated. This is an override of ActivateSelf() in LPane.
Purpose:
Set the foreground and background colors of the current port. The Window or one of its subpanes must already be focused. This is an override of ApplyForeAndBackColors() in LPane.
Purpose:
Try to close a Window as a result of direct user action.
Access:
Prototype:
virtual void AttemptClose();Parameters:
Return:
Purpose:
Calculate the bounds of the Window in its standard state and return whether it is in the standard state. The standard state depends on the screen containing the largest area of the Window and the current standard size.
Access:
Prototype:
virtual Boolean CalcStandardBounds(Parameters:
Rect &outStdBounds) const;
The parameter for this method is:
Return:
Returns true if in the standard state, else false.
Purpose:
Calculate the bounds of the Window if it was at a standard (zoomed out) state on a Screen with the specified bounds.
Access:
Prototype:
virtual void CalcStandardBoundsForScreen(Parameters:
const Rect &inScreenBounds,
Rect &outStdBounds) const;
The parameters for this method are:
Return:
Purpose:
Clear the attribute in mAttributes that is passed in to this method.
Access:
Prototype:
void ClearAttribute( EWindAttr inAttribute );Parameters:
The parameter for this method is:
Return:
Purpose:
Respond to a click in the content region of a Window.
Access:
Prototype:
virtual void ClickInContent(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Process a click in drag region of a Window.
Access:
Prototype:
virtual void ClickInDrag(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Handle a click inside the close box of a Window.
Access:
Prototype:
virtual void ClickInGoAway(Parameters:
const EventRecord &inMacEvent)
The parameter for this method is:
Return:
Purpose:
Handle a click in the Grow box of a Window.
Access:
Prototype:
virtual void ClickInGrow(Parameters:
const EventRecord &inMacEvent);
The parameter for this method is:
Return:
Purpose:
Handle a click inside the zoom box of a Window
Access:
Prototype:
virtual void ClickInZoom(Parameters:
const EventRecord &inMacEvent,
SInt16 inZoomDirection)
The parameters for this method are:
Return:
Purpose:
Return a newly created Window object initialized from a PPob resource.
Access:
Prototype:
static Window* CreateWindow(Parameters:
ResIDT inWindowID,
LCommander *inSuperCommander);
The parameters for this method are:
Return:
Purpose:
Deactivate the Window. This is an override of Deactivate() in LPane.
Purpose:
This is called when a Window is being deactivated. This is an override of DeactivateSelf() in LPane.
Purpose:
Access:
Prototype:
virtual void DoClose();Parameters:
Return:
Purpose:
Change size and location of a Window.
Access:
Prototype:
virtual void DoSetBounds(Parameters:
const Rect &inBounds );
The parameter for this method is:
Return:
Purpose:
Change the location of a Window.
Access:
Prototype:
virtual void DoSetPosition( Point inPosition );Parameters:
The parameter for this method is:
Return:
Purpose:
Zoom window to either the Standard or User state.
Access:
Prototype:
virtual void DoSetZoom(Parameters:
Boolean inZoomToStdState );
The parameter for this method is:
Return:
Purpose:
This draws the window. This is an override of DrawSelf() in LPane.
Access:
Prototype:
virtual void DrawSelf();Parameters:
Return:
Purpose:
Draw standard size box for resizable Windows.
Access:
Prototype:
virtual void DrawSizeBox();Parameters:
Return:
Purpose:
Enable the Window. This is an override of Enable() in LPane.
Access:
Prototype:
virtual void Enable();Parameters:
Return:
Purpose:
Access:
Prototype:
virtual Boolean EstablishPort();Parameters:
Return:
Remarks:
If you call this function directly, you should call LView::OutOfFocus() with nil, since changing the current port may invalidate the Focus.
Purpose:
Resize a subpane so that it is the same size as the Window, horizontally and/or vertically. This is an override of ExpandSubPane() in LView.
Purpose:
Return the PowerPlant Window object associated with a Mac OS WindowPtr.
Access:
Prototype:
static LWindow* FetchWindowObject(Parameters:
WindowPtr inWindowP );
The parameter for this method is:
Return:
Returns nil if the WindowPtr is not a PowerPlant Window.
Purpose:
Pass back whether a Command is enabled and/or marked (in a Menu). This is an override of FindCommandStatus() in LCommander.
Purpose:
Return the Window object with the specified Pane ID number.
This method loops through all Windows from front to back searching for the first one with the specified Pane ID. Note that it's common to use the same PPob (and WIND) resource to create multiple windows, all of which have the same Pane ID. This function returns the frontmost match, whether it is visible or not.
Access:
Prototype:
static LWindow* FindWindowByID(Parameters:
PaneIDT inWindowID );
The parameter for this method is:
Return:
Returns nil if no match found, else returns the pointer to the Window.
Purpose:
This method returns an AppleEvent property.
Access:
Prototype:
virtual void GetAEProperty(Parameters:
DescType inProperty,
const AEDesc &inRequestedType,
AEDesc &outPropertyDesc ) const;
The parameters for this method are:
Purpose:
Determines the Window attribute based on the received AppleEvent.
Access:
Prototype:
void GetAEWindowAttribute(Parameters:
EWindAttr inAttribute,
AEDesc &outPropertyDesc ) const;
The parameters for this method are:
Return:
Purpose:
Return the title of a Window. This is an override of GetDescriptor() in LPane.
Purpose:
Pass back the port rectangle of a Window in global coordinates.
Access:
Prototype:
void GetGlobalBounds(Parameters:
Rect &outBounds ) const;
The parameter for this method is:
Return:
Purpose:
Return Toolbox GrafPort associated with a Window object. This is an override of GetMacPort() in LPane.
Purpose:
This method gets the value of mMinMaxSize.
Access:
Prototype:
void GetMinMaxSize( Rect &outRect) const;Parameters:
The parameter for this method is:
Return:
Purpose:
This method returns the value of mStandardSize in the outStdSize parameter.
Access:
Prototype:
void GetStandardSize( SDimension16 &Parameters:
outStdSize ) const;
The parameter for this method is:
Return:
Purpose:
Convert a point from global (screen) coordinates to a Window's Port coordinates. This is an override of GlobalToPortPoint() in LPane.
Purpose:
This method handles an AppleEvent.
Access:
Prototype:
virtual void HandleAppleEvent(Parameters:
const AppleEvent &inAppleEvent,
AppleEvent &outAEReply,
AEDesc &outResult,
long inAENumber );
The parameters for this method are:
Return:
Purpose:
Respond to a click on a Window.
The inPart parameter is the part code returned by the Toolbox FindWindow routine.
Access:
Prototype:
virtual void HandleClick(Parameters:
const EventRecord &inMacEvent,
SInt16 inPart);
The parameters for this method are:
Return:
Purpose:
Checks the Window to see if it has a given attribute.
Access:
Prototype:
Boolean HasAttribute( EWindAttrParameters:
inAttribute ) const;
The parameter for this method is:
Return:
Returns true is the attribute is present, else false.
Purpose:
Window is being made invisible. This is an override of HideSelf() in LPane.
Access:
Prototype:
virtual void HideSelf();Parameters:
Return:
Purpose:
Private Initializer from data in a struct.
Access:
Prototype:
void InitWindow(Parameters:
const SWindowInfo &inWindowInfo );
The parameter for this method is:
Return:
Purpose:
This method calls InvalRect() to invalidate the port rectangle. This is an override of InvalPortRect() in LPane.
Purpose:
This method calls InvalRgn(). This is an override of InvalPortRgn() in LPane.
Purpose:
Make a new Mac Window from a WIND resource template.
Access:
Prototype:
void MakeMacWindow( SInt16 inWINDid );Parameters:
The parameter for this method is:
Return:
Purpose:
AppleEvent Object Model Support
Access:
Prototype:
virtual void MakeSelfSpecifier(Parameters:
AEDesc &inSuperSpecifier,
AEDesc &outSelfSpecifier ) const;
The parameters for this method are:
Return:
Purpose:
Access:
Prototype:
void MoveWindowBy(Parameters:
SInt16 inHorizDelta,
SInt16 inVertDelta );
The parameters for this method are:
Return:
Purpose:
Move the top left corner of the Window's port rect to the specified location in Global coordinates.
Access:
Prototype:
void MoveWindowTo(Parameters:
SInt16 inHoriz,
SInt16 inVert );
The parameters for this method are:
Return:
Purpose:
Handle a command. This is an override of ObeyCommand() in LCommander.
Purpose:
Convert a point from Port to Global (screen) coordinates. Refer to the discussion for GlobalToPortPoint() for more comments. This is an override of PortToGlobalPoint() in LPane.
Purpose:
Change the Frame size by the specified amounts. This is an override of ResizeFrameBy() in LPane.
Purpose:
Change the size of a Window by the specified number of pixels.
Access:
Prototype:
void ResizeWindowBy(Parameters:
SInt16 inWidthDelta,
SInt16 inHeightDelta );
The parameters for this method are:
Return:
Purpose:
Change the size of a Window to the specified width and height (in pixels).
Access:
Prototype:
void ResizeWindowTo( SInt16 inWidth, SInt16 inHeight );Parameters:
The parameters for this method are:
Return:
Purpose:
Brings the window to the front.
Access:
Prototype:
virtual void Resume();Parameters:
Return:
Purpose:
Access:
Prototype:
virtual void Select();Parameters:
Return:
Purpose:
AppleEvent for changing the size of a Window.
inBounds is the new port rectangle for the Window, in Global coordinates. Set inExecuteAE to true to actually resize the Window, false to just send the event for script recording purposes.
Access:
Prototype:
virtual void SendAESetBounds(Parameters:
Rect *inBounds,
Boolean inExecuteAE );
The parameters for this method are:
Return:
Purpose:
AppleEvent for moving a Window to a new position.
Access:
Prototype:
virtual void SendAESetPosition(Parameters:
Point inPosition,
Boolean inExecuteAE);
The parameters for this method are:
Return:
Remarks:
You'll use the false value for inExecuteAE when you have already moved the window
in response to tracking user actions (the Toolbox trap DragWindow moves the Window).
Purpose:
AppleEvent for zooming a Window.
This method figures out whether to zoom in or out based on the current window size and location
Access:
Prototype:
virtual void SendAESetZoom();Parameters:
Return:
Purpose:
Access:
Prototype:
virtual void SetAEProperty(Parameters:
DescType inProperty,
const AEDesc &inValue,
AEDesc& outAEReply );
The parameters for this method are:
Return:
Purpose:
Sets an attribute for the Window.
Access:
Prototype:
void SetAttribute( EWindAttr inAttribute );Parameters:
The parameter for this method is:
Return:
Purpose:
Set the title of a Window. This is an override of SetDescriptor() in LPane.
Purpose:
Specify the foreground and/or background colors of a Window. This is an override of SetForeAndBackColors() in LPane.
Purpose:
This is an accessor method for mMinMaxSize.
Access:
Prototype:
void SetMinMaxSize( const Rect &inRect );Parameters:
The parameter for this method is:
|
Return:
Purpose:
Set the standard size (mStandardSize) for the Window.
Access:
Prototype:
void SetStandardSize( SDimension16 inStdSize );Parameters:
The parameter for this method is:
|
Return:
Purpose:
Make a Window visible. This is an override of Show() in LPane.
Purpose:
Window is being made visible. This is an override of ShowSelf() in LPane.
Purpose:
This method hides the window if the windAttr_HideOnSuspend attribute is present, else it deactivates the window if it is
active and suspend occurs.
Access:
Prototype:
virtual void Suspend();Parameters:
Return:
Purpose:
Redraw invalidated area of the Window. The Mac WindowPtr maintains an update region that defines the area that needs to be redrawn. This is an override of UpdatePort() in LPane.
Purpose:
This method calls ValidRect(). This is an override of ValidPortRect() in LPane.
Purpose:
This method calls ValidRect(). This is an override of ValidPortRgn() in LPane.
Purpose:
This stores the Mac OS WindowPtr.
Access:
Prototype:
WindowPtr mMacWindowP;
Purpose:
This stores the min and max size for the Window.
Access:
Prototype:
Rect mMinMaxSize;
Purpose:
This stores the standard size for the Window.
Access:
Prototype:
SDimension16 mStandardSize;
Purpose:
This stores the user bounds Rect for the Window.
Access:
Prototype:
Rect mUserBounds;
Purpose:
This stores the attributes for the Window.
Access:
Prototype:
UInt32 mAttributes;
Purpose:
This stores the foreground color for the Window.
Access:
Prototype:
RGBColor mForeColor;
Purpose:
This stores the background color for the Window.
Access:
Prototype:
RGBColor mBackColor;
Purpose:
This stores information about zooming a Window that is at standard size, but is partially offscreen.
Access:
Prototype:
Boolean mMoveOnlyUserZoom;