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

CP_View Class Reference
[UI]

Base class for all UI elements in the CPLAT framework. More...

Inheritance diagram for CP_View:

CP_View_Imp CP_M_SubViewHandler CP_M_Persist CP_M_CommandHandler CP_M_DragSource CP_M_DragTarget CP_Object CP_SigSlot::CP_SlotObject CP_NoCopy 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.

Persistance

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

virtual ~CP_View () throw ()
 Destructor.
void InitFromOSControl (CP_View *inSuperview, OSControl inOSControl)
virtual void SetForeBackColors ()
virtual LRESULT HandleWinHelperProcMessage (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
void DrawViewHierachy ()
void SetLocationAndSubs (const CP_Point &inLocation)
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
 CP_View (CP_View *inSuperview, const CP_Point &inUpperLeft, const CP_Size &inContentSize, bool inCreateImp=false, UInt32 inFlags=CP_E_ViewFlags_None)
 Constructor.

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 FinishInitFromOSControl (OSControl)
virtual bool OnCanAcceptDrag (UInt32 inItem, CP_DragDrop &inDragDrop)=0
virtual bool PtInDropArea (CP_Point &inGlobalPoint)
virtual void HandleControlColor (CP_Event_Base &inEvent)
virtual bool OnCanAcceptDragWin (LPDATAOBJECT pIDataSource, DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
Constructor / Destructor
 CP_View ()
 Constructor.

Protected Attributes

bool fIsContainer
OSWindow fToolTipWindow
GtkWidget * fContentAreaContainer
CP_Point fPrintLocation
CP_Size fPrintSize
bool fIsFocused
CP_DataValueSignal fFocusChangedSignal
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
CP_SubViews_ListfSubViews

Static Protected Attributes

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

Detailed Description

All UI elements derive from this common base class, and implement 2 basic types of UI elements:

Platform controls are OS defined elements, and user defined elements. The actual implementation of the CP_View class is done by an implemntation class that is platform specific.


Constructor & Destructor Documentation

CP_View::CP_View CP_View inSuperview,
const CP_Point inLocation,
const CP_Size inSize,
bool  inCreateImp = false,
UInt32  inFlags = CP_E_ViewFlags_None
 

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 

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

Destructor.

Exceptions:
none 

CPLAT_Begin_Namespace_CPLAT CP_View::CP_View  )  [protected]
 

Constructor. Creates a pane of empty size and located at 0, 0 coordinates.

Exceptions:
none 


Member Function Documentation

CP_M_Persist * CP_View::PersistCreator  )  [static]
 

CP_M_Persist function to create an instance of this view. Called from our CP_PersistManager class to create persistant object from a stream.

Exceptions:
none 
Returns:
CP_M_Persist * Returns a pointer to a new CP_View object.

Reimplemented in CP_BevelButton, CP_ChasingArrows, CP_CheckBox, CP_CheckGroupBox, CP_Clock, CP_DisclosureButton, CP_DisclosureTriangle, CP_DocumentWindow, CP_EditField, CP_FocusBorder, CP_IconControl, CP_ImageWell, CP_LittleArrows, CP_LittleArrowsEditBuddy, CP_OpenGLView, CP_PictureControl, CP_Placard, CP_PopupArrow, CP_PopupButton, CP_PopupGroupBox, CP_PopupMenu, CP_PrintView, CP_ProgressBar, CP_PushButton, CP_QT_MovieView, CP_RadioButton, CP_RadioGroup, CP_Relevance, CP_RoundButton, CP_ScrollableView, CP_ScrollBar, CP_Scroller, CP_SearchField, CP_SegmentView, CP_SelectColorButton, CP_Separator, CP_Slider, CP_Splitter, CP_StaticText, CP_TableHeaders, CP_TableView, CP_TabView, CP_TextGroupBox, CP_TextView, CP_Toolbar, CP_TV_DataBrowser, CP_TV_TextColumn, CP_Window, CP_WindowHeader, and CP_WindowListHeader.

