本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
}
示例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());
}
示例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);
}
示例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
示例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;
}
示例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();
}
示例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);
}
示例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;
}