EditableText::Observer Class Reference

Inheritance diagram for EditableText::Observer:

Notifiable List of all members.

Public Member Functions

 Observer (EditableText *const pContainer)
void Notify (Notifier *const pSender)
 Embedded object catches Notifications (doesn't do anything en ce moment, so don't use Notify.

Private Attributes

EditableTextm_pTheTextObject

Detailed Description

Definition at line 283 of file uielem.h.


Constructor & Destructor Documentation

EditableText::Observer::Observer EditableText *const   pContainer  )  [inline]
 

Definition at line 287 of file uielem.h.

00287 : m_pTheTextObject(pContainer){}


Member Function Documentation

void EditableText::Observer::Notify Notifier *const   pSender  )  [virtual]
 

Embedded object catches Notifications (doesn't do anything en ce moment, so don't use Notify.

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

Implements Notifiable.

Definition at line 985 of file uielem.cpp.

00986 {
00987     // This function is a friend of class Text, a pointer
00988     // to which is in the owner field; It's called when the
00989     // String base class changes. Note that we have to turn
00990     // notify off in whichever object is being updated. Otherwise,
00991     // we'll just end up back here.
00992 
00993     EditableText* const pText = (EditableText*)(pSender);
00994     if (pText != NULL)
00995     {
00996         // String base class was changed, transfer the new value
00997         // to the display.
00998         TextControl* const pUI = pText->m_pUIElement;
00999         if (pUI != NULL)
01000         {
01001             pUI->NotifyOff();
01002             pUI->UpdateText(*m_pTheTextObject); // modify the string
01003             pUI->NotifyOn();
01004         }
01005     }
01006     else // User changed the TextControl, copy new value to
01007     {    // the string base class of the associated text object.
01008 
01009         TextControl* pUI = (TextControl*)(pSender);
01010         ASSERT(pUI != NULL);
01011         
01012         pUI->NotifyOff();           // prevent string from notifying us
01013         pUI->RetrieveText(&m_pTheTextObject->m_String);
01014         pUI->NotifyOn();            // re-enable notification
01015     }
01016 }


Member Data Documentation

EditableText* EditableText::Observer::m_pTheTextObject [private]
 

Definition at line 285 of file uielem.h.


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