本文整理汇总了C++中CSkinSimple::GetProjectImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CSkinSimple::GetProjectImage方法的具体用法?C++ CSkinSimple::GetProjectImage怎么用?C++ CSkinSimple::GetProjectImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSkinSimple
的用法示例。
在下文中一共展示了CSkinSimple::GetProjectImage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetProjectSpecificBitmap
wxBitmap* CSimpleProjectPanel::GetProjectSpecificBitmap(char* project_url) {
char defaultIcnPath[256];
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
wxASSERT(pSkinSimple);
// Only update if it is project specific is found
if(boinc_resolve_filename(GetProjectIconLoc(project_url).c_str(), defaultIcnPath, sizeof(defaultIcnPath)) == 0) {
wxBitmap* projectBM = new wxBitmap();
if ( projectBM->LoadFile(wxString(defaultIcnPath,wxConvUTF8), wxBITMAP_TYPE_ANY) ) {
return projectBM;
}
}
return pSkinSimple->GetProjectImage()->GetBitmap();
}
示例2: GetProjectSpecificBitmap
wxBitmap* CSimpleProjectPanel::GetProjectSpecificBitmap(char* project_url) {
char defaultIcnPath[256];
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
wxASSERT(pSkinSimple);
// Only update it if project specific is found
if(boinc_resolve_filename(GetProjectIconLoc(project_url).c_str(), defaultIcnPath, sizeof(defaultIcnPath)) == 0) {
wxBitmap* projectBM;
wxString strIconPath = wxString(defaultIcnPath,wxConvUTF8);
if (wxFile::Exists(strIconPath)) {
#ifdef __WXMSW__
if ((GetXDPIScaling() > 1.05) || (GetYDPIScaling() > 1.05)) {
wxImage img = wxImage(strIconPath, wxBITMAP_TYPE_ANY);
if (img.IsOk()) {
img.Rescale((int) (img.GetWidth()*GetXDPIScaling()),
(int) (img.GetHeight()*GetYDPIScaling()),
wxIMAGE_QUALITY_BILINEAR
);
projectBM = new wxBitmap(img);
if (projectBM->IsOk()) {
return projectBM;
}
}
} else
#endif
{
projectBM = new wxBitmap();
if ( projectBM->LoadFile(strIconPath, wxBITMAP_TYPE_ANY) ) {
return projectBM;
}
}
}
}
return pSkinSimple->GetProjectImage()->GetBitmap();
}
示例3: dc
CSimpleProjectPanel::CSimpleProjectPanel( wxWindow* parent ) :
CSimplePanelBase( parent )
{
wxSize sz;
wxString str = wxEmptyString;
wxWindowDC dc(this);
m_UsingAccountManager = -1; // Force action the first time
m_CurrentSelectedProjectURL[0] = '\0';
m_sAddProjectString = _("Add Project");
m_sSynchronizeString = _("Synchronize");
m_sTotalWorkDoneString = _("Work done for this project");
m_sAddProjectToolTip = _("Volunteer for any or all of 30+ projects in many areas of science");
m_sSynchronizeToolTip = _("Synchronize projects with account manager system");
m_GotBGBitMap = false; // Can't be made until parent has been laid out.
SetForegroundColour(*wxBLACK);
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer( wxHORIZONTAL );
bSizer1->AddSpacer(ADJUSTFORYDPI(5));
m_myProjectsLabel = new CTransparentStaticText( this, wxID_ANY, _("Projects:"), wxDefaultPosition, wxDefaultSize, 0 );
m_myProjectsLabel->Wrap( -1 );
bSizer2->Add( m_myProjectsLabel, 0, wxRIGHT, ADJUSTFORXDPI(5) );
bSizer2->AddStretchSpacer();
int addProjectWidth, synchronizeWidth, y;
GetTextExtent(m_sAddProjectString, &addProjectWidth, &y);
GetTextExtent(m_sSynchronizeString, &synchronizeWidth, &y);
m_TaskAddProjectButton = new CTransparentButton( this, ID_ADDROJECTBUTTON,
(addProjectWidth > synchronizeWidth) ? m_sAddProjectString : m_sSynchronizeString,
wxDefaultPosition, wxDefaultSize, 0
);
bSizer2->Add( m_TaskAddProjectButton, 0, wxRIGHT | wxEXPAND | wxALIGN_RIGHT, SIDEMARGINS );
bSizer1->Add( bSizer2, 0, wxEXPAND | wxTOP | wxLEFT, ADJUSTFORXDPI(10) );
#ifndef __WXMAC__
bSizer1->AddSpacer(ADJUSTFORYDPI(5));
#endif
#if TESTBIGICONPOPUP
m_ProjectSelectionCtrl = new CBOINCBitmapComboBox( this, ID_SGPROJECTSELECTOR, wxT(""), wxDefaultPosition, wxSize(-1, 42), 4, tempArray, wxCB_READONLY );
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
bmArray[0] = *pSkinSimple->GetProjectImage()->GetBitmap();
m_ProjectSelectionCtrl->SetItemBitmap(0, bmArray[0]);
bmArray[1] = wxBitmap((const char**)sah_40_xpm);
m_ProjectSelectionCtrl->SetItemBitmap(1, bmArray[1]);
bmArray[2] = wxBitmap((const char**)einstein_icon_xpm);
m_ProjectSelectionCtrl->SetItemBitmap(3, bmArray[2]);
// m_ProjectSelectionCtrl->SetStringSelection(tempArray[1]);
m_ProjectSelectionCtrl->SetSelection(1);
#else
m_ProjectSelectionCtrl = new CBOINCBitmapComboBox( this, ID_SGPROJECTSELECTOR, wxT(""), wxDefaultPosition, wxSize(-1, 42), 0, NULL, wxCB_READONLY);
#endif
// TODO: Might want better wording for Project Selection Combo Box tooltip
str = _("Select a project to access with the controls below");
m_ProjectSelectionCtrl->SetToolTip(str);
bSizer1->Add( m_ProjectSelectionCtrl, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );
#ifndef __WXMAC__
bSizer1->AddSpacer(ADJUSTFORYDPI(8));
#endif
// Make sure m_TotalCreditValue string is large enough
m_fDisplayedCredit = 9999999999.99;
str.Printf(wxT("%s: %.0f"), m_sTotalWorkDoneString.c_str(), m_fDisplayedCredit);
m_TotalCreditValue = new CTransparentStaticText( this, wxID_ANY, str, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
m_TotalCreditValue->Wrap( -1 );
bSizer1->Add( m_TotalCreditValue, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );
bSizer1->AddSpacer(ADJUSTFORYDPI(5));
wxBoxSizer* bSizer3;
bSizer3 = new wxBoxSizer( wxHORIZONTAL );
m_ProjectWebSitesButton = new CSimpleProjectWebSitesPopupButton( this, ID_PROJECTWEBSITESBUTTON, _("Project Web Pages"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3->Add( m_ProjectWebSitesButton, 0, wxEXPAND | wxALIGN_LEFT, 0 );
bSizer3->AddStretchSpacer();
m_ProjectCommandsButton = new CSimpleProjectCommandPopupButton( this, ID_PROJECTCOMMANDBUTTON, _("Project Commands"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer3->Add( m_ProjectCommandsButton, 0, wxEXPAND | wxALIGN_RIGHT, 0 );
bSizer1->Add( bSizer3, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS );
bSizer1->AddSpacer(ADJUSTFORYDPI(10));
// Temporarily insert a dummy entry so sizer can
// get correct height of m_ProjectSelectionCtrl
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
wxBitmap* defaultBM = pSkinSimple->GetProjectImage()->GetBitmap();
m_ProjectSelectionCtrl->Insert("", *defaultBM, 0, (void*)NULL);
//.........这里部分代码省略.........