Update of /cvsroot/mahogany/M/src/modules
In directory sc8-pr-cvs1:/tmp/cvs-serv28217/src/modules

Modified Files:
        BareBonesEditor.cpp 
Log Message:
workaround for wxTextCtrl bug under MSW; use wxTE_RICH

Index: BareBonesEditor.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/BareBonesEditor.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -b -u -2 -r1.5 -r1.6
--- BareBonesEditor.cpp 31 Aug 2003 14:45:13 -0000      1.5
+++ BareBonesEditor.cpp 31 Aug 2003 21:11:18 -0000      1.6
@@ -35,4 +35,6 @@
 #include <wx/imaglist.h>
 
+#include <wx/fontutil.h>      // for wxNativeFontInfo
+
 #include "Composer.h"
 #include "MessageEditor.h"
@@ -275,6 +277,11 @@
 bool FormattedParagraph::IsWhiteLine(int line)
 {
-   String content(m_control->GetLineText(line));
-   return content.find_first_not_of(_T(" \t\r\n")) == content.npos;
+   String text = m_control->GetLineText(line);
+   const wxChar *p = text.c_str();
+
+   while ( wxIsalnum(*p) )
+      p++;
+
+   return *p == _T('\0');
 }
 
@@ -661,5 +668,8 @@
                                                wxWindow *parent)
                       : wxTextCtrl(parent,-1,_T(""),
-                        wxDefaultPosition,wxDefaultSize,wxTE_MULTILINE)
+                                   wxDefaultPosition,wxDefaultSize,
+                                   // use wxTE_RICH to allow for more than 64Kb
+                                   // of text under Win9x
+                                   wxTE_MULTILINE | wxTE_RICH)
 {
    m_editor = editor;
@@ -814,4 +824,19 @@
    m_textControl->Clear();
    m_textControl->DiscardEdits();
+
+   Options& options = (Options &)GetOptions();     // const_cast
+
+   wxFont font;
+   if ( !options.m_font.empty() )
+   {
+      wxNativeFontInfo fontInfo;
+      if ( fontInfo.FromString(options.m_font) )
+      {
+         font.SetNativeFontInfo(fontInfo);
+      }
+   }
+
+   if ( font.Ok() )
+      m_textControl->SetFont(font);
 }
 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to