Inheritance diagram for VisibleLabel::Observer:
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 | |
VisibleLabel * | m_pTheTextObject |
Definition at line 329 of file uielem.h.
|
Definition at line 333 of file uielem.h. 00333 : m_pTheTextObject(pContainer){}
|
|
Embedded object catches Notifications (doesn't do anything en ce moment, so don't use Notify.
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 }
|
|
|