TextControl Class Reference

Represents an Edit Box in a DialogOp. More...

#include <gadget.h>

Inheritance diagram for TextControl:

DialogMgrGadget NotifyingGadget Gadget CCCoreUI List of all members.

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 TextControloperator= (const TextControl &OtherControl)
 TextControl (const TextControl &OtherControl)

Private Member Functions

 CC_DECLARE_MEMDUMP (TextControl)

Private Attributes

Notifiablem_pObserver

Detailed Description

Represents an Edit Box in a DialogOp.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/10/96

Definition at line 490 of file gadget.h.


Constructor & Destructor Documentation

TextControl::TextControl DialogOp *const   pDialog,
CGadgetID  ControlID,
const StringBase InitialText = NullString,
Notifiable *const   pTell = &Nobody
 

Default constructor for a TextControl.

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

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 }

virtual TextControl::~TextControl  )  [inline, virtual]
 

Definition at line 500 of file gadget.h.

00500 {};

TextControl::TextControl const TextControl OtherControl  )  [protected]
 

Definition at line 226 of file gadget.cpp.

00226                                                         :
00227     DialogMgrGadget(NULL, 0)
00228 {
00229     ERROR3("TextControl copy constructor not implemented\n");
00230 }


Member Function Documentation

TextControl::CC_DECLARE_MEMDUMP TextControl   )  [private]
 

void TextControl::OnChange  )  [virtual]
 

Default destructor for a TextControl.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Parameters:
pDisplayedString : the string to set in the text control [OUTPUTS]

Definition at line 289 of file gadget.cpp.

00290 {
00291     Notify(m_pObserver);
00292 }

const TextControl & TextControl::operator= const TextControl OtherControl  )  [protected]
 

Definition at line 219 of file gadget.cpp.

00220 {
00221     ERROR3("TextControl assignment not implemented\n");
00222 
00223     return *this;
00224 }

void TextControl::RetrieveText StringBase *const   pDisplayedString  )  const
 

Default destructor for a TextControl.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Parameters:
pDisplayedString : the string to set in the text control [OUTPUTS]

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 }

void TextControl::UpdateText const StringBase NewString  ) 
 

Default destructor for a TextControl.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/06/97
Input: NewString : the string to set in the text control

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 }


Member Data Documentation

Notifiable* TextControl::m_pObserver [private]
 

Definition at line 512 of file gadget.h.


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