Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_View_Imp Class Reference
[UI]

MacOS implementation of the CP_View class. More...

Inheritance diagram for CP_View_Imp:

CP_M_Persist CP_M_CommandHandler CP_M_DragSource CP_M_DragTarget CP_Object CP_SigSlot::CP_SlotObject CP_NoCopy CP_View CP_BackgroundView CP_FocusBorder CP_LittleArrowsEditBuddy CP_OpenGLView CP_PlatformControl CP_PrintView CP_QT_MovieView CP_ScrollableView CP_Scroller CP_SelectColorButton CP_Splitter CP_TextView CP_Toolbar CP_Window_Imp CP_Window_Imp CP_Window_Imp List of all members.

Setters

void SetCommandID (UInt32 inCommandID)
virtual void SetLocation (const CP_Point &inLocation)
virtual void SetSize (const CP_Size &inSize)
virtual void SetPortBounds (const CP_Rect &inBounds)

Superview

virtual void AddSubview (CP_View *inView)
void AdjustToSuperview (CP_View *inView)

Testers

virtual bool IsVisible () const
virtual bool IsActive () const
virtual bool IsEnabled () const
bool ContainsPoint (const CP_Point &inPortPoint)

Frame

virtual void HandleBoundsChanged (const CP_Rect &, const CP_Rect &)
virtual void OnBoundsChanged (const CP_Rect &inPreviousBounds, const CP_Rect &inNewBounds)

Initialization

virtual void OnInitPersist (CP_View *inSuperview, CP_DataValueList &inDataValueList)
virtual void OnFinishPersist ()

Drag Target

virtual void OnDragEnter (CP_DragDrop &inDragDrop, bool inDragHasLeftSender)
virtual void OnDragLeave (CP_DragDrop &inDragDrop)
virtual void OnDragTrack (CP_DragDrop &inDragDrop)
static CP_M_DragTargetFindDragTarget (OSWindow inOSWindow, CP_Point &inMouseLocation, CP_DragDrop &inDragDrop)

Public Member Functions