void CP_View::Show  )  [virtual]
 

Show this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

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

void CP_View::Hide  )  [virtual]
 

Hide this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

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

void CP_View::Activate  )  [virtual]
 

Activate this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

Reimplemented in CP_QT_MovieView, and CP_TextView.

void CP_View::Deactivate  )  [virtual]
 

Deactivate this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

Reimplemented in CP_QT_MovieView, and CP_TextView.

void CP_View::Enable  )  [virtual]
 

Enable this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

Reimplemented in CP_QT_MovieView.

void CP_View::Disable  )  [virtual]
 

Disable this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

Reimplemented in CP_QT_MovieView.

bool CP_View::IsFocused  ) 
 

void CP_View::SetFocused bool  inFocused  ) 
 

bool CP_View::CanLoseFocus  )  [virtual]
 

bool CP_View::FocusCanChange  ) 
 

void CP_View::LosingFocus  ) 
 

void CP_View::HandleActivationEvent  ) 
 

void CP_View::HandleDeactivationEvent  ) 
 

void CP_View::HandleBoundsChanged const CP_Rect inPreviousBounds,
const CP_Rect inNewBounds
[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 from CP_View_Imp.

Reimplemented in CP_Scroller, and CP_Splitter.

OSControl CP_View::GetOSControl  ) 
 

Returns the underlying platforms OSControl that implements this view. This is a convenience function for GetViewImpBase()->GetOSControl().

Exceptions:
none 
Returns:
OSControl The underlying platforms OSControl that implements this view. NULL is returned if the view imp base object is not created yet, or the control hasn't been created yet.

Reimplemented in CP_PlatformControl.

void CP_View::SetHelp const CP_String inHelpString,
const CP_String inSecondaryHelpString
[virtual]
 

Sets the help string displayed for this view.

Parameters:
inHelpString The help string to be displayed.
inSecondaryHelpString A secondary help string if the underlying OS supports display of alternate strings.
Exceptions:
none 
Returns:
void

void CP_View::SetHelp SInt16  inHelpStringResID,
SInt16  inHelpStringIndex,
SInt16  inSecondaryHelpStringResID = 0,
SInt16  inSecondaryHelpStringIndex = 0
[virtual]
 

Sets the help string displayed for this view.

Parameters:
inHelpStringResID The help string resource id.
inHelpStringIndex The help string index of the resource.
inSecondarHelpStringResID The secondary help string resource id.
inSecondarHelpStringIndex The secondary help string index of the resource.
Exceptions:
none 
Returns:
void

void CP_View::Move const CP_Point inDistance  )  [virtual]
 

Moves the view by the distance specified in the passed in point parameter. All subviews of this view will also move along with the view.

Parameters:
inDistance Distance to move this view by.
Exceptions:
none 
Returns:
void

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

Sets the location of this view relative to its superview.

Parameters:
inLocation Location of the view, releative to its containing or superview.
Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

Reimplemented in CP_Window_Imp, and CP_Window.

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

Sets the size of this view.

Parameters:
inSize The size of the view.
Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

Reimplemented in CP_Window_Imp, and CP_Window.

virtual void CP_View::OnBeginPrinting CP_Printer  )  [virtual]
 

void CP_View::OnPrint CP_Canvas inCanvas,
UInt32  inPageNumber,
CP_Printer_PageFormat  pageFormat
[virtual]
 

Called when the user wants to print the contents of this view. The default is to call the OnDraw method of the view to use the same drawing for both printing and user interface. Override if you want to handle drawing differently when printing.

Parameters:
inCanvas The printing port to draw into.
inPageNumber The page number being printed.
inPageFormat Object that describes the format of the page that is printing.
Exceptions:
none 
Returns:
CP_Rect The bounds of this view when printing.

virtual void CP_View::OnEndPrinting CP_Printer  )  [virtual]
 

void CP_View::CountTiles CP_Printer inPrinter,
CP_Printer_PageFormat pageFormat,
UInt16 inOutHorTiles,
UInt16 inOutVerTiles
[virtual]
 

