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

CP_View_Imp_Rich Class Reference

Inheritance diagram for CP_View_Imp_Rich:

CP_View_Imp_Win CP_Object CP_View_Imp_Base CP_NoCopy CP_M_CommandHandler CP_SigSlot::CP_SlotObject List of all members.

Events

virtual void InitEventHandler (CP_EventHandler &inEventHandler)
LRESULT HandleWinProcMessage (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
void HandleMouseEnteredEvent (CP_Event_Base &inEvent)
void HandleMouseExitedEvent (CP_Event_Base &inEvent)

Getters

virtual CP_EventHandlerGetEventHandler ()
WNDPROC GetOldWinProc ()
HBRUSH GetBackgroundBrush ()
static CP_View_Imp_WinGetLastViewWithMouse ()
static void SetLastViewWithMouse (CP_View_Imp_Win *inView)

Public Member Functions

 CP_View_Imp_Rich (CP_View_Imp *inOwnerViewImp, CP_View *inSuperview, const CP_Point &inUpperLeft, const CP_Size &inContentSize, bool inHasHorizontalScroll=true, bool inHasVerticalScroll=true, bool inReadOnly=false)
virtual ~CP_View_Imp_Rich () throw ()
void disconnect_all ()
void signal_connect (CP_Signal *inSender)
void signal_disconnect (CP_Signal *inSender)
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))
Appearance
void Activate ()
void Deactivate ()
Command Handling
void HandleCommandStatus (CP_CommandStatus &inCommandStatus, bool &inOutResult, CP_CommandNo &inCommandNo)
void HandleCutCommand (OSStatus &inOutStatus)
void HandleCopyCommand (OSStatus &inOutStatus)
void HandleClearCommand (OSStatus &inOutStatus)
void HandlePasteCommand (OSStatus &inOutStatus)
void HandleSelectAllCommand (OSStatus &inOutStatus)
void HandleUndoCommand (OSStatus &inOutStatus)
void HandleRedoCommand (OSStatus &inOutStatus)
Drawing
virtual void HandleDraw (OSControl inControl)
Focus
virtual void OnLosingFocus ()
Getters
OSStatus ReadTextFromFile (const CP_FileSystemSpec &inFileSpec)
Getters
CP_String GetText (char inLineEnd=CP_LF)
UInt32 GetTextLength ()
Key Filter
void AttachFilter (CP_KeyInputFilter *inFilter)
CP_KeyInputFilterGetFilter ()
Printing
void Print ()
Selection
void GetSelection (UInt32 *inStartSelection, UInt32 *inEndSelection)
void SetSelection (UInt32 inStartSelection, UInt32 inEndSelection)
bool HasSelection ()
Setters
void SetText (const CP_String &inText)
void SetText (CP_InStream *inStream)
void InsertText (const CP_String &inText)
void InsertText (const char *inTextPtr, SInt32 inTextLength)
void SetFontSpec (CP_FontSpec &inFontSpec)
Testers
bool HasTextToPaste ()

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

Setters
virtual void SetPortBounds (const CP_Rect &inBounds)
void SetTextFont (const CP_String &inFontName)
void SetTextSize (SInt16 inFontSize)
void SetTextFace (SInt16 inFace)
void SetTextColor (const CP_RGBColor &inForeColor)

Protected Attributes

CP_KeyInputFilterfKeyFilter
CP_DataValueSignal fFieldExitSignal
CP_EventHandler fEventHandler
CP_Point fLocation
UInt32 fWinStyleFlags
UInt32 fWinExtStyleFlags
WNDPROC fnOldWndProc
bool fIsCustomPane
CP_ViewfSuperview
CP_Point fOrigin
CP_View_ImpfOwnerViewImp
OSControl fOSControl
CP_EventHandler fDummyEventHandler
CP_Size fSize
CP_Commands_ArrayfCommands
CP_MenuSelectionSignalfMennuSelectionSignal
sender_set fSenders
CP_Signals_ArrayfSignals
CP_Slots_ArrayfSlots
FourCharCode fObjectID

Static Protected Attributes

static SInt16 fsWinViewID = 0
static HBRUSH fsBackgroundBrush
static CP_View_Imp_WinfsLastViewWithMouse = NULL
static FourCharCode fObjectIDCount = 0

Private Member Functions

