git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73095
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
14 files changed:
- s_colOld = wxColour(wxT("red"));
- SetBackgroundColour(wxT("white"));
+ s_colOld = *wxRED;
+ SetBackgroundColour(*wxWHITE);
m_lbSelectThis->SetForegroundColour(wxT("white"));
m_lbSelectThis->SetBackgroundColour(wxT("red"));
m_lbSelectThis->SetForegroundColour(wxT("white"));
m_lbSelectThis->SetBackgroundColour(wxT("red"));
r3.y += 60;
wxRect r4 = r2;
r4.y += 60;
r3.y += 60;
wxRect r4 = r2;
r4.y += 60;
- dc.SetPen(wxPen(wxColour(255, 0, 0)));
dc.DrawRectangle(r);
r.Deflate(1);
dc.DrawRectangle(r);
r.Deflate(1);
- dc.GradientFillLinear(r, wxColour(0,255,0), wxColour(0,0,0), wxNORTH);
+ dc.GradientFillLinear(r, *wxGREEN, *wxBLACK, wxNORTH);
dc.DrawRectangle(r2);
r2.Deflate(1);
dc.DrawRectangle(r2);
r2.Deflate(1);
- dc.GradientFillLinear(r2, wxColour(0,0,0), wxColour(0,255,0), wxSOUTH);
+ dc.GradientFillLinear(r2, *wxBLACK, *wxGREEN, wxSOUTH);
dc.DrawRectangle(r3);
r3.Deflate(1);
dc.DrawRectangle(r3);
r3.Deflate(1);
- dc.GradientFillLinear(r3, wxColour(0,255,0), wxColour(0,0,0), wxEAST);
+ dc.GradientFillLinear(r3, *wxGREEN, *wxBLACK, wxEAST);
dc.DrawRectangle(r4);
r4.Deflate(1);
dc.DrawRectangle(r4);
r4.Deflate(1);
- dc.GradientFillLinear(r4, wxColour(0,0,0), wxColour(0,255,0), wxWEST);
+ dc.GradientFillLinear(r4, *wxBLACK, *wxGREEN, wxWEST);
#if wxUSE_GRAPHICS_CONTEXT
if (m_useContext)
#if wxUSE_GRAPHICS_CONTEXT
if (m_useContext)
dc.DrawText(wxT("Linear Gradient with Stops"), gfr.x, gfr.y);
gfr.Offset(0, TEXT_HEIGHT);
dc.DrawText(wxT("Linear Gradient with Stops"), gfr.x, gfr.y);
gfr.Offset(0, TEXT_HEIGHT);
- stops = wxGraphicsGradientStops(wxColour(255,0,0), wxColour(0,0,255));
+ stops = wxGraphicsGradientStops(*wxRED, *wxBLUE);
stops.Add(wxColour(255,255,0), 0.33f);
stops.Add(wxColour(255,255,0), 0.33f);
- stops.Add(wxColour(0,255,0), 0.67f);
+ stops.Add(*wxGREEN, 0.67f);
gc->SetBrush(gc->CreateLinearGradientBrush(gfr.x, gfr.y,
gfr.x + gfr.width, gfr.y + gfr.height,
gc->SetBrush(gc->CreateLinearGradientBrush(gfr.x, gfr.y,
gfr.x + gfr.width, gfr.y + gfr.height,
dc.DrawText(wxT("Linear Gradient with Stops and Gaps"), gfr.x, gfr.y);
gfr.Offset(0, TEXT_HEIGHT);
dc.DrawText(wxT("Linear Gradient with Stops and Gaps"), gfr.x, gfr.y);
gfr.Offset(0, TEXT_HEIGHT);
- stops = wxGraphicsGradientStops(wxColour(255,0,0), wxColour(0,0,255));
+ stops = wxGraphicsGradientStops(*wxRED, *wxBLUE);
stops.Add(wxColour(255,255,0), 0.33f);
stops.Add(wxTransparentColour, 0.33f);
stops.Add(wxTransparentColour, 0.67f);
stops.Add(wxColour(255,255,0), 0.33f);
stops.Add(wxTransparentColour, 0.33f);
stops.Add(wxTransparentColour, 0.67f);
- stops.Add(wxColour(0,255,0), 0.67f);
+ stops.Add(*wxGREEN, 0.67f);
gc->SetBrush(gc->CreateLinearGradientBrush(gfr.x, gfr.y + gfr.height,
gfr.x + gfr.width, gfr.y,
gc->SetBrush(gc->CreateLinearGradientBrush(gfr.x, gfr.y + gfr.height,
gfr.x + gfr.width, gfr.y,
dc.DrawText(wxT("Gradients with Stops and Transparency"), gfr.x, gfr.y);
gfr.Offset(0, TEXT_HEIGHT);
dc.DrawText(wxT("Gradients with Stops and Transparency"), gfr.x, gfr.y);
gfr.Offset(0, TEXT_HEIGHT);
- stops = wxGraphicsGradientStops(wxColour(255,0,0), wxTransparentColour);
- stops.Add(wxColour(255,0,0), 0.33f);
+ stops = wxGraphicsGradientStops(*wxRED, wxTransparentColour);
+ stops.Add(*wxRED, 0.33f);
stops.Add(wxTransparentColour, 0.33f);
stops.Add(wxTransparentColour, 0.67f);
stops.Add(wxTransparentColour, 0.33f);
stops.Add(wxTransparentColour, 0.67f);
- stops.Add(wxColour(0,0,255), 0.67f);
- stops.Add(wxColour(0,0,255), 1.0f);
+ stops.Add(*wxBLUE, 0.67f);
+ stops.Add(*wxBLUE, 1.0f);
pth = gc->CreatePath();
pth.MoveToPoint(gfr.x,gfr.y);
pth = gc->CreatePath();
pth.MoveToPoint(gfr.x,gfr.y);
wxNO_FULL_REPAINT_ON_RESIZE |
wxVSCROLL | wxHSCROLL)
{
wxNO_FULL_REPAINT_ON_RESIZE |
wxVSCROLL | wxHSCROLL)
{
- SetBackgroundColour(wxColour("WHITE"));
+ SetBackgroundColour(*wxWHITE);
SetCursor(wxCursor(wxCURSOR_PENCIL));
SetScrollbars(20, 20, 50, 50);
SetCursor(wxCursor(wxCURSOR_PENCIL));
SetScrollbars(20, 20, 50, 50);
| wxSUNKEN_BORDER);
// Set the background of our listctrl to white
| wxSUNKEN_BORDER);
// Set the background of our listctrl to white
- m_playlist->SetBackgroundColour(wxColour(255,255,255));
+ m_playlist->SetBackgroundColour(*wxWHITE);
// The layout of the headers of the listctrl are like
// | | File | Length
// The layout of the headers of the listctrl are like
// | | File | Length
#endif
// object allocation
#endif
// object allocation
- wxBrush* brush = new wxBrush(*wxRED);
+ wxBrush* brush = new wxBrush(*wxRED_BRUSH);
wxBitmap* bitmap = new wxBitmap(100, 100);
// non-object allocation
wxBitmap* bitmap = new wxBitmap(100, 100);
// non-object allocation
: wxFrame(parent, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
{
// this reduces flicker effects
: wxFrame(parent, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
{
// this reduces flicker effects
- SetBackgroundColour(wxColour(255, 255, 255));
+ SetBackgroundColour(*wxWHITE);
// set the icon
// ------------
// set the icon
// ------------
r.WriteImage(wxBitmap(smiley_xpm));
r.WriteText(wxT(" Well, you can change text "));
r.WriteImage(wxBitmap(smiley_xpm));
r.WriteText(wxT(" Well, you can change text "));
- r.BeginTextColour(wxColour(255, 0, 0));
+ r.BeginTextColour(*wxRED);
r.WriteText(wxT("colour, like this red bit."));
r.EndTextColour();
wxRichTextAttr backgroundColourAttr;
backgroundColourAttr.SetBackgroundColour(*wxGREEN);
r.WriteText(wxT("colour, like this red bit."));
r.EndTextColour();
wxRichTextAttr backgroundColourAttr;
backgroundColourAttr.SetBackgroundColour(*wxGREEN);
- backgroundColourAttr.SetTextColour(wxColour(0, 0, 255));
+ backgroundColourAttr.SetTextColour(*wxBLUE);
r.BeginStyle(backgroundColourAttr);
r.WriteText(wxT(" And this blue on green bit."));
r.EndStyle();
r.BeginStyle(backgroundColourAttr);
r.WriteText(wxT(" And this blue on green bit."));
r.EndStyle();
win->SetDefaultSize(wxSize(1000, 30));
win->SetOrientation(wxLAYOUT_HORIZONTAL);
win->SetAlignment(wxLAYOUT_TOP);
win->SetDefaultSize(wxSize(1000, 30));
win->SetOrientation(wxLAYOUT_HORIZONTAL);
win->SetAlignment(wxLAYOUT_TOP);
- win->SetBackgroundColour(wxColour(255, 0, 0));
+ win->SetBackgroundColour(*wxRED);
win->SetSashVisible(wxSASH_BOTTOM, true);
m_topWindow = win;
win->SetSashVisible(wxSASH_BOTTOM, true);
m_topWindow = win;
win->SetDefaultSize(wxSize(1000, 30));
win->SetOrientation(wxLAYOUT_HORIZONTAL);
win->SetAlignment(wxLAYOUT_BOTTOM);
win->SetDefaultSize(wxSize(1000, 30));
win->SetOrientation(wxLAYOUT_HORIZONTAL);
win->SetAlignment(wxLAYOUT_BOTTOM);
- win->SetBackgroundColour(wxColour(0, 0, 255));
+ win->SetBackgroundColour(*wxBLUE);
win->SetSashVisible(wxSASH_TOP, true);
m_bottomWindow = win;
win->SetSashVisible(wxSASH_TOP, true);
m_bottomWindow = win;
win->SetDefaultSize(wxSize(120, 1000));
win->SetOrientation(wxLAYOUT_VERTICAL);
win->SetAlignment(wxLAYOUT_LEFT);
win->SetDefaultSize(wxSize(120, 1000));
win->SetOrientation(wxLAYOUT_VERTICAL);
win->SetAlignment(wxLAYOUT_LEFT);
- win->SetBackgroundColour(wxColour(0, 255, 0));
+ win->SetBackgroundColour(*wxGREEN);
win->SetSashVisible(wxSASH_RIGHT, true);
win->SetExtraBorderSize(10);
win->SetSashVisible(wxSASH_RIGHT, true);
win->SetExtraBorderSize(10);
wxSTAY_ON_TOP),
m_currentState(STATE_SEETHROUGH)
{
wxSTAY_ON_TOP),
m_currentState(STATE_SEETHROUGH)
{
- SetBackgroundColour(wxColour(255, 255, 255, 255));
+ SetBackgroundColour(*wxWHITE);
SetBackgroundStyle(wxBG_STYLE_TRANSPARENT);
}
SetBackgroundStyle(wxBG_STYLE_TRANSPARENT);
}
MyCanvas::MyCanvas(MyChild *parent, const wxPoint& pos, const wxSize& size)
: wxScrolledWindow(parent, wxID_ANY, pos, size, wxSUNKEN_BORDER|wxVSCROLL|wxHSCROLL)
{
MyCanvas::MyCanvas(MyChild *parent, const wxPoint& pos, const wxSize& size)
: wxScrolledWindow(parent, wxID_ANY, pos, size, wxSUNKEN_BORDER|wxVSCROLL|wxHSCROLL)
{
- SetBackgroundColour(wxColour(wxT("WHITE")));
+ SetBackgroundColour(*wxWHITE);
m_child = parent;
m_index = m_child->GetFrame()->GetCountOfChildren() % 9;
m_child = parent;
m_index = m_child->GetFrame()->GetCountOfChildren() % 9;
// This reduces flicker effects - even better would be to define
// OnEraseBackground to do nothing. When the tree control's scrollbars are
// show or hidden, the frame is sent a background erase event.
// This reduces flicker effects - even better would be to define
// OnEraseBackground to do nothing. When the tree control's scrollbars are
// show or hidden, the frame is sent a background erase event.
- SetBackgroundColour(wxColour(255, 255, 255));
+ SetBackgroundColour(*wxWHITE);
// Give it an icon
SetIcon(wxICON(sample));
// Give it an icon
SetIcon(wxICON(sample));
wxBitmap bmp(180, 70); // shouldn't hardcode but it's simpler like this
wxMemoryDC dc;
dc.SelectObject(bmp);
wxBitmap bmp(180, 70); // shouldn't hardcode but it's simpler like this
wxMemoryDC dc;
dc.SelectObject(bmp);
- dc.SetBackground(wxBrush(*wxCYAN));
+ dc.SetBackground(*wxCYAN_BRUSH);
dc.Clear();
dc.SetTextForeground(*wxBLACK);
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n")
dc.Clear();
dc.SetTextForeground(*wxBLACK);
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n")
if ( m_chkBitmapbutton->GetValue() )
{
if ( m_chkBitmapbutton->GetValue() )
{
- wxBitmap bmpNormal = CreateBitmap(wxColour(0,0,255));
+ wxBitmap bmpNormal = CreateBitmap(*wxBLUE);
wxBitmap bmpPressed = CreateBitmap(wxColour(0,0,128));
wxBitmap bmpHover = CreateBitmap(wxColour(128,128,255));
m_combobox->SetButtonBitmaps(bmpNormal,m_chkStdbutton->GetValue(),bmpPressed,bmpHover);
wxBitmap bmpPressed = CreateBitmap(wxColour(0,0,128));
wxBitmap bmpHover = CreateBitmap(wxColour(128,128,255));
m_combobox->SetButtonBitmaps(bmpNormal,m_chkStdbutton->GetValue(),bmpPressed,bmpHover);
wxBitmap bmp(180, 70); // shouldn't hardcode but it's simpler like this
wxMemoryDC dc;
dc.SelectObject(bmp);
wxBitmap bmp(180, 70); // shouldn't hardcode but it's simpler like this
wxMemoryDC dc;
dc.SelectObject(bmp);
- dc.SetBackground(wxBrush(*wxCYAN));
+ dc.SetBackground(*wxCYAN_BRUSH);
dc.Clear();
dc.SetTextForeground(*wxBLACK);
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n")
dc.Clear();
dc.SetTextForeground(*wxBLACK);
dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n")