CP_ViewBackgroundGetViewBackground ()
void SetViewBackground (CP_ViewBackground *inViewBackground)
virtual CP_RGBColor GetBackColor ()
virtual void HandleMouseDown (CP_Event_Base &inEvent)
virtual void HandleMouseUp (CP_Event_Base &inEvent)
void SetID (FourCharCode inIdentifier)
FourCharCode GetID ()
void RegisterSignal (const CP_SignalHolder &inSignal)
CP_DataValueSignalFindSignal (const CP_String &inSignalName)
UInt32 GetNumberSignals ()
CP_String GetNthSignalName (UInt32 inSignalIndex)
void RegisterSlot (const CP_SlotHolder &inSlot)
CP_DataValueSlot FindSlot (const CP_String &inSlotName)
UInt32 GetNumberSlots ()
CP_String GetNthSlotName (UInt32 inSlotIndex)
template<class R, class P1, class P2>
CP_CommandHandlerSignalConnect (CPLAT::CP_CommandNo cmd, void(R::*handler)(P1, P2), SInt32 mode)
template<class R, class P1, class P2>
void Connect (CP_Object *control, const CPLAT::CP_String &signalName, void(R::*handler)(P1, P2))
void disconnect_all ()
void signal_connect (CP_Signal *inSender)
void signal_disconnect (CP_Signal *inSender)
void ClearFlavors ()
virtual void OnDragEnter (LPDATAOBJECT pIDataSource, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
virtual void OnDragLeave ()
void SetTargetWindow (OSWindow inWindow)
virtual void OnDragOver (DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
virtual void OnDrop (LPDATAOBJECT pIDataSource, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
CP_Point GetDropPoint ()
Constructor / Destructor
virtual ~CP_View_Imp () throw ()
 Destructor.
Appearance
virtual void Show ()
virtual void Hide ()
virtual void Activate ()
virtual void Deactivate ()
virtual void Enable ()
virtual void Disable ()

Static Public Member Functions

static void Connect (CP_Object *sender, const CP_String &signalName, CP_Object *receiver, const CP_String &slotName, const bool reciprocal=false)
static void Connect (CP_Object *sender, CP_Object *receiver, const bool reciprocal=false, const CP_String &signalName=kCP_Signal_ValueChanged, const CP_String &slotName=kCP_Slot_SetValue)

Protected Member Functions

virtual void HandleControlColor (CP_Event_Base &inEvent)
virtual bool OnCanAcceptDrag (UInt32 inItem, CP_DragDrop &inDragDrop)=0
virtual bool PtInDropArea (CP_Point &inGlobalPoint)
virtual bool OnCanAcceptDragWin (LPDATAOBJECT pIDataSource, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
Constructor / Destructor
 CP_View_Imp ()
 Constructor.
 CP_View_Imp (CP_View *inSuperview, const CP_Point &inUpperLeft, const CP_Size &inContentSize, bool inCreateImp=false, UInt32 inFlags=CP_E_ViewFlags_None)

Protected Attributes

CP_View_Imp_BasefViewImpBase
CP_EventHandler fDummyEventHandler
UInt32 fCommandID
CP_SmartPtr< CP_FrameAdapterfFrameAdapter
UInt32 fFlags
CP_ViewBackgroundfViewBackground
CP_DataValueSignal fBoundsChangedSignal
CP_DataValueSignal fShowSignal
CP_DataValueSignal fHideSignal
CP_DataValueSignal fActivateSignal
CP_DataValueSignal fDeactivateSignal
CP_DataValueSignal fEnableSignal
CP_DataValueSignal fDisableSignal
CP_DataValueSlot fShowSlot
CP_DataValueSlot fHideSlot
CP_DataValueSlot fActivateSlot
CP_DataValueSlot fDeactivateSlot
CP_DataValueSlot fEnableSlot
CP_DataValueSlot fDisableSlot
CP_Signals_ArrayfSignals
CP_Slots_ArrayfSlots
FourCharCode fObjectID
CP_Commands_ArrayfCommands
CP_MenuSelectionSignalfMennuSelectionSignal
sender_set fSenders
CP_IDropSourcefIDropSource
CP_IDataObjectfIDataObject
FORMATETC * fDataFormats
DWORD fNumberFormats
CP_EnumeratorfEnumerator
CP_DataStream fData
CP_WindowfWindow
bool fDropAreaIsHilited
bool fCanAcceptCurrentDrag
OSWindow fTargetWindow
CDropTargetfDropTarget
CP_Point fDropPoint

Static Protected Attributes

static FourCharCode fObjectIDCount = 0
static CP_DragTarget_ListfsDragTargetList = NULL
static CP_M_DragTargetfsCurrentDragTarget = NULL
static bool fsDragHasLeftSender = false

Detailed Description

Under MacOS non HIView all panes are implmented in this class as MacOS user pane controls.

Under Windows all panes are implmented in this class as Windows child windows.


Constructor & Destructor Documentation

CP_View_Imp::~CP_View_Imp  )  throw () [virtual]
 

Destructor.

Exceptions:
none 

CPLAT_Begin_Namespace_CPLAT CP_View_Imp::CP_View_Imp  )  [protected]
 

Constructor.

Exceptions:
none 

CP_View_Imp::CP_View_Imp CP_View inSuperview,
const CP_Point inUpperLeft,
const CP_Size inContentSize,
bool  inCreateImp = false,
UInt32  inFlags = CP_E_ViewFlags_None
[protected]
 

Constructor. Create a pane with the upper left corner at inLocation, and the content size of inSize.

Parameters:
inSuperview The subview handler that contains this pane.
inLocation Upper left corner of pane in releation to its superview.
inSize Content size of the pane.
inCreateImp Flag to indicate if the user pane control should be created for this pane. This flag would be true if this is a custom pane and not one of the system controls.
Exceptions:
none 


Member Function Documentation

void CP_View_Imp::Show  )  [virtual]
 

Show this view.

Exceptions:
none 
Returns:
void

Reimplemented in CP_Window_Imp, CP_Window_Imp, CP_DrawerWindow, CP_QT_MovieView, CP_SheetWindow, CP_TabView, CP_View, CP_Window, and CP_Window_Imp.

void CP_View_Imp::Hide  )  [virtual]
 