Count and return the number of tiles needed to print this view.

NOTE: In order to print a pane/view that is larger than the printed page, we divide our view up into tiles that our the size of each page. Subclasses need to override this if they are larger than the page size. This default is to return 1 for each of the horizontal and vertical tiles.

Parameters:
inPrinter The CP_Printer that is controlling the printing.
inPageFormat Describes the size of the page being printed.
inOutHorTiles The number of horizontal tiles is returned here.
inOutVerTiles The number of vertical tiles is returned here.
Exceptions:
none 
Returns:
void

CP_Point CP_View::GetPrintLocation  ) 
 

CP_Size CP_View::GetPrintSize  ) 
 

CP_Rect CP_View::GetLocalPrintBounds  ) 
 

Returns the bounds of this view in local coordinates when printing. The user can change the bounds of the view when printing by calling SetPrintLocation, SetPrintSize which can be different than used to draw into a window.

Exceptions:
none 
Returns:
CP_Rect The bounds of this view when printing.

void CP_View::SetPrintLocation const CP_Point inLocation  ) 
 

void CP_View::SetPrintSize const CP_Size inSize  ) 
 

void CP_View::AddSubview CP_View inView  )  [virtual]
 

Adds the passed in view to our list of views.

Parameters:
inView The view being added.
Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

bool CP_View::IsVisible  )  const [virtual]
 

Returns true if this view is visible.

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

Reimplemented from CP_View_Imp.

Reimplemented in CP_Window_Imp.

bool CP_View::IsActive  )  const [virtual]
 

Returns true if this view is active.

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

Reimplemented from CP_View_Imp.

Reimplemented in CP_Window_Imp.

bool CP_View::IsEnabled  )  const [virtual]
 

Returns true if this view is enhabled.

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

Reimplemented from CP_View_Imp.

bool CP_View::IsContainer  )  const
 

void CP_View::OnLosingFocus  )  [protected, virtual]
 

Reimplemented in CP_TextView.

void CP_View::OnInitPersist CP_View inSuperview,
CP_DataValueList inDataValueList
[protected, virtual]
 

Called from the persistance classes once an object has been created, and now needs to be initialized. This method is used to initialize the data members of the class from the passed in CP_DataValueList which contains fields to initialize a data member.

Once the data members have been initialized, a platforms implementation is created through the CreatePlatformImp() method.

Parameters:
inSubViewHandler The superview that contains this push button.
inDataValueList List of the values for setting the data members of this class to.
Exceptions:
none 
Returns:
void

Reimplemented from CP_M_Persist.

Reimplemented in CP_BevelButton, CP_ChasingArrows, CP_CheckBox, CP_CheckGroupBox, CP_Clock, CP_DisclosureButton, CP_DisclosureTriangle, CP_EditField, CP_FocusBorder, CP_IconControl, CP_ImageWell, CP_LittleArrows, CP_LittleArrowsEditBuddy, CP_OpenGLView, CP_PictureControl, CP_Placard, CP_PopupArrow, CP_PopupGroupBox, CP_PopupMenu, CP_ProgressBar, CP_PushButton, CP_QT_MovieView, CP_RadioButton, CP_RadioGroup, CP_Relevance, CP_RoundButton, CP_ScrollableView, CP_ScrollBar, CP_Scroller, CP_SearchField, CP_SegmentView, CP_SelectColorButton, CP_Separator, CP_Slider, CP_Splitter, CP_StaticText, CP_TableHeaders, CP_TableView, CP_TabView, CP_TextGroupBox, CP_TextView, CP_TV_DataBrowser, CP_TV_TextColumn, CP_Window, CP_WindowHeader, and CP_WindowListHeader.

void CP_View::OnFinishPersist  )  [protected, virtual]
 

This is called after the containing window and all of its subviews have been created. This gives each view a chance to perform any needed operations after the window and subviews have been created, but before the window is made visible to the user.

Exceptions:
none 
Returns:
void

