VisibleLabel::Observer Class Reference

Inheritance diagram for VisibleLabel::Observer:

Notifiable List of all members.

Public Member Functions

 Observer (VisibleLabel *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

VisibleLabelm_pTheTextObject

Detailed Description

Definition at line 329 of file uielem.h.


Constructor & Destructor Documentation

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

Definition at line 333 of file uielem.h.

00333 : m_pTheTextObject(pContainer){}


Member Function Documentation

void VisibleLabel::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 1176 of file uielem.cpp.

01177 {
01178     // This function is a friend of class Text, a pointer
01179     // to which is in the owner field; It's called when the
01180     // String base class changes. Note that we have to turn
01181     // notify off in whichever object is being updated. Otherwise,
01182     // we'll just end up back here.
01183 
01184 //  ENSURE_KIND(pSender, VisibleLabel);
01185     VisibleLabel* const pText = (VisibleLabel*)(pSender);
01186     if (pText != NULL)
01187     {
01188         // String base class was changed, transfer the new value
01189         // to the display.
01190         StaticTextControl* const pUI = pText->m_pUIElement;
01191         if (pUI != NULL)
01192         {
01193             pUI->NotifyOff();
01194             pUI->RetrieveText(&m_pTheTextObject->m_String);
01195             pUI->NotifyOn();
01196         }
01197     }
01198     else // User changed the TextControl, copy new value to
01199     {    // the string base class of the associated text object.
01200 
01201         StaticTextControl* pUI = (StaticTextControl*)(pSender);
01202         ASSERT(pUI != NULL);
01203         
01204         pUI->NotifyOff();           // prevent string from notifying us
01205         pUI->UpdateText(*m_pTheTextObject); // modify the string
01206         pUI->NotifyOn();            // re-enable notification
01207     }
01208 }


Member Data Documentation

VisibleLabel* VisibleLabel::Observer::m_pTheTextObject [private]
 

Definition at line 331 of file uielem.h.


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