m_lwin->SetFocus();
Clear();
+#if 0
// create and set the background bitmap (this will result in a lattice)
static const int sizeBmp = 10;
wxBitmap *bitmap = new wxBitmap(sizeBmp, sizeBmp);
dcMem.SelectObject( wxNullBitmap );
m_lwin->SetBackgroundBitmap(bitmap);
+#endif // 0
};
void
void
MyFrame::Clear(void)
{
- m_lwin->Clear(wxROMAN,16,wxNORMAL,wxNORMAL, false);
+ wxColour colBg(0, 255, 255);
+
+ m_lwin->Clear(wxROMAN,16,wxNORMAL,wxNORMAL, false, wxGREEN, &colBg);
}
m_bitmap = new wxBitmap(4,4);
m_bitmapSize = wxPoint(4,4);
m_llist = new wxLayoutList();
-#ifdef __WXMSW__
- SetAutoDeleteSelection(true);
-#else
- SetAutoDeleteSelection(false);
-#endif
m_BGbitmap = NULL;
m_ScrollToCursor = false;
SetWrapMargin(0);
wxCaret *caret = new wxCaret(this, 2, 20);
SetCaret(caret);
m_llist->SetCaret(caret);
- caret->Show();
#endif // WXLAYOUT_USE_CARET
+ m_HaveFocus = FALSE;
m_HandCursor = FALSE;
m_CursorVisibility = -1;
SetCursor(wxCURSOR_IBEAM);
SetDirty();
+
+ // at least under Windows, this should be the default behaviour
+#ifdef __WXMSW__
+ m_AutoDeleteSelection = TRUE;
+#else // !Windows
+ m_AutoDeleteSelection = FALSE;
+#endif // Win/!Win
}
wxLayoutWindow::~wxLayoutWindow()
ResizeScrollbars(true);
SetDirty();
SetModified(false);
- wxScrolledWindow::Clear();
+
+#ifdef WXLAYOUT_USE_CARET
+ if ( m_CursorVisibility == 1 )
+ GetCaret()->Show();
+#endif // WXLAYOUT_USE_CARET
+
DoPaint((wxRect *)NULL);
}
if(m_CursorVisibility != 0)
{
- // draw a thick cursor for editable windows with focus
+ // draw a thick cursor for editable windows with focus
m_llist->DrawCursor(dc, m_HaveFocus && IsEditable(), offset);
}
wxLayoutWindow::DoPaint(const wxRect *updateRect)
{
#ifdef __WXGTK__
+ // Calling Refresh() causes bad flicker under wxGTK!!!
InternalPaint(updateRect);
-#else // Causes bad flicker under wxGTK!!!
+#else
+ // shouldn't specify the update rectangle if it doesn't include all the
+ // changed locations - otherwise, they won't be repainted at all because
+ // the system clips the display to the update rect
Refresh(FALSE); //, updateRect);
-
- if ( !::UpdateWindow(GetHwnd()) )
- wxLogLastError("UpdateWindow");
#endif
}
m_llist->Layout(dc);
ResizeScrollbars();
}
+
/* Check whether the window has grown, if so, we need to reallocate
the bitmap to be larger. */
if(x1 > m_bitmapSize.x || y1 > m_bitmapSize.y)
}
m_memDC->SetDeviceOrigin(0,0);
- m_memDC->SetBrush(wxBrush(m_llist->GetDefaultStyleInfo().GetBGColour(),wxSOLID));
+ m_memDC->SetBackground(wxBrush(m_llist->GetDefaultStyleInfo().GetBGColour(),wxSOLID));
m_memDC->SetPen(wxPen(m_llist->GetDefaultStyleInfo().GetBGColour(),
0,wxTRANSPARENT));
m_memDC->SetLogicalFunction(wxCOPY);
#ifdef WXLAYOUT_USE_CARET
// show the caret back after everything is redrawn
- m_caret->Show();
+ GetCaret()->Show();
#endif // WXLAYOUT_USE_CARET
ResetDirty();
WXLOWIN_MENU_DBLCLICK,
WXLOWIN_MENU_MDOWN,
WXLOWIN_MENU_LDOWN,
+ WXLOWIN_MENU_LCLICK = WXLOWIN_MENU_LDOWN,
WXLOWIN_MENU_LUP,
WXLOWIN_MENU_MOUSEMOVE,
WXLOWIN_MENU_LAST = WXLOWIN_MENU_MOUSEMOVE
m_BGbitmap = bitmap;
}
/// Enable or disable editing, i.e. processing of keystrokes.
- void SetEditable(bool toggle) { m_Editable = toggle; }
+ void SetEditable(bool toggle)
+ { m_Editable = toggle; SetCursorVisibility(toggle); }
/// Query whether list can be edited by user.
bool IsEditable(void) const { return m_Editable; }
/** Sets cursor visibility, visible=1, invisible=0,