#include <gadget.h>
Inheritance diagram for TextControl:
Public Member Functions | |
TextControl (DialogOp *const pDialog, CGadgetID ControlID, const StringBase &InitialText=NullString, Notifiable *const pTell=&Nobody) | |
Default constructor for a TextControl. | |
virtual | ~TextControl () |
void | UpdateText (const StringBase &NewString) |
Default destructor for a TextControl. | |
void | RetrieveText (StringBase *const pExistingString) const |
Default destructor for a TextControl. | |
virtual void | OnChange () |
Default destructor for a TextControl. | |
Protected Member Functions | |
const TextControl & | operator= (const TextControl &OtherControl) |
TextControl (const TextControl &OtherControl) | |
Private Member Functions | |
CC_DECLARE_MEMDUMP (TextControl) | |
Private Attributes | |
Notifiable * | m_pObserver |
Definition at line 490 of file gadget.h.
|
Default constructor for a TextControl.
Definition at line 188 of file gadget.cpp. 00190 : 00191 DialogMgrGadget(pDialog, ControlID), 00192 m_pObserver(pTell) 00193 { 00194 // The SetWindowText sends an EN_CHANGE, which calls OnChange, which 00195 // notifies the Text_control, which updates the String, which notifies 00196 // the Text_control, which updates the window text, and around and 00197 // and around. Solve the problem in the OnChange() function, but set 00198 // "initializing" true to tell OnChange what's going on. Turn off 00199 // notification to prevent this. 00200 // 00201 // I'm assuming synchronous behavior; I don't expect SentWindowText 00202 // to return until AFTER the EnChange() handler has been executed. 00203 // If this turns out not to be the case in the future, you'll have 00204 // to modify this code: add an "initializing" field to the class, 00205 // set it true instead of calling notify_off, set it false instead 00206 // of calling notify_on, and modify OnChange to not notify anybody 00207 // if "initializing" is true. 00208 00209 00210 if (!InitialText.IsEmpty()) 00211 { 00212 NotifyOff(); 00213 pDialog->SetStringGadgetValue(m_ControlID, InitialText); 00214 NotifyOn(); 00215 } 00216 }
|
|
Definition at line 500 of file gadget.h.
|
|
Definition at line 226 of file gadget.cpp. 00226 : 00227 DialogMgrGadget(NULL, 0) 00228 { 00229 ERROR3("TextControl copy constructor not implemented\n"); 00230 }
|
|
|
|
Default destructor for a TextControl.
Definition at line 289 of file gadget.cpp. 00290 { 00291 Notify(m_pObserver); 00292 }
|
|
Definition at line 219 of file gadget.cpp. 00220 { 00221 ERROR3("TextControl assignment not implemented\n"); 00222 00223 return *this; 00224 }
|
|
Default destructor for a TextControl.
Definition at line 266 of file gadget.cpp. 00267 { 00268 ASSERT(m_ControlID != 0 && m_pDialog != NULL); 00269 00270 if (pDisplayedString != NULL) 00271 { 00272 *pDisplayedString = m_pDialog->GetStringGadgetValue(m_ControlID); 00273 } 00274 }
|
|
Default destructor for a TextControl.
Definition at line 245 of file gadget.cpp. 00246 { 00247 ASSERT(m_ControlID != 0 && m_pDialog != NULL); 00248 00249 m_pDialog->SetStringGadgetValue(m_ControlID, NewString); 00250 Notify(m_pObserver); 00251 }
|
|
|