git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73091
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual void Draw(wxDC& dc)
{
virtual void Draw(wxDC& dc)
{
- dc.SetPen(wxPen(m_col, 1, wxSOLID));
+ dc.SetPen(wxPen(m_col));
dc.DrawLine(p3, p1);
//works in multicolor modes; on GTK (at least) will fail in 16-bit color
dc.DrawLine(p3, p1);
//works in multicolor modes; on GTK (at least) will fail in 16-bit color
- dc.SetBrush(wxBrush(m_col, wxSOLID));
+ dc.SetBrush(wxBrush(m_col));
dc.FloodFill(GetCentre(), m_col, wxFLOOD_BORDER);
}
};
dc.FloodFill(GetCentre(), m_col, wxFLOOD_BORDER);
}
};
dc.DrawLine(p3, p4);
dc.DrawLine(p4, p1);
dc.DrawLine(p3, p4);
dc.DrawLine(p4, p1);
- dc.SetBrush(wxBrush(m_col, wxSOLID));
+ dc.SetBrush(wxBrush(m_col));
dc.FloodFill(GetCentre(), m_col, wxFLOOD_BORDER);
}
};
dc.FloodFill(GetCentre(), m_col, wxFLOOD_BORDER);
}
};
dc.DrawEllipse(m_pos, m_size);
dc.DrawEllipse(m_pos, m_size);
- dc.SetBrush(wxBrush(m_col, wxSOLID));
+ dc.SetBrush(wxBrush(m_col));
dc.FloodFill(GetCentre(), m_col, wxFLOOD_BORDER);
}
};
dc.FloodFill(GetCentre(), m_col, wxFLOOD_BORDER);
}
};
wxBitmap bitmap(x, y);
wxMemoryDC dc;
dc.SelectObject(bitmap);
wxBitmap bitmap(x, y);
wxMemoryDC dc;
dc.SelectObject(bitmap);
- dc.SetBrush(wxBrush(wxT("white"), wxSOLID));
+ dc.SetBrush(*wxWHITE_BRUSH);
dc.Clear();
m_shape->Draw(dc);
dc.SelectObject(wxNullBitmap);
dc.Clear();
m_shape->Draw(dc);
dc.SelectObject(wxNullBitmap);
- dc.SetBrush(wxBrush(*wxGREEN, wxSOLID));
+ dc.SetBrush(*wxGREEN_BRUSH);
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
dc.DrawText(wxT("Solid green"), x + 10, y + 10);
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
dc.DrawText(wxT("Solid green"), x + 10, y + 10);
void MyCanvas::DrawTestLines( int x, int y, int width, wxDC &dc )
{
void MyCanvas::DrawTestLines( int x, int y, int width, wxDC &dc )
{
- dc.SetPen( wxPen( wxT("black"), width, wxSOLID) );
+ dc.SetPen( wxPen( *wxBLACK, width ) );
dc.SetBrush( *wxRED_BRUSH );
dc.DrawText(wxString::Format(wxT("Testing lines of width %d"), width), x + 10, y - 10);
dc.DrawRectangle( x+10, y+10, 100, 190 );
dc.DrawText(wxT("Solid/dot/short dash/long dash/dot dash"), x + 150, y + 10);
dc.SetBrush( *wxRED_BRUSH );
dc.DrawText(wxString::Format(wxT("Testing lines of width %d"), width), x + 10, y - 10);
dc.DrawRectangle( x+10, y+10, 100, 190 );
dc.DrawText(wxT("Solid/dot/short dash/long dash/dot dash"), x + 150, y + 10);
- dc.SetPen( wxPen( wxT("black"), width, wxSOLID) );
+ dc.SetPen( wxPen( *wxBLACK, width ) );
dc.DrawLine( x+20, y+20, 100, y+20 );
dc.SetPen( wxPen( wxT("black"), width, wxDOT) );
dc.DrawLine( x+20, y+30, 100, y+30 );
dc.DrawLine( x+20, y+20, 100, y+20 );
dc.SetPen( wxPen( wxT("black"), width, wxDOT) );
dc.DrawLine( x+20, y+30, 100, y+30 );
wxMemoryDC memdc2;
memdc2.SelectObject(bitmap2);
wxMemoryDC memdc2;
memdc2.SelectObject(bitmap2);
- wxColour clr(255, 255, 0);
- wxBrush yellowBrush(clr, wxSOLID);
- memdc2.SetBackground(yellowBrush);
+ memdc2.SetBackground(*wxYELLOW_BRUSH);
- wxPen yellowPen(clr, 1, wxSOLID);
-
// Now draw a white rectangle with red outline. It should
// entirely eclipse the yellow background.
memdc2.SetPen(*wxRED_PEN);
// Now draw a white rectangle with red outline. It should
// entirely eclipse the yellow background.
memdc2.SetPen(*wxRED_PEN);
// Draw a yellow rectangle filling the bitmap
x = 600; int y = 270;
// Draw a yellow rectangle filling the bitmap
x = 600; int y = 270;
- dc.SetPen(yellowPen);
- dc.SetBrush(yellowBrush);
+ dc.SetPen(*wxYELLOW_PEN);
+ dc.SetBrush(*wxYELLOW_BRUSH);
dc.DrawRectangle(x, y, totalWidth, totalHeight);
// Now draw a white rectangle with red outline. It should
dc.DrawRectangle(x, y, totalWidth, totalHeight);
// Now draw a white rectangle with red outline. It should
static const wxCoord h = 60;
// reuse the text colour here
static const wxCoord h = 60;
// reuse the text colour here
- dc.SetPen(wxPen(m_owner->m_colourForeground, 1, wxSOLID));
+ dc.SetPen(wxPen(m_owner->m_colourForeground));
dc.SetBrush(*wxTRANSPARENT_BRUSH);
size_t n;
dc.SetBrush(*wxTRANSPARENT_BRUSH);
size_t n;
}
// now some filled rectangles
}
// now some filled rectangles
- dc.SetBrush(wxBrush(m_owner->m_colourForeground, wxSOLID));
+ dc.SetBrush(wxBrush(m_owner->m_colourForeground));
for ( n = 0; n < WXSIZEOF(rasterOperations); n++ )
{
for ( n = 0; n < WXSIZEOF(rasterOperations); n++ )
{
wxDouble width = 180 ;
wxDouble radius = 30 ;
wxDouble width = 180 ;
wxDouble radius = 30 ;
- dc.SetPen( wxPen( wxColour( 128, 0, 0, 255 ),12, wxSOLID));
- dc.SetBrush( wxBrush( wxColour( 255, 0, 0, 255),wxSOLID));
+ dc.SetPen( wxPen( wxColour( 128, 0, 0 ), 12 ));
+ dc.SetBrush(*wxRED_BRUSH);
wxRect r(margin,margin+width*0.66,width,width) ;
dc.DrawRoundedRectangle( r.x, r.y, r.width, r.width, radius ) ;
wxRect r(margin,margin+width*0.66,width,width) ;
dc.DrawRoundedRectangle( r.x, r.y, r.width, r.width, radius ) ;
- dc.SetPen( wxPen( wxColour( 0, 0, 128, 255 ),12, wxSOLID));
- dc.SetBrush( wxBrush( wxColour( 0, 0, 255, 255),wxSOLID));
+ dc.SetPen( wxPen( wxColour( 0, 0, 128 ), 12));
+ dc.SetBrush(*wxBLUE_BRUSH);
r.Offset( width * 0.8 , - width * 0.66 ) ;
dc.DrawRoundedRectangle( r.x, r.y, r.width, r.width, radius ) ;
r.Offset( width * 0.8 , - width * 0.66 ) ;
dc.DrawRoundedRectangle( r.x, r.y, r.width, r.width, radius ) ;
- dc.SetPen( wxPen( wxColour( 128, 128, 0, 255 ),12, wxSOLID));
- dc.SetBrush( wxBrush( wxColour( 192, 192, 0, 255),wxSOLID));
+ dc.SetPen( wxPen( wxColour( 128, 128, 0 ), 12));
+ dc.SetBrush( wxBrush( wxColour( 192, 192, 0)));
r.Offset( width * 0.8 , width *0.5 ) ;
r.Offset( width * 0.8 , width *0.5 ) ;
gc->PushState(); // save current translation/scale/other state
gc->Translate(60, 75); // reposition the context origin
gc->PushState(); // save current translation/scale/other state
gc->Translate(60, 75); // reposition the context origin
- gc->SetPen(wxPen("navy", 1));
+ gc->SetPen(wxPen("navy"));
gc->SetBrush(wxBrush("pink"));
for( int i = 0 ; i < 3 ; ++i )
gc->SetBrush(wxBrush("pink"));
for( int i = 0 ; i < 3 ; ++i )
letters[m][n].y = center.y + h[ letters[m][n].y ];
}
letters[m][n].y = center.y + h[ letters[m][n].y ];
}
- dc.SetPen( wxPen( wxT("blue"), 1, wxDOT) );
+ dc.SetPen( wxPen( *wxBLUE, 1, wxDOT) );
dc.DrawLines(5, letters[m]);
dc.DrawLines(5, letters[m]);
- dc.SetPen( wxPen( wxT("black"), 4, wxSOLID) );
+ dc.SetPen( wxPen( *wxBLACK, 4) );
dc.DrawSpline(5, letters[m]);
}
dc.DrawSpline(5, letters[m]);
}
if ( m_owner->m_textureBackground) {
if ( ! m_owner->m_backgroundBrush.IsOk() ) {
if ( m_owner->m_textureBackground) {
if ( ! m_owner->m_backgroundBrush.IsOk() ) {
- wxColour clr(0,128,0);
- wxBrush b(clr, wxSOLID);
- dc.SetBackground(b);
+ dc.SetBackground(wxBrush(wxColour(0, 128, 0)));
dc.SetPen( *wxGREY_PEN );
dc.SetBrush( wxColour( 192,192,192,64 ) );
#else
dc.SetPen( *wxGREY_PEN );
dc.SetBrush( wxColour( 192,192,192,64 ) );
#else
- dc.SetPen( wxPen( *wxLIGHT_GREY, 2, wxSOLID ) );
+ dc.SetPen( wxPen( *wxLIGHT_GREY, 2, ) );
dc.SetBrush( *wxTRANSPARENT_BRUSH );
#endif
dc.DrawRectangle( newrect );
dc.SetBrush( *wxTRANSPARENT_BRUSH );
#endif
dc.DrawRectangle( newrect );
PrepareDC(dc);
// set background
PrepareDC(dc);
// set background
- dc.SetBackground(wxBrush(wxT("white"), wxSOLID));
+ dc.SetBackground(*wxWHITE_BRUSH);
dc.Clear();
dc.SetFont(m_font);
dc.Clear();
dc.SetFont(m_font);
}
// draw the lines between them
}
// draw the lines between them
- dc.SetPen(wxPen(wxColour(wxT("blue")), 1, wxSOLID));
+ dc.SetPen(*wxBLUE_PEN);
wxMemoryDC dc;
dc.SelectObject( bitmap );
wxMemoryDC dc;
dc.SelectObject( bitmap );
- dc.SetBrush( wxBrush( wxT("orange"), wxSOLID ) );
+ dc.SetBrush( wxBrush( wxS("orange") ) );
dc.SetPen( *wxBLACK_PEN );
dc.DrawRectangle( 0, 0, 100, 100 );
dc.SetBrush( *wxWHITE_BRUSH );
dc.SetPen( *wxBLACK_PEN );
dc.DrawRectangle( 0, 0, 100, 100 );
dc.SetBrush( *wxWHITE_BRUSH );
dc.DrawBitmap( my_square, 30, 30 );
dc.DrawText( wxT("Drawn directly"), 150, 10 );
dc.DrawBitmap( my_square, 30, 30 );
dc.DrawText( wxT("Drawn directly"), 150, 10 );
- dc.SetBrush( wxBrush( wxT("orange"), wxSOLID ) );
+ dc.SetBrush( wxBrush( wxS("orange") ) );
dc.SetPen( *wxBLACK_PEN );
dc.DrawRectangle( 150, 30, 100, 100 );
dc.SetBrush( *wxWHITE_BRUSH );
dc.SetPen( *wxBLACK_PEN );
dc.DrawRectangle( 150, 30, 100, 100 );
dc.SetBrush( *wxWHITE_BRUSH );
void MyAutoScrollingWindow::OnDraw(wxDC& dc)
{
dc.SetFont(m_font);
void MyAutoScrollingWindow::OnDraw(wxDC& dc)
{
dc.SetFont(m_font);
- wxBrush normBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)
- , wxSOLID);
- wxBrush selBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)
- , wxSOLID);
+ wxBrush normBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
+ wxBrush selBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT));
dc.SetPen(*wxTRANSPARENT_PEN);
const wxString str = sm_testData;
size_t strLength = str.length();
dc.SetPen(*wxTRANSPARENT_PEN);
const wxString str = sm_testData;
size_t strLength = str.length();