Implement [GS]etLabel() for wxStaticText and wxCheckBox in wxQt
This allows the corresponding unit tests to pass. Closes https://github.com/wxWidgets/wxWidgets/pull/1033
This commit is contained in:
parent
7e22ddd27c
commit
16c121d4d3
@ -32,6 +32,9 @@ public:
|
||||
virtual void SetValue(bool value);
|
||||
virtual bool GetValue() const;
|
||||
|
||||
virtual void SetLabel(const wxString& label) wxOVERRIDE;
|
||||
virtual wxString GetLabel() const wxOVERRIDE;
|
||||
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
|
@ -30,7 +30,8 @@ public:
|
||||
long style = 0,
|
||||
const wxString &name = wxStaticTextNameStr );
|
||||
|
||||
void SetLabel(const wxString& label);
|
||||
virtual void SetLabel(const wxString& label) wxOVERRIDE;
|
||||
virtual wxString GetLabel() const wxOVERRIDE;
|
||||
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
|
@ -130,3 +130,14 @@ QWidget *wxCheckBox::GetHandle() const
|
||||
{
|
||||
return m_qtCheckBox;
|
||||
}
|
||||
|
||||
wxString wxCheckBox::GetLabel() const
|
||||
{
|
||||
return wxQtConvertString( m_qtCheckBox->text() );
|
||||
}
|
||||
|
||||
void wxCheckBox::SetLabel(const wxString& label)
|
||||
{
|
||||
m_qtCheckBox->setText( wxQtConvertString(label) );
|
||||
}
|
||||
|
||||
|
@ -62,6 +62,11 @@ void wxStaticText::SetLabel(const wxString& label)
|
||||
m_qtLabel->setText( wxQtConvertString( label ) );
|
||||
}
|
||||
|
||||
wxString wxStaticText::GetLabel() const
|
||||
{
|
||||
return wxQtConvertString( m_qtLabel->text() );
|
||||
}
|
||||
|
||||
QWidget *wxStaticText::GetHandle() const
|
||||
{
|
||||
return m_qtLabel;
|
||||
|
Loading…
Reference in New Issue
Block a user