Hide this view.

Exceptions:
none 
Returns:
void

Reimplemented in CP_Window_Imp, CP_Window_Imp, CP_DrawerWindow, CP_QT_MovieView, CP_SheetWindow, CP_TabView, CP_View, CP_Window, and CP_Window_Imp.

void CP_View_Imp::Activate  )  [virtual]
 

Activate this view.

Exceptions:
none 
Returns:
void

Reimplemented in CP_QT_MovieView, CP_TextView, and CP_View.

void CP_View_Imp::Deactivate  )  [virtual]
 

Deactivate this view.

Exceptions:
none 
Returns:
void

Reimplemented in CP_QT_MovieView, CP_TextView, and CP_View.

void CP_View_Imp::Enable  )  [virtual]
 

Enable this view.

Exceptions:
none 
Returns:
void

Reimplemented in CP_QT_MovieView, and CP_View.

void CP_View_Imp::Disable  )  [virtual]
 

Disable this view.

Exceptions:
none 
Returns:
void

Reimplemented in CP_QT_MovieView, and CP_View.

void CP_View_Imp::GlobalToPort CP_Point inGlobalPoint  )  [virtual]
 

Converts the passed in point from global to port coordinates.

Parameters:
inGlobalPoint The point to convert to port coordinates.
Exceptions:
none 
Returns:
void

Reimplemented in CP_Window_Imp.

void CP_View_Imp::GlobalToLocal CP_Point inGlobalPoint  )  [virtual]
 

Converts the passed in point from global to local coordinates.

Parameters:
inGlobalPoint The point to convert to local coordinates.
Exceptions:
none 
Returns:
void

void CP_View_Imp::PortToLocal CP_Point inPortPoint  ) 
 

Converts the passed in point from port to local coordinates.

Parameters:
inGlobalPoint The point to convert to port coordinates.
Exceptions:
none 
Returns:
void

void CP_View_Imp::PortToGlobal CP_Point inPortPoint  )  [virtual]
 

Reimplemented in CP_Window_Imp.

void CP_View_Imp::PortToGlobal CP_Rect inPortRect  )  [virtual]
 

Reimplemented in CP_Window_Imp.

void CP_View_Imp::LocalToPort CP_Point inPortPoint  ) 
 

void CP_View_Imp::LocalToPort CP_Rect inPortRect  ) 
 

void CP_View_Imp::GetData UInt32  inTagName,
SInt32  inDataSize,
void *  inData
 

Sets some user data for this view. This is used to allow users to attach some data to a CP_View object.

Parameters:
inTagName Tag name for the data.
inDataSize Size of the data.
inData The data to be set.
Exceptions:
OSErrExceptions 
Returns:
void

Reimplemented in CP_Window_Imp.

void CP_View_Imp::SetData UInt32  inTagName,
SInt32  inDataSize,
const void *  inData
 

Sets some user data for this view. This is used to allow users to attach some data to a CP_View object.

Parameters:
inTagName Tag name for the data.
inDataSize Size of the data.
inData The data to be set.
Exceptions:
OSErrExceptions 
Returns:
void

Reimplemented in CP_Window_Imp.

virtual void CP_View_Imp::HandleDragReceive CP_DragDrop  )  [virtual]
 

Reimplemented from CP_M_DragTarget.

CP_EventHandler & CP_View_Imp::GetEventHandler  )  [virtual]
 

Return the event handler for this view implementation. This will be the OS implentation event handler.

Exceptions:
none 
Returns:
CP_EventHandler The OS implementations event handler.

Reimplemented in CP_Window_Imp, CP_MDIFrameWindow, and CP_Window_Imp.

CP_Window * CP_View_Imp::GetContainingWindow  )  [virtual]
 

Return the CP_Window that contains this pane.

Exceptions:
none 
Returns:
CP_Window * Returns the window this pane is contained in.

Reimplemented in CP_Window.

CP_View * CP_View_Imp::GetSuperview  ) 
 

Return the superview of this view.

Exceptions:
none 
Returns:
CP_View * Return the superview of this view.