Events
void HandleKeyboardInput_Win (CP_Event_Base &inEvent)
void CommandProcess (CP_Event_Base &inEvent)
void CommandUpdateStatus (CP_Event_Base &inEvent)
Initialization
void Init (CP_View *inSuperview, const CP_Point &inLocation, const CP_Size &inContentSize, bool inHasHorizontalScroll=true, bool inHasVerticalScroll=true, bool inReadOnly=false)
void InitEventHandler (CPLAT::CP_EventHandler &inEventHandler)
bool HandleFieldExitChar (char inChar)
Misc
void TextChanged ()

Static Private Member Functions

static DWORD CALLBACK CP_RichText_StreamInCallback (DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb)

Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_View_Imp_Rich::CP_View_Imp_Rich CP_View_Imp inOwnerViewImp,
CP_View inSuperview,
const CP_Point inUpperLeft,
const CP_Size inContentSize,
bool  inHasHorizontalScroll = true,
bool  inHasVerticalScroll = true,
bool  inReadOnly = false
 

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

Destructor.

Exceptions:
none 


Member Function Documentation

void CP_View_Imp_Rich::Activate  )  [virtual]
 

Activate this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Rich::Deactivate  )  [virtual]
 

Deactivate this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Rich::HandleCommandStatus CP_CommandStatus inCommandStatus,
bool &  inOutResult,
CP_CommandNo inCommandNo
 

void CP_View_Imp_Rich::HandleCutCommand OSStatus inOutStatus  ) 
 

void CP_View_Imp_Rich::HandleCopyCommand OSStatus inOutStatus  ) 
 

void CP_View_Imp_Rich::HandleClearCommand OSStatus inOutStatus  ) 
 

void CP_View_Imp_Rich::HandlePasteCommand OSStatus inOutStatus  ) 
 

void CP_View_Imp_Rich::HandleSelectAllCommand OSStatus inOutStatus  ) 
 

void CP_View_Imp_Rich::HandleUndoCommand OSStatus inOutStatus  ) 
 

void CP_View_Imp_Rich::HandleRedoCommand OSStatus inOutStatus  ) 
 

void CP_View_Imp_Rich::HandleDraw OSControl  inControl  )  [virtual]
 

void CP_View_Imp_Rich::OnLosingFocus  )  [virtual]
 

OSStatus CP_View_Imp_Rich::ReadTextFromFile const CP_FileSystemSpec inFileSpec  ) 
 

CP_String CP_View_Imp_Rich::GetText char  inLineEnd = CP_LF  ) 
 

UInt32 CP_View_Imp_Rich::GetTextLength  ) 
 

void CP_View_Imp_Rich::AttachFilter CP_KeyInputFilter inFilter  ) 
 

Attach a text field to this field. NOTE: It is possible to pass a NULL validator in, which will remove any existing one.

Parameters:
inValidate - the text filter to attach.

CP_KeyInputFilter * CP_View_Imp_Rich::GetFilter  ) 
 

Return the key input filter associated with this field.

void CP_View_Imp_Rich::Print  ) 
 

void CP_View_Imp_Rich::GetSelection UInt32 inStartSelection,
UInt32 inEndSelection
 

void CP_View_Imp_Rich::SetSelection UInt32  inStartSelection,
UInt32  inEndSelection
 

bool CP_View_Imp_Rich::HasSelection  ) 
 

void CP_View_Imp_Rich::SetText const CP_String inText  ) 
 

void CP_View_Imp_Rich::SetText CP_InStream inStream  ) 
 

void CP_View_Imp_Rich::InsertText const CP_String inText  ) 
 

void CP_View_Imp_Rich::InsertText const char *  inTextPtr,
SInt32  inTextLength
 

void CP_View_Imp_Rich::SetFontSpec CP_FontSpec inFontSpec  ) 
 

bool CP_View_Imp_Rich::HasTextToPaste  ) 
 

Do we have text in our scrap to paste into our field.

void CP_View_Imp_Rich::SetPortBounds const CP_Rect inBounds  )  [protected, virtual]
 

Sets the port bounds of the child window.

Parameters:
inBounds The bounds of the window.
Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Win.

void CP_View_Imp_Rich::SetTextFont const CP_String inFontName  )  [protected]
 

void CP_View_Imp_Rich::SetTextSize SInt16  inFontSize  )  [protected]
 

void CP_View_Imp_Rich::SetTextFace SInt16  inFace  )  [protected]
 

void CP_View_Imp_Rich::SetTextColor const CP_RGBColor inForeColor  )  [protected]
 

void CP_View_Imp_Rich::HandleKeyboardInput_Win CP_Event_Base inEvent  )  [private]
 

