![]() |
wxIScan
|
The text input box for an options dialog. More...
#include <wxoptionsdialog.h>
Public Member Functions | |
| wxOptionTextBox (const wxString &strText, wxString *pstrValue, int nWidth=400) | |
| Default constructor. | |
| virtual bool | AddToSizer (wxBoxSizer *poSizer) |
| ... | |
| virtual void | Setup (wxWindow *poWindow, int nId) |
| ... | |
| virtual void | StoreValue () |
| Store the value in the connected variables. | |
Protected Attributes | |
| wxWindow * | m_poWindow |
| ... | |
| wxString | m_strText |
| ... | |
| wxString * | m_pstrValue |
| ... | |
| wxTextCtrl * | m_poTextCtrl |
| ... | |
| int | m_nWidth |
| ... | |
The text input box for an options dialog.
This class represents a text (wxTextCtrl) option used in an options dialog.
Definition at line 118 of file wxoptionsdialog.h.
| wxOptionTextBox::wxOptionTextBox | ( | const wxString & | strText, |
| wxString * | pstrValue, | ||
| int | nWidth = 400 |
||
| ) |
Default constructor.
| strText | ... |
| pstrValue | ... |
| nWidth | ... |
Definition at line 89 of file wxoptionsdialog.cpp.
References m_nWidth, m_pstrValue, and m_strText.
{
m_strText= strText;
m_pstrValue= pstrValue;
m_nWidth= nWidth;
}
| bool wxOptionTextBox::AddToSizer | ( | wxBoxSizer * | poSizer | ) | [virtual] |
...
Implements wxOptionBase.
Definition at line 96 of file wxoptionsdialog.cpp.
References m_poTextCtrl, m_poWindow, and m_strText.
{
if( !m_poTextCtrl )
{
return false;
}
wxBoxSizer *poHSizer= new wxBoxSizer( wxHORIZONTAL );
if( !poHSizer )
{
return false;
}
if( !poHSizer->Add( new wxStaticText( m_poWindow, wxID_ANY, m_strText ), 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT )
|| !poHSizer->Add( m_poTextCtrl, 0,
wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT )
)
{
delete poHSizer;
return false;
}
return (bool)poSizer->Add( poHSizer, 0, wxALIGN_RIGHT | wxALL, 1 );
}
| void wxOptionTextBox::Setup | ( | wxWindow * | poWindow, |
| int | nId | ||
| ) | [virtual] |
...
Implements wxOptionBase.
Definition at line 121 of file wxoptionsdialog.cpp.
References m_nWidth, m_poTextCtrl, m_poWindow, and m_pstrValue.
{
m_poWindow= poWindow;
m_poTextCtrl= new wxTextCtrl( m_poWindow, nId, *m_pstrValue, wxDefaultPosition, wxSize( m_nWidth, -1 ) );
if( !m_poTextCtrl )
{
wxLogError( _( "Cannot create option textbox." ) );
return;
}
}
| void wxOptionTextBox::StoreValue | ( | ) | [virtual] |
Store the value in the connected variables.
Implements wxOptionBase.
Definition at line 133 of file wxoptionsdialog.cpp.
References m_poTextCtrl.
{
(*m_pstrValue)= m_poTextCtrl->GetValue();
}
int wxOptionTextBox::m_nWidth [protected] |
wxTextCtrl* wxOptionTextBox::m_poTextCtrl [protected] |
...
Definition at line 138 of file wxoptionsdialog.h.
Referenced by AddToSizer(), Setup(), and StoreValue().
wxWindow* wxOptionTextBox::m_poWindow [protected] |
wxString* wxOptionTextBox::m_pstrValue [protected] |
wxString wxOptionTextBox::m_strText [protected] |
...
Definition at line 136 of file wxoptionsdialog.h.
Referenced by AddToSizer(), and wxOptionTextBox().