您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetBackgroundColour函数代码示例

51自学网 2021-06-01 21:04:09
  C++
这篇教程C++ GetBackgroundColour函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetBackgroundColour函数的典型用法代码示例。如果您正苦于以下问题:C++ GetBackgroundColour函数的具体用法?C++ GetBackgroundColour怎么用?C++ GetBackgroundColour使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetBackgroundColour函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: wxMultiColumnListCtrl

bool wxSwitcherDialog::Create( const wxSwitcherItems& items, wxWindow *parent, wxWindowID id,        const wxString& title, const wxPoint &position, const wxSize& size, long style ){    m_switcherBorderStyle = (style & wxBORDER_MASK);    if (m_switcherBorderStyle == wxBORDER_NONE)        m_switcherBorderStyle = wxBORDER_SIMPLE;    style &= wxBORDER_MASK;    style |= wxBORDER_NONE;    wxScrollingDialog::Create( parent, id, title, position, size, style );    m_listCtrl = new wxMultiColumnListCtrl();    m_listCtrl->SetItems(items);    m_listCtrl->Create(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS|wxNO_BORDER);    m_listCtrl->CalculateLayout();    if (m_extraNavigationKey != -1)        m_listCtrl->SetExtraNavigationKey(m_extraNavigationKey);    if (m_modifierKey != -1)        m_listCtrl->SetModifierKey(m_modifierKey);    int borderStyle = wxSIMPLE_BORDER;        borderStyle = wxBORDER_NONE;    m_descriptionCtrl = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 100), borderStyle);    m_descriptionCtrl->SetHTMLBackgroundColour(GetBackgroundColour());#ifdef __WXGTK20__    int fontSize = 11;    m_descriptionCtrl->SetStandardFonts(fontSize);#endif    wxSizer* sizer = new wxBoxSizer(wxVERTICAL);    SetSizer(sizer);    sizer->Add(m_listCtrl, 1, wxALL|wxEXPAND, 10);    sizer->Add(m_descriptionCtrl, 0, wxALL|wxEXPAND, 10);    sizer->SetSizeHints(this);    m_listCtrl->SetFocus();    Centre(wxBOTH);    if (m_listCtrl->GetItems().GetSelection() == -1)        m_listCtrl->GetItems().SetSelection(0);    m_listCtrl->AdvanceToNextSelectableItem(1);    ShowDescription(m_listCtrl->GetItems().GetSelection());    return true;}
开发者ID:jenslody,项目名称:codeblocks,代码行数:55,


示例2: GetBackgroundColour

