]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/text/text.cpp
Add wxHtmlHelpController::SetShouldPreventAppExit().
[wxWidgets.git] / samples / text / text.cpp
index 3e1efc157f0e69809f708557ac4563284ddbf16d..6de65763706c7ed9f5080c3d3dc705a14429e774 100644 (file)
@@ -5,7 +5,7 @@
 // Modified by:
 // RCS-ID:      $Id$
 // Copyright:   (c) Robert Roebling, Julian Smart, Vadim Zeitlin
 // Modified by:
 // RCS-ID:      $Id$
 // Copyright:   (c) Robert Roebling, Julian Smart, Vadim Zeitlin
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx/wx.h".
 /////////////////////////////////////////////////////////////////////////////
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -545,8 +545,6 @@ bool MyApp::OnInit()
 
     frame->Show(true);
 
 
     frame->Show(true);
 
-    SetTopWindow(frame);
-
     // report success
     return true;
 }
     // report success
     return true;
 }
@@ -1031,7 +1029,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
 #if wxUSE_LOG
     m_log = new wxTextCtrl( this, wxID_ANY, wxT("This is the log window.\n"),
                             wxPoint(5,260), wxSize(630,100),
 #if wxUSE_LOG
     m_log = new wxTextCtrl( this, wxID_ANY, wxT("This is the log window.\n"),
                             wxPoint(5,260), wxSize(630,100),
-                            wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH);
+                            wxTE_MULTILINE | wxTE_READONLY);
 
     m_logOld = wxLog::SetActiveTarget( new wxLogTextCtrl( m_log ) );
 #endif // wxUSE_LOG
 
     m_logOld = wxLog::SetActiveTarget( new wxLogTextCtrl( m_log ) );
 #endif // wxUSE_LOG
@@ -1863,9 +1861,20 @@ void RichTextFrame::OnIdle(wxIdleEvent& WXUNUSED(event))
                 alignment = wxT("left-aligned");
             else if (attr.GetAlignment() == wxTEXT_ALIGNMENT_JUSTIFIED)
                 alignment = wxT("justified");
                 alignment = wxT("left-aligned");
             else if (attr.GetAlignment() == wxTEXT_ALIGNMENT_JUSTIFIED)
                 alignment = wxT("justified");
-            msg.Printf( "Facename: %s, wxColour(%d, %d, %d), %s", facename,
-                attr.GetTextColour().Red(), attr.GetTextColour().Green(), attr.GetTextColour().Blue(),
-                alignment );
+
+            msg.Printf("Facename: %s", facename);
+
+            if (attr.HasTextColour())
+            {
+                msg += wxString::Format(", colour: %s",
+                                        attr.GetTextColour().GetAsString());
+            }
+            else
+            {
+                msg += ", no colour";
+            }
+
+            msg << ", " << alignment;
 
             if (attr.HasFont())
             {
 
             if (attr.HasFont())
             {