- Added wxAboutBox() function for displaying the standard about dialog
- Added wxID_PAGE_SETUP standard id.
- Added wxSize::IncBy() and DecBy() methods.
+- Added wxTextCtrl::IsEmpty()
- Added file type parameter to wxTextCtrl::LoadFile, wxTextCtrl::SaveFile for
consistency with wxRichTextCtrl.
- wxRichTextCtrl: fixed range out-by-one bug to be consistent with wxTextCtrl API,
// ----------------------------------
virtual wxString GetValue() const;
+ virtual bool IsEmpty() const;
virtual void SetValue(const wxString& value) { DoSetValue(value, SetValue_SendEvent); }
-
- virtual void ChangeValue(const wxString &value) { DoSetValue(value); }
+ virtual void ChangeValue(const wxString& value) { DoSetValue(value); }
virtual int GetLineLength(long lineNo) const;
virtual wxString GetLineText(long lineNo) const;
// ----------------------------------
virtual wxString GetValue() const;
+ virtual bool IsEmpty() const;
virtual void SetValue(const wxString& value) { DoSetValue(value, SetValue_SendEvent); }
- virtual void ChangeValue(const wxString &value) { DoSetValue(value); }
+ virtual void ChangeValue(const wxString& value) { DoSetValue(value); }
virtual wxString GetRange(long from, long to) const;
virtual wxString GetValue() const = 0;
virtual void SetValue(const wxString& value) = 0;
+ virtual bool IsEmpty() const { return GetValue().empty(); }
+
virtual void ChangeValue(const wxString &value) = 0;
virtual wxString GetRange(long from, long to) const;
return enc;
}
+bool wxTextCtrl::IsEmpty() const
+{
+ if ( IsMultiLine() )
+ return gtk_text_buffer_get_char_count(m_buffer) != 0;
+
+ return wxTextCtrlBase::IsEmpty();
+}
+
void wxTextCtrl::DoSetValue( const wxString &value, int flags )
{
wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
// set/get the controls text
// ----------------------------------------------------------------------------
+bool wxTextCtrl::IsEmpty() const
+{
+ // this is an optimization for multiline controls containing a lot of text
+ if ( IsMultiLine() && GetNumberOfLines() != 1 )
+ return false;
+
+ return wxTextCtrlBase::IsEmpty();
+}
+
wxString wxTextCtrl::GetValue() const
{
// range 0..-1 is special for GetRange() and means to retrieve all text