// ressources
// ----------------------------------------------------------------------------
// the application icon
-#if defined(__WXGTK__) || defined(__WXMOTIF__)
+#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)
#include "mondrian.xpm"
#endif
// would use GetUpdateRegion() and iterate over rectangles it contains
void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
{
+ wxCaretSuspend cs(this);
wxPaintDC dc( this );
PrepareDC( dc );
dc.Clear();
void MyCanvas::OnChar( wxKeyEvent &event )
{
- bool refresh = FALSE;
-
switch ( event.KeyCode() )
{
case WXK_LEFT:
default:
if ( !event.AltDown() && wxIsprint(event.KeyCode()) )
{
- CharAt(m_xCaret, m_yCaret) = (wxChar)event.KeyCode();
- NextChar();
+ wxChar ch = (wxChar)event.KeyCode();
+ CharAt(m_xCaret, m_yCaret) = ch;
+
+ wxCaretSuspend cs(this);
+ wxClientDC dc(this);
+ dc.SetFont(m_font);
+ dc.SetBackgroundMode(wxSOLID); // overwrite old value
+ dc.DrawText(ch, m_xMargin + m_xCaret * m_widthChar,
+ m_yMargin + m_yCaret * m_heightChar );
- refresh = TRUE;
+ NextChar();
}
else
{
}
DoMoveCaret();
-
- if ( refresh )
- Refresh();
}