#include "wx/tooltip.h"
#include "wx/wxhtml.h"
#include "wx/statline.h"
+#include "wx/config.h"
#include "CDMUtilities.h"
#include "creaDevManagerIds.h"
#include "wxCDMFileDescriptionPanel.h"
#include "wxCDMPackageManagerPanel.h"
+#include "wxCDMSettingsDialog.h"
+
#include "wxCDMProjectActionsPanel.h"
#include "wxCDMNewProjectDialog.h"
EVT_MENU(ID_MENU_EXPORT_HIERARCHY, wxCDMMainFrame::OnMenuExportHierarchy)
EVT_MENU(ID_MENU_EXIT, wxCDMMainFrame::OnMenuExit)
EVT_MENU(ID_MENU_REFRESH_PROJECT, wxCDMMainFrame::OnMenuRefreshProject)
+EVT_MENU(ID_MENU_SETTINGS, wxCDMMainFrame::OnMenuSettings)
EVT_MENU(ID_MENU_BBTK_GRAPHICAL_EDITOR, wxCDMMainFrame::OnMenuBBTKGraphicalEditor)
EVT_MENU(ID_MENU_MINITOOLS, wxCDMMainFrame::OnMenuMiniTools)
EVT_MENU(ID_MENU_CODE_EDITOR, wxCDMMainFrame::OnMenuCodeEditor)
wxCDMMainFrame::~wxCDMMainFrame()
{
+ wxConfigBase* pConfig = wxConfigBase::Get();
+ pConfig->Write(wxT("HELP"), this->help);
+
auiManager.UnInit();
}
)
{
wxFrame::Create(parent, id, caption, pos, size, style);
- this->model = new modelCDMMain();
this->help = true;
+
+ wxConfigBase* pConfig = wxConfigBase::Get();
+ this->help = pConfig->Read(wxT("HELP"), this->help) != 0;
+
+ this->model = new modelCDMMain();
+
CreateMenus();
CreateControls();
return TRUE;
//EditMenu
menu_Edit = new wxMenu();
menu_Edit->Append(ID_MENU_REFRESH_PROJECT, wxT("&Refresh Project"));
+ menu_Edit->Append(ID_MENU_SETTINGS, wxT("&Settings"));
menuBar->Append(menu_Edit, wxT("&Edit"));
event.Skip();
}
+void wxCDMMainFrame::OnMenuSettings(wxCommandEvent& event)
+{
+ wxCDMSettingsDialog* settingsDialog = new wxCDMSettingsDialog(this, -1);
+ settingsDialog->SetHelpEnabled(this->help);
+
+ int res = settingsDialog->ShowModal();
+ if(res == wxID_OK)
+ {
+ this->help = settingsDialog->IsHelpEnabled();
+ this->menu_Help->Check(ID_MENU_TOGGLE_HELP, this->help);
+ }
+}
+
void wxCDMMainFrame::OnMenuBBTKGraphicalEditor(wxCommandEvent& event)
{
std::cerr << "Event OnMenuBBTKGraphicalEditor not implemented" << std::endl;
auiManager.Update();
break;
default:
- event.Skip();
+ event.Skip();
+ break;
}
}