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

CP_TextView Class Reference
[UI]

Implementation of a platforms text view. More...

Inheritance diagram for CP_TextView:

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 List of all members.

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_TextView () 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 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_TextView ()
 Constructor.
 CP_TextView (CP_View *inSuperview, const CP_Point &inUpperLeft, const CP_Size &inContentSize, const CP_String &inTitle, bool inHasHorizontalScroll=true, bool inHasVerticalScroll=true, bool inHasGrowBox=true, bool inReadOnly=false, bool inDrawFocusBorder=true)
Appearance
virtual void Activate ()
virtual void Deactivate ()
Files
OSStatus ReadTextFromFile (const CP_FileSystemSpec &inFileSpec)
Getters
CP_String GetText (char inLineEnd=CP_LF)
UInt32 GetTextLength ()
Misc
virtual void TextChanged ()
Printing
virtual 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)
virtual void SetFontSpec (CP_FontSpec &inFontSpec)
void SetFontName (const CP_String &inFontName)
void SetFontSize (SInt16 inSize)
void SetFontStyle (SInt16 inStyle)

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)
Persistance
static CP_M_PersistPersistCreator ()

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)
Events
virtual void InitEventHandler (CP_EventHandler &inEventHandler)
Events
virtual void OnLosingFocus ()
Persistance
virtual void OnInitPersist (CP_View *inSuperview, CP_DataValueList &inDataValueList)

Protected Attributes

CP_DataValueSignal fValueChangedSignal
CP_View_Imp_MLTEfTextViewImp
CP_FontSpec fCurrentFontSpec
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

Private Member Functions

void CommandUpdateStatus (CP_Event_Base &inEvent)
void CommandProcess (CP_Event_Base &inEvent)
void HandleCommandStatus (CP_CommandStatus &inCommandStatus, bool &inOutResult, CP_CommandNo &inCommandNo)
void HandleCutCommand (OSStatus &inOutStatus, CP_CommandNo &inCommandNo)
void HandleCopyCommand (OSStatus &inOutStatus, CP_CommandNo &inCommandNo)
void HandleClearCommand (OSStatus &inOutStatus, CP_CommandNo &inCommandNo)
void HandlePasteCommand (OSStatus &inOutStatus, CP_CommandNo &inCommandNo)
void HandleSelectAllCommand (OSStatus &inOutStatus, CP_CommandNo &inCommandNo)
void HandleUndoCommand (OSStatus &inOutStatus, CP_CommandNo &inCommandNo)
void HandleRedoCommand (OSStatus &inOutStatus, CP_CommandNo &inCommandNo)
Initialization
void CreatePlatformImp (CP_View *inSuperview, const CP_Point &inUpperLeft, const CP_Size &inContentSize, const CP_String &inText, bool inHasHorizontalScroll=true, bool inHasVerticalScroll=true, bool inHasGrowBox=true, bool inReadOnly=false, bool inDrawFocusBorder=true)
Events
void HandleMouseDown (CP_Event_Base &inEvent)
Initialization
void CreatePlatformImp (CP_View *inSuperview, const CP_Point &inUpperLeft, const CP_Size &inContentSize, const CP_String &inText, bool inHasHorizontalScroll=true, bool inHasVerticalScroll=true, bool inHasGrowBox=true, bool inReadOnly=false, bool inDrawFocusBorder=true)
Initialization
void CreatePlatformImp (CP_View *inSuperview, const CP_Point &inUpperLeft, const CP_Size &inContentSize, const CP_String &inText, bool inHasHorizontalScroll=true, bool inHasVerticalScroll=true, bool inHasGrowBox=true, bool inReadOnly=false, bool inDrawFocusBorder=true)

Detailed Description


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_TextView::CP_TextView  ) 
 

Constructor.

Exceptions:
none 

CP_TextView::CP_TextView CP_View inSuperview,
const CP_Point inUpperLeft,
const CP_Size inContentSize,
const CP_String inTitle,
bool  inHasHorizontalScroll = true,
bool  inHasVerticalScroll = true,
bool  inHasGrowBox = true,
bool  inReadOnly = false,
bool  inDrawFocusBorder = true
 

Constructor. The will also create the platforms implementation of the control.

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.
inTitle The text/title of the control.
Exceptions:
none 

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

Destructor.

Exceptions:
none 


Member Function Documentation

CP_M_Persist * CP_TextView::PersistCreator  )  [static]
 

CP_M_Persist function to create an instance of this button. 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_BevelButton object.

Reimplemented from CP_View.

void CP_TextView::Activate  )  [virtual]
 

Activate this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View.

void CP_TextView::Deactivate  )  [virtual]
 

Deactivate this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View.

OSStatus CP_TextView::ReadTextFromFile const CP_FileSystemSpec inFileSpec  ) 
 

CP_String CP_TextView::GetText char  inLineEnd = CP_LF  ) 
 

UInt32 CP_TextView::GetTextLength  ) 
 