WXHBRUSH wxControl::MSWControlColor(WXHDC pDC, WXHWND hWnd){    wxColour colBg;    if ( HasTransparentBackground() )        ::SetBkMode((HDC)pDC, TRANSPARENT);    else // if the control is opaque it shouldn't use the parents background        colBg = GetBackgroundColour();    return DoMSWControlColor(pDC, colBg, hWnd);}
开发者ID:Duion,项目名称:Torsion,代码行数:11,


示例3: WXUNUSED

bool AboutDialog::Create( wxWindow* parent, wxWindowID WXUNUSED(id), const wxString& WXUNUSED(caption), const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), long WXUNUSED(style) ){////@begin AboutDialog member initialisation    m_pHtmlWindow = NULL;////@end AboutDialog member initialisation////@begin AboutDialog creation    SetExtraStyle(wxWS_EX_BLOCK_EVENTS);    SetParent(parent);    CreateControls();    SetIcon(GetIconResource(wxT("res/nx.png")));    if (GetSizer())    {        GetSizer()->SetSizeHints(this);    }    Centre();////@end AboutDialog creation    int fs[7];    wxFont fv = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);    wxFont ff = wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT);    for (int i = 0; i < 7; i++)        fs[i] = fv.GetPointSize();    m_pHtmlWindow->SetFonts(fv.GetFaceName(), ff.GetFaceName(), fs);    m_pHtmlWindow->SetBorders(0);    wxString version = _("Version") + wxString::Format(wxT(" <B>%s</B>"),        ::wxGetApp().GetVersion().c_str());#ifdef __WXDEBUG__    version += wxT(" (DEBUG)");#else    version += wxT(" (RELEASE)");#endif    wxString content = ::wxGetApp().LoadFileFromResource(wxT("res/about.html"));    content.Replace(wxT("<VERSION>"), version);    content.Replace(wxT("<WXVERSION>"), wxVERSION_STRING);    content.Replace(wxT("/"res:"), wxT("/"") + ::wxGetApp().GetResourcePrefix());    m_pHtmlWindow->SetPage(content);    m_pHtmlWindow->SetBackgroundColour(GetBackgroundColour());    if (!content.IsEmpty()) {        int width, height;        m_pHtmlWindow->GetSize(&width, &height);        m_pHtmlWindow->GetInternalRepresentation()->Layout(width);        height = m_pHtmlWindow->GetInternalRepresentation()->GetHeight();        width = m_pHtmlWindow->GetInternalRepresentation()->GetWidth();        m_pHtmlWindow->SetSize(width, height);        m_pHtmlWindow->SetSizeHints(width, height);        Fit();    }    return TRUE;}
开发者ID:carriercomm,项目名称:opennx-1,代码行数:54,


示例4: WXUNUSED

void wxVListBox::OnPaint(wxPaintEvent& WXUNUSED(event)){    wxSize clientSize = GetClientSize();    wxAutoBufferedPaintDC dc(this);    // the update rectangle    wxRect rectUpdate = GetUpdateClientRect();    // fill it with background colour    dc.SetBackground(GetBackgroundColour());    dc.Clear();    // the bounding rectangle of the current line    wxRect rectLine;    rectLine.width = clientSize.x;    // iterate over all visible lines    const size_t lineMax = GetVisibleEnd();    for ( size_t line = GetFirstVisibleLine(); line < lineMax; line++ )    {        const wxCoord hLine = OnGetLineHeight(line);        rectLine.height = hLine;        // and draw the ones which intersect the update rect        if ( rectLine.Intersects(rectUpdate) )        {            // don't allow drawing outside of the lines rectangle            wxDCClipper clip(dc, rectLine);            wxRect rect = rectLine;            OnDrawBackground(dc, rect, line);            OnDrawSeparator(dc, rect, line);            rect.Deflate(m_ptMargins.x, m_ptMargins.y);            OnDrawItem(dc, rect, line);        }        else // no intersection        {            if ( rectLine.GetTop() > rectUpdate.GetBottom() )            {                // we are already below the update rect, no need to continue                // further                break;            }            //else: the next line may intersect the update rect        }        rectLine.y += hLine;    }}
开发者ID:hgwells,项目名称:tive,代码行数:53,


示例5: dc

void gcSpinningBar::onPaint(wxPaintEvent& event){	wxPaintDC dc(this);	if (GetSize().GetWidth() == 0 || GetSize().GetHeight() == 0)		return;	dc.SetTextBackground(GetBackgroundColour());	if (m_imgProg.getImg() && m_imgProg->IsOk())		doPaint(&dc);}
开发者ID:EasyCoding,项目名称:desura-app,代码行数:12,


示例6: WXUNUSED

void wxShapeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)){    wxPaintDC dc(this);    PrepareDC(dc);    dc.SetBackground(wxBrush(GetBackgroundColour(), wxSOLID));    dc.Clear();    if (GetDiagram())        GetDiagram()->Redraw(dc);}
开发者ID:crioux,项目名称:SpeedDemon-Profiler,代码行数:12,


示例7: bmp

wxBitmap CRemoteTreeView::CreateIcon(int index, const wxString& overlay /*=_T("")*/){	// Create memory DC	wxSize s = CThemeProvider::GetIconSize(iconSizeSmall);#ifdef __WXMSW__	wxBitmap bmp(s.x, s.y, 32);#else	wxBitmap bmp(s.x, s.y, 24);#endif	wxMemoryDC dc;	dc.SelectObject(bmp);	// Make sure the background is set correctly	dc.SetBrush(wxBrush(GetBackgroundColour()));	dc.SetPen(wxPen(GetBackgroundColour()));	dc.DrawRectangle(0, 0, s.x, s.y);	// Draw item from system image list	GetSystemImageList()->Draw(index, dc, 0, 0, wxIMAGELIST_DRAW_TRANSPARENT);	// Load overlay	if (!overlay.empty())	{		wxImage unknownIcon = wxArtProvider::GetBitmap(overlay, wxART_OTHER, CThemeProvider::GetIconSize(iconSizeSmall)).ConvertToImage();		// Convert mask into alpha channel		if (unknownIcon.IsOk() && !unknownIcon.HasAlpha())		{			wxASSERT(unknownIcon.HasMask());			unknownIcon.InitAlpha();		}		// Draw overlay		dc.DrawBitmap(unknownIcon, 0, 0, true);	}	dc.SelectObject(wxNullBitmap);	return bmp;}
开发者ID:oneminot,项目名称:filezilla3,代码行数:39,


示例8: WXUNUSED

void wxGenericHyperlinkCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)){    wxPaintDC dc(this);    dc.SetFont(GetFont());    dc.SetTextForeground(GetForegroundColour());    dc.SetTextBackground(GetBackgroundColour());    dc.DrawText(GetLabel(), GetLabelRect().GetTopLeft());    if (HasFocus())    {        wxRendererNative::Get().DrawFocusRect(this, dc, GetClientRect(), wxCONTROL_SELECTED);    }}
开发者ID:CustomCardsOnline,项目名称:wxWidgets,代码行数:13,


