bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style)
{
- GetTextPeer()->SetStyle( start , end , style ) ;
+ if (GetTextPeer())
+ GetTextPeer()->SetStyle( start , end , style ) ;
return true ;
}
wxSize wxTextCtrl::DoGetBestSize() const
{
+ if (GetTextPeer())
+ {
+ wxSize size = GetTextPeer()->GetBestSize();
+ if (size.x > 0 && size.y > 0)
+ return size;
+ }
+
int wText, hText;
// these are the numbers from the HIG:
return wxSize(wText, hText);
}
+bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
+{
+ return GetTextPeer()->GetStyle(position, style);
+}
+
// ----------------------------------------------------------------------------
// Undo/redo
// ----------------------------------------------------------------------------
// implementation base class
// ----------------------------------------------------------------------------
+bool wxTextWidgetImpl::GetStyle(long WXUNUSED(position),
+ wxTextAttr& WXUNUSED(style))
+{
+ return false;
+}
+
void wxTextWidgetImpl::SetStyle(long WXUNUSED(start),
long WXUNUSED(end),
const wxTextAttr& WXUNUSED(style))
for (size_t i = 0; i < content.length() ; i++)
{
+#if wxOSX_USE_COCOA
+ if (content[i] == '\n')
+#else
if (content[i] == '\r')
+#endif
lines++;
}