class XGView

@D"XGDispatch" @D"XGOwner" @H"XView.h" @I

This is the base class for defining a view object. This is the root of all of my drawing handling and processing.

This is the workhorse class; this class handles encapsulating the drawing subviews that I can draw into. How this is handled differs between the Macintosh and Windows; the essence of this, however, is that this class only specifies the boundary of the view--the drawing is mediated by the XGDraw code.

On all platforms this only contains the geometry of the area that the view covers. This is a departure on Windows and X Windows where separate child windows are used instead.


Construction/Destruction

XGView::XGView
XGView::XGView
XGView::~XGView

View status

XGView::GetRefNum
XGView::GetViewID
XGView::GetViewType
XGView::IsTabStop
XGView::SetRefNum

View hierarchy

XGView::FindAfterView
XGView::FindBeforeView
XGView::FindFirstView
XGView::FindLastView
XGView::FindNextView
XGView::FindViewByAccel
XGView::FindViewByID
XGView::FindViewByPoint
XGView::GetChild
XGView::GetParent
XGView::GetSibling

View location

XGView::CalcAutoLocate
XGView::CalcChildPos
XGView::CalcPos
XGView::GetContentRect
XGView::GetPos
XGView::GetSize
XGView::GlobalToView
XGView::GlobalToView
XGView::SetLocation
XGView::ViewToGlobal
XGView::ViewToGlobal

Universal Internal Support

XGView::GetSelect
XGView::SetSelect

Event Stubs

XGView::DoActivate
XGView::DoDrawView
XGView::DoEnable
XGView::DoMouseDown
XGView::DoMouseMove
XGView::DoMouseUp
XGView::DoMoveView
XGView::DoShowHide
XGView::DoSizeView

Focus

XGView::SetFocus

View Attributes

XGView::DisableView
XGView::EnableView
XGView::GetTitle
XGView::HideView
XGView::IsActive
XGView::IsEnabled
XGView::IsVisible
XGView::SetTitle
XGView::ShowView

Drawing Support

XGView::InvalView
XGView::UpdateView
XGView::ValidView

Scroll Support

XGView::Scroll
XGView::ScrollView

View Management

XGView::FindClick
XGView::ProcessActivate
XGView::ProcessDraw

OS Support

XGView::Is72DPI


Construction/Destruction

XGView::XGView

Usage: XGView::XGView(XGOwner*parent,XGArgStream&init):XGOwner(parent)

Construct the XGView object.

XGView::XGView

Usage: XGView::XGView(XGOwner*parent,XGSViewInitRecord&i):XGOwner(parent)

Construct the XGView object from the XGSViewInitRecord

XGView::~XGView

Usage: XGView::~XGView()

Delete me. Deletes my children

View status

XGView::GetRefNum

Usage: long GetRefNum()const

Returns the application reference value

XGView::GetViewID

Usage: short GetViewID()const

Get the view ID of this view

XGView::GetViewType

Usage: long GetViewType()const

Get the view type of this view

XGView::IsTabStop

Usage: bool IsTabStop()const

Returns the tab stop status of this view

XGView::SetRefNum

Usage: void SetRefNum(long x)

Sets the application reference value

View hierarchy

XGView::FindAfterView

Usage: XGView*XGView::FindAfterView(short vid)

Find the first view in the list of views after this ID

XGView::FindBeforeView

Usage: XGView*XGView::FindBeforeView(short vid)

Find the first view in the list of views

XGView::FindFirstView

Usage: XGView*XGView::FindFirstView()

Find the first view in the list of views

XGView::FindLastView

Usage: XGView*XGView::FindLastView()

Find the first view in the list of views

XGView::FindNextView

Usage: XGView*XGView::FindNextView()

Find the next view; this finds the view after this one in the overall hierarchy

XGView::FindViewByAccel

Usage: XGView*XGView::FindViewByAccel(char accel)

Find the view with the specified accelerator

XGView::FindViewByID

Usage: XGView*XGView::FindViewByID(short index)

Find the specified view by it's identifier

XGView::FindViewByPoint

Usage: XGView*XGView::FindViewByPoint(Point where,bool recurse)

Find the specified view by it's location. Find the view which contains this rectangle. Note: This stops at invisible views, but searches enabled views

XGView::GetChild

Usage: XGView*GetChild()const

Get the first child of this view

XGView::GetParent

Usage: XGView*GetParent()const

Get the parent of this view

XGView::GetSibling

Usage: XGView*GetSibling()const

Gets the sibling of this view

View location

XGView::CalcAutoLocate

Usage: Rect XGView::CalcAutoLocate(Rect r)

Given the parameters for how this view should be locked to my parent's view, this calculates the various location parameters

XGView::CalcChildPos

Usage: Rect XGView::CalcChildPos(XGView*child)

This automatically calculates the position of this particular child inside of it's parent.

XGView::CalcPos

Usage: void XGView::CalcPos(void)

Calculate the position of the children views. This recurses down, moving the children around as well.

XGView::GetContentRect

Usage: Rect XGView::GetContentRect()const

