git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3231
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void OnChar( wxKeyEvent &event );
private:
void OnChar( wxKeyEvent &event );
private:
wxFont m_font;
// the margin around the text (looks nicer)
wxFont m_font;
// the margin around the text (looks nicer)
m_heightChar = dc.GetCharHeight();
m_widthChar = dc.GetCharWidth();
m_heightChar = dc.GetCharHeight();
m_widthChar = dc.GetCharWidth();
- m_caret.Create( this, m_widthChar, m_heightChar );
+ wxCaret *caret = new wxCaret(this, m_widthChar, m_heightChar);
+ SetCaret(caret);
m_xCaret = m_yCaret =
m_xChars = m_yChars = 0;
m_xMargin = m_yMargin = 5;
m_xCaret = m_yCaret =
m_xChars = m_yChars = 0;
m_xMargin = m_yMargin = 5;
- m_caret.Move(m_xMargin, m_yMargin);
- m_caret.Show();
+ caret->Move(m_xMargin, m_yMargin);
+ caret->Show();
free(m_text);
m_text = (wxChar *)calloc(m_xChars * m_yChars, sizeof(wxChar));
free(m_text);
m_text = (wxChar *)calloc(m_xChars * m_yChars, sizeof(wxChar));
- wxString msg;
- msg.Printf(_T("Panel size is (%d, %d)"), m_xChars, m_yChars);
+ wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
+
+ if ( frame && frame->GetStatusBar() )
+ {
+ wxString msg;
+ msg.Printf(_T("Panel size is (%d, %d)"), m_xChars, m_yChars);
- ((wxFrame *)GetParent())->SetStatusText(msg, 1);
+ frame->SetStatusText(msg, 1);
+ }
wxLogStatus(_T("Caret is at (%d, %d)"), m_xCaret, m_yCaret);
wxLogStatus(_T("Caret is at (%d, %d)"), m_xCaret, m_yCaret);
- m_caret.Move(m_xMargin + m_xCaret * m_widthChar,
- m_yMargin + m_yCaret * m_heightChar);
+ GetCaret()->Move(m_xMargin + m_xCaret * m_widthChar,
+ m_yMargin + m_yCaret * m_heightChar);