VisibleLabel Class Reference

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

#include <uielem.h>

Inheritance diagram for VisibleLabel:

UserInterface Notifier List of all members.

Public Member Functions

 VisibleLabel (const StringBase &TextString=NullString)
 Provides the user with a label so they can see what's what. And it allows us to re-label things.
virtual ~VisibleLabel ()
 Provides the user with a label so they can see what's what. And it allows us to re-label things.
virtual const VisibleLabeloperator= (const StringBase &NewText)
 Presents the given text to the user.
 operator const StringBase & () const
 Pretends this VisibleLabel is a StringBase, so it can be assigned and stuff.
virtual BOOL Display (DialogOp &Dialog)
 Displays this VisibleLabel slightly bodgily in the given (Template)Dialog, but doesn't enable it.
virtual BOOL Interact (DialogOp &Dialog)
 Displays this VisibleLabel slightly bodgily in the given (Template)Dialog and enables it (otherwise it's grey).
virtual void Hide ()
 Removes this VisibleLabel from the Dialog given in Display() or Interact().

Private Attributes

VisibleLabel::Observer m_Watcher
StaticTextControlm_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 312 of file uielem.h.


Constructor & Destructor Documentation

VisibleLabel::VisibleLabel const StringBase TextString = NullString  ) 
 

Provides the user with a label so they can see what's what. And it allows us to re-label things.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: This is very much like EditableText: should it be the same? The original MSJ version had a read-only EditableText object.

Definition at line 1096 of file uielem.cpp.

01096                                                        :
01097     m_Watcher(this),
01098     m_pUIElement(NULL),
01099     m_String(TextString)
01100 {
01101 }
#pragma warning( default : 4355 )

VisibleLabel::~VisibleLabel  )  [virtual]
 

Provides the user with a label so they can see what's what. And it allows us to re-label things.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Notes: This is very much like EditableText: should it be the same? The original MSJ version had a read-only EditableText object.

Definition at line 1120 of file uielem.cpp.

01121 {
01122     if (m_pUIElement != NULL)
01123     {
01124         m_pUIElement->UpdateText(NullString);
01125     }
01126 }


Member Function Documentation

BOOL VisibleLabel::Display DialogOp Dialog  )  [virtual]
 

Displays this VisibleLabel slightly bodgily in the given (Template)Dialog, but doesn't enable it.

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?

Implements UserInterface.

Definition at line 1227 of file uielem.cpp.

01228 {
01229     PORTNOTETRACE("dialog","VisibleLabel::Display - do nothing");
01230 #ifndef EXCLUDE_FROM_XARALX
01231     ERROR3IF(!((&Dialog)->IS_KIND_OF(TemplateDialog)), "Dialog isn't kind of TemplateDialog");
01232 
01233     TemplateDialog& BetterBeThisDialog = (TemplateDialog&)Dialog;
01234 
01235     m_pUIElement = &(BetterBeThisDialog.GetParamHintControl());
01236 
01237     m_pUIElement->UpdateText(m_String);
01238 #endif
01239     return TRUE;
01240 }

void VisibleLabel::Hide  )  [virtual]
 

Removes this VisibleLabel from the Dialog given in Display() or Interact().

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 1286 of file uielem.cpp.

01287 {
01288     if (m_pUIElement != NULL)
01289     {
01290         m_pUIElement->UpdateText(NullString);
01291         m_pUIElement->Disable();
01292         m_pUIElement = NULL;
01293     }
01294 }

BOOL VisibleLabel::Interact DialogOp Dialog  )  [virtual]
 

Displays this VisibleLabel slightly bodgily in the given (Template)Dialog and enables it (otherwise it's grey).

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?

Implements UserInterface.

Definition at line 1259 of file uielem.cpp.

01260 {
01261     BOOL Ok = Display(Dialog);
01262 
01263     if (Ok && m_pUIElement != NULL)
01264     {
01265         m_pUIElement->Enable();
01266     }
01267 
01268     return Ok;
01269 }

VisibleLabel::operator const StringBase &  )  const
 

Pretends this VisibleLabel 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 1159 of file uielem.cpp.

01160 {
01161     return m_String;
01162 }

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

Presents the given text to the user.

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

Definition at line 1139 of file uielem.cpp.

01140 {
01141     m_String = NewString;
01142 
01143     Notify(&m_Watcher);
01144 
01145     return *this;
01146 }


Friends And Related Function Documentation

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


Member Data Documentation

StaticTextControl* VisibleLabel::m_pUIElement [private]
 

Definition at line 340 of file uielem.h.

String_256 VisibleLabel::m_String [private]
 

Definition at line 341 of file uielem.h.

VisibleLabel::Observer VisibleLabel::m_Watcher [private]
 


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