/******************************************************************************************** > void EditableText::Observer::Notify(Notifier* const pSender) Author: Colin_Barfoot (Xara Group Ltd) <*****@*****.**> Created: 09/06/97 Purpose: Embedded object catches Notifications (doesn't do anything en ce moment, so don't use Notify ********************************************************************************************/ void EditableText::Observer::Notify(Notifier* const pSender) { // This function is a friend of class Text, a pointer // to which is in the owner field; It's called when the // String base class changes. Note that we have to turn // notify off in whichever object is being updated. Otherwise, // we'll just end up back here. EditableText* const pText = (EditableText*)(pSender); if (pText != NULL) { // String base class was changed, transfer the new value // to the display. TextControl* const pUI = pText->m_pUIElement; if (pUI != NULL) { pUI->NotifyOff(); pUI->UpdateText(*m_pTheTextObject); // modify the string pUI->NotifyOn(); } } else // User changed the TextControl, copy new value to { // the string base class of the associated text object. TextControl* pUI = (TextControl*)(pSender); ASSERT(pUI != NULL); pUI->NotifyOff(); // prevent string from notifying us pUI->RetrieveText(&m_pTheTextObject->m_String); pUI->NotifyOn(); // re-enable notification } }
/******************************************************************************************** > BOOL EditableText::Display(TextControl& Control) Author: Colin_Barfoot (Xara Group Ltd) <*****@*****.**> Created: 09/06/97 Purpose: Displays this EditableText in the given TextControl. 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? ********************************************************************************************/ BOOL EditableText::Display(TextControl& Control) { m_pUIElement = &Control; Control.UpdateText(m_String); return TRUE; }
void CountersWindow::CreateSubWindows(HWND hWnd) { TextControl text; text.CreateThis(hWnd, 0, 0, 200, 20, "Counters...", 0); }
void SwitchesWindow::CreateSubWindows(HWND hWnd) { TextControl text; text.CreateThis(hWnd, 0, 0, 200, 20, "Switches...", 0); }
void TemplatesWindow::CreateSubWindows(HWND hWnd) { TextControl text; text.CreateThis(hWnd, 0, 0, 200, 20, "Templates...", 0); }