A bit of scrolling works under GTK 2.0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -74,6 +74,8 @@ public:
|
||||
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
void OnEraseBackground( wxEraseEvent &event );
|
||||
|
||||
wxBitmap m_bitmap;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
@@ -174,6 +176,10 @@ MyCanvas::MyCanvas( MyFrame *parent )
|
||||
wxScrolledWindowStyle|wxNO_FULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER )
|
||||
{
|
||||
SetScrollbars( 10, 10, 40, 100, 0, 0 );
|
||||
|
||||
m_bitmap = wxBitmap( mondrian_xpm );
|
||||
|
||||
new wxStaticBitmap( this, -1, m_bitmap, wxPoint(80,20) );
|
||||
}
|
||||
|
||||
void MyCanvas::OnPaint( wxPaintEvent &event )
|
||||
@@ -181,6 +187,11 @@ void MyCanvas::OnPaint( wxPaintEvent &event )
|
||||
wxPaintDC dc(this);
|
||||
PrepareDC( dc );
|
||||
|
||||
dc.SetBrush( *wxBLACK_BRUSH );
|
||||
dc.DrawRectangle( 0,0,200,50 );
|
||||
|
||||
dc.DrawBitmap( m_bitmap, 10, 20, TRUE );
|
||||
|
||||
#if 0
|
||||
wxRegionIterator upd( GetUpdateRegion() );
|
||||
while (upd)
|
||||
|
@@ -1,13 +1,14 @@
|
||||
/* XPM */
|
||||
static char *mondrian_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 6 1",
|
||||
"32 32 7 1",
|
||||
" c Black",
|
||||
". c Blue",
|
||||
"X c #00bf00",
|
||||
"o c Red",
|
||||
"O c Yellow",
|
||||
"+ c Gray100",
|
||||
"a c None",
|
||||
/* pixels */
|
||||
" ",
|
||||
" oooooo +++++++++++++++++++++++ ",
|
||||
@@ -20,13 +21,13 @@ static char *mondrian_xpm[] = {
|
||||
" ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ +aaaaaaaaaaaaaaaa+ .... ",
|
||||
" ++++++ +aaaaaaaaaaaaaaaa+ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ .... ",
|
||||
" ++++++ ++++++++++++++++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ +aaaaaaaaaaaaaaaa+ ",
|
||||
" ++++++ +aaaaaaaaaaaaaaaa+ ++++ ",
|
||||
" ++++++ +aaaaaaaaaaaaaaaa+ ++++ ",
|
||||
" ++++++ +aaaaaaaaaaaaaaaa+ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
" ++++++ ++++++++++++++++++ ++++ ",
|
||||
|
Reference in New Issue
Block a user