Reimplemented from CP_M_Persist.

Reimplemented in CP_TabView.

void CP_View::InitFromOSControl CP_View inSuperview,
OSControl  inOSControl
 

Initializes this view from a superview and an existing platform OSControl.

Parameters:
inSuperview The view that will contain this view.
inOSControl The OSControl that is implementing this view.
Exceptions:
none 
Returns:
void

void CP_View::SetForeBackColors  )  [virtual]
 

Called when the view needs to setup its foreground and background colors for drawing. This is called during drawing when the OS needs to setup the correct colors for the AppearanceManager. Normally you don't need to call this yourself.

Exceptions:
none 
Returns:
void

Reimplemented in CP_BackgroundView, and CP_TabView.

virtual void CP_View::FinishInitFromOSControl OSControl   )  [protected, virtual]
 

LRESULT CP_View::HandleWinHelperProcMessage HWND  hwnd,
UINT  iMsg,
WPARAM  wParam,
LPARAM  lParam
[virtual]
 

Handle any Windows specific message for this pane. This is the routine that is called from the windows pane handler. You need override the protected OnHandleWinProcMessage method to handle the specific messages you need to in your class.

This method will catch any exceptions thrown in your methods to prevent propagating into the Windows callback.

Parameters:
hwnd the HWND that the message applies to.
iMsg the incoming message to handle.
wPa ram the wParam for the message.
lParam the lParam for the message.
Exceptions:
none 
Returns:
LRESULT Returns the result of the operation.

Reimplemented in CP_CheckGroupBox.

void CP_View::DrawViewHierachy  ) 
 

void CP_View::SetLocationAndSubs const CP_Point inLocation  ) 
 

GtkWidget* CP_View::GetContentAreaContainer  ) 
 

Reimplemented in CP_Window_Imp.

void CP_View::SetContentAreaContainer GtkWidget *  inContentAreaContainer  ) 
 

Reimplemented in CP_Window_Imp.

void CP_View_Imp::GlobalToPort CP_Point inGlobalPoint  )  [virtual, inherited]
 

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, inherited]
 

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  )  [inherited]
 

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, inherited]
 

Reimplemented in CP_Window_Imp.

void CP_View_Imp::PortToGlobal CP_Rect inPortRect  )  [virtual, inherited]
 

Reimplemented in CP_Window_Imp.

void CP_View_Imp::LocalToPort CP_Point inPortPoint  )  [inherited]
 

void CP_View_Imp::LocalToPort CP_Rect inPortRect  )  [inherited]
 

void CP_View_Imp::GetData UInt32  inTagName,
SInt32  inDataSize,
void *  inData
[inherited]
 

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.

HRESULT CP_M_DragSource::GetData LPFORMATETC  lpfe,
LPSTGMEDIUM  lpstg
[inherited]
 

GetData method. Caller is asking if we can supply data in a given format and medium. Subclasses should override the OnGetData method to return the data.

Parameters:
lpfe Pointer to a FORMATETC structure.
lpstg Pointer to a STGMEDIUM structure.
Exceptions:
none 
Returns:
HRESULT

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

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.

HRESULT CP_M_DragSource::SetData LPFORMATETC  lpfe,
STGMEDIUM *  lpst,
BOOL  fRelease
[inherited]
 

SetData method. Calls OnSetData which you should override if needed.

Parameters:
lpfe Pointer to a FORMATETC structure.
lpstg Pointer to a STGMEDIUM structure.
fRelease Flag to indicate if the data is to be released.
Exceptions:
none 
Returns:
HRESULT

virtual void CP_View_Imp::HandleDragReceive CP_DragDrop  )  [virtual, inherited]
 

Reimplemented from CP_M_DragTarget.

CP_EventHandler & CP_View_Imp::GetEventHandler  )  [virtual, inherited]
 

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, inherited]
 

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  )  [inherited]
 

Return the superview of this view.

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

CP_Rect CP_View_Imp::GetLocalBounds  )  [inherited]
 

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