CP_Rect CP_View_Imp::GetLocalBounds  ) 
 

Return the local bounds of this pane. This will always have the top left corner at location 0, 0.

Exceptions:
none 
Returns:
CP_Rect const Returns the bounds of this pane.

Reimplemented in CP_Window_Imp, and CP_Window_Imp.

CP_Rect CP_View_Imp::GetPortBounds  )  [virtual]
 

Return the local bounds of this pane. This is the bounds of the pane in port coordinates.

Exceptions:
none 
Returns:
CP_Rect const Returns the bounds of this pane.

Reimplemented in CP_Window_Imp, and CP_Window_Imp.

CP_Rect CP_View_Imp::GetContentBounds  )  [virtual]
 

Reimplemented in CP_Window_Imp, and CP_Scroller.

CP_Point CP_View_Imp::GetLocation  )  const [virtual]
 

Return the location of this pane. This is the panes location relative its superviews top left corner.

Exceptions:
none 
Returns:
CP_Point const Returns the location of this pane.

Reimplemented in CP_Window_Imp.

CP_Size CP_View_Imp::GetSize  )  const [virtual]
 

Return the size of this pane.

Exceptions:
none 
Returns:
CP_Size const Returns the size of this pane.

Reimplemented in CP_Window_Imp, and CP_Window_Imp.

UInt32 CP_View_Imp::GetCommandID  ) 
 

CP_Canvas CP_View_Imp::SetupForDrawing  )  [virtual]
 

Used when the user needs to draw into a view at times other than the normal drawing times. This will setup the view for drawing into, and return a canvas object suitable for use.

Exceptions:
none 
Returns:
CP_Canvas CP_Canvas object to use to draw into.

Reimplemented in CP_QT_MovieView.

void CP_View_Imp::FinishDrawing CP_Canvas drawCanvas  ) 
 

Call after the drawing is complete to free up system resources.

Exceptions:
none 
Returns:
CP_Canvas CP_Canvas object to use to draw into.

void CP_View_Imp::HandleDraw CP_Canvas inCanvas,
CP_Region inUpdateArea
 

CP_View_Imp method called from the user panes callback. This calls the virtual OnDraw function which users override to do the actual drawing in their panes.

Parameters:
inCanvas CP_Canvas object to draw into.
inUpdateArea CP_Region containing the area to draw.
Exceptions:
none 
Returns:
void

void CP_View_Imp::Invalidate const CP_Region inInvalidArea  ) 
 

Cause the passed in area of this pane to become invalid and force the OS to create an update event to redraw that portion.

Parameters:
inRegion CP_Region that contains the invalid area. Region should be in local coordinates.
Exceptions:
none 
Returns:
void

void CP_View_Imp::Invalidate const CP_Rect inInvalidArea  ) 
 

Cause the passed in area of this pane to become invalid and force the OS to create an update event to redraw that portion.

Parameters:
inRect CP_Rect that contains the invalid area. Rect should be in local coordinates.
Exceptions:
none 
Returns:
void

void CP_View_Imp::Refresh  )  [virtual]
 

Cause the view to redraw itself on the next chance it gets. This will mark the view as dirty, and redraw itself the next time the underlying OS updates dirty views. If used in a loop, the view will not be redrawn untill the underlying OS can process an event.

Exceptions:
none 
Returns:
void

Reimplemented in CP_Window_Imp.

UInt32 CP_View_Imp::GetFlags  ) 
 

void CP_View_Imp::SetFlags UInt32  inFlags  ) 
 

void CP_View_Imp::SetFrameAdapter CP_FrameAdapter inAdapter  ) 
 

Sets the frame adapter for this view. The frame adapter determines how a view will resize and reposition itself when the superview that contains it changes bounds.

Parameters:
inAdapter The frame adapter for this view.
Exceptions:
none 
Returns:
void

virtual void CP_View_Imp::HandleMouseMoved CP_Event_Base ,
const CP_Point
[virtual]
 

virtual void CP_View_Imp::HandleMouseEntered CP_Event_Base  )  [virtual]
 

virtual void CP_View_Imp::HandleMouseExited CP_Event_Base  )  [virtual]
 

