这篇教程C++ wxBrush函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中wxBrush函数的典型用法代码示例。如果您正苦于以下问题:C++ wxBrush函数的具体用法?C++ wxBrush怎么用?C++ wxBrush使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了wxBrush函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: wxGCDCImplwxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) : wxGCDCImpl( owner ){ m_window = window; m_ok = true ; m_window->GetSize( &m_width , &m_height); if ( !m_window->IsShownOnScreen() ) m_width = m_height = 0; CGContextRef cg = (CGContextRef) window->MacGetCGContextRef(); m_release = false; if ( cg == NULL ) { SetGraphicsContext( wxGraphicsContext::Create( window ) ) ; m_contentScaleFactor = window->GetContentScaleFactor(); SetDeviceOrigin(-window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize()); } else { // determine content scale CGRect userrect = CGRectMake(0, 0, 10, 10); CGRect devicerect; devicerect = CGContextConvertRectToDeviceSpace(cg, userrect); m_contentScaleFactor = devicerect.size.height / userrect.size.height; CGContextSaveGState( cg ); m_release = true ; // make sure the context is having its origin at the wx-window coordinates of the // view (read at the top of window.cpp about the differences) if ( window->MacGetLeftBorderSize() != 0 || window->MacGetTopBorderSize() != 0 ) CGContextTranslateCTM( cg , -window->MacGetLeftBorderSize() , -window->MacGetTopBorderSize() ); wxGraphicsContext* context = wxGraphicsContext::CreateFromNative( cg ); context->EnableOffset(true); SetGraphicsContext( context ); } DoSetClippingRegion( 0 , 0 , m_width , m_height ) ; SetBackground(wxBrush(window->GetBackgroundColour(),wxSOLID)); SetFont( window->GetFont() ) ;}
开发者ID:chromylei,项目名称:third_party,代码行数:45,
示例2: wxLogDebugvoid wxQtDCImpl::QtPreparePainter( ){ //Do here all QPainter initialization (called after each begin()) if ( m_qtPainter == NULL ) { wxLogDebug(wxT("wxQtDCImpl::QtPreparePainter is NULL!!!")); } else if ( m_qtPainter->isActive() ) { m_qtPainter->setPen( wxPen().GetHandle() ); m_qtPainter->setBrush( wxBrush().GetHandle() ); m_qtPainter->setFont( wxFont().GetHandle() ); } else { wxLogDebug(wxT("wxQtDCImpl::QtPreparePainter not active!")); }}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:18,
示例3: Draw//----------------------------------------------------------------------------// STISpectrumGridCellColoredRectRenderer implementation//----------------------------------------------------------------------------void STISpectrumGridCellColoredRectRenderer::Draw(wxGrid &grid, wxGridCellAttr& attr, wxDC &dc, const wxRect& rect, int nRow, int nCol, bool bIsSelected){ wxGridCellStringRenderer::Draw(grid, attr, dc, rect, nRow, nCol, bIsSelected); wxColour col; ::AuroraChooseColour(col, nRow); wxRect r = rect; r.SetWidth(r.width/2); r.SetHeight(r.height/2); r.x += (rect.width - r.width)/2; r.y += (rect.height - r.height)/2; dc.SetPen(*wxBLACK); dc.SetBrush(wxBrush(col)); dc.DrawRectangle(r);}
开发者ID:TheHamSlam,项目名称:aurora-for-audacity,代码行数:21,
示例4: DrawButtonvoid DrawButton(unsigned int* const bitmasks, unsigned int buttons, unsigned int n, wxDC& dc, ControlGroupBox* g, unsigned int row){ if (buttons & bitmasks[(row * 8) + n]) { dc.SetBrush(*wxRED_BRUSH); } else { unsigned char amt = 255 - g->control_group->controls[(row * 8) + n]->control_ref->State() * 128; dc.SetBrush(wxBrush(wxColour(amt, amt, amt))); } dc.DrawRectangle(n * 12, (row == 0) ? 0 : (row * 12 - 1), 14, 12); // text const std::string name = g->control_group->controls[(row * 8) + n]->name; // bit of hax so ZL, ZR show up as L, R dc.DrawText(StrToWxStr(std::string(1, (name[1] && name[1] < 'a') ? name[1] : name[0])), n * 12 + 2, 1 + ((row == 0) ? 0 : (row * 12 - 1)));}
开发者ID:bradparks,项目名称:dolphin,代码行数:18,
示例5: render/* * Here we do the actual rendering. I put it in a separate * method so that it can work no matter what type of DC * (e.g. wxPaintDC or wxClientDC) is used. */void wxStateButton::render(wxDC& dc) { int w; int h; dc.GetSize(&w,&h); if (m_bChecked) { dc.SetBrush(*wxGREY_BRUSH); dc.SetTextForeground(wxColor(255, 255, 255)); } else { dc.SetBrush(wxBrush(wxColor(64, 64, 64))); dc.SetTextForeground(*wxLIGHT_GREY); } dc.SetPen(*wxGREY_PEN); wxRect r = GetClientRect(); dc.DrawRectangle(0, 0, w, h); dc.SetFont(wxSystemSettings::GetFont(wxSystemFont::wxSYS_DEFAULT_GUI_FONT)); dc.DrawLabel(GetLabel(), r, wxALIGN_CENTER_VERTICAL | wxALIGN_CENTER_HORIZONTAL);}
开发者ID:orxx,项目名称:BodySlide-and-Outfit-Studio,代码行数:23,
示例6: dcvoid ToggleBitmap::OnPaint(wxPaintEvent &) { wxAutoBufferedPaintDC dc(this); // Get background color wxColour bgColor = command.IsActive(context) ? wxColour(0,255,0) : wxColour(255,0,0); wxColor sysCol = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNHIGHLIGHT); bgColor.Set( (sysCol.Red() + bgColor.Red()) / 2, (sysCol.Green() + bgColor.Green()) / 2, (sysCol.Blue() + bgColor.Blue()) / 2); dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(wxBrush(bgColor)); dc.DrawRectangle(wxPoint(0, 0), GetClientSize()); wxSize excess = (GetClientSize() - img.GetSize()) / 2; dc.DrawBitmap(img, excess.GetX(), excess.GetY(), true);}
开发者ID:Gpower2,项目名称:Aegisub,代码行数:18,
示例7: void TLView::Draw3dRect(wxDC *dc, wxCoord x, wxCoord y, wxCoord width, wxCoord height, wxColour colour){/* wxBrush b1=dc->GetBrush(); b1.SetColour(colour);*/ dc->SetBrush(wxBrush(colour, wxSOLID)); dc->SetPen(*wxTRANSPARENT_PEN); dc->DrawRectangle(x,y,width,height);/* wxPen pen1=dc->GetPen(); pen1.SetColour(GetLightColour(colour));*/ dc->SetPen(wxPen(GetLightColour(colour), 1, wxSOLID )); dc->DrawLine(x,y,x+width-1,y); dc->DrawLine(x,y,x,y+height-1);/* pen1=dc->GetPen(); pen1.SetColour(GetDarkColour(colour));*/ dc->SetPen(wxPen(GetDarkColour(colour), 1, wxSOLID )); dc->DrawLine(x,y+height-1,x+width-1,y+height-1); dc->DrawLine(x+width-1,y,x+width-1,y+height);}
开发者ID:oracle2025,项目名称:ggseq,代码行数:18,
示例8: linevoid AudioWaveformRenderer::RenderBlank(wxDC &dc, const wxRect &rect, AudioRenderingStyle style){ const AudioColorScheme *pal = &colors[style]; wxColor line(pal->get(1.0)); wxColor bg(pal->get(0.0)); // Draw the line as background above and below, and line in the middle, to avoid // overdraw flicker (the common theme in all of audio display direct drawing). int halfheight = rect.height / 2; dc.SetBrush(wxBrush(bg)); dc.SetPen(*wxTRANSPARENT_PEN); dc.DrawRectangle(rect.x, rect.y, rect.width, halfheight); dc.DrawRectangle(rect.x, rect.y + halfheight + 1, rect.width, rect.height - halfheight - 1); dc.SetPen(wxPen(line)); dc.DrawLine(rect.x, rect.y+halfheight, rect.x+rect.width, rect.y+halfheight);}
开发者ID:seawaveT,项目名称:Aegisub,代码行数:18,
示例9: frameBmpwxBitmap TexturePackPanel::GetFrameBitmap(const Frame& frame, int zoom){ wxSize imgSize = frame.GetSize(); imgSize *= zoom; wxMemoryDC srcDC; srcDC.SelectObject(m_bitmap); wxBitmap frameBmp(imgSize, m_bitmap.GetDepth()); wxMemoryDC dstDC; dstDC.SelectObject(frameBmp); dstDC.SetBackground(wxBrush(m_colourPicker->GetColour())); dstDC.Clear(); dstDC.StretchBlit(wxPoint(0, 0), imgSize, &srcDC, frame.GetOffset(), frame.GetSize(), wxCOPY, true); return frameBmp;}
开发者ID:UnforeseenOcean,项目名称:HLMWadExplorer,代码行数:18,
示例10: dcvoid wxGenericColourButton::UpdateColour(){ wxMemoryDC dc(m_bitmap); dc.SetPen( *wxTRANSPARENT_PEN ); dc.SetBrush( wxBrush(m_colour) ); dc.DrawRectangle( 0,0,m_bitmap.GetWidth(),m_bitmap.GetHeight() ); if ( HasFlag(wxCLRP_SHOW_LABEL) ) { wxColour col( ~m_colour.Red(), ~m_colour.Green(), ~m_colour.Blue() ); dc.SetTextForeground( col ); dc.SetFont( GetFont() ); dc.DrawText( m_colour.GetAsString(wxC2S_HTML_SYNTAX), 0, 0 ); } dc.SelectObject( wxNullBitmap ); SetBitmapLabel( m_bitmap );}
开发者ID:Zombiebest,项目名称:Dolphin,代码行数:18,
示例11: bgColvoid PenStyleComboBox::OnDrawBackground( wxDC& dc, const wxRect& rect, int item, int flags ) const{ // If item is selected or even, or we are painting the // combo control itself, use the default rendering. if ( (flags & (wxODCB_PAINTING_CONTROL|wxODCB_PAINTING_SELECTED)) || (item & 1) == 0 ) { wxOwnerDrawnComboBox::OnDrawBackground(dc,rect,item,flags); return; } // Otherwise, draw every other background with different colour. wxColour bgCol(240,240,250); dc.SetBrush(wxBrush(bgCol)); dc.SetPen(wxPen(bgCol)); dc.DrawRectangle(rect);}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:18,
示例12: wxColorSAuiDockArt::SAuiDockArt(){ captionBackColour = Drawing::darkColour(Drawing::getPanelBGColour(), 0.0f); wxColour textColour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT); float r = ((float)textColour.Red() * 0.2f) + ((float)captionBackColour.Red() * 0.8f); float g = ((float)textColour.Green() * 0.2f) + ((float)captionBackColour.Green() * 0.8f); float b = ((float)textColour.Blue() * 0.2f) + ((float)captionBackColour.Blue() * 0.8f); captionAccentColour = wxColor(r, g, b); m_activeCloseBitmap = bitmapFromBits(close_bits, 16, 16, wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); m_inactiveCloseBitmap = bitmapFromBits(close_bits, 16, 16, wxColour(128, 128, 128)); if (Global::win_version_major >= 10) m_sashBrush = wxBrush(col_w10_bg); m_captionSize = 19; m_sashSize = 4;}
开发者ID:SanyaWaffles,项目名称:SLADE,代码行数:19,
示例13: GetSizevoid wxTabbedCtrl::DrawMenu(bool active, wxDC &dc) { const int SIZE = 8; wxSize size = GetSize(); wxBrush back_brush = wxBrush(GetBackgroundColour()); wxPen back_pen = wxPen(GetBackgroundColour()); wxPen x_pen = wxPen(active ? *wxBLACK : wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); x_pen.SetWidth(2); int posx = size.x-(SIZE*8), posy = (size.y-SIZE)/2; Menu_rect = wxRect(posx, posy, SIZE, SIZE); dc.SetPen(back_pen); dc.SetBrush(back_brush); dc.DrawRectangle(posx-SIZE+1, 1, SIZE*3-2, size.y-2); dc.SetPen(x_pen); dc.DrawLine(posx, posy+4, posx+4, posy+8); dc.DrawLine(posx+4, posy+8, posx+8, posy+4);}
开发者ID:bihai,项目名称:fbide,代码行数:19,
示例14: dcvoid BaseEditor::OnPaintEvt(wxPaintEvent& event){ wxBufferedPaintDC dc(this); // get client size wxSize maxSize = CalculateMaxSize(); // fill background dc.SetBackground(*wxLIGHT_GREY_BRUSH); dc.Clear(); // draw cross dc.SetBrush(wxBrush(*wxWHITE, wxBRUSHSTYLE_CROSSDIAG_HATCH)); dc.SetPen(*wxTRANSPARENT_PEN); dc.DrawRectangle(wxPoint(0, 0), maxSize*m_nZoom); // custom draw Draw(dc);}
开发者ID:mshandle,项目名称:spank,代码行数:19,
示例15: wxDUMMY_INITIALIZEvoid wxEmulatorContainer::OnEraseBackground(wxEraseEvent& event){ wxDC* dc wxDUMMY_INITIALIZE(NULL); if (event.GetDC()) { dc = event.GetDC(); } else { dc = new wxClientDC(this); } dc->SetBackground(wxBrush(wxGetApp().m_emulatorInfo.m_emulatorBackgroundColour, wxSOLID)); dc->Clear(); if (!event.GetDC()) delete dc;}
开发者ID:mark711,项目名称:Cafu,代码行数:19,
示例16: GetClientRect//----------------------------------------------------------------// draw()//----------------------------------------------------------------void PlotWaterfall::draw(wxAutoBufferedPaintDC& dc){ m_rCtrl = GetClientRect(); // m_rGrid is coords of inner window we actually plot to. We deflate it a bit // to leave room for axis labels. m_rGrid = m_rCtrl; m_rGrid = m_rGrid.Deflate(PLOT_BORDER + (XLEFT_OFFSET/2), (PLOT_BORDER + (YBOTTOM_OFFSET/2))); if (m_pBmp == NULL) { // we want a bit map the size of m_rGrid m_pBmp = new wxBitmap(m_rGrid.GetWidth(), m_rGrid.GetHeight(), 24); } dc.Clear(); if(m_newdata) { m_newdata = false; plotPixelData(); dc.DrawBitmap(*m_pBmp, PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER); m_dT = DT; } else { // no data to plot so just erase to black. Blue looks nicer // but is same colour as low amplitude signal // Bug on Linux: When Stop is pressed this code doesn't erase // the lower 25% of the Waterfall Window m_rPlot = wxRect(PLOT_BORDER + XLEFT_OFFSET, PLOT_BORDER, m_rGrid.GetWidth(), m_rGrid.GetHeight()); wxBrush ltGraphBkgBrush = wxBrush(BLACK_COLOR); dc.SetBrush(ltGraphBkgBrush); dc.SetPen(wxPen(BLACK_COLOR, 0)); dc.DrawRectangle(m_rPlot); } drawGraticule(dc);}
开发者ID:dl2fw,项目名称:freedv,代码行数:46,
示例17: project void GPSDraw::point(double latitude, double longitude) { if (false) { int x; int y; project(latitude, longitude, x, y); _dc->DrawPoint(x, y); } else { wxBrush saved_brush = _dc->GetBrush(); _dc->SetBrush(wxBrush(_dc->GetPen().GetColour())); circle(latitude, longitude, 1.0); _dc->SetBrush(saved_brush); } }
开发者ID:BackupTheBerlios,项目名称:mapgeneration-svn,代码行数:19,
示例18: dcvoid SeqTrack::OnPaint(wxPaintEvent &WXUNUSED(event)){ wxPaintDC dc(this); wxSize s;#define BORDER (3) PrepareDC(dc); s = GetSize(); dc.SetPen(*wxMEDIUM_GREY_PEN); dc.SetBrush(wxBrush(CL_RULER_BACKGROUND, wxTRANSPARENT));//*wxLIGHT_GREY_BRUSH); dc.DrawRoundedRectangle(0, 0, s.x - BORDER, s.y, 3); if (Selected) dc.SetPen(wxPen(CL_WAVE_DRAW, 3, wxSOLID)); else dc.SetPen(wxPen(wxColor(141, 153, 170), 2, wxSOLID)); dc.SetBrush(CL_RULER_BACKGROUND);//*wxLIGHT_GREY_BRUSH); dc.DrawRoundedRectangle(1, 1, s.x - 3 - BORDER, s.y - 2, 3);}
开发者ID:eriser,项目名称:wired,代码行数:19,
示例19: GetRectvoid CDragBar::OnPaint(wxPaintEvent& /*evt*/){ wxRect rcWin = GetRect(); //draw along the entire window rect, since clipping rect is always (0, 0, -1, -1) wxPaintDC dc(this); dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE))); //draw the dragbar background, which some platforms don't handle automatically dc.DrawRectangle(rcWin); wxPen shadow(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNSHADOW)); dc.SetPen(shadow); //draw a shadow along the bottom or the right edge, depending on orientation if (m_orientation == wxHORIZONTAL) dc.DrawLine(rcWin.GetBottomLeft(), rcWin.GetBottomRight()); else dc.DrawLine(rcWin.GetTopRight(), rcWin.GetBottomRight()); //remove the shadown pen dc.SetPen(wxNullPen); wxRect rc; dc.GetClippingBox(rc); //wxLogDebug(wxT("Clipping box = [(%d, %d) (%d %d)]"), rc.GetLeft(), rc.GetTop(), rc.GetRight(), rc.GetBottom()); wxSize range = GetInvalidatedIconRange(rc); wxASSERT(range.x == -1 || (range.x >= 0 && size_t(range.x) < m_items.size())); wxASSERT(range.y == -1 || (range.y >= range.x && size_t(range.y) < m_items.size())); if (range.x >= 0) { //wxLogDebug(wxT("Painting dragbar icons %d - %d"), range.x + 1, range.y + 1); for (int idx = range.x; idx <= range.y; ++idx) { dc.DrawBitmap(m_items[idx].enabled? m_items[idx].bmp : m_items[idx].bmpDisabled, GetToolX(idx), GetToolY(idx), true); } } else { //wxLogDebug(wxT("all dragbar icons valid")); }}
开发者ID:soundsrc,项目名称:pwsafe,代码行数:43,
示例20: wxColourvoid ClientBoard::DrawSquare(wxPaintDC& dc, int x, int y, Tetrominoes shape){ static wxColour colors[] = { wxColour(0, 0, 0), wxColour(204, 102, 102), wxColour(102, 204, 102), wxColour(102, 102, 204), wxColour(204, 204, 102), wxColour(204, 102, 204), wxColour(102, 204, 204), wxColour(218, 170, 0) }; static wxColour light[] = { wxColour(0, 0, 0), wxColour(248, 159, 171), wxColour(121, 252, 121), wxColour(121, 121, 252), wxColour(252, 252, 121), wxColour(252, 121, 252), wxColour(121, 252, 252), wxColour(252, 198, 0) }; static wxColour dark[] = { wxColour(0, 0, 0), wxColour(128, 59, 59), wxColour(59, 128, 59), wxColour(59, 59, 128), wxColour(128, 128, 59), wxColour(128, 59, 128), wxColour(59, 128, 128), wxColour(128, 98, 0) }; wxPen pen(light[int(shape)]); pen.SetCap(wxCAP_PROJECTING); dc.SetPen(pen); dc.DrawLine(x, y + SquareHeight() - 1, x, y); dc.DrawLine(x, y, x + SquareWidth() - 1, y); wxPen darkpen(dark[int(shape)]); darkpen.SetCap(wxCAP_PROJECTING); dc.SetPen(darkpen); dc.DrawLine(x + 1, y + SquareHeight() - 1, x + SquareWidth() - 1, y + SquareHeight() - 1); dc.DrawLine(x + SquareWidth() - 1, y + SquareHeight() - 1, x + SquareWidth() - 1, y + 1); dc.SetPen(*wxTRANSPARENT_PEN); dc.SetBrush(wxBrush(colors[int(shape)])); dc.DrawRectangle(x + 1, y + 1, SquareWidth() - 2, SquareHeight() - 2);}
开发者ID:bulue,项目名称:----,代码行数:42,
|