void CP_View_Imp_Rich::CommandProcess CP_Event_Base inEvent  )  [private]
 

void CP_View_Imp_Rich::CommandUpdateStatus CP_Event_Base inEvent  )  [private]
 

void CP_View_Imp_Rich::Init CP_View inSuperview,
const CP_Point inLocation,
const CP_Size inContentSize,
bool  inHasHorizontalScroll = true,
bool  inHasVerticalScroll = true,
bool  inReadOnly = false
[private]
 

void CP_View_Imp_Rich::InitEventHandler CPLAT::CP_EventHandler &  inEventHandler  )  [private]
 

bool CP_View_Imp_Rich::HandleFieldExitChar char  inChar  )  [private]
 

void CP_View_Imp_Rich::TextChanged  )  [private]
 

DWORD CALLBACK CP_View_Imp_Rich::CP_RichText_StreamInCallback DWORD  dwCookie,
LPBYTE  pbBuff,
LONG  cb,
LONG *  pcb
[static, private]
 

void CP_View_Imp_Win::Show  )  [virtual, inherited]
 

Show this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Win::Hide  )  [virtual, inherited]
 

Hide this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Win::Enable  )  [virtual, inherited]
 

Enable this control.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Win::Disable  )  [virtual, inherited]
 

Disable this control.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

CP_Canvas CP_View_Imp_Win::SetupForDrawing  )  [virtual, inherited]
 

Used when the user needs to draw into a view at times other than the normal drawing times. This will setup the control 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 from CP_View_Imp_Base.

void CP_View_Imp_Win::Draw  )  [virtual, inherited]
 

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Win::Refresh  )  [virtual, inherited]
 

Cause the control to refresh itself by invalidating the bounds of this control.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Win::FinishDrawing CP_Canvas drawCanvas  )  [virtual, inherited]
 

Reimplemented from CP_View_Imp_Base.

CP_Rect CP_View_Imp_Win::GetPortBounds  )  [virtual, inherited]
 

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

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

Reimplemented from CP_View_Imp_Base.

OSWindow CP_View_Imp_Win::CreateChildWindow const CP_String inTitle,
const CP_String inWindowType,
DWORD  inWindowFlags,
DWORD  inExWindowFlags,
const CP_Point inUpperLeft,
const CP_Size inSize
[inherited]
 

Create the Windows child window that is used to display the contents of this pane.

Parameters:
inTitle Any text displayed by the window.
inWindowType A string describing the type of window to create.
inWindowFlags Flags used to create the Windows child window.
inExWindowFlags Extended flags used to create the Windows child window.
inUpperLeft Upper left location to create the window.
inSize Size to make the child window.
Exceptions:
none 
Returns:
OSWindow Windows child window of this pane.

void CP_View_Imp_Win::CreateWindowsChildWindow const CP_Point inUpperLeft,
const CP_Size inContentSize
[inherited]
 

Creates the Windows child HWND that is used to implement this class under Windows. If the user has not changed the default flags used to create the child window, they will be created with the following flags:

  • WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS

Parameters:
inUpperLeft Upper left coordinate of the window in local coordinates.
inContentSize Size of the content area of the view.
Exceptions:
none 
Returns:
void

bool CP_View_Imp_Win::GetIsCustomPane  )  [inherited]
 

void CP_View_Imp_Win::SetIsCustomPane bool  inIsCustomPane  )  [inherited]
 

void CP_View_Imp_Win::InitEventHandler CP_EventHandler inEventHandler  )  [virtual, inherited]
 

Initialize the event handler data member for this class. This will register the Windows messages that are handled by this class with their respective CP_EventSignal handlers.

Parameters:
inEventHandler The CP_EventHandler that handles the view events.
Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

Reimplemented in CP_View_Imp_WinToolbar.

LRESULT CP_View_Imp_Win::HandleWinProcMessage HWND  hwnd,
UINT  iMsg,
WPARAM  wParam,
LPARAM  lParam
[inherited]
 

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.
wParam the wParam for the message.
lParam the lParam for the message.
Exceptions:
none 
Returns:
LRESULT Returns the result of the operation.

void CP_View_Imp_Win::HandleMouseEnteredEvent CP_Event_Base inEvent  )  [inherited]
 

void CP_View_Imp_Win::HandleMouseExitedEvent CP_Event_Base inEvent  )  [inherited]
 

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

Reimplemented from CP_View_Imp_Base.