void CP_View_Imp::SetCommandID UInt32  inCommandID  ) 
 

Sets the command id associated with this view. This will be the command sent out when the control is clicked on.

Parameters:
inCommandID The command to be sent when clicked on.
Exceptions:
none 
Returns:
void

void CP_View_Imp::SetLocation const CP_Point inLocation  )  [virtual]
 

Reimplemented in CP_Window_Imp, CP_View, and CP_Window.

void CP_View_Imp::SetSize const CP_Size inSize  )  [virtual]
 

Reimplemented in CP_Window_Imp, CP_View, and CP_Window.

void CP_View_Imp::SetPortBounds const CP_Rect inBounds  )  [virtual]
 

Sets the bounds of this view in port coordinates.

Parameters:
inBounds Bounds of the view in port coordinates.
Exceptions:
none 
Returns:
void

Reimplemented in CP_Window_Imp.

void CP_View_Imp::Show_Slot CP_DataValueHolder inValue,
OSStatus inOutStatus
 

void CP_View_Imp::Hide_Slot CP_DataValueHolder inValue,
OSStatus inOutStatus
 

void CP_View_Imp::Activate_Slot CP_DataValueHolder inValue,
OSStatus inOutStatus
 

void CP_View_Imp::Deactivate_Slot CP_DataValueHolder inValue,
OSStatus inOutStatus
 

void CP_View_Imp::Enable_Slot CP_DataValueHolder inValue,
OSStatus inOutStatus
 

void CP_View_Imp::Disable_Slot CP_DataValueHolder inValue,
OSStatus inOutStatus
 

void CP_View_Imp::AddSubview CP_View inView  )  [virtual]
 

Reimplemented in CP_View.

void CP_View_Imp::AdjustToSuperview CP_View inView  ) 
 

void CP_View_Imp::SetViewImpBase CP_View_Imp_Base inViewImpBase  ) 
 

CP_View_Imp_Base* CP_View_Imp::GetViewImpBase  ) 
 

bool CP_View_Imp::IsVisible  )  const [virtual]
 

Returns true if this view is visible.

Exceptions:
none 
Returns:
bool const Returns true if the view is visible.

Reimplemented in CP_Window_Imp, and CP_View.

bool CP_View_Imp::IsActive  )  const [virtual]
 

Returns true if this view is active.

Exceptions:
none 
Returns:
bool const Returns true if the view is active.

Reimplemented in CP_View, and CP_Window_Imp.

bool CP_View_Imp::IsEnabled  )  const [virtual]
 

Returns true if this view is enabled.

Exceptions:
none 
Returns:
bool const Returns true if the view is enabled.

Reimplemented in CP_View.

bool CP_View_Imp::ContainsPoint const CP_Point inPortPoint  ) 
 

Tests this view to see if it contains the passed in point, which is in port coordinates.

Parameters:
inPortPoint Point to check in port coordinates.
Exceptions:
none 
Returns:
bool Returns true if the passed in port point is contained in this view.

CP_ViewBackground * CP_View_Imp::GetViewBackground  ) 
 

void CP_View_Imp::SetViewBackground CP_ViewBackground inViewBackground  ) 
 

void CP_View_Imp::CreateImp CP_View inSuperview,
const CP_Point inUpperLeft,
const CP_Size inContentSize,
bool  inCreateImp = false
[protected, virtual]
 

Creates the MacOS user pane control that performs all drawing and other interaction between this class and the MacOS ControlManager

Parameters:
inSuperview The subview handler that contains this pane.
inLocation Upper left corner of pane in releation to its superview.
inSize Content size of the pane.
inCreateImp Flag to indicate if the user pane control should be created for this pane. This flag would be true if this is a custom pane and not one of the system controls.
Exceptions:
OSStatusException CP_paramErr if superview is NULL
Returns:
void

void CP_View_Imp::OnDraw CP_Canvas inCanvas,
CP_Region inUpdateArea
[protected, virtual]
 

Virtual method that users use to handle the actual drawing of their panes data. All platform implemntations eventually call this method to perform the actual drawing, and this is the only place that drawing should occur in.

