本文整理汇总了C++中CSkinSimple::GetBackgroundImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CSkinSimple::GetBackgroundImage方法的具体用法?C++ CSkinSimple::GetBackgroundImage怎么用?C++ CSkinSimple::GetBackgroundImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSkinSimple
的用法示例。
在下文中一共展示了CSkinSimple::GetBackgroundImage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateComponent
void ClientStateIndicator::CreateComponent(){
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
wxASSERT(pSkinSimple);
wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple));
//Set Background color
SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
}
示例2: CreateComponent
void CProjectsComponent::CreateComponent()
{
Freeze();
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
wxASSERT(pSkinSimple);
wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple));
//Set Background color
SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
//Static content in my Projects section
// add project button
wxToolTip *ttAddProject = new wxToolTip(_("Volunteer for any or all of 30+ projects in many areas of science"));
btnAddProj=new wxBitmapButton(
this,
ID_WIZARDATTACH,
*pSkinSimple->GetAttachProjectButton()->GetBitmap(),
wxPoint(214,7),
wxSize(81,18),
wxBU_AUTODRAW
);
if ( pSkinSimple->GetAttachProjectButton()->GetBitmapClicked() != NULL ) {
btnAddProj->SetBitmapSelected(
*pSkinSimple->GetAttachProjectButton()->GetBitmapClicked()
);
}
btnAddProj->SetToolTip(ttAddProject);
// syncronize button, hidden by default.
wxToolTip *ttSynchronize = new wxToolTip(_("Synchronize projects with account manager system"));
btnSynchronize=new wxBitmapButton(
this,
ID_WIZARDUPDATE,
*pSkinSimple->GetSynchronizeButton()->GetBitmap(),
wxPoint(214,7),
wxSize(81,18),
wxBU_AUTODRAW
);
if ( pSkinSimple->GetSynchronizeButton()->GetBitmapClicked() != NULL ) {
btnSynchronize->SetBitmapSelected(
*pSkinSimple->GetSynchronizeButton()->GetBitmapClicked()
);
}
btnSynchronize->SetToolTip(ttSynchronize);
btnSynchronize->Show(false);
/// Help
wxToolTip *ttHelp = new wxToolTip(_("Get help with BOINC"));
btnHelp=new wxBitmapButton(
this,
ID_SIMPLE_HELP,
*pSkinSimple->GetHelpButton()->GetBitmap(),
wxPoint(300,7),
wxSize(
(*pSkinSimple->GetHelpButton()->GetBitmap()).GetWidth(),
(*pSkinSimple->GetHelpButton()->GetBitmap()).GetHeight()
),
wxBU_AUTODRAW
);
if ( pSkinSimple->GetHelpButton()->GetBitmapClicked() != NULL ) {
btnHelp->SetBitmapSelected(
*pSkinSimple->GetHelpButton()->GetBitmapClicked()
);
}
btnHelp->SetToolTip(ttHelp);
/// Line
lnMyProjTop = new CTransparentStaticLine(this, wxID_ANY, wxPoint(29,29),wxSize(292,1));
lnMyProjTop->SetLineColor(pSkinSimple->GetStaticLineColor());
//// Arrow Btns
btnArwLeft = new wxBitmapButton(
this,
-1,
*pSkinSimple->GetLeftArrowButton()->GetBitmap(),
wxPoint(29,47),
wxSize(20,20),
wxBU_AUTODRAW
);
if ( pSkinSimple->GetLeftArrowButton()->GetBitmapClicked() != NULL ) {
btnArwLeft->SetBitmapSelected(*pSkinSimple->GetLeftArrowButton()->GetBitmapClicked());
}
btnArwLeft->Show(false);//on creation this one is always false
btnArwRight = new wxBitmapButton(
this,
-1,
*pSkinSimple->GetRightArrowButton()->GetBitmap(),
wxPoint(301,47),
wxSize(20,20),
wxBU_AUTODRAW
);
if ( pSkinSimple->GetRightArrowButton()->GetBitmapClicked() != NULL ) {
btnArwRight->SetBitmapSelected(*pSkinSimple->GetRightArrowButton()->GetBitmapClicked());
}
btnArwRight->Show(false);
//
//.........这里部分代码省略.........
示例3: ReskinInterface
void CProjectsComponent::ReskinInterface()
{
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
wxASSERT(pSkinSimple);
wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple));
//Set Background color only
SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
//right button
btnArwRight->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnArwRight->SetBitmapLabel(*(pSkinSimple->GetRightArrowButton()->GetBitmap()));
btnArwRight->SetBitmapSelected(*(pSkinSimple->GetRightArrowButton()->GetBitmapClicked()));
//left button
btnArwLeft->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnArwLeft->SetBitmapLabel(*(pSkinSimple->GetLeftArrowButton()->GetBitmap()));
btnArwLeft->SetBitmapSelected(*(pSkinSimple->GetLeftArrowButton()->GetBitmapClicked()));
// add project btn
btnAddProj->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnAddProj->SetBitmapLabel(*(pSkinSimple->GetAttachProjectButton()->GetBitmap()));
btnAddProj->SetBitmapSelected(*(pSkinSimple->GetAttachProjectButton()->GetBitmapClicked()));
// synchronize btn
btnSynchronize->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnSynchronize->SetBitmapLabel(*(pSkinSimple->GetSynchronizeButton()->GetBitmap()));
btnSynchronize->SetBitmapSelected(*(pSkinSimple->GetSynchronizeButton()->GetBitmapClicked()));
// help btn
btnHelp->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnHelp->SetBitmapLabel(*(pSkinSimple->GetHelpButton()->GetBitmap()));
btnHelp->SetBitmapSelected(*(pSkinSimple->GetHelpButton()->GetBitmapClicked()));
// messages btn
btnMessages->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnMessages->SetBitmapLabel(*(pSkinSimple->GetMessagesLink()->GetBitmap()));
btnMessages->SetBitmapSelected(*(pSkinSimple->GetMessagesLink()->GetBitmap()));
// alert messages btn
btnAlertMessages->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnAlertMessages->SetBitmapLabel(*(pSkinSimple->GetMessagesAlertLink()->GetBitmap()));
btnAlertMessages->SetBitmapSelected(*(pSkinSimple->GetMessagesAlertLink()->GetBitmap()));
// pause btn
btnPause->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnPause->SetBitmapLabel(*(pSkinSimple->GetSuspendLink()->GetBitmap()));
btnPause->SetBitmapSelected(*(pSkinSimple->GetSuspendLink()->GetBitmap()));
// resume btn
btnResume->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnResume->SetBitmapLabel(*(pSkinSimple->GetResumeLink()->GetBitmap()));
btnResume->SetBitmapSelected(*(pSkinSimple->GetResumeLink()->GetBitmap()));
// preferences btn
btnPreferences->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnPreferences->SetBitmapLabel(*(pSkinSimple->GetPreferencesLink()->GetBitmap()));
btnPreferences->SetBitmapSelected(*(pSkinSimple->GetPreferencesLink()->GetBitmap()));
// advance view btn
btnAdvancedView->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
btnAdvancedView->SetBitmapLabel(*(pSkinSimple->GetAdvancedLink()->GetBitmap()));
btnAdvancedView->SetBitmapSelected(*(pSkinSimple->GetAdvancedLink()->GetBitmap()));
//set line colors
lnMyProjTop->SetLineColor(pSkinSimple->GetStaticLineColor());
lnMyProjBtm->SetLineColor(pSkinSimple->GetStaticLineColor());
// spacers
i_spacer1->LoadImage(*(pSkinSimple->GetSpacerImage()->GetBitmap()));
i_spacer2->LoadImage(*(pSkinSimple->GetSpacerImage()->GetBitmap()));
i_spacer2->LoadImage(*(pSkinSimple->GetSpacerImage()->GetBitmap()));
// Rebuild stat menus and reload icons
for(int m = 0; m < (int)m_statProjects.size(); m++){
StatImageLoader *i_statImage = m_statProjects.at(m);
i_statImage->LoadImage();
i_statImage->RebuildMenu();
}
}
示例4: SetBackgroundBitmap
void CSimpleGUIPanel::SetBackgroundBitmap() {
wxLogTrace(wxT("Function Start/End"), wxT("CSimpleGUIPanel::SetBackgroundBitmap - Function Start"));
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
wxASSERT(pSkinSimple);
wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple));
wxColour bgColor(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
SetBackgroundColour(bgColor);
wxRect panelRect = GetRect();
m_bmpBg = wxBitmap(panelRect.width, panelRect.height);
wxMemoryDC dc(m_bmpBg);
wxBrush bgBrush(bgColor);
dc.SetBackground(bgBrush);
dc.Clear();
#ifdef __WXMAC__
// Work around an apparent bug in wxMemoryDC::Clear() in wxCarbon 2.9.4
// TODO: remove this when the wxCarbon bug is fixed
dc.SetBrush(bgBrush);
wxPen bgPen(bgColor);
dc.SetPen(bgPen);
dc.DrawRectangle(panelRect);
#endif
int srcX, srcY, destX, destY, h, w;
wxBitmap* srcBmp = pSkinSimple->GetBackgroundImage()->GetBitmap();
wxSize srcSize = srcBmp->GetSize();
switch(pSkinSimple->GetBackgroundImage()->GetHorizontalAnchor()) {
case BKGD_ANCHOR_HORIZ_LEFT:
default:
srcX = 0;
destX = 0;
break;
case BKGD_ANCHOR_HORIZ_CENTER:
if (panelRect.width < srcSize.GetWidth()) {
srcX = (srcSize.GetWidth() - panelRect.width) / 2;
destX = 0;
} else {
srcX = 0;
destX = (panelRect.width - srcSize.GetWidth()) / 2;
}
break;
case BKGD_ANCHOR_HORIZ_RIGHT:
if (panelRect.width < srcSize.GetWidth()) {
srcX = (srcSize.GetWidth() - panelRect.width);
destX = 0;
} else {
srcX = 0;
destX = (panelRect.width - srcSize.GetWidth());
}
break;
}
w = wxMin(panelRect.width, srcSize.GetWidth());
switch(pSkinSimple->GetBackgroundImage()->GetVerticalAnchor()) {
case BKGD_ANCHOR_VERT_TOP:
default:
srcY = 0;
destY = 0;
break;
case BKGD_ANCHOR_VERT_CENTER:
if (panelRect.height < srcSize.GetHeight()) {
srcY = (srcSize.GetHeight() - panelRect.height) / 2;
destY = 0;
} else {
srcY = 0;
destY = (panelRect.height - srcSize.GetHeight()) / 2;
}
break;
case BKGD_ANCHOR_VERT_BOTTOM:
if (panelRect.height < srcSize.GetHeight()) {
srcY = (srcSize.GetHeight() - panelRect.height);
destY = 0;
} else {
srcY = 0;
destY = (panelRect.height - srcSize.GetHeight());
}
break;
}
h = wxMin(panelRect.height, srcSize.GetHeight());
wxMemoryDC srcDC(*srcBmp);
dc.Blit(destX, destY, w, h, &srcDC, srcX, srcY, wxCOPY);
// dc.DrawBitmap(*pSkinSimple->GetBackgroundImage()->GetBitmap(), 0, 0, false);
wxLogTrace(wxT("Function Start/End"), wxT("CSimpleGUIPanel::SetBackgroundBitmap - Function End"));
}