diff --git a/checkin_notes b/checkin_notes index 802a5aa316..709bd3b6a8 100755 --- a/checkin_notes +++ b/checkin_notes @@ -174,3 +174,10 @@ David 5 Jan 2007 clientgui/ BOINCGridCtrl.cpp,h WelcomPage.cpp + +Rom 5 Jan 2007 + - MGR: Fix the help handling code for the Mac UI conventions. + + clientgui/ + sg_DlgMessages.cpp, .h + sg_DlgPreferences.cpp, .h diff --git a/clientgui/sg_DlgMessages.cpp b/clientgui/sg_DlgMessages.cpp index e22251a50a..01322e9baa 100644 --- a/clientgui/sg_DlgMessages.cpp +++ b/clientgui/sg_DlgMessages.cpp @@ -67,6 +67,7 @@ BEGIN_EVENT_TABLE( CPanelMessages, wxPanel ) EVT_BUTTON( wxID_OK, CPanelMessages::OnOK ) EVT_BUTTON(ID_COPYAll, CPanelMessages::OnMessagesCopyAll) EVT_BUTTON(ID_COPYSELECTED, CPanelMessages::OnMessagesCopySelected) + EVT_BUTTON(ID_SIMPLE_HELP, CPanelMessages::OnButtonHelp) ////@end CPanelPreferences event table entries END_EVENT_TABLE() @@ -248,9 +249,30 @@ void CPanelMessages::CreateControls() itemBoxSizer4->Add(itemBitmapButton44, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); #ifndef __WXMSW__ +#ifdef __WXMAC__ + wxBitmapButton* itemButton45 = new wxBitmapButton( + this, + ID_SIMPLE_HELP, + *pSkinSimple->GetHelpButton()->GetBitmap(), + wxDefaultPosition, + wxSize( + (*pSkinSimple->GetHelpButton()->GetBitmap()).GetWidth(), + (*pSkinSimple->GetHelpButton()->GetBitmap()).GetHeight() + ), + wxBU_AUTODRAW + ); + if ( pSkinSimple->GetHelpButton()->GetBitmapClicked() != NULL ) { + itemButton45->SetBitmapSelected(*pSkinSimple->GetHelpButton()->GetBitmapClicked()); + } +#ifdef wxUSE_TOOLTIPS + itemButton45->SetToolTip(new wxToolTip(_("Get help with BOINC"));); +#endif + itemBoxSizer4->Add(itemButton45, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); +#else wxContextHelpButton* itemButton45 = new wxContextHelpButton(this); itemBoxSizer4->Add(itemButton45, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); #endif +#endif } @@ -408,6 +430,25 @@ void CPanelMessages::OnMessagesCopySelected( wxCommandEvent& WXUNUSED(event) ) { } +/*! + * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SIMPLE_HELP + */ + +void CPanelMessages::OnButtonHelp( wxCommandEvent& WXUNUSED(event) ) { + wxLogTrace(wxT("Function Start/End"), wxT("CPanelMessages::OnHelp - Function Begin")); + + std::string url; + url = wxGetApp().GetSkinManager()->GetAdvanced()->GetCompanyWebsite().mb_str(); + canonicalize_master_url(url); + + wxString wxurl; + wxurl.Printf(wxT("%smanager_links.php?target=simple"), url.c_str()); + wxHyperLink::ExecuteLink(wxurl); + + wxLogTrace(wxT("Function Start/End"), wxT("CPanelMessages::OnHelp - Function End")); +} + + bool CPanelMessages::OnSaveState(wxConfigBase* pConfig) { wxString strBaseConfigLocation = wxEmptyString; wxListItem liColumnInfo; diff --git a/clientgui/sg_DlgMessages.h b/clientgui/sg_DlgMessages.h index 6f0f56dc0f..a075c64b60 100644 --- a/clientgui/sg_DlgMessages.h +++ b/clientgui/sg_DlgMessages.h @@ -107,6 +107,9 @@ public: /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_COPYSELECTED void OnMessagesCopySelected( wxCommandEvent& event ); + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SIMPLE_HELP + void OnButtonHelp( wxCommandEvent& event ); + ////@end CPanelMessages event handler declarations ////@begin CPanelMessages member function declarations diff --git a/clientgui/sg_DlgPreferences.cpp b/clientgui/sg_DlgPreferences.cpp index 1a22fb14e0..440455867e 100644 --- a/clientgui/sg_DlgPreferences.cpp +++ b/clientgui/sg_DlgPreferences.cpp @@ -208,6 +208,7 @@ BEGIN_EVENT_TABLE( CPanelPreferences, wxPanel ) EVT_CHECKBOX( ID_CUSTOMIZEPREFERENCES, CPanelPreferences::OnCustomizePreferencesClick ) EVT_COMBOBOX( ID_WORKBETWEENBEGIN, CPanelPreferences::OnWorkBetweenBeginSelected ) EVT_COMBOBOX( ID_CONNECTBETWEENBEGIN, CPanelPreferences::OnConnectBetweenBeginSelected ) + EVT_BUTTON(ID_SIMPLE_HELP, CPanelPreferences::OnButtonHelp) ////@end CPanelPreferences event table entries END_EVENT_TABLE() @@ -486,8 +487,29 @@ void CPanelPreferences::CreateControls() itemBoxSizer44->Add(itemBitmapButton45, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); #ifndef __WXMSW__ - wxContextHelpButton* itemButton46 = new wxContextHelpButton(this); - itemBoxSizer44->Add(itemButton46, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); +#ifdef __WXMAC__ + wxBitmapButton* itemButton46 = new wxBitmapButton( + this, + ID_SIMPLE_HELP, + *pSkinSimple->GetHelpButton()->GetBitmap(), + wxDefaultPosition, + wxSize( + (*pSkinSimple->GetHelpButton()->GetBitmap()).GetWidth(), + (*pSkinSimple->GetHelpButton()->GetBitmap()).GetHeight() + ), + wxBU_AUTODRAW + ); + if ( pSkinSimple->GetHelpButton()->GetBitmapClicked() != NULL ) { + itemButton46->SetBitmapSelected(*pSkinSimple->GetHelpButton()->GetBitmapClicked()); + } +#ifdef wxUSE_TOOLTIPS + itemButton45->SetToolTip(new wxToolTip(_("Get help with BOINC"));); +#endif + itemBoxSizer4->Add(itemButton45, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); +#else + wxContextHelpButton* itemButton45 = new wxContextHelpButton(this); + itemBoxSizer4->Add(itemButton45, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); +#endif #endif // Set validators @@ -532,6 +554,25 @@ void CPanelPreferences::OnConnectBetweenBeginSelected( wxCommandEvent& /*event*/ } +/*! + * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SIMPLE_HELP + */ + +void CPanelPreferences::OnButtonHelp( wxCommandEvent& WXUNUSED(event) ) { + wxLogTrace(wxT("Function Start/End"), wxT("CPanelPreferences::OnHelp - Function Begin")); + + std::string url; + url = wxGetApp().GetSkinManager()->GetAdvanced()->GetCompanyWebsite().mb_str(); + canonicalize_master_url(url); + + wxString wxurl; + wxurl.Printf(wxT("%smanager_links.php?target=simple"), url.c_str()); + wxHyperLink::ExecuteLink(wxurl); + + wxLogTrace(wxT("Function Start/End"), wxT("CPanelPreferences::OnHelp - Function End")); +} + + /*! * wxEVT_ERASE_BACKGROUND event handler for ID_DLGPREFERENCES */ diff --git a/clientgui/sg_DlgPreferences.h b/clientgui/sg_DlgPreferences.h index 0149698df2..831a736e70 100644 --- a/clientgui/sg_DlgPreferences.h +++ b/clientgui/sg_DlgPreferences.h @@ -109,6 +109,9 @@ public: /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_CONNECTBETWEENBEGIN void OnConnectBetweenBeginSelected( wxCommandEvent& event ); + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SIMPLE_HELP + void OnButtonHelp( wxCommandEvent& event ); + ////@end CPanelPreferences event handler declarations ////@begin CPanelPreferences member function declarations