You can also assume that by the time this method is called, the clipping region and other necessary platform stuff has been setup for you to draw. The passed in canvas also contains a valid port for drawing into.

Parameters:
inCanvas CP_Canvas object to draw into.
inUpdateArea CP_Region containing the area to draw.
Exceptions:
none 
Returns:
void

Reimplemented in CP_BackgroundView, CP_BevelButton, CP_BevelButton, CP_ChasingArrows, CP_ChasingArrows, CP_CheckGroupBox, CP_DisclosureButton, CP_DisclosureButton, CP_DisclosureButton, CP_DisclosureTriangle, CP_DisclosureTriangle, CP_FocusBorder, CP_IconControl, CP_IconControl, CP_ImageWell, CP_ImageWell, CP_OpenGLView, CP_PictureControl, CP_PictureControl, CP_Placard, CP_Placard, CP_PopupArrow, CP_PopupArrow, CP_PopupButton, CP_PopupGroupBox, CP_QT_MovieView, CP_Relevance, CP_Relevance, CP_Relevance, CP_RoundButton, CP_RoundButton, CP_RoundButton, CP_Scroller, CP_SearchField, CP_SearchField, CP_SearchField, CP_SegmentView, CP_SegmentView, CP_SegmentView, CP_SelectColorButton, CP_Separator, CP_Splitter, CP_StaticText, CP_TableHeaders, CP_TableView, CP_TextGroupBox, CP_TV_DataBrowser, CP_TV_TextColumn, CP_WindowHeader, CP_WindowHeader, and CP_WindowListHeader.

bool CP_View_Imp::OnCanAcceptDrag UInt32  inItem,
CPLAT::CP_DragDrop &  inDragDrop
[protected, virtual]
 

Linux - Returns true if this view supports drag and drop. This default implementation just returns true if the CP_E_ViewFlags_SupportsDragAndDrop is set, and does not check the contents of the drag and drop. Users should override this to perform a check on the contents of the drag and drop to determine if an item is acceptable.

Parameters:
inItem Index of the item to check.
inDragDrop CP_DragDrop object that is handling this drag and drop.
Exceptions:
none 
Returns:
bool Returns true if the view flags support drag and drop.

void CP_View_Imp::InitEventHandler CP_EventHandler inEventHandler  )  [protected, virtual]
 

Initialize the event handler for events that this class will handle.

Parameters:
inEventHandler CP_EventHandler that handles events for this class.
Exceptions:
none 
Returns:
void

Reimplemented in CP_Window_Imp, CP_BevelButton, CP_ChasingArrows, CP_DisclosureButton, CP_DisclosureTriangle, CP_DocumentWindow, CP_DrawerWindow, CP_EditField, CP_FocusBorder, CP_LittleArrows, CP_LittleArrowsEditBuddy, CP_PlatformControl, CP_PopupButton, CP_PopupMenu, CP_ProgressBar, CP_PushButton, CP_QT_MovieView, CP_RadioGroup, CP_ScrollBar, CP_SearchField, CP_SegmentView, CP_SelectColorButton, CP_Slider, CP_Splitter, CP_TableHeaders, CP_TableView, CP_TabView, CP_TextGroupBox, CP_TextView, CP_Toolbar, CP_WindowListHeader, CP_MDIFrameWindow, CP_MenuBarWindow, and CP_Window_Imp.

virtual void CP_View_Imp::HandleBoundsChanged const CP_Rect ,
const CP_Rect
[protected, virtual]
 

Reimplemented in CP_Scroller, CP_Splitter, and CP_View.

void CP_View_Imp::OnBoundsChanged const CP_Rect inPreviousBounds,
const CP_Rect inNewBounds
[protected, virtual]
 

Called when the bounds of this view has changed.

Parameters:
inPreviousBounds The previous bounds of this view.
inNewBounds The new bounds to make this view.
Exceptions:
none 
Returns:
void

Reimplemented in CP_OpenGLView, and CP_QT_MovieView.

ControlPartCode CP_View_Imp::HandleHitTest const CP_Point inMouseLocation  )  [virtual]
 

Slot to disable a view.

Reimplemented in CP_SelectColorButt