示例9: dc

void AttentionBar::OnPaint(wxPaintEvent&){    wxPaintDC dc(this);    wxRect rect(dc.GetSize());    auto bg = GetBackgroundColour();    dc.SetBrush(*wxTRANSPARENT_BRUSH);    dc.SetPen(bg.ChangeLightness(90));#ifndef __WXOSX__    dc.DrawLine(rect.GetTopLeft(), rect.GetTopRight());#endif    dc.DrawLine(rect.GetBottomLeft(), rect.GetBottomRight());}
开发者ID:benpope82,项目名称:poedit,代码行数:13,


示例10: WXUNUSED

void MuleGifCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)){	wxBufferedPaintDC dc(this);	wxSize clientsize = GetClientSize();	wxSize gifsize = m_decoder->GetAnimationSize();	int x = (clientsize.GetWidth()-gifsize.GetWidth())/2;	int y = (clientsize.GetHeight()-gifsize.GetHeight())/2;	dc.SetBackground(*(wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID)));	dc.Clear();	dc.DrawBitmap(m_frame, x, y, true);}
开发者ID:Artoria2e5,项目名称:amule-dlp,代码行数:13,


示例11: WXUNUSED

WXHBRUSH wxButton::OnCtlColor( WXHDC    WXUNUSED(pDC),                               WXHWND   WXUNUSED(pWnd),                               WXUINT   WXUNUSED(nCtlColor),                               WXUINT   WXUNUSED(uMessage),                               WXWPARAM WXUNUSED(wParam),                               WXLPARAM WXUNUSED(lParam) ){    wxBrush* pBackgroundBrush = wxTheBrushList->FindOrCreateBrush( GetBackgroundColour()                                                                  ,wxSOLID                                                                  );    return (WXHBRUSH)pBackgroundBrush->GetResourceHandle();} // end of wxButton::OnCtlColor
开发者ID:LuaDist,项目名称:wxwidgets,代码行数:13,


示例12: DimeControl

