[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LPane



Overview:

LPane is the fundamental visual class in PowerPlant. Every area you draw in, and everything you draw, descends from LPane. There are LPane derivative classes for text, pictures, lists, tables, controls and more.

Methods :

The methods in this class are:

 

LPane()  
~LPane()  
Activate()  
ActivateSelf()  
AdaptToNewSurroundings()  
AdaptToSuperFrameSize()  
AdaptToSuperScroll()  
AdjustCursor()  
AdjustCursorSelf()  
ApplyForeAndBackColors()  
CalcLocalFrameRect()  
CalcPortFrameRect()  
Click()  
ClickSelf()  
ClickTimesAreClose()  
Contains()  
CountPanels()  
Deactivate()  
DeactivateSelf()  
Disable()  
DisableSelf()  
DontRefresh()  
Draw()  
DrawSelf()  
Enable()  
EnableSelf()  
EventMouseUp()  
FindConstPaneByID()  
FindDeepSubPaneContaining()  
FindPaneByID()  
FindShallowSubPaneContaining()  
FindSubPaneHitBy()  
FinishCreate()  
FinishCreateSelf()  
FocusDraw()  
FocusExposed()  
GetActiveState()  
GetClickCount()  
GetDefaultView()  
GetDescriptor()  
GetEnabledState()  
GetFrameBinding()  
GetFrameLocation()  
GetFrameSize()  
GetLastPaneClicked()  
GetLastPaneMoused()  
GetLocalUpdateRgn()  
GetMacPort()  
GetPaneID()  
GetSuperView()  
GetUserCon()  
GetValue()  
GetVisibleState()  
GlobalToPortPoint()  
Hide()  
HideSelf()  
InitPane()  
InvalPortRect()  
InvalPortRgn()  
IsActive()  
IsAreaInQDSpace()  
IsEnabled()  
IsHitBy()  
IsVisible()  
LocalToPortPoint()  
MouseEnter()  
MouseLeave()  
MouseWithin()  
MoveBy()  
PlaceInSuperFrameAt()  
PlaceInSuperImageAt()  
PointIsInFrame()  
PointsAreClose()  
PortToGlobalPoint()  
PortToLocalPoint()  
PrintPanel()  
PrintPanelSelf()  
PutInside()  
Refresh()  
ResizeFrameBy()  
ResizeFrameTo()  
RestorePlace()  
SavePlace()  
ScrollToPanel()  
SetDefaultView()  
SetDescriptor()  
SetForeAndBackColors()  
SetFrameBinding()  
SetLastPaneMoused()  
SetPaneID()  
SetRefreshAllWhenResized()  
SetUserCon()  
SetValue()  
Show()  
ShowSelf()  
SuperActivate()  
SuperDeactivate()  
SuperDisable()  
SuperEnable()  
SuperHide()  
SuperPrintPanel()  
SuperShow()  
UpdateClickCount()  
UpdatePort()  
ValidPortRect()  
ValidPortRgn()  

Data Members:

The data members in this class are:

 

sDefaultView  
sLastPaneClicked  
sLastPaneMoused  
sWhenLastMouseUp  
sWhenLastMouseDown  
sWhereLastMouseDown  
sClickCount  
mPaneID  
mFrameSize  
mFrameLocation  
mFrameBinding  
mUserCon  
mSuperView  
mVisible  
mActive  
mEnabled  
mRefreshAllWhenResized  
 

Operation:

LPane is one of the central classes to the magic of PowerPlant. In order to learn how to use it effectively, you should read about it in The PowerPlant Book on your documentation CD.

Source files:

(Pane Classes)

LPane.h

LPane.cp

See also:

LAttachable

LView

LPane()

Purpose:

The constructor creates the object using the passed-in parameters.

Access:

Public

Prototype:

LPane();

LPane( const LPane &inOriginal );

LPane( const SPaneInfo &inPaneInfo );

LPane( LStream *inStream );
Parameters:

The parameters for these contructors are:

 

const LPane&  
inOriginal  
The object to copy.  
const SPaneInfo&  
inPaneInfo  
The Superpane's info.  
LStream*  
inStream  
The stream to read from.  

~LPane()

Purpose:

The destructor destroys the object.

Access:

Virtual, Public

Prototype:

virtual ~LPane();

Activate()

Purpose:

Activate a pane.

Access:

Virtual, Public

Prototype:

virtual void Activate();
Parameters:

None

Return:

None

ActivateSelf()

Purpose:

This is called when a pane is being activated. You should override this method for pane classes that change appearance when activated.

Access:

Virtual, Protected

Prototype:

virtual void ActivateSelf();
Parameters:

None

Return:

None

AdaptToNewSurroundings()

Purpose:

Adjust the state of the pane when installed in a new parent pane.

Access:

Virtual, Public

Prototype:

virtual void AdaptToNewSurroundings();
Parameters:

None

Return:

None

AdaptToSuperFrameSize()

Purpose:

Adjust the state of the pane when the size of the superview's frame changes by the specified amounts.

Access:

Virtual, Public

Prototype:

virtual void AdaptToSuperFrameSize(
SInt32 inSurrWidthDelta,
SInt32 inSurrHeightDelta,
Boolean inRefresh);
Parameters:

The parameters for this method are:

 

SInt32  
inSurrWidthDelta  
The change in width.  
SInt32  
inSurrHeightDelta  
The change in height.  
Boolean  
inRefresh  
Indicate whether to refresh or not.  

Return:

None

AdaptToSuperScroll()

Purpose:

Adjust the state of the pane when its superview scrolls by the specified amounts.

Access:

Virtual, Public

Prototype:

virtual void AdaptToSuperScroll(
SInt32 inHorizScroll,
SInt32 inVertScroll);
Parameters:

The parameters for this method are:

 

SInt32  
inHorizScroll  
The width amount to scroll.  
SInt32  
inVertScroll  
The height amount to scroll.  

Return:

None

AdjustCursor()

Purpose:

Wrapper function for setting the cursor shape.

Access:

Virtual, Public

Prototype:

virtual void AdjustCursor(
Point inPortPt,
const EventRecord &inMacEvent );
Parameters:

The parameters for this method are:

 

Point  
inPortPt  
The point in Port coordinates.  
const   EventRecord&  
inMacEvent  
The event record.  

Return:

None

AdjustCursorSelf()

Purpose:

Set the cursor shape when the cursor is inside a pane.

Access:

Virtual, Public

Prototype:

virtual void AdjustCursorSelf(
Point inPortPt,
const EventRecord& inMacEvent);
Parameters:

The parameters for this method are:

 

Point  
inPortPt  
The point in Port coordinates.  
const   EventRecord&  
inMacEvent  
The event record. Use the inMacEvent->modifiers if the cursor shape depends on whether modifier keys (such as Option) are down.  

Return:

None

ApplyForeAndBackColors()

Purpose:

Set the foreground and background colors of the current port. The pane must already be focused.

Access:

Virtual, Protected

Prototype:

virtual void ApplyForeAndBackColors() const;
Parameters:

None

Return:

None

CalcLocalFrameRect()

Purpose:

Calculate the pane's frame rectangle in local (Image) coordinates.

Access:

Virtual, Public

Prototype:

virtual Boolean CalcLocalFrameRect(
Rect &outRect ) const;
Parameters:

The parameter for this method is:

 

Rect&  
outRect  
The Rect to calculate the pane's frame rectangle from.  

Return:

Returns true if the frame is within QuickDraw space (16-bit), and returns false if the frame is outside QuickDraw space with outRect is unchanged.

CalcPortFrameRect()

Purpose:

Calculate the pane's frame rectangle in Port coordinates.

Returns true if the frame is within QuickDraw space (16-bit) Returns false if the frame is outside QuickDraw space and outRect is unchanged

Access:

Virtual, Public

Prototype:

virtual Boolean CalcPortFrameRect(
Rect &outRect ) const;
Parameters:

The parameter for this method is:

 

Rect&  
outRect  
The Rect to calculate the pane's frame rectangle from.  

Return:

Returns true if the frame is within QuickDraw space (16-bit), and returns false if the frame is outside QuickDraw space with outRect is unchanged.

Click()

Purpose:

This is a wrapper method for handling a click inside a pane.

This method does some bookkeeping, executes Attachments, then calls ClickSelf() to actually respond to the click.

Access:

Virtual, Public

Prototype:

virtual void Click(
SMouseDownEvent &inMouseDown );
Parameters:

The parameter for this method is:

 

SMouseDownEvent&  
inMouseDown  
The mouse down event.  

Return:

None

ClickSelf()

Purpose:

Respond to click inside this pane. You should override this to do something when the user clicks inside a pane.

Access:

Virtual, Public

Prototype:

virtual void ClickSelf(
const SMouseDownEvent& inMouseDown );
Parameters:

The parameter for this method is:

 

SMouseDownEvent&  
inMouseDown  
The mouse down event.  

Return:

None

ClickTimesAreClose()

Purpose:

Indicate whether the time between the specified time and the time of the last mouse down are close enough to be considered a double-click.

Access:

Virtual, Public

Prototype:

virtual Boolean ClickTimesAreClose(
UInt32 inLastClickTime ) const;
Parameters:

The parameter for this method is:

 

UInt32  
inLastClickTime  
The mouse down event.  

Return:

Returns true if a double-click, else false.

Contains()

Purpose:

Indicates whether a pane contains the specified point, which is in Port coordinates.

Note: This function just calls PointIsInFrame(), but is exists so that you can override it to change how the FindDeepSubPaneContaining() and FindShallowSubPaneContaining() search for Panes.

Access:

Virtual, Public

Prototype:

virtual Boolean Contains(
SInt32 inHorizPort,
SInt32 inVertPort ) const;
Parameters:

The parameters for this method are:

 

SInt32  
inHorizPort  
The horizontal coordinate.  
SInt32  
inVertPort  
The vertical coordinate.  

Return:

Returns true if the pane contains the point, else returns false.

CountPanels()

Purpose:

Indicate the number of horizontal and vertical panels. A panel is a "frameful" of a pane.

Access:

Virtual, Public

Prototype:

virtual void CountPanels(
UInt32 &outHorizPanels,
UInt32 &outVertPanels );
Parameters:

The parameters for this method are:

 

UInt32  
outHorizPanels  
The number of horizontal panels.  
UInt32  
outVertPanels  
The number of vertical panels.  

Return:

None

Deactivate()

Purpose:

Deactivate a pane.

Access:

Virtual, Public

Prototype:

virtual void Deactivate();
Parameters:

None

Return:

None

DeactivateSelf()

Purpose:

This is called when a pane is being deactivated. You should override this for pane classes that change appearance when deactivated.

Access:

Virtual, Protected

Prototype:

virtual void DeactivateSelf();
Parameters:

None

Return:

None

Disable()

Purpose:

Disable a pane.

Access:

Public

Prototype:

virtual void Disable();
Parameters:

None

Return:

None

DisableSelf()

Purpose:

Pane is being disabled. You should override this for pane classes that change appearance when disabled. To avoid flicker, a pane can draw immediately from this method rather than refreshing and drawing at the next update event.

Access:

Virtual, Protected

Prototype:

virtual void DisableSelf();
Parameters:

None

Return:

None

DontRefresh()

Purpose:

Validate the area occupied by a pane. This removes the pane area from the update region so that the pane won't be redrawn during the next update event.

Access:

Virtual, Public

Prototype:

virtual void DontRefresh( Boolean inOKIfHidden );
Parameters:

The parameter for this method is:

 

Boolean  
inOKIfHidden  
Specifies whether to validate even if the pane is not visible. Pass true for this parameter to suppress the automatic refresh which occurs after hiding a pane.  

Return:

None

Draw()

Purpose:

Try to draw the contents of a pane.

This is a wrapper function which calls DrawSelf() if it is proper for the pane to draw. This means that:

Virtual, Public

Prototype:

virtual void Draw( RgnHandle inSuperDrawRgnH );
Parameters:

The parameter for this method is:

 

RgnHandle  
inSuperDrawRgnH  
Specifies, in Port coordinates, the portion of the pane's superview that needs to be drawn. Specify nil to bypass the intersection test.  

Return:

None

DrawSelf()

Purpose:

This draws a box around the pane and a diagonal line from the top left to the bottom right corner using the default foreground and background colors for the pane.

On entry, the clipping region is the revealed area of the pane's superview. Therefore, it is possible for a pane to draw outside of its frame. You will not normally do this.

The port, coordinate system, and clipping region are set on entry. They must be the same upon exit. You are responsible for setting the Pen state and text characteristics to the proper values for your pane.

Access:

Virtual, Protected

Prototype:

virtual void DrawSelf();
Parameters:

None

Return:

None

Enable()

Purpose:

Enable a pane.

Access:

Virtual, Public

Prototype:

virtual void Enable();
Parameters:

None

Return:

None

EnableSelf()

Purpose:

Pane is being enabled. You should override this for pane classes that change appearance when enabled. To avoid flicker, a pane can draw immediately from this function rather than refreshing and drawing at the next update event.

Access:

Virtual, Protected

Prototype:

virtual void EnableSelf();
Parameters:

None

Return:

None

EventMouseUp()

Purpose:

Respond to a mouse up event following a click (mouse down) inside a pane.

Access:

Virtual, Public

Prototype:

virtual void EventMouseUp(
const EventRecord &inMouseUp );
Parameters:

The parameter for this method is:

 

const   EventRecord&  
inMouseUp  
The event info for the mouse up.  

Return:

None

FindConstPaneByID()

Purpose:

Find the pane of a View which has the specified ID. This method searches all Panes contained within this View, not just direct subpanes. Returns nil if pane with the target ID is not found.

Use when you only want to inspect (and not change) the pane.

Access:

Virtual, Public

Prototype:

virtual const LPane* FindConstPaneByID(
PaneIDT inPaneID ) const;
Parameters:

The parameter for this method is:

 

PaneIDT  
inPaneID  
The resource ID for the pane.  

Return:

A pointer to the pane.

FindDeepSubPaneContaining()

Purpose:

Return the most deeply nested subpane which contains the specified point, which is in Port coordinates.

Access:

Virtual, Public

Prototype:

virtual LPane* FindDeepSubPaneContaining(
SInt32 inHorizPort,
SInt32 inVertPort ) const;
Parameters:

The parameters for this method are:

 

SInt32  
inHorizPort  
The horizontal coordinate.  
SInt32  
inVertPort  
The vertical coordinate.  

Return:

Return nil if no subpane contains the point, else returns a pointer to the pane.

FindPaneByID()

Purpose:

Find the pane of a View which has the specified ID. This method searches all Panes contained within this View, not just direct subpanes.

Access:

Virtual, Public

Prototype:

virtual LPane* FindPaneByID( PaneIDT inPaneID );
Parameters:

The parameter for this method is:

 

PaneIDT  
inPaneID  
The resource ID for the pane.  

Return:

Returns nil if pane with the target ID is not found.

FindShallowSubPaneContaining()

Purpose:

Return the immediate subpane which contains the specified point, which is in Port coordinates.

Same as FindSubPaneHitBy() except that it tests using Contains() rather than IsHitBy(). Contains() does not check if the pane is enabled.

Access:

Virtual, Public

Prototype:

virtual LPane* FindShallowSubPaneContaining(
SInt32 inHorizPort,
SInt32 inVertPort ) const;
Parameters:

The parameters for this method are:

 

SInt32  
inHorizPort  
The horizontal coordinate.  
SInt32  
inVertPort  
The vertical coordinate.  

Return:

Return nil if no subpane contains the point, else returns a pointer to the pane.

FindSubPaneHitBy()

Purpose:

Find the subpane of this pane that is hit by the specified point.

Access:

Virtual, Public

Prototype:

virtual LPane* FindSubPaneHitBy(
SInt32 inHorizPort,
SInt32 inVertPort ) const;
Parameters:

The parameters for this method are:

 

SInt32  
inHorizPort  
The horizontal coordinate.  
SInt32  
inVertPort  
The vertical coordinate.  

Return:

Return nil if no subpane is hit, else return a pointer to the pane.

Remarks:

inHorizPort and inVertPort are in Port coordinates.

FinishCreate()

Purpose:

Wrapper function for FinishCreateSelf(). You will rarely want to override this function.

Subpanes are told to FinishCreateSelf before their superview. Therefore, a superview is assured that all its subpanes have finished creating when its FinishCreateSelf function gets called.

Access:

Virtual, Public

Prototype:

virtual void FinishCreate();
Parameters:

None

Return:

None

FinishCreateSelf()

Purpose:

Override this method to perform finishing touches that depend on the entire pane hierarchy being constructed.

For example, if a View wants to store a pointer to a subpane, it should override this function to call FindPaneByID() for that pane. This saves the overhead of repeatedly calling FindPaneByID() when the View wants to access that subpane. You can't do this from a constructor because subpanes are created after their superview.

Access:

Virtual, Protected

Prototype:

virtual void FinishCreateSelf();
Parameters:

None

Return:

None

FocusDraw()

Purpose:

Prepare for drawing in the pane. Throws an exception if the pane has no superview. A pane does not have its own coordinate system and clipping region.

This method relies on its superview to set the focus. Even if FocusDraw() returns false, the pane's GrafPort and clipping region of its superview will be set (unless pane has no superview)

Access:

Virtual, Public

Prototype:

virtual Boolean FocusDraw( LPane* inSubPane );
Parameters:

The parameter for this method is:

 

LPane*  
inSubPane  
The pointer to the Subpane.  

Return:

Returns true if superview is focused.

FocusExposed()

Purpose:

Prepare for drawing in the pane.

A pane is exposed when all the following conditions are true:

pane's "visible" flag is on pane has a superview superview is exposed pane's frame intersects exposed area of its superview

Since a pane does not have its own coordinate system, focusing a pane sets up the port, coordinate system, and clipping region of its superview.

Access:

Virtual, Public

Prototype:

virtual Boolean FocusExposed(
Boolean inAlwaysFocus );
Parameters:

The parameter for this method is:

 

Boolean  
inAlwaysFocus  
Specifies whether to focus the pane even if it is not exposed. pane is not focused if it is not exposed and inAlwaysFocus is false.  

Return:

Returns true if a View is exposed, meaning that it is visible and that it is revealed through the Frames of all its SuperViews.

GetActiveState()

Purpose:

Indicate the state of the pane, stored in the mActive data member.

Access:

Public

Prototype:

ETriState GetActiveState() const;
Parameters:

None

Return:

The state of the pane.

GetClickCount()

Purpose:

Indicate the value of the sClickCount data member.

Access:

Inline, Static, Public

Prototype:

static SInt16 GetClickCount();
Parameters:

None

Return:

The value of sClickCount.

GetDefaultView()

Purpose:

Returns the value of sDefaultView.

Access:

Inline, Static, Public

Prototype:

static LView* GetDefaultView();
Parameters:

None

Return:

A pointer to the LView.

GetDescriptor()

Purpose:

Returns the descriptor string for a pane.

Access:

Virtual, Public

Prototype:

virtual StringPtr GetDescriptor(
Str255 outDescriptor ) const;
Parameters:

The parameter for this method is:

 

Str255  
outDescriptor  
The descriptor string.  

Return:

A pointer to the descriptor string.

GetEnabledState()

Purpose:

Returns the value of the mEnabled data member.

Access:

Public

Prototype:

ETriState GetEnabledState() const;
Parameters:

None

Return:

Returns the value of mEnabled.

GetFrameBinding()

Purpose:

Retrieves the value of mFrameBinding.

Access:

Public

Prototype:

void GetFrameBinding(
SBooleanRect &outFrameBinding ) const;
Parameters:

The parameter for this method is:

 

SBooleanRect&  
outFrameBinding  
The frame Rect.  

Return:

None

GetFrameLocation()

Purpose:

Get the location of a pane's frame, in 32-bit Port coordinates.

Access:

Public

Prototype:

void GetFrameLocation(
SPoint32 &outLocation ) const;
Parameters:

The parameter for this method is:

 

SPoint32&  
outLocation  
The location of the frame.  

Return:

None

GetFrameSize()

Purpose:

Get the width and height, in pixels, of the frame of a pane

Access:

Public

Prototype:

void GetFrameSize(
SDimension16 &outSize ) const;
Parameters:

The parameter for this method is:

 

SDimension16&  
outSize  
The size of the frame.  

Return:

None

GetLastPaneClicked()

Purpose:

Returns the value of the sLastPaneClicked data member.

Access:

Static, Public

Prototype:

static LPane* GetLastPaneClicked();
Parameters:

None

Return:

A pointer to the last pane clicked.

GetLastPaneMoused()

Purpose:

Returns the value of the sLastPaneMoused data member.

Access:

Static, Public

Prototype:

static LPane* GetLastPaneMoused();
Parameters:

None

Return:

A pointer to the last pane moused.

GetLocalUpdateRgn()

Purpose:

Return the region being updated. The region will be empty if called outside of a Draw() operation

Access:

Virtual, Public

Prototype:

virtual RgnHandle GetLocalUpdateRgn();
Parameters:

None

Return:

A handle the the region.

Remarks:

This region is non-empty only within the scope of a Draw() operation. Call this function from a DrawSelf() function if you want to know the actual area that requires redrawing. Most of the time, you will just draw everything and let the clipping region mask out unnecessary drawing. However, if your drawing is complex, your program might run faster if you only draw the portion which is inside the update region.

GetMacPort()

Purpose:

Return the Mac OS GrafPort.

Access:

Virtual, Public

Prototype:

virtual GrafPtr GetMacPort() const;
Parameters:

None

Return:

A pointer to the Mac OS GrafPort.

GetPaneID()

Purpose:

Returns the value of the mPaneID data member.

Access:

Public

Prototype:

PaneIDT GetPaneID() const;
Parameters:

None

Return:

The value of mPaneID.

GetSuperView()

Purpose:

Returns the value of mSuperView.

Access:

Public

Prototype:

LView* GetSuperView() const;
Parameters:

None

Return:

A pointer to the LView held in mSuperView.

GetUserCon()

Purpose:

Return the value of mUserCon.

Access:

Virtual, Public

Prototype:

virtual SInt32 GetUserCon() const;
Parameters:

None

Return:

Return the value of mUserCon.

GetValue()

Purpose:

Returns the value for the pane. You should override this if you want this method to return something other than 0.

Access:

Virtual, Public

Prototype:

virtual SInt32 GetValue() const;
Parameters:

None

Return:

The pane value.

GetVisibleState()

Purpose:

Return the value of the mVisible data member.

Access:

Public

Prototype:

ETriState GetVisibleState() const;
Parameters:

None

Return:

The value of mVisible.

GlobalToPortPoint()

Purpose:

Convert a global point to a Port point.

Access:

Virtual, Public

Prototype:

virtual void GlobalToPortPoint(
Point &ioPoint ) const;
Parameters:

The parameter for this method is:

 

Point&  
ioPoint  
The Point.  

Return:

None

Hide()

Purpose:

Make a pane invisible.

Access:

Virtual, Public

Prototype:

virtual void Hide();
Parameters:

None

Return:

None

HideSelf()

Purpose:

Pane is being made invisible. You should override this method for pane classes that need to be informed when they are made invisible

Access:

Virtual, Protected

Prototype:

virtual void HideSelf();
Parameters:

None

Return:

None

InitPane()

Purpose:

Initializer for the pane.

Access:

Protected

Prototype:

void InitPane( const SPaneInfo &inPaneInfo );
Parameters:

The parameter for this method is:

 

const   SPaneInfo&  
inPaneInfo  
The Superpane info.  

Return:

None

InvalPortRect()

Purpose:

Invalidate the Port rectangle.

All rectangles and regions must be in Port coordinates.

Access:

Virtual, Public

Prototype:

virtual void InvalPortRect( const Rect *inRect );
Parameters:

The parameter for this method is:

 

const Rect *  
inRect  
The Rect.  

Return:

None

Remarks:

You should use these routines rather than the Toolbox traps InvalRect, InvalRgn, ValidRect, and ValidRgn. Those traps require that the current GrafPort be a Window. However, a pane could be in another kind of GrafPort, such as a Printer Port or GWorld, where calling one of those traps would cause a crash (when the Toolbox tries to access a nonexistant update region).

InvalPortRgn()

Purpose:

Invalidate the Port region.

Access:

Virtual, Public

Prototype:

virtual void InvalPortRgn(
RgnHandle inRgnH );
Parameters:

The parameter for this method is:

 

RgnHandle  
inRgnH  
The region handle.  

Return:

None

IsActive()

Purpose:

Indicates whether a pane is active. A pane is "active" if its active flag is on and it is visible.

Access:

Public

Prototype:

Boolean IsActive() const;
Parameters:

None

Return:

Returns true if the pane is active, else false.

IsAreaInQDSpace()

Purpose:

Indicates whether an area is inQuickDraw space.

Access:

Static, Public

Prototype:

static Boolean IsAreaInQDSpace(
SInt32 inLeft,
SInt32 inTop,
SInt16 inWidth,
SInt16 inHeight );
Parameters:

The parameters for this method are:

 

SInt32  
inLeft  
The left coordinate.  
SInt32  
inTop  
The top coordinate.  
SInt16  
inWidth  
The width.  
SInt16  
inHeight  
The height.  

Return:

Returns true if the area is in the space, else false.

IsEnabled()

Purpose:

Return whether a pane is enabled. A pane is "enabled" if its enabled flag is on and it is visible.

Access:

Public

Prototype:

Boolean IsEnabled() const;
Parameters:

None

Return:

Returns true if the pane is enabled, else returns false.

IsHitBy()

Purpose:

Indicates whether a pane is hit by the specified point, which is in Port coordinates. A pane is hit if the point is inside its frame and the pane is enabled.

Access:

Virtual, Public

Prototype:

virtual Boolean IsHitBy(
SInt32 inHorizPort,
SInt32 inVertPort );
Parameters:

The parameters for this method are:

 

SInt32  
inHorizPort  
The horizontal coordinate.  
SInt32  
inVertPort  
The vertical coordinate.  

Return:

Returns true if the pane is hit by the specified point, else returns false.

IsVisible()

Purpose:

Indicates whether a pane is visible. A pane is "visible" if its visible flag is on.

Access:

Public

Prototype:

Boolean IsVisible() const;
Parameters:

None

Return:

Returns true if the pane is visible.

LocalToPortPoint()

Purpose:

Convert point from Local to Port coordinates.

Access:

Virtual, Public

Prototype:

virtual void LocalToPortPoint( 
Point &ioPoint ) const;
Parameters:

The parameter for this method is:

 

Point &  
ioPoint  
The point to convert (conversion is in place).  

Return:

None

MouseEnter()

Purpose:

This method could be overrided to provide useful functionality when the mouse pointer enters the pane.

Access:

Virtual, Public

Prototype:

virtual void MouseEnter(
Point inPortPt,
const EventRecord& inMacEvent );
Parameters:

The parameter for this method is:

 

const   EventRecord&  
inMouseUp  
The event info for the mouse up.  

Return:

None

MouseLeave()

Purpose:

This method could be overrided to provide useful functionality when the mouse pointer leaves the pane.

Access:

Virtual, Public

Prototype:

virtual void MouseLeave();
Parameters:

None

Return:

None

MouseWithin()

Purpose:

Override this method to provide useful functionality when the mouse pointer is within the pane.

Access:

Virtual, Public

Prototype:

virtual void MouseWithin(
Point inPortPt,
const EventRecord& inMacEvent );
Parameters:

The parameters for this method are:

 

Point  
inPortPt  
The port point.  
const   EventRecord&  
inMacEvent  
The event info.  

Return:

None

MoveBy()

Purpose:

Move the location of the frame by the specified amounts. This specifies, in pixels, how far to move the frame (within its surrounding Image).

inHorizDelta and inVertDelta specify, in pixels, how far to move the frame (within its surrounding Image).

Access:

Virtual, Public

Prototype:

virtual void MoveBy(
SInt32 inHorizDelta,
SInt32 inVertDelta,
Boolean inRefresh );
Parameters:

The parameters for this method are:

 

SInt32  
inHorizDelta  
Positive horizontal deltas move to the right, negative to the left.  
SInt32  
inVertDelta  
Positive vertical deltas move down, negative up.  
Boolean  
inRefresh  
Indicates whether to refresh or not.  

Return:

None

PlaceInSuperFrameAt()

Purpose:

Place the pane at a location relative to the frame of its superview.

Access:

Public

Prototype:

void PlaceInSuperFrameAt(
SInt32 inHorizOffset,
SInt32 inVertOffset,
Boolean inRefresh);
Parameters:

The parameters for this method are:

 

SInt32  
inHorizOffset  
Specifies, in pixels, how far the left edge of the frame is from the left edge of its parent frame. Positive offsets are to the left, negative to the right.  
SInt32  
inVertOffset  
Specifies, in pixels, how far the top edge of the frame is from the top edge of its parent frame. Positive offsets are below, negative above.  
Boolean  
inRefresh  
This value is passed to MoveBy().  

Return:

None

PlaceInSuperImageAt()

Purpose:

Place the pane within the Image of its superview.

Access:

Virtual, Public

Prototype:

virtual void PlaceInSuperImageAt(
SInt32 inHorizOffset,
SInt32 inVertOffset,
Boolean inRefresh );
Parameters:

The parameters for this method are:

 

SInt32  
inHorizOffset  
Specify the distance of the top left of the frame from the top left of the Image of its superview.  
SInt32  
inVertOffset  
Specify the distance of the top left of the frame from the top left of the Image of its superview.  
Boolean  
inRefresh  
This value is passed to MoveBy().  

Return:

None

PointIsInFrame()

Purpose:

This method determines whether a given coordinate is within the perimeter of the button.

Access:

Virtual, Public

Prototype:

virtual Boolean PointIsInFrame( SInt32 inHoriz,
SInt32 inVert ) const;
Parameters:

This method has the following parameters:

 

SInt32  
inHoriz  
The horizontal coordinate  
SInt32  
inVert  
The vertical coordinate  

Return:

Boolean of true if the point is within the perimeter, false otherwise.

PointsAreClose()

Purpose:

Return whether the two points are close enough to be part of a multi-click. Points are in Local coordinates.

Access:

Virtual, Public

Prototype:

virtual Boolean PointsAreClose(
Point inFirstPt,
Point inSecondPt ) const;
Parameters:

This method has the following parameters:

 

Point  
inFirstPt  
The first point.  
Point  
inSecondPt  
The second point.  

Return:

Returns true if the points are close enough to be a multi-click, else false.

PortToGlobalPoint()

Purpose:

Convert a point to global coordinates.

Access:

Virtual, Public

Prototype:

virtual void PortToGlobalPoint(
Point &ioPoint ) const;
Parameters:

The parameter for this method is:

 

Point&  
ioPoint  
The point to convert.  

Return:

None

PortToLocalPoint()

Purpose:

Convert point from Port to Local coordinates.

Access:

Virtual, Public

Prototype:

virtual void PortToLocalPoint(
Point &ioPoint ) const;
Parameters:

The parameter for this method is:

 

Point&  
ioPoint  
The point to convert.  

Return:

None

PrintPanel()

Purpose:

Try to print a panel of a pane. Since a pane does not scroll, it just prints itself for every panel.

This is a wrapper function which calls PrintPanelSelf() if it is proper for the pane to print. This means that:

pane is visible pane's frame is in QuickDraw space pane's frame intersects inSuperDrawRgnH pane can be focused Access:

Virtual, Public

Prototype:

virtual void PrintPanel(
const PanelSpec &inPanel,
RgnHandle inSuperPrintRgnH );
Parameters:

The parameters for this method are:

 

const   PanelSpec&  
inPanel  
The panel info.  
RgnHandle  
inSuperPrintRgnH  
Specifies, in Port coordinates, the portion of the pane's superview that needs to be printed. Specify nil to bypass the intersection test.  

Return:

None

PrintPanelSelf()

Purpose:

Print a panel of a pane.

Access:

VIrtual, Public

Prototype:

virtual void PrintPanelSelf(
const PanelSpec& inPanel);
Parameters:

The parameter for this method is:

 

const   PanelSpec&  
inPanel  
The panel info.  

Return:

None

PutInside()

Purpose:

Put pane inside the specified View. Location is unspecified.

InitPane() calls PutInside() with inOrient set to false since the pane is not fully constructed at that point, meaning that any functions called by OrientSubPane() will be the ones for LPane, and not any overrides. This may result in the pane not being properly oriented. After creating a pane, you should call FinishCreate(), which will call OrientSubPane() for the fully constructed pane object.

Access:

Public

Prototype:

void PutInside( LView *inView, Boolean inOrient );
Parameters:

The parameters for this method are:

 

Boolean  
inOrient  
Specifies whether or not to orient the pane within its new superview. The default value is true, which is what you'll normally want.  
LView*  
inView  
The pointer to the View.  

Return:

None

Refresh()

Purpose:

Invalidate the area occupied by a pane. This forces an update event that, when processed, will redraw the pane. This method does nothing if the pane is not exposed.

Access:

Public

Prototype:

virtual void Refresh();
Parameters:

None

Return:

None

ResizeFrameBy()

Purpose:

Change the frame size by the specified amounts.

inWidthDelta and inHeightDelta specify, in pixels, how much larger to make the frame. Positive deltas increase the size, negative deltas reduce the size.

Access:

Virtual, Public

Prototype:

virtual void ResizeFrameBy(
SInt16 inWidthDelta,
SInt16 inHeightDelta,
Boolean inRefresh );
Parameters:

The parameters for this method are:

 

SInt32  
inWidthDelta  
The width change.  
SInt32  
inHeightDelta  
The height change.  
Boolean  
inRefresh  
Indicates whether to refresh or not.  

Return:

None

Remarks:

Note that this function only changes the frame size, not the bounds of any enclosing view. To change the actual size (on screen) of an LWindow object, call ResizeWindowBy() or ResizeWindowTo().

ResizeFrameTo()

Purpose:

Set the dimensions of the frame.

inWidthDelta and inHeightDelta specify, in pixels, how much larger to make the frame. Positive deltas increase the size, negative deltas reduce the size.

Access:

Public

Prototype:

void ResizeFrameTo(
SInt16 inWidth,
SInt16 inHeight,
Boolean inRefresh );
Parameters:

The parameters for this method are:

 

SInt16  
inWidth  
The horizontal width change to resize the window by.  
SInt16  
inHeight  
The vertical height change to resize the window by.  
Boolean  
inRefresh  
Indicates whether to refresh or not.  

Return:

None

RestorePlace()

Purpose:

Read size and location information stored in a Stream by the SavePlace() function

Access:

Virtual, Public

Prototype:

virtual void RestorePlace( LStream *inPlace );
Parameters:

The parameter for this method is:

 

LStream*  
inPlace  
The stream to read from.  

Return:

None

SavePlace()

Purpose:

Write size and location information to a Stream for later retrieval by the RestorePlace() function.

Access:

Virtual, Public

Prototype:

virtual void SavePlace( LStream *outPlace );
Parameters:

The parameter for this method is:

 

LStream*  
outPlace  
The stream to write to.  

Return:

None

ScrollToPanel()

Purpose:

Scroll pane to the specified panel. Panes do not scroll, so just return true indicating that the panel is always valid

Access:

Virtual, Public

Prototype:

virtual Boolean ScrollToPanel(
const PanelSpec &inPanel );
Parameters:

The parameter for this method is:

 

const   PanelSpec&  
inPanel  
The panel info.  

Return:

Return whether the specified panel exists. If it doesn't, View is not scrolled.

SetDefaultView()

Purpose:

Return the value of the sDefaultView data member.

Access:

Static, Public

Prototype:

static void SetDefaultView( LView *inView);
Parameters:

None

Return:

Return the value of the sDefaultView.

SetDescriptor()

Purpose:

Set the descriptor string.

Access:

Virtual, Public

Prototype:

virtual void SetDescriptor( 
ConstStringPtr inDescriptor );
Parameters:

The parameter for this method is:

 

ConstStringPtr  
inDescriptor  
The string pointer to set for the descriptor.  

Return:

None

SetForeAndBackColors()

Purpose:

Specify the foreground and/or background colors of a Window. Specify nil for inForeColor and/or inBackColor to leave that color trait unchanged

Access:

Virtual, Public

Prototype:

virtual void SetForeAndBackColors(
const RGBColor *inForeColor,
const RGBColor *inBackColor );
Parameters:

The parameters for this method are:

 

const   RGBColor*  
inForeColor  
The foreground color.  
const   RGBColor*  
inBackColor  
The background color.  

Return:

None

SetFrameBinding()

Purpose:

This method sets the value of the mFrameBinding data member.

Access:

Public

Prototype:

void SetFrameBinding(
const SBooleanRect &inFrameBinding );
Parameters:

The parameter for this method is:

 

const   SBooleanRect &  
inFrameBinding  
The rect for the frame.  

Return:

None

SetLastPaneMoused()

Purpose:

This data member sets the value of the sLastPaneMoused data member.

Access:

Static, Public

Prototype:

static void SetLastPaneMoused( LPane *inPane );
Parameters:

The parameter for this method is:

 

LPane*  
inPane  
The rect for the frame.  

Return:

None

SetPaneID()

Purpose:

Set the value of the mPaneID data member.

Access:

Public

Prototype:

void SetPaneID( PaneIDT inPaneID );
Parameters:

The parameter for this method is:

 

PaneIDT  
inPaneID  
The resource ID for the pane.  

Return:

None

SetRefreshAllWhenResized()

Purpose:

This method sets the value of the mRefreshAllWhenResized data member.

Access:

Public

Prototype:

void SetRefreshAllWhenResized( 
Boolean inRefreshAll );
Parameters:

The parameter for this method is:

 

Boolean  
inRefreshAll  
Whether to refresh all panes when resized.  

Return:

None

SetUserCon()

Purpose:

Set the mUserCon data member.

Access:

Virtual, Public

Prototype:

virtual void SetUserCon( SInt32 inUserCon );
Parameters:

The parameter for this method is:

 

SInt32  
inUserCon  
The value to set for the data member.  

Return:

None

SetValue()

Purpose:

Override this method to provide useful functionality for setting the value of a pane.

Access:

Virtual, Public

Prototype:

virtual void SetValue( SInt32 inValue );
Parameters:

The parameter for this method is:

 

SInt32  
inValue  
The value to set.  

Return:

None

Show()

Purpose:

Make a pane visible.

Access:

Virtual, Public

Prototype:

virtual void Show();
Parameters:

None

Return:

None

ShowSelf()

Purpose:

Pane is being made visible. You should override this method for pane classes that need to be informed when they are made visible.

Access:

Virtual, Protected

Prototype:

virtual void ShowSelf();
Parameters:

None

Return:

None

SuperActivate()

Purpose:

The superview of a pane has been activated.

Access:

Virtual, Protected

Prototype:

virtual void SuperActivate();
Parameters:

None

Return:

None

SuperDeactivate()

Purpose:

The superview of a pane has been deactivated.

Access:

Virtual, Protected

Prototype:

virtual void SuperDeactivate();
Parameters:

None

Return:

None

SuperDisable()

Purpose:

The superview of a pane has been disabled.

Access:

Virtual, Protected

Prototype:

virtual void SuperDisable();
Parameters:

None

Return:

None

SuperEnable()

Purpose:

The superview of a pane has been enabled.

Access:

Virtual, Protected

Prototype:

virtual void SuperEnable();
Parameters:

None

Return:

None

SuperHide()

Purpose:

The superview of a pane has been hidden.

Access:

Virtual, Protected

Prototype:

virtual void SuperHide();
Parameters:

None

Return:

None

SuperPrintPanel()

Purpose:

superview is printing a panel. The View is not in control of pagination. In general, it is not clear how to print nested scrolling views. This function just prints the View at its current location, without scrolling to a particular panel.

Access:

Virtual, Public

Prototype:

virtual void SuperPrintPanel(
const PanelSpec &inSuperPanel,
RgnHandle inSuperPrintRgnH );
Parameters:

The parameters for this method are:

 

const   PanelSpec&  
inSuperPanel  
The panel info.  
RgnHandle  
inSuperPrintRgnH  
Specifies, in Port coordinates, the portion of the pane's superview that needs to be printed. Specify nil to bypass the intersection test.  

Return:

None

SuperShow()

Purpose:

The superview of a pane has become visible.

Access:

Virtual, Protected

Prototype:

virtual void SuperShow();
Parameters:

None

Return:

None

UpdateClickCount()

Purpose:

Determine if the mouse down is part of a multi-click and set internal counters.

Access:

Virtual, Public

Prototype:

virtual void UpdateClickCount(
const SMouseDownEvent &inMouseDown );
Parameters:

The parameter for this method is:

 

const   EventRecord&  
inMouseDown  
The event info.  

Return:

None

UpdatePort()

Purpose:

Redraw invalidated area of the Port containing the pane.

For Panes that are in a Window Port (i.e., the ultimate super view is a Window), this forces an immediate redraw of the update region of the Window. Since this message is really directed at the Port containing the pane (rather than the pane itself), the update occurs even if the pane is not visible.

Panes that maintain a Mac GrafPort must override this function if they support updating.

Access:

Virtual, Public

Prototype:

virtual void UpdatePort();
Parameters:

None

Return:

None

ValidPortRect()

Purpose:

Sets the port rect.

Access:

Virtual, Public

Prototype:

virtual void ValidPortRect( const Rect *inRect );
Parameters:

The parameter for this method is:

 

const Rect*  
inRect  
The Rect.  

Return:

None

ValidPortRgn()

Purpose:

Sets the port region.

Access:

Virtual, Public

Prototype:

virtual void ValidPortRgn( RgnHandle inRgnH );
Parameters:

The parameter for this method is:

 

RgnHandle  
inRgnH  
The region handle.  

Return:

None

sDefaultView

Purpose:

The default view pointer storage.

Access:

Static, Protected

Prototype:

static LView *sDefaultView;

sLastPaneClicked

Purpose:

The storage for the last pane clicked.

Access:

Static, Protected

Prototype:

static LPane *sLastPaneClicked;

sLastPaneMoused

Purpose:

The storage for the last pane moused.

Access:

Static, Protected

Prototype:

static LPane *sLastPaneMoused;

sWhenLastMouseUp

Purpose:

Storage for when the last mouse up occurred.

Access:

Static, Protected

Prototype:

static UInt32 sWhenLastMouseUp

sWhenLastMouseDown

Purpose:

Storage for when the last mouse down occurred.

Access:

Static, Protected

Prototype:

static UInt32 sWhenLastMouseDown;

sWhereLastMouseDown

Purpose:

Storage for where the last mouse down occurred.

Access:

Static, Protected

Prototype:

static Point sWhereLastMouseDown;

sClickCount

Purpose:

Storage for the click count.

Access:

Static, Protected

Prototype:

static SInt16 sClickCount;

mPaneID

Purpose:

The storage for the pane ID.

Access:

Protected

Prototype:

PaneIDT mPaneID;

mFrameSize

Purpose:

The storage for the frame size.

Access:

Protected

Prototype:

SDimension16 mFrameSize;

mFrameLocation

Purpose:

Storage for the frame location.

Access:

Protected

Prototype:

SPoint32 mFrameLocation;

mFrameBinding

Purpose:

Storage for the frame binding.

Access:

Protected

Prototype:

SBooleanRect mFrameBinding;

mUserCon

Purpose:

Storage for the UserCon storage area.

Access:

Protected

Prototype:

SInt32 mUserCon;

mSuperView

Purpose:

Storage for the superview.

Access:

Protected

Prototype:

LView *mSuperView;

mVisible

Purpose:

Storage for whether the pane is visible or not.

Access:

Protected

Prototype:

ETriState mVisible;

mActive

Purpose:

This is storage for whether the pane is active or not.

Access:

Protected

Prototype:

ETriState mActive;

mEnabled

Purpose:

This is storage for whether the pane is enabled or not.

Access:

Protected

Prototype:

ETriState mEnabled;

mRefreshAllWhenResized

Purpose:

Storage for whether to resize all when the pane is resized.

Access:

Protected

Prototype:

Boolean mRefreshAllWhenResized;

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000