@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
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
Event Stubs
XGView::DoActivate
XGView::DoDrawView
XGView::DoEnable
XGView::DoMouseDown
XGView::DoMouseMove
XGView::DoMouseUp
XGView::DoMoveView
XGView::DoShowHide
XGView::DoSizeView
Focus
View Attributes
XGView::DisableView
XGView::EnableView
XGView::GetTitle
XGView::HideView
XGView::IsActive
XGView::IsEnabled
XGView::IsVisible
XGView::SetTitle
XGView::ShowView
Drawing Support
Scroll Support
View Management
XGView::FindClick
XGView::ProcessActivate
XGView::ProcessDraw
OS Support
Construction/Destruction
Usage: XGView::XGView(XGOwner*parent,XGArgStream&init):XGOwner(parent)
Construct the XGView object.
Usage: XGView::XGView(XGOwner*parent,XGSViewInitRecord&i):XGOwner(parent)
Construct the XGView object from the XGSViewInitRecord
Usage: XGView::~XGView()
Delete me. Deletes my children
View status
Usage: long GetRefNum()const
Returns the application reference value
Usage: short GetViewID()const
Get the view ID of this view
Usage: long GetViewType()const
Get the view type of this view
Usage: bool IsTabStop()const
Returns the tab stop status of this view
Usage: void SetRefNum(long x)
Sets the application reference value
View hierarchy
Usage: XGView*XGView::FindAfterView(short vid)
Find the first view in the list of views after this ID
Usage: XGView*XGView::FindBeforeView(short vid)
Find the first view in the list of views
Usage: XGView*XGView::FindFirstView()
Find the first view in the list of views
Usage: XGView*XGView::FindLastView()
Find the first view in the list of views
Usage: XGView*XGView::FindNextView()
Find the next view; this finds the view after this one in the overall hierarchy
Usage: XGView*XGView::FindViewByAccel(char accel)
Find the view with the specified accelerator
Usage: XGView*XGView::FindViewByID(short index)
Find the specified view by it's identifier
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
Usage: XGView*GetChild()const
Get the first child of this view
Usage: XGView*GetParent()const
Get the parent of this view
Usage: XGView*GetSibling()const
Gets the sibling of this view
View location
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
Usage: Rect XGView::CalcChildPos(XGView*child)
This automatically calculates the position of this particular child inside of it's parent.
Usage: void XGView::CalcPos(void)
Calculate the position of the children views. This recurses down, moving the children around as well.
Usage: Rect XGView::GetContentRect()const
Get the content rectangle for this view
Usage: Point GetPos()const
Gets the position of this view in the parent view
Usage: Point GetSize()const
Gets the size of this view
Usage: void GlobalToView(Point*p)const
Converts point from global to view coordinates
Usage: void GlobalToView(Rect*r)const
Converts rectangle from global to view coordinates
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.
Usage: void ViewToGlobal(Point*p)const
Converts the point from view to global coordinates
Usage: void ViewToGlobal(Rect*r)const
Converts rectangle from view to global coordinates
Universal Internal Support
Usage: void XGEditText::GetSelect(short*s,short*e)
Get the current selection range
Usage: void XGEditText::SetSelect(short s,short e)
Set the current selection
Event Stubs
Usage: void XGView::DoActivate(bool)
Called by YAAF when this view needs to be activated or deactivated. By default does nothing.
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
Usage: void XGView::DoEnable()
Sent when the view is enabled or disabled
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.
Usage: void XGView::DoMouseMove(Point,short)
Process mouse move. Sets the cursor to the arrow cursor
Usage: void XGView::DoMouseUp(Point,short)
Process mouse up. Does nothing
Usage: void XGView::DoMoveView()
Event sent when the view is moved. Does nothing
Usage: void XGView::DoShowHide()
When the view is either shown or hidden, this is sent
Usage: void XGView::DoSizeView()
Event sent when the view is resized. Does nothing
Focus
Usage: bool XGView::SetFocus(void)
Set the focus. This overrides stuff on Windows by setting the MS Window focus as well.
View Attributes
Usage: void XGView::DisableView()
Disable this view.
Usage: void XGView::EnableView()
Enable this view. If the view is not enabled, this will enable the view
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
Usage: void XGView::HideView()
This hides the view. If the view is shown, this sends the 'showide' message and hides the view
Usage: bool XGView::IsActive()const
Am I an active view?
Usage: bool XGView::IsEnabled()const
Is this view enabled? Only if the parent is also enabled
Usage: bool XGView::IsVisible()const
Is this view visible? Only if the parent is also visible
Usage: void XGView::SetTitle(const char*)
Set the title. This should never be called
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
Usage: void XGView::InvalView(Rect*r)
This invalidates the drawing area where this view appears.
Usage: void XGView::UpdateView()
This forces this view to be updated _right_ _now_
Usage: void XGView::ValidView(Rect*r)
This validates the drawing area.
Scroll Support
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.
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
Usage: XGView*XGView::FindClick(Point where)
Find the view to send this click event. This skips disabled and invisible views
Usage: void XGView::ProcessActivate(bool active)
Run through and activate or deactivate all the views
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
Usage: bool XGView::Is72DPI()
Return true if this is 72 DPI, and false if this is higher.
###FIX ME