當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetBackgroundColour函數代碼示例

本文整理匯總了C++中GetBackgroundColour函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetBackgroundColour函數的具體用法?C++ GetBackgroundColour怎麽用?C++ GetBackgroundColour使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetBackgroundColour函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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,代碼來源:switcherdlg.cpp

示例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,代碼來源:control.cpp

示例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,代碼來源:AboutDialog.cpp

示例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,代碼來源:vlbox.cpp

示例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,代碼來源:gcSpinningBar.cpp

示例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,代碼來源:canvas.cpp

示例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,代碼來源:RemoteTreeView.cpp

示例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,代碼來源:hyperlinkg.cpp

示例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,代碼來源:attentionbar.cpp

示例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,代碼來源:MuleGifCtrl.cpp

示例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,代碼來源:button.cpp

示例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,代碼來源:AISTargetQueryDialog.cpp

示例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,代碼來源:wxJigsawEditorCanvas.cpp

示例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,代碼來源:bmpcombo.cpp

示例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,代碼來源:SToolBar.cpp


注:本文中的GetBackgroundColour函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。