Added wxTextCtrl::IsEditable(), GetSelection() and

ShowPosition()


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 1999-06-01 11:10:17 +00:00
parent b00c560766
commit 05060eeb83
2 changed files with 32 additions and 18 deletions

View File

@ -693,9 +693,9 @@ void wxTextCtrl::SetSelection( long from, long to )
gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to ); gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
} }
void wxTextCtrl::ShowPosition( long WXUNUSED(pos) ) void wxTextCtrl::ShowPosition( long pos )
{ {
wxFAIL_MSG( _T("wxTextCtrl::ShowPosition not implemented") ); SetInsertionPoint( pos );
} }
long wxTextCtrl::GetInsertionPoint() const long wxTextCtrl::GetInsertionPoint() const
@ -825,17 +825,24 @@ bool wxTextCtrl::CanRedo() const
// selection. // selection.
void wxTextCtrl::GetSelection(long* from, long* to) const void wxTextCtrl::GetSelection(long* from, long* to) const
{ {
// TODO wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
*from = 0;
*to = 0; if (!(GTK_EDITABLE(m_text)->has_selection))
wxFAIL_MSG( _T("wxTextCtrl::GetSelection not implemented") ); {
if (from) *from = 0;
if (to) *to = 0;
return;
}
if (from) *from = (long) GTK_EDITABLE(m_text)->selection_start_pos;
if (to) *to = (long) GTK_EDITABLE(m_text)->selection_end_pos;
} }
bool wxTextCtrl::IsEditable() const bool wxTextCtrl::IsEditable() const
{ {
// TODO wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
wxFAIL_MSG( _T("wxTextCtrl::IsEditable not implemented") );
return FALSE; return GTK_EDITABLE(m_text)->editable;
} }
void wxTextCtrl::Clear() void wxTextCtrl::Clear()

View File

@ -693,9 +693,9 @@ void wxTextCtrl::SetSelection( long from, long to )
gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to ); gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
} }
void wxTextCtrl::ShowPosition( long WXUNUSED(pos) ) void wxTextCtrl::ShowPosition( long pos )
{ {
wxFAIL_MSG( _T("wxTextCtrl::ShowPosition not implemented") ); SetInsertionPoint( pos );
} }
long wxTextCtrl::GetInsertionPoint() const long wxTextCtrl::GetInsertionPoint() const
@ -825,17 +825,24 @@ bool wxTextCtrl::CanRedo() const
// selection. // selection.
void wxTextCtrl::GetSelection(long* from, long* to) const void wxTextCtrl::GetSelection(long* from, long* to) const
{ {
// TODO wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
*from = 0;
*to = 0; if (!(GTK_EDITABLE(m_text)->has_selection))
wxFAIL_MSG( _T("wxTextCtrl::GetSelection not implemented") ); {
if (from) *from = 0;
if (to) *to = 0;
return;
}
if (from) *from = (long) GTK_EDITABLE(m_text)->selection_start_pos;
if (to) *to = (long) GTK_EDITABLE(m_text)->selection_end_pos;
} }
bool wxTextCtrl::IsEditable() const bool wxTextCtrl::IsEditable() const
{ {
// TODO wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
wxFAIL_MSG( _T("wxTextCtrl::IsEditable not implemented") );
return FALSE; return GTK_EDITABLE(m_text)->editable;
} }
void wxTextCtrl::Clear() void wxTextCtrl::Clear()