Get the content rectangle for this view

XGView::GetPos

Usage: Point GetPos()const

Gets the position of this view in the parent view

XGView::GetSize

Usage: Point GetSize()const

Gets the size of this view

XGView::GlobalToView

Usage: void GlobalToView(Point*p)const

Converts point from global to view coordinates

XGView::GlobalToView

Usage: void GlobalToView(Rect*r)const

Converts rectangle from global to view coordinates

XGView::SetLocation

Usage: void XGView::SetLocation(Rect r)

Set the location of this thing within my parent's content area. This will invalidate the rectangle areas where the location was.

XGView::ViewToGlobal

Usage: void ViewToGlobal(Point*p)const

Converts the point from view to global coordinates

XGView::ViewToGlobal

Usage: void ViewToGlobal(Rect*r)const

Converts rectangle from view to global coordinates

Universal Internal Support

XGView::GetSelect

Usage: void XGEditText::GetSelect(short*s,short*e)

Get the current selection range

XGView::SetSelect

Usage: void XGEditText::SetSelect(short s,short e)

Set the current selection

Event Stubs

XGView::DoActivate

Usage: void XGView::DoActivate(bool)

Called by YAAF when this view needs to be activated or deactivated. By default does nothing.

XGView::DoDrawView

Usage: void XGView::DoDrawView(Rect)

This method is called by YAAF when this view needs to be redawn. By default this draws a debugging rectangle

XGView::DoEnable

Usage: void XGView::DoEnable()

Sent when the view is enabled or disabled

XGView::DoMouseDown

Usage: bool XGView::DoMouseDown(Point,short)

Called by YAAF when the mouse is clicked in this view. By default this returns 'false'. Return 'true' if your view needs to capture the mouse for a click/drag cycle.

XGView::DoMouseMove

Usage: void XGView::DoMouseMove(Point,short)

Process mouse move. Sets the cursor to the arrow cursor

XGView::DoMouseUp

Usage: void XGView::DoMouseUp(Point,short)

Process mouse up. Does nothing

XGView::DoMoveView

Usage: void XGView::DoMoveView()

Event sent when the view is moved. Does nothing

XGView::DoShowHide

Usage: void XGView::DoShowHide()

When the view is either shown or hidden, this is sent

XGView::DoSizeView

Usage: void XGView::DoSizeView()

Event sent when the view is resized. Does nothing

Focus

XGView::SetFocus

Usage: bool XGView::SetFocus(void)

Set the focus. This overrides stuff on Windows by setting the MS Window focus as well.

View Attributes

XGView::DisableView

Usage: void XGView::DisableView()

Disable this view.

XGView::EnableView

Usage: void XGView::EnableView()

Enable this view. If the view is not enabled, this will enable the view

XGView::GetTitle

Usage: void XGView::GetTitle(char*c)const

Get the title of this view. By default returns an empty string. This is necessary for '&' processing for dialogs

XGView::HideView

Usage: void XGView::HideView()

This hides the view. If the view is shown, this sends the 'showide' message and hides the view

XGView::IsActive

Usage: bool XGView::IsActive()const

Am I an active view?

XGView::IsEnabled

Usage: bool XGView::IsEnabled()const

Is this view enabled? Only if the parent is also enabled

XGView::IsVisible

Usage: bool XGView::IsVisible()const

Is this view visible? Only if the parent is also visible

XGView::SetTitle

Usage: void XGView::SetTitle(const char*)

Set the title. This should never be called

XGView::ShowView

Usage: void XGView::ShowView()

This shows the view. If the view is hidden, this sends the 'showhide' message and then shows the view

Drawing Support

XGView::InvalView

Usage: void XGView::InvalView(Rect*r)

This invalidates the drawing area where this view appears.

XGView::UpdateView

Usage: void XGView::UpdateView()

This forces this view to be updated _right_ _now_

XGView::ValidView

Usage: void XGView::ValidView(Rect*r)

This validates the drawing area.

Scroll Support

XGView::Scroll

Usage: void XGView::Scroll(long x,long y)

This is the method which is called when it's time to scroll this thing, such as processing scrollbar messages. By default, this scrolls the entire thing.

XGView::ScrollView

Usage: void XGView::ScrollView(long x,long y,Rect*r)

This handles the scrolling view itself. This is a bit tricky, given the various operating systems this thing can be hosted on. Basically, I can scroll the bits in this view without having a drawing context open to this view. This is accomplished with various black magic incantations.

View Management

XGView::FindClick

Usage: XGView*XGView::FindClick(Point where)

Find the view to send this click event. This skips disabled and invisible views

XGView::ProcessActivate

Usage: void XGView::ProcessActivate(bool active)

Run through and activate or deactivate all the views

XGView::ProcessDraw

Usage: void XGView::ProcessDraw(Rect ginval)

Process drawing command. This runs through all of the views that are inside of me and passes the appropriate command

OS Support

XGView::Is72DPI

Usage: bool XGView::Is72DPI()

Return true if this is 72 DPI, and false if this is higher.

###FIX ME