void AISTargetQueryDialog::SetColorScheme( ColorScheme cs ){    DimeControl( this );    wxColor bg = GetBackgroundColour();    m_pQueryTextCtl->SetBackgroundColour( bg );    SetBackgroundColour( bg );                  // This looks like non-sense, but is needed for __WXGTK__    // to get colours to propagate down the control's family tree.    if( cs != m_colorscheme ) {        Refresh();    }    m_colorscheme = cs;}
开发者ID:libai245,项目名称:wht1,代码行数:14,


示例13: RefreshBuffer

void wxJigsawEditorCanvas::RefreshBuffer(){	do	{		if(!m_DoubleBufferDC.IsOk()) break;		m_DoubleBufferDC.SetBackground(wxBrush(GetBackgroundColour()));		m_DoubleBufferDC.Clear();		if(!m_View) break;		m_DoubleBufferDC.SetFont(GetScaledFont());		m_View->OnDraw(&m_DoubleBufferDC);	}	while(false);	Refresh();}
开发者ID:cubemoon,项目名称:game-editor,代码行数:14,


示例14: dc

void wxBitmapComboLabel::OnPaint( wxPaintEvent &WXUNUSED(event) ){    wxPaintDC dc(this);    dc.SetFont(m_bmpCombo->GetFont());    //dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID));    //dc.Clear();    dc.SetBrush(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID));    dc.SetPen(*wxTRANSPARENT_PEN);    dc.DrawRectangle(wxRect(wxPoint(0,0), GetClientSize()));    const int sel = m_bmpCombo->GetSelection();    if ((sel >= 0) && (sel < m_bmpCombo->GetCount()))        m_bmpCombo->DrawItem(dc, sel);}
开发者ID:Kangar0o,项目名称:gambit,代码行数:14,


示例15: GetSizer

/* SToolBarGroup::addActionButton * Adds a toolbar button to the group for [action]. If [icon] is * empty, the action's icon is used *******************************************************************/SToolBarButton* SToolBarGroup::addActionButton(string action, string icon, bool show_name){	// Get sizer	wxSizer* sizer = GetSizer();	// Create button	SToolBarButton* button = new SToolBarButton(this, action, icon, show_name);	button->SetBackgroundColour(GetBackgroundColour());	// Add it to the group	sizer->Add(button, 0, wxALIGN_CENTER_VERTICAL|wxALL, 1);	return button;}
开发者ID:Blzut3,项目名称:SLADE,代码行数:18,


示例16: GetBackgroundColour

void NassiDiagramWindow::PaintBackground(wxDC &dc){    wxColour backgroundColour = GetBackgroundColour();    if ( !backgroundColour.Ok())        backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);    dc.SetBrush(wxBrush(backgroundColour));    dc.SetPen(wxPen(backgroundColour, 1));    wxRect windowRect(wxPoint(0,0), GetClientSize());    CalcUnscrolledPosition(windowRect.x, windowRect.y, &windowRect.x, &windowRect.y);    dc.DrawRectangle(windowRect);    dc.SetBrush(wxNullBrush);    dc.SetPen(wxNullPen);}
开发者ID:simple-codeblocks,项目名称:Codeblocks,代码行数:14,


示例17: wxUnknownControlContainer

 wxUnknownControlContainer(wxWindow *parent,                           const wxString& controlName,                           wxWindowID id = wxID_ANY,                           const wxPoint& pos = wxDefaultPosition,                           const wxSize& size = wxDefaultSize,                           long style = 0)     // Always add the wxTAB_TRAVERSAL and wxNO_BORDER styles to what comes     // from the XRC if anything.     : wxPanel(parent, id, pos, size, style | wxTAB_TRAVERSAL | wxNO_BORDER,               controlName + wxT("_container")),       m_controlName(controlName), m_controlAdded(false) {     m_bg = GetBackgroundColour();     SetBackgroundColour(wxColour(255, 0, 255)); }
开发者ID:AmbientMalice,项目名称:pcsx2,代码行数:15,


示例18: GetVirtualSize

void wxlCan::Render( wxDC& dc ){    int w,h;    GetVirtualSize( &w, &h );    dc.SetBackground( GetBackgroundColour() );    dc.Clear();    dc.SetBrush(m_backbrush);    dc.SetPen( *wxTRANSPARENT_PEN );    dc.DrawRectangle( 0, 0, w, h );    //draw objects    m_rootobject.Draw( dc, 0, 0 );}
开发者ID:Abyss116,项目名称:luaplus51-all,代码行数:15,


示例19: GetClientSize

void wxAnimationCtrl::ClearToBackgroundColour(){    wxSize sz = GetClientSize();    GdkPixbuf *newpix = gdk_pixbuf_new(GDK_COLORSPACE_RGB, false, 8,                                       sz.GetWidth(), sz.GetHeight());    if (!newpix)        return;    wxColour clr = GetBackgroundColour();    guint32 col = (clr.Red() << 24) | (clr.Green() << 16) | (clr.Blue() << 8);    gdk_pixbuf_fill(newpix, col);    gtk_image_set_from_pixbuf(GTK_IMAGE(m_widget), newpix);    g_object_unref(newpix);}
开发者ID:Bluehorn,项目名称:wxPython,代码行数:15,


示例20: onPaint

	void onPaint(wxPaintEvent& e)	{		wxPaintDC dc(this);		// Get system colours needed		wxColour col_background = GetBackgroundColour();//toolbar_win10 ? *wxWHITE : Drawing::getPanelBGColour();		wxColour col_light = Drawing::lightColour(col_background, 1.5f);		wxColour col_dark = Drawing::darkColour(col_background, 1.5f);		// Draw lines		//dc.SetPen(wxPen(col_dark));		//dc.DrawLine(wxPoint(0, 0), wxPoint(GetSize().x+1, 0));		//dc.SetPen(wxPen(col_light));		//dc.DrawLine(wxPoint(0, 1), wxPoint(GetSize().x+1, 1));	}
开发者ID:Blzut3,项目名称:SLADE,代码行数:15,


示例21: old_dc

void kwxBitmapButton::OnPaint(wxPaintEvent& event){	wxPaintDC old_dc(this);		int w,h;		GetClientSize(&w,&h);	/////////////////	// Create a memory DC	wxMemoryDC dc;	dc.SelectObject(*membitmap);	dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(),wxSOLID));	dc.Clear();	///////////////////		// se impostato n bitmap lo disegno    //if (mDefaultBitmap)	if(m_stato == 0)		dc.DrawBitmap(*mDefaultBitmap, 0, 0, TRUE);	else if(m_stato == 1)		dc.DrawBitmap(*mMoveMouseBitmap, 0, 0, TRUE);	else if(m_stato == 2)		dc.DrawBitmap(*mPressMouseBitmap, 0, 0, TRUE);	// Cornice intorno	dc.SetPen(*wxThePenList->FindOrCreatePen(*wxRED, 1, wxSOLID));	dc.DrawLine(0, 0, 0, h - 1);	dc.DrawLine(0, 0, w, 0);	dc.DrawLine(0, h - 1, w, h - 1);	dc.DrawLine(w - 1, 0, w - 1, h - 1);	// We can now draw into the memory DC...	// Copy from this DC to another DC.	old_dc.Blit(0, 0, w, h, &dc, 0, 0); }
开发者ID:BlueAndi,项目名称:vscp_software,代码行数:48,


示例22: old_dc

void kwxBmpSwitcher::OnPaint(wxPaintEvent &WXUNUSED(event)){	wxPaintDC old_dc(this);	int w,h;	wxBitmap *pCurrent ;	m_nCount = m_bmplist.GetCount() ;	GetClientSize(&w,&h);	/////////////////	// Create a memory DC	wxMemoryDC dc;	dc.SelectObject(*membitmap);	dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(),wxSOLID));	dc.Clear();	double  dx = 30.5,        	dy = 30.5,        	dr = 29.95;    dc.SetPen( *wxBLACK_PEN );    dc.SetBrush( *wxBLACK_BRUSH );    dc.DrawCircle((int)dx, (int)dy, (int)dr);	if (m_nCount == 1)	{		CBmpList::Node *node = m_bmplist.GetFirst();		pCurrent = node->GetData() ;	}	else	{		if (m_nState >= m_nCount )			m_nState = 0 ;		CBmpList::Node *node = m_bmplist.Item(m_nState);		pCurrent = node->GetData();	}    if (pCurrent->IsOk())		dc.DrawBitmap(*pCurrent, 0, 0, TRUE);		old_dc.Blit(0, 0, w, h, &dc, 0, 0);}
开发者ID:jhoggart,项目名称:rt-tuner,代码行数:48,


示例23: GetBackgroundColour

// wxGTK-specific: called recursively by Enable,// to give widgets an oppprtunity to correct their colours after they// have been changed by Enablevoid wxTextCtrl::OnParentEnable( bool enable ){    // If we have a custom background colour, we use this colour in both    // disabled and enabled mode, or we end up with a different colour under the    // text.    wxColour oldColour = GetBackgroundColour();    if (oldColour.Ok())    {        // Need to set twice or it'll optimize the useful stuff out        if (oldColour == * wxWHITE)            SetBackgroundColour(*wxBLACK);        else            SetBackgroundColour(*wxWHITE);        SetBackgroundColour(oldColour);    }}
开发者ID:EdgarTx,项目名称:wx,代码行数:19,


示例24: GetBackgroundColour

/// Paint the backgroundvoid InstanceCtrl::PaintBackground(wxDC& dc){	wxColour backgroundColour = GetBackgroundColour();	if (!backgroundColour.Ok())		backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);			// Clear the background	dc.SetBrush(wxBrush(backgroundColour));	dc.SetPen(*wxTRANSPARENT_PEN);	wxRect windowRect(wxPoint(0, 0), GetClientSize());		// We need to shift the rectangle to take into account	// scrolling. Converting device to logical coordinates.	CalcUnscrolledPosition(windowRect.x, windowRect.y, & windowRect.x, & windowRect.y);	dc.DrawRectangle(windowRect);}
开发者ID:Glought,项目名称:MultiMC4,代码行数:17,


示例25: addGroup

/* SToolBar::addGroup * Adds [group] to the toolbar *******************************************************************/void SToolBar::addGroup(SToolBarGroup* group){	// Set the group's parent	group->SetParent(this);	// Set background colour	group->SetBackgroundColour(GetBackgroundColour());	// Add it to the list of groups	groups.push_back(group);	// Update layout	updateLayout(true);	Bind(wxEVT_STOOLBAR_BUTTON_CLICKED, &SToolBar::onButtonClick, this, group->GetId());}
开发者ID:Blzut3,项目名称:SLADE,代码行数:19,


示例26: WXUNUSED

void wxPaintBox::OnPaint(wxPaintEvent& WXUNUSED(event)){  SetVirtualSize(m_imageWidth, m_imageHeight);    wxPaintDC dc(this);    PrepareDC(dc);  dc.BeginDrawing();  dc.DrawBitmap(*m_buffer, m_bufferX, m_bufferY);  //background  dc.SetPen(wxPen(*wxBLACK,0,wxTRANSPARENT));  dc.SetBrush(wxBrush(GetBackgroundColour(), wxSOLID));  int w = wxMax(GetClientSize().GetWidth(), m_imageWidth);  int h = wxMax(GetClientSize().GetHeight(), m_imageHeight);  dc.DrawRectangle(m_imageWidth, 0, w-m_imageWidth, h+50);  dc.DrawRectangle(0, m_imageHeight, w, h-m_imageHeight+50);  dc.EndDrawing();}
开发者ID:aszlig,项目名称:wx-Youtube,代码行数:17,


示例27: WXUNUSED

void wxStaticBitmap::DoPaintManually(wxPaintEvent& WXUNUSED(event)){    wxPaintDC dc(this);    const wxSize size(GetSize());    const wxBitmap bmp(GetBitmap());    // Clear the background    dc.SetBrush(GetBackgroundColour());    dc.SetPen(*wxTRANSPARENT_PEN);    dc.DrawRectangle(0, 0, size.GetWidth(), size.GetHeight());    // Draw the image in the middle    dc.DrawBitmap(bmp,                  (size.GetWidth() - bmp.GetWidth()) / 2,                  (size.GetHeight() - bmp.GetHeight()) / 2,                  true /* use mask */);}
开发者ID:EdgarTx,项目名称:wx,代码行数:18,


示例28: GetBackgroundColour

void AISTargetAlertDialog::UpdateText(){    if( GetAlertText() ) {        wxColor bg = GetBackgroundColour();        m_pAlertTextCtl->SetBackgroundColour( bg );        wxFont *dFont = FontMgr::Get().GetFont( _("AISTargetQuery"), 12 );        wxString face = dFont->GetFaceName();        int sizes[7];        for( int i = -2; i < 5; i++ ) {            sizes[i + 2] = dFont->GetPointSize() + i + ( i > 0 ? i : 0 );        }        wxString html;        html.Printf( _T("<html><body bgcolor=#%02x%02x%02x><center>"), bg.Red(), bg.Blue(),                bg.Green() );        html << m_alert_text;        html << _T("</center></font></body></html>");        m_pAlertTextCtl->SetFonts( face, face, sizes );        m_pAlertTextCtl->SetPage( html );        // Try to create a min size that works across font sizes.        wxSize sz;        if( !IsShown() ) {            sz = m_pAlertTextCtl->GetVirtualSize();            sz.x = 300;            m_pAlertTextCtl->SetSize( sz );        }        m_pAlertTextCtl->Layout();        wxSize ir( m_pAlertTextCtl->GetInternalRepresentation()->GetWidth(),                m_pAlertTextCtl->GetInternalRepresentation()->GetHeight() );        sz.x = wxMax( m_pAlertTextCtl->GetSize().x, ir.x );        sz.y = wxMax( m_pAlertTextCtl->GetSize().y, ir.y );        m_pAlertTextCtl->SetMinSize( sz );        Fit();        sz -= wxSize( 200, 200 );        m_pAlertTextCtl->SetMinSize( sz );    }    DimeControl( this );    if( !g_bopengl && CanSetTransparent() ) SetTransparent( 192 );}
开发者ID:Choony,项目名称:OpenCPN,代码行数:44,



注:本文中的GetBackgroundColour函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetBagSize函数代码示例
C++ GetBValue函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。