void CP_TextView::TextChanged  )  [virtual]
 

void CP_TextView::Print  )  [virtual]
 

void CP_TextView::GetSelection UInt32 inStartSelection,
UInt32 inEndSelection
 

void CP_TextView::SetSelection UInt32  inStartSelection,
UInt32  inEndSelection
 

bool CP_TextView::HasSelection  ) 
 

void CP_TextView::SetText const CP_String inText  ) 
 

void CP_TextView::SetText CP_InStream inStream  ) 
 

void CP_TextView::InsertText const CP_String inText  ) 
 

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

void CP_TextView::SetFontSpec CP_FontSpec inFontSpec  )  [virtual]
 

void CP_TextView::SetFontName const CP_String inFontName  ) 
 

void CP_TextView::SetFontSize SInt16  inSize  ) 
 

void CP_TextView::SetFontStyle SInt16  inStyle  ) 
 

void CP_TextView::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 from CP_View_Imp.

void CP_TextView::OnLosingFocus  )  [protected, virtual]
 

Reimplemented from CP_View.

void CP_TextView::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_View.

void CP_TextView::CommandUpdateStatus CP_Event_Base inEvent  )  [private]
 

void CP_TextView::CommandProcess CP_Event_Base inEvent  )  [private]
 

void CP_TextView::HandleCommandStatus CP_CommandStatus inCommandStatus,
bool &  inOutResult,
CP_CommandNo inCommandNo
[private]
 

void CP_TextView::HandleCutCommand OSStatus inOutStatus,
CP_CommandNo inCommandNo
[private]
 

void CP_TextView::HandleCopyCommand OSStatus inOutStatus,
CP_CommandNo inCommandNo
[private]
 

void CP_TextView::HandleClearCommand OSStatus inOutStatus,
CP_CommandNo inCommandNo
[private]
 

void CP_TextView::HandlePasteCommand OSStatus inOutStatus,
CP_CommandNo inCommandNo
[private]
 

void CP_TextView::HandleSelectAllCommand OSStatus inOutStatus,
CP_CommandNo inCommandNo
[private]
 

void CP_TextView::HandleUndoCommand OSStatus inOutStatus,
CP_CommandNo inCommandNo
[private]
 

void CP_TextView::HandleRedoCommand OSStatus inOutStatus,
CP_CommandNo inCommandNo
[private]
 

void CP_TextView::CreatePlatformImp CP_View inSuperview,
const CP_Point inUpperLeft,
const CP_Size inContentSize,
const CP_String inText,
bool  inHasHorizontalScroll = true,
bool  inHasVerticalScroll = true,
bool  inHasGrowBox = true,
bool  inReadOnly = false,
bool  inDrawFocusBorder = true
[private]
 

Contains the current font settings for the text.

void CP_TextView::HandleMouseDown CP_Event_Base inEvent  )  [private, virtual]
 

Reimplemented from CP_View_Imp.

void CP_TextView::CreatePlatformImp CP_View inSuperview,
const CP_Point inUpperLeft,
const CP_Size inContentSize,
const CP_String inText,
bool  inHasHorizontalScroll = true,
bool  inHasVerticalScroll = true,
bool  inHasGrowBox = true,
bool  inReadOnly = false,
bool  inDrawFocusBorder = true
[private]
 

void CP_TextView::CreatePlatformImp CP_View inSuperview,
const CP_Point inUpperLeft,
const CP_Size inContentSize,
const CP_String inText,
bool  inHasHorizontalScroll = true,
bool  inHasVerticalScroll = true,
bool  inHasGrowBox = true,
bool  inReadOnly = false,
bool  inDrawFocusBorder = true
[private]
 

void CP_View::Show  )  [virtual, inherited]
 

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

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::Enable  )  [virtual, inherited]
 

Enable this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

Reimplemented in CP_QT_MovieView.

void CP_View::Disable  )  [virtual, inherited]
 

Disable this view.

Exceptions:
none 
Returns:
void

Reimplemented from CP_View_Imp.

Reimplemented in CP_QT_MovieView.

bool CP_View::IsFocused  )  [inherited]
 

void CP_View::SetFocused bool  inFocused  )  [inherited]
 

bool CP_View::CanLoseFocus  )  [virtual, inherited]
 

bool CP_View::FocusCanChange  )  [inherited]
 

void CP_View::LosingFocus  )  [inherited]
 

void CP_View::HandleActivationEvent  )  [inherited]
 

void CP_View::HandleDeactivationEvent  )  [inherited]
 

void CP_View::HandleBoundsChanged const CP_Rect inPreviousBounds,
const CP_Rect inNewBounds
[virtual, inherited]
 

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

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

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

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

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

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

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

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

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

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

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

CP_Size CP_View::GetPrintSize  )  [inherited]
 

CP_Rect CP_View::GetLocalPrintBounds  )  [inherited]
 

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

void CP_View::SetPrintSize const CP_Size inSize  )  [inherited]
 

void CP_View::AddSubview CP_View inView