WNDPROC CP_View_Imp_Win::GetOldWinProc  )  [inherited]
 

HBRUSH CP_View_Imp_Win::GetBackgroundBrush  )  [inherited]
 

static CP_View_Imp_Win* CP_View_Imp_Win::GetLastViewWithMouse  )  [static, inherited]
 

static void CP_View_Imp_Win::SetLastViewWithMouse CP_View_Imp_Win inView  )  [static, inherited]
 

void CP_View_Imp_Win::Move const CP_Point inOffset  )  [virtual, inherited]
 

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Win::SetOldWinProc WNDPROC  inOldWndProc  )  [inherited]
 

Sets the data member and event handler to the passed in Windows window proc that was used in a created child window. This is the previous one that we are subclassing.

Parameters:
inOldWndProc The WNDPROC we are saving.
Exceptions:
none 
Returns:
void

SInt16 CP_View_Imp_Win::GetWinViewID  )  [inherited]
 

void CP_View_Imp_Win::SetWinViewID SInt16  inWinViewID  )  [inherited]
 

bool CP_View_Imp_Win::IsVisible  )  const [virtual, inherited]
 

Returns true if this view is visible.

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

Reimplemented from CP_View_Imp_Base.

bool CP_View_Imp_Win::IsActive  )  const [virtual, inherited]
 

Returns true if this view is active.

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

Reimplemented from CP_View_Imp_Base.

bool CP_View_Imp_Win::IsEnabled  )  const [virtual, inherited]
 

Returns true if this view is enabled.

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

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Win::Invalidate const CP_Region inInvalidArea  )  [protected, virtual, inherited]
 

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.
Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Win::HandleErase CP_Event_Base inEvent  )  [protected, virtual, inherited]
 

void CP_View_Imp_Win::CreateViewChildWindow DWORD  inExWindowFlags,
const CP_Point inUpperLeft,
const CP_Size inContentSize
[protected, inherited]
 

Creates the Windows child window for our view class. This is called by the other methods to create our custom window class used to implmement this class under Windows.

Parameters:
inExWindowFlags Extended flags used in the creation of the window.
inUpperLeft Upper left coordinate of the window in local coordinates.
inContentSize Size of the content area of the view.
Exceptions:
none 
Returns:
void

void CP_View_Imp_Win::RegisterWindowClass  )  [protected, inherited]
 

Register the window class used for the panes child window with Windows.

Exceptions:
none 
Returns:
void

void CP_View_Imp_Win::SetLocation const CP_Point inLocation  )  [protected, virtual, inherited]
 

Sets the location of this control releative to its superview. The passed in location is relative to the subview that contains this control.

Parameters:
inLocation Superview relative coordinates of the location.
Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Win::SetSize const CP_Size inSize  )  [protected, virtual, inherited]
 

Sets the size of this control. This will expand or shrink the control relative to its upper left corner.

Parameters:
inSize Size to make this control.
Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp_Base.

void CP_View_Imp_Base::HandleDraw CP_Canvas inCanvas,
CP_Region inUpdateArea
[inherited]
 

Public method called from the various OS implementations when they need to draw some content. This then calls the CP_View_Imp HandleDraw to notify your object that is should draw something via its OnDraw() method.

Parameters:
inCanvas CP_Canvas object that holds the graphics port for the View to draw into. The canvas object should only be considered setup correctly in this call, and not held onto.
inUpdateArea The area that needs to be updated or drawn.
Exceptions:
none 
Returns:
void

void CP_View_Imp_Base::PortToLocal CP_Point inPortPoint  )  [virtual, inherited]
 

void CP_View_Imp_Base::PortToLocal CP_Rect inPortRect  )  [inherited]
 

void CP_View_Imp_Base::PortToGlobal CP_Point inPortPoint  )  [inherited]
 

void CP_View_Imp_Base::PortToGlobal CP_Rect inPortRect  )  [inherited]
 

void CP_View_Imp_Base::LocalToPort CP_Point inPortPoint  )  [inherited]
 

void CP_View_Imp_Base::LocalToPort CP_Rect inPortRect  )  [inherited]
 

CP_Rect CP_View_Imp_Base::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.

OSControl CP_View_Imp_Base::GetOSControl  )  const [inherited]
 

Returns the OSControl that is implementing this base view. The will be a MacOS ControlHandle on non HIView OSs or non compositing windows, and an HIViewRef on compositing windows.

Exceptions:
none 
Returns:
OSControl The OSControl implementing this view.

<