#include <wg_editbox.h>
Inheritance diagram for wGui::CEditBox:
Definition at line 43 of file wg_editbox.h.
wGui::CEditBox::CEditBox | ( | const CRect & | WindowRect, | |
CWindow * | pParent, | |||
CFontEngine * | pFontEngine = 0 | |||
) |
Construct a new Edit control
WindowRect | A CRect that defines the outer limits of the control | |
pParent | A pointer to the parent window | |
pFontEngine | A pointer to the font engine to use when drawing the control If this is left out (or set to 0) it will use the default font engine specified by the CApplication (which must be set before instantiating this object) |
Definition at line 39 of file wg_editbox.cpp.
References wGui::COLOR_WHITE, wGui::CMessage::CTRL_DOUBLELCLICK, wGui::CMessage::CTRL_GAININGKEYFOCUS, wGui::CMessage::CTRL_LOSINGKEYFOCUS, wGui::CMessage::CTRL_TIMER, Draw(), wGui::CApplication::GetDefaultFontEngine(), wGui::CRect::Grow(), wGui::CRenderedString::HALIGN_LEFT, wGui::CMessageServer::Instance(), wGui::CApplication::Instance(), wGui::CMessage::KEYBOARD_KEYDOWN, wGui::CWindow::m_BackgroundColor, wGui::CWindow::m_ClientRect, m_pFontEngine, m_pRenderedString, wGui::CMessage::MOUSE_BUTTONUP, wGui::CMessage::MOUSE_MOVE, wGui::CMessageServer::RegisterMessageClient(), and wGui::CRenderedString::VALIGN_NORMAL.
void wGui::CEditBox::SetUsePasswordMask | ( | bool | bUseMask | ) | [inline] |
Set the Password mask state of the control
bUseMask | If set to true, the control will act as a password mask box |
Definition at line 58 of file wg_editbox.h.
References m_bUseMask.
bool wGui::CEditBox::UsingPasswordMask | ( | void | ) | const [inline] |
Indicates if the edit box is using a password mask
Definition at line 62 of file wg_editbox.h.
References m_bUseMask.
void wGui::CEditBox::SetReadOnly | ( | bool | bReadOnly | ) |
Set the Read-only state of the control
bReadOnly | If set to true, the control will not take any keyboard input |
Definition at line 84 of file wg_editbox.cpp.
References wGui::COLOR_LIGHTGRAY, wGui::COLOR_WHITE, Draw(), wGui::CWindow::m_BackgroundColor, and m_bReadOnly.
Referenced by wGui::CDropDown::CDropDown().
bool wGui::CEditBox::IsReadOnly | ( | void | ) | const [inline] |
Indicates if the edit box is operating in read-only mode
Definition at line 70 of file wg_editbox.h.
References m_bReadOnly.
std::wstring wGui::CEditBox::GetSelText | ( | void | ) | const |
Gets the currently selected text
Definition at line 92 of file wg_editbox.cpp.
References m_bUseMask, m_SelLength, m_SelStart, and wGui::CWindow::m_sWindowText.
void wGui::CEditBox::SetSelection | ( | std::wstring::size_type | iSelStart, | |
int | iSelLength | |||
) |
Set the selection
iSelStart | The index of the start of the selection | |
iSelLength | The number of characters selected |
Definition at line 115 of file wg_editbox.cpp.
References m_SelLength, m_SelStart, and wGui::CWindow::m_sWindowText.
virtual std::wstring::size_type wGui::CEditBox::GetSelectionStart | ( | void | ) | const [inline, virtual] |
Gets the starting index of the selection
Definition at line 83 of file wg_editbox.h.
References m_SelStart.
virtual int wGui::CEditBox::GetSelectionLength | ( | void | ) | const [inline, virtual] |
Gets the length of the selection
Definition at line 87 of file wg_editbox.h.
References m_SelLength.
std::wstring::size_type wGui::CEditBox::GetIndexFromPoint | ( | const CPoint & | Point | ) | const [virtual] |
Gets a character index from a point
Point | The point (in window coordinates) |
Definition at line 133 of file wg_editbox.cpp.
References wGui::CPoint::SetX(), and wGui::CPoint::XPos().
Referenced by HandleMessage(), and OnMouseButtonDown().
void wGui::CEditBox::SetWindowText | ( | const std::wstring & | sText | ) | [virtual] |
Set the WindowText of the control
sText | The text to assign to the window |
Reimplemented from wGui::CWindow.
Definition at line 283 of file wg_editbox.cpp.
References wGui::CRenderedString::HALIGN_LEFT, m_pFontEngine, m_pRenderedString, m_SelLength, m_SelStart, wGui::CWindow::SetWindowText(), and wGui::CRenderedString::VALIGN_NORMAL.
Referenced by wGui::CDropDown::SetWindowText().
bool wGui::CEditBox::OnMouseButtonDown | ( | CPoint | Point, | |
unsigned int | Button | |||
) | [virtual] |
This is called whenever the editbox is clicked on by the mouse Only the topmost window that bounds the point will be called by the system
Point | The point where the mouse clicked | |
Button | A bitfield indicating which button the window was clicked with |
Reimplemented from wGui::CWindow.
Definition at line 294 of file wg_editbox.cpp.
References wGui::CMessage::CTRL_DOUBLELCLICK, Draw(), GetIndexFromPoint(), wGui::CRect::HitTest(), wGui::CApplication::Instance(), wGui::CMessageServer::Instance(), wGui::CTimer::IsRunning(), wGui::CMouseMessage::LEFT, m_bMouseDown, m_bReadOnly, wGui::CWindow::m_bVisible, wGui::CWindow::m_ClientRect, m_DragStart, m_SelLength, m_SelStart, wGui::CWindow::OnMouseButtonDown(), wGui::CMessageServer::QueueMessage(), wGui::CRect::RELPOS_INSIDE, wGui::CApplication::SetKeyFocus(), wGui::CTimer::StartTimer(), wGui::CTimer::StopTimer(), and wGui::CWindow::ViewToWindow().
bool wGui::CEditBox::HandleMessage | ( | CMessage * | pMessage | ) | [virtual] |
CEditBox will handle MOUSE_BUTTONDOWN and KEYBOARD_KEYDOWN messages
pMessage | A pointer to the message that needs to be handled |
Reimplemented from wGui::CWindow.
Definition at line 335 of file wg_editbox.cpp.
References wGui::CMessage::CTRL_DOUBLELCLICK, wGui::CMessage::CTRL_GAININGKEYFOCUS, wGui::CMessage::CTRL_LOSINGKEYFOCUS, wGui::CMessage::CTRL_TIMER, wGui::CMessage::CTRL_VALUECHANGE, wGui::CMessage::Destination(), Draw(), wGui::CView::GetFloatingWindow(), GetIndexFromPoint(), wGui::CWindow::GetView(), wGui::CRect::Grow(), wGui::CRenderedString::HALIGN_LEFT, wGui::CWindow::HandleMessage(), wGui::CRect::HitTest(), wGui::CWindow::HitTest(), wGui::CMessageServer::Instance(), wGui::CApplication::Instance(), wGui::CKeyboardMessage::Key, wGui::CMessage::KEYBOARD_KEYDOWN, m_bLastMouseMoveInside, m_bMouseDown, m_bReadOnly, wGui::CWindow::m_bVisible, wGui::CWindow::m_ClientRect, m_DragStart, m_pFontEngine, wGui::CWindow::m_pParentWindow, m_pRenderedString, m_SelLength, m_SelStart, wGui::CWindow::m_sWindowText, wGui::CWindow::m_WindowRect, wGui::CMessage::MessageType(), wGui::CKeyboardMessage::Modifiers, wGui::CMessage::MOUSE_BUTTONUP, wGui::CMessage::MOUSE_MOVE, wGui::CMouseMessage::Point, wGui::CMessageServer::QueueMessage(), wGui::CRect::RELPOS_INSIDE, SelDelete(), wGui::CApplication::SetMouseCursor(), wGui::CWindow::SetWindowText(), wGui::CMessage::Source(), wGui::CTimer::StartTimer(), wGui::CTimer::StopTimer(), wGui::CKeyboardMessage::Unicode, wGui::CRenderedString::VALIGN_NORMAL, and wGui::CWindow::ViewToWindow().
void wGui::CEditBox::SelDelete | ( | std::wstring * | psString | ) | [protected] |
Deletes the selected portion of the string
Definition at line 639 of file wg_editbox.cpp.
References m_SelLength, and m_SelStart.
Referenced by HandleMessage().