EditableText Class Reference

Allows a user to edit a list of items. More...

#include <uielem.h>

Inheritance diagram for EditableText:

UserInterface Notifier List of all members.

Public Member Functions

 EditableText (const StringBase &TextString=NullString)
 Provides the user with a string that they can edit and we can retrieve.
virtual ~EditableText ()
 Ensures the text in the control / gadget is empty.
 EditableText (const EditableText &Other)
 Warns that these members are unimplemented (destructor is though).
virtual const EditableTextoperator= (const EditableText &Other)
virtual const EditableTextoperator= (const StringBase &NewText)
 Puts the given text into the UIElement.
 operator const StringBase & ()
 Pretends this EditableText is a StringBase, so it can be assigned and stuff.
virtual BOOL Display (DialogOp &Dialog)
virtual BOOL Interact (DialogOp &Dialog)
virtual BOOL Display (TextControl &Control)
 Displays this EditableText in the given TextControl.
virtual void Hide ()
 Ensures the Text in the control is the text inside this EditableText object.

Private Attributes

EditableText::Observer m_Watcher
TextControlm_pUIElement
String_256 m_String

Friends

void Observer::Notify (Notifier *const pSender)

Classes

class  Observer

Detailed Description

Allows a user to edit a list of items.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/10/96

Definition at line 263 of file uielem.h.


Constructor & Destructor Documentation

EditableText::EditableText const StringBase TextString = NullString  ) 
 

Provides the user with a string that they can edit and we can retrieve.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: This was taken from MSJ, but is not complete, so be careful. In particular, 1. The interface for Display, etc. is not clarified, (what goes in, what comes out). 2. Notification is not used properly.

The following code kicks out:

warning C4355: 'this' : used in base member initializer list.

Normally, it would be dangerous for the contained-object constructor to access the container class because the contained objects are initialized before the container is initialized. We don't do that here, and it's convenient to pass a pointer to the container at construction time, so turn off the warning.

Definition at line 874 of file uielem.cpp.

00874                                                        :
00875     m_Watcher(this),
00876     m_pUIElement(NULL),
00877     m_String(TextString)
00878 {
00879 }

EditableText::~EditableText  )  [virtual]
 

Ensures the text in the control / gadget is empty.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97

Definition at line 894 of file uielem.cpp.

00895 {
00896     if (m_pUIElement != NULL)
00897     {
00898         m_pUIElement->UpdateText(NullString);
00899     }
00900 }

EditableText::EditableText const EditableText Other  ) 
 

Warns that these members are unimplemented (destructor is though).

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97

Definition at line 916 of file uielem.cpp.

00916                                                     :
00917     m_Watcher(this)
00918 {   
00919     ERROR3("EditableText - copy constructor unimplemented\n");  
00920 }


Member Function Documentation

BOOL EditableText::Display TextControl Control  )  [virtual]
 

Displays this EditableText in the given TextControl.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: This interface may very well change. At present there's one of these taking a DialogOp (inherited from UserInterface) which does nothing. There's also an Interact function missing: should it just enable the control?

Definition at line 1034 of file uielem.cpp.

01035 {
01036     m_pUIElement = &Control;
01037     Control.UpdateText(m_String);
01038 
01039     return TRUE;
01040 }

virtual BOOL EditableText::Display DialogOp Dialog  )  [inline, virtual]
 

Implements UserInterface.

Definition at line 276 of file uielem.h.

00276 {   return TRUE;    }

void EditableText::Hide  )  [virtual]
 

Ensures the Text in the control is the text inside this EditableText object.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: This interface may very well change. At present the control is emptied and disabled: should it disappear completely?

Implements UserInterface.

Definition at line 1057 of file uielem.cpp.

01058 {
01059     if (m_pUIElement != NULL)
01060     {
01061         m_pUIElement->RetrieveText(&m_String);
01062         m_pUIElement->UpdateText(NullString);
01063         m_pUIElement->Disable();
01064         m_pUIElement = NULL;
01065     }
01066 }

virtual BOOL EditableText::Interact DialogOp Dialog  )  [inline, virtual]
 

Implements UserInterface.

Definition at line 277 of file uielem.h.

00277 {   return TRUE;    }

EditableText::operator const StringBase &  ) 
 

Pretends this EditableText is a StringBase, so it can be assigned and stuff.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97

Definition at line 963 of file uielem.cpp.

00964 {
00965     if (m_pUIElement != NULL)
00966     {
00967         m_pUIElement->RetrieveText(&m_String);
00968     }
00969 
00970     return m_String;
00971 }

const EditableText & EditableText::operator= const StringBase NewString  )  [virtual]
 

Puts the given text into the UIElement.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97

Definition at line 943 of file uielem.cpp.

00944 {
00945     m_String = NewString;
00946 
00947     Notify(&m_Watcher);
00948 
00949     return *this;
00950 }

const EditableText & EditableText::operator= const EditableText Other  )  [virtual]
 

Definition at line 925 of file uielem.cpp.

00926 {   
00927     ERROR3("EditableText - assignment operator not implemented\n"); 
00928 
00929     return *this;
00930 }


Friends And Related Function Documentation

void Observer::Notify Notifier *const   pSender  )  [friend]
 


Member Data Documentation

TextControl* EditableText::m_pUIElement [private]
 

Definition at line 294 of file uielem.h.

String_256 EditableText::m_String [private]
 

Definition at line 295 of file uielem.h.

EditableText::Observer EditableText::m_Watcher [private]
 


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:53:55 2007 for Camelot by  doxygen 1.4.4