more attempts to make wxScrolledWindow to work

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-08-29 21:13:47 +00:00
parent 2026a23167
commit 06be91840a
7 changed files with 123 additions and 36 deletions

View File

@@ -184,6 +184,8 @@ bool MyUnivApp::OnInit()
wxFrame *frame = new MyUnivFrame(_T("wxUniversal demo"));
frame->Show();
wxLog::AddTraceMask(_T("scroll"));
return TRUE;
}
@@ -277,7 +279,7 @@ MyUnivFrame::MyUnivFrame(const wxString& title)
wxSize(300, 150),
wxSUNKEN_BORDER);
win->SetScrollbars(10, 10, 100, 100, 0, 0);
win->ScrollWindow(100, 0);
//win->Scroll(10, 0);
#endif
new wxButton(this, -1, wxBITMAP(open), _T("&Open..."), wxPoint(10, 420));
@@ -323,8 +325,19 @@ void MyUnivFrame::OnLeftUp(wxMouseEvent& event)
void MyUnivCanvas::OnPaint(wxPaintEvent& event)
{
wxPaintDC dc(this);
dc.SetPen(*wxRED_PEN);
PrepareDC(dc);
static bool s_oddRepaint = TRUE;
s_oddRepaint = !s_oddRepaint;
wxCoord x, y;
GetViewStart(&x, &y);
wxLogDebug("Repainting with %s pen (at %dx%d)",
s_oddRepaint ? "red" : "green",
x, y);
dc.SetPen(s_oddRepaint ? *wxRED_PEN: *wxGREEN_PEN);
dc.DrawLine(0, 0, 1000, 1000);
dc.DrawText(_T("This is a canvas"), 10, 10);
dc.DrawText(_T("This is the top of the canvas"), 10, 10);
dc.DrawLabel(_T("This is the bottom of the canvas"),
wxRect(0, 950, 950, 50), wxALIGN_RIGHT | wxBOTTOM);
}