+
+ m_currentPosition = -1;
+ }
+}
+
+void RichTextFrame::OnIdle(wxIdleEvent& event)
+{
+ long insertionPoint = m_textCtrl->GetInsertionPoint();
+ if (insertionPoint != m_currentPosition)
+ {
+ wxTextAttr attr;
+ if (m_textCtrl->GetStyle(insertionPoint, attr))
+ {
+ wxString msg;
+ wxString facename(wxT("unknown"));
+ if (attr.GetFont().Ok())
+ {
+ facename = attr.GetFont().GetFaceName();
+ }
+ wxString alignment(wxT("unknown alignment"));
+ if (attr.GetAlignment() == wxTEXT_ALIGNMENT_CENTRE)
+ alignment = wxT("centred");
+ else if (attr.GetAlignment() == wxTEXT_ALIGNMENT_RIGHT)
+ alignment = wxT("right-aligned");
+ else if (attr.GetAlignment() == wxTEXT_ALIGNMENT_LEFT)
+ alignment = wxT("left-aligned");
+ else if (attr.GetAlignment() == wxTEXT_ALIGNMENT_JUSTIFIED)
+ alignment = wxT("justified");
+ msg.Printf(wxT("Facename: %s, wxColour(%d, %d, %d), %s"),
+ (const wxChar*) facename,
+ attr.GetTextColour().Red(), attr.GetTextColour().Green(), attr.GetTextColour().Blue(),
+ (const wxChar*) alignment);
+ SetStatusText(msg);
+ }
+ m_currentPosition = insertionPoint;