- MGR: Use standard menus, even on Windows, for the Simple GUI.

clientgui/
        sg_StatImageLoader.cpp

svn path=/trunk/boinc/; revision=22782
This commit is contained in:
Rom Walton 2010-12-01 16:06:01 +00:00
parent 0220ab3319
commit 30190aa77c
2 changed files with 7 additions and 20 deletions

View File

@ -8525,3 +8525,9 @@ Bernd 01 Dec 2010
api/
boinc-api.cpp
Rom 01 Dec 2010
- MGR: Use standard menus, even on Windows, for the Simple GUI.
clientgui/
sg_StatImageLoader.cpp

View File

@ -55,7 +55,7 @@ StatImageLoader::StatImageLoader(wxWindow* parent, char* url) :
project_files_downloaded_time = 1;
project_last_rpc_time = 1;
BuildUserStatToolTip();
statPopUpMenu = new wxMenu(wxSIMPLE_BORDER);
statPopUpMenu = new wxMenu();
AddMenuItems();
}
@ -114,20 +114,11 @@ void StatImageLoader::AddMenuItems()
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
#ifndef __WXMAC__
CSkinSimple* pSkinSimple = wxGetApp().GetSkinManager()->GetSimple();
wxASSERT(pSkinSimple);
wxASSERT(wxDynamicCast(pSkinSimple, CSkinSimple));
#endif
PROJECT* project = pDoc->state.lookup_project(project_url);
urlCount = project->gui_urls.size();
// Add the home page link
wxMenuItem *urlItem = new wxMenuItem(statPopUpMenu, WEBSITE_URL_MENU_ID_HOMEPAGE,wxString(project->project_name.c_str(), wxConvUTF8));
#ifdef __WXMSW__
urlItem->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
#endif
Connect( WEBSITE_URL_MENU_ID_HOMEPAGE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(StatImageLoader::OnMenuLinkClicked) );
statPopUpMenu->Append(urlItem);
@ -135,9 +126,6 @@ void StatImageLoader::AddMenuItems()
// Add any GUI urls
for(unsigned int i = 0; i < urlCount; i++){
urlItem = new wxMenuItem(statPopUpMenu, WEBSITE_URL_MENU_ID + i, wxGetTranslation(wxString(project->gui_urls[i].name.c_str(), wxConvUTF8)));
#ifdef __WXMSW__
urlItem->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
#endif
Connect( WEBSITE_URL_MENU_ID + i, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(StatImageLoader::OnMenuLinkClicked) );
statPopUpMenu->Append(urlItem);
@ -147,14 +135,7 @@ void StatImageLoader::AddMenuItems()
if (!project->attached_via_acct_mgr) {
statPopUpMenu->AppendSeparator();
wxMenuItemList menuList = statPopUpMenu->GetMenuItems();
#ifdef __WXMSW__
menuList[statPopUpMenu->GetMenuItemCount()-1]->SetBackgroundColour(wxColour(_T("RED")));
#endif
urlItem = new wxMenuItem(statPopUpMenu, WEBSITE_URL_MENU_ID_REMOVE_PROJECT, _("Remove Project"));
#ifdef __WXMSW__
urlItem->SetBackgroundColour(*pSkinSimple->GetBackgroundImage()->GetBackgroundColor());
#endif
Connect( WEBSITE_URL_MENU_ID_REMOVE_PROJECT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(StatImageLoader::OnMenuLinkClicked) );
statPopUpMenu->Append(urlItem);
}