W32DLib
W32DLib::Text Class Reference

The Text class. More...

#include <w32dlib/text.h>

Inheritance diagram for W32DLib::Text:
W32DLib::Control W32DLib::Window

Public Member Functions

 Text (Dialog *parent, int resource_id, DataX *datax)
 Constructor.
 
virtual ~Text ()
 Destructor.
 
void OnTextChanged (Window *owner, W32DLibCallback callback)
 Sets a callback for when the text is altered.
 
void MaxLen (int count)
 Sets the maximum length the user can enter.
 
void ReadOnly (bool readonly)
 Sets whether the user can enter text.
 
void AppendText (const TCHAR *text)
 Appends text.
 
void AppendText (const W32String &text)
 Appends text.
 
- Public Member Functions inherited from W32DLib::Control
 Control (Dialog *parent, int resource_id, DataX *datax)
 Constructor.
 
virtual ~Control ()
 Destructor.
 
int ResourceID ()
 Returns the Resource ID for the control.
 
BOOL ProcessMessage (UINT msg, WPARAM wp, LPARAM lp)
 Processes a windows event.
 
virtual void DoDataExchange (bool set)
 Provides a base DoDataExchange.
 
- Public Member Functions inherited from W32DLib::Window
 Window ()
 Constructor.
 
virtual ~Window ()
 Destructor.
 
bool HasMutex ()
 Whether the Window() constructor could create a mutex.
 
HWND GetHWND ()
 Returns the HWND for the window.
 
HMENU GetHMENU ()
 Returns the HMENU associated with this window.
 
bool SetHMENU (HMENU menu)
 Sets the HMENU associated with this window.
 
bool Move (int x, int y, int width, int height, bool repaint=true)
 Sets a Window's position and size.
 
bool MoveBase (Window *w, int x, int y, int width, int height, bool repaint=true)
 Sets a Window's position and size using Dialog base units.
 
LRESULT SendMsg (UINT msg, WPARAM wp, LPARAM lp)
 Send a message to the window.
 
void SetText (const TCHAR *text)
 Sets the window text.
 
void SetText (const W32String &text)
 Sets the window text.
 
W32String GetText ()
 Gets the window text.
 
void Enable (bool enable)
 Enables or disables the window.
 

Additional Inherited Members

- Protected Member Functions inherited from W32DLib::Control
void AddCallback (UINT msg, UINT notification, Window *owner, W32DLibCallback callback)
 Add a callback for the control.
 
- Static Protected Member Functions inherited from W32DLib::Window
static BOOL CALLBACK WindowProc (HWND wnd, UINT msg, WPARAM wp, LPARAM lp)
 The base WindProc.
 
- Protected Attributes inherited from W32DLib::Control
Dialogm_parent
 Filled in by the constructor with the parent dialog.
 
int m_resid
 Filled in by the constructor with the resource ID.
 
DataXm_data
 Filled in by the constructor with the DataX object.
 

Detailed Description

The Text class.

Constructor & Destructor Documentation

W32DLib::Text::Text ( Dialog parent,
int  resource_id,
DataX datax 
)

Constructor.

Parameters
parentThe dialog the control belongs to.
resource_idThe ID of the control in the resource file.
dataxThe DataX to use. NULL means don't use data exchange.
virtual W32DLib::Text::~Text ( )
virtual

Destructor.

Member Function Documentation

void W32DLib::Text::AppendText ( const TCHAR *  text)

Appends text.

Note this is mainly for providing logging controls and the suchlike. Any current selection and caret position will almost certainly be messed up.

Parameters
textThe text to add.
void W32DLib::Text::AppendText ( const W32String text)

Appends text.

Note this is mainly for providing logging controls and the suchlike. Any current selection and caret position will almost certainly be messed up.

Parameters
textThe text to add.
void W32DLib::Text::MaxLen ( int  count)

Sets the maximum length the user can enter.

Parameters
countThe maximum number of characters the user can enter.
void W32DLib::Text::OnTextChanged ( Window owner,
W32DLibCallback  callback 
)

Sets a callback for when the text is altered.

Parameters
ownerThe class the callback resides in.
callbackThe callback.
void W32DLib::Text::ReadOnly ( bool  readonly)

Sets whether the user can enter text.

Parameters
readonlytrue for readonly, false for editable.

The documentation for this class was generated from the following file: