//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: workspacesettingsbase.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////

#include "workspacesettingsbase.h"


// Declare the bitmap loading function
extern void wxC3C39InitBitmapResources();

static bool bBitmapLoaded = false;


WorkspaceSettingsBase::WorkspaceSettingsBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
    : wxDialog(parent, id, title, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC3C39InitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(mainSizer);
    
    m_notebook1 = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), 0);
    m_notebook1->SetName(wxT("m_notebook1"));
    
    mainSizer->Add(m_notebook1, 1, wxALL|wxEXPAND, 5);
    
    m_panelEnv = new wxPanel(m_notebook1, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxTAB_TRAVERSAL);
    m_notebook1->AddPage(m_panelEnv, _("Environment"), false);
    
    wxBoxSizer* bSizer81 = new wxBoxSizer(wxVERTICAL);
    m_panelEnv->SetSizer(bSizer81);
    
    wxStaticBoxSizer* sbSizer3 = new wxStaticBoxSizer( new wxStaticBox(m_panelEnv, wxID_ANY, wxT("")), wxVERTICAL);
    
    bSizer81->Add(sbSizer3, 0, wxALL, 5);
    
    m_staticText3 = new wxStaticText(m_panelEnv, wxID_ANY, _("By default, CodeLite uses the current active environment variables set as defined in the Settings > Environment Variables dialog.\nHowever, you may choose a different set to become the active set when this workspace is loaded selecting it here."), wxDefaultPosition, wxSize(-1, -1), 0);
    
    sbSizer3->Add(m_staticText3, 0, wxALL, 5);
    
    m_staticText4 = new wxStaticText(m_panelEnv, wxID_ANY, _("Environment sets:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizer81->Add(m_staticText4, 0, wxALL|wxEXPAND, 5);
    
    wxArrayString m_choiceEnvSetsArr;
    m_choiceEnvSetsArr.Add(wxT("Default"));
    m_choiceEnvSets = new wxChoice(m_panelEnv, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), m_choiceEnvSetsArr, 0);
    m_choiceEnvSets->SetSelection(0);
    
    bSizer81->Add(m_choiceEnvSets, 0, wxALL|wxEXPAND, 5);
    
    m_staticline2 = new wxStaticLine(m_panelEnv, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxLI_HORIZONTAL);
    
    bSizer81->Add(m_staticline2, 0, wxALL|wxEXPAND, 5);
    
    m_staticText6 = new wxStaticText(m_panelEnv, wxID_ANY, _("Specify here an additional environment variables that will be shared with other people who are using this workspace:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizer81->Add(m_staticText6, 0, wxALL|wxEXPAND, 5);
    
    m_textCtrlWspEnvVars = new wxTextCtrl(m_panelEnv, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), wxTE_RICH2|wxTE_PROCESS_TAB|wxTE_MULTILINE);
    #ifdef __WXMSW__
    // To get the newer version of the font on MSW, we use font wxSYS_DEFAULT_GUI_FONT with family set to wxFONTFAMILY_TELETYPE
    wxFont m_textCtrlWspEnvVarsFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    m_textCtrlWspEnvVarsFont.SetFamily(wxFONTFAMILY_TELETYPE);
    #else
    wxFont m_textCtrlWspEnvVarsFont = wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT);
    m_textCtrlWspEnvVarsFont.SetFamily(wxFONTFAMILY_TELETYPE);
    #endif
    m_textCtrlWspEnvVars->SetFont(m_textCtrlWspEnvVarsFont);
    
    bSizer81->Add(m_textCtrlWspEnvVars, 1, wxALL|wxEXPAND, 5);
    
    m_staticline1 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxLI_HORIZONTAL);
    
    mainSizer->Add(m_staticline1, 0, wxALL|wxEXPAND, 5);
    
    wxBoxSizer* buttonSizer = new wxBoxSizer(wxHORIZONTAL);
    
    mainSizer->Add(buttonSizer, 0, wxALIGN_CENTER_HORIZONTAL, 5);
    
    m_buttonOk = new wxButton(this, wxID_OK, _("&Ok"), wxDefaultPosition, wxSize(-1, -1), 0);
    m_buttonOk->SetDefault();
    
    buttonSizer->Add(m_buttonOk, 0, wxALL, 5);
    
    m_buttonCancel = new wxButton(this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    buttonSizer->Add(m_buttonCancel, 0, wxALL, 5);
    
    
    #if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(m_notebook1)){
        wxPersistenceManager::Get().RegisterAndRestore(m_notebook1);
    } else {
        wxPersistenceManager::Get().Restore(m_notebook1);
    }
    #endif
    
    SetName(wxT("WorkspaceSettingsBase"));
    SetSize(-1,-1);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent(wxBOTH);
    } else {
        CentreOnScreen(wxBOTH);
    }
#if wxVERSION_NUMBER >= 2900
    if(!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
#endif
    // Connect events
    m_choiceEnvSets->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(WorkspaceSettingsBase::OnEnvSelected), NULL, this);
    m_buttonOk->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(WorkspaceSettingsBase::OnButtonOK), NULL, this);
    
}

WorkspaceSettingsBase::~WorkspaceSettingsBase()
{
    m_choiceEnvSets->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(WorkspaceSettingsBase::OnEnvSelected), NULL, this);
    m_buttonOk->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(WorkspaceSettingsBase::OnButtonOK), NULL, this);
    
}

CodeCompletionBasePage::CodeCompletionBasePage(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style)
    : wxPanel(parent, id, pos, size, style)
{
    if ( !bBitmapLoaded ) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxC3C39InitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* bSizer9 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(bSizer9);
    
    m_splitter1 = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxSP_LIVE_UPDATE|wxSP_NO_XP_THEME|wxSP_3DSASH);
    m_splitter1->SetSashGravity(0.5);
    m_splitter1->SetMinimumPaneSize(1);
    
    bSizer9->Add(m_splitter1, 1, wxEXPAND, 5);
    
    m_panel8 = new wxPanel(m_splitter1, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxTAB_TRAVERSAL);
    
    wxBoxSizer* bSizer24 = new wxBoxSizer(wxVERTICAL);
    m_panel8->SetSizer(bSizer24);
    
    m_staticText5 = new wxStaticText(m_panel8, wxID_ANY, _("Search paths:"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizer24->Add(m_staticText5, 0, wxLEFT|wxRIGHT|wxTOP, 5);
    
    m_textCtrlSearchPaths = new wxTextCtrl(m_panel8, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), wxTE_RICH2|wxTE_PROCESS_TAB|wxTE_MULTILINE);
    #ifdef __WXMSW__
    // To get the newer version of the font on MSW, we use font wxSYS_DEFAULT_GUI_FONT with family set to wxFONTFAMILY_TELETYPE
    wxFont m_textCtrlSearchPathsFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    m_textCtrlSearchPathsFont.SetFamily(wxFONTFAMILY_TELETYPE);
    #else
    wxFont m_textCtrlSearchPathsFont = wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT);
    m_textCtrlSearchPathsFont.SetFamily(wxFONTFAMILY_TELETYPE);
    #endif
    m_textCtrlSearchPaths->SetFont(m_textCtrlSearchPathsFont);
    m_textCtrlSearchPaths->SetToolTip(_("Add here search paths used by clang / ctags for locating include files"));
    
    bSizer24->Add(m_textCtrlSearchPaths, 1, wxALL|wxEXPAND, 5);
    
    m_panel6 = new wxPanel(m_splitter1, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxTAB_TRAVERSAL);
    m_splitter1->SplitHorizontally(m_panel8, m_panel6, 0);
    
    wxBoxSizer* bSizer221 = new wxBoxSizer(wxVERTICAL);
    m_panel6->SetSizer(bSizer221);
    
    m_staticText12 = new wxStaticText(m_panel6, wxID_ANY, _("Macros (clang):"), wxDefaultPosition, wxSize(-1, -1), 0);
    
    bSizer221->Add(m_staticText12, 0, wxLEFT|wxRIGHT|wxTOP, 5);
    
    m_textCtrlMacros = new wxTextCtrl(m_panel6, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1, -1), wxTE_RICH2|wxTE_PROCESS_TAB|wxTE_MULTILINE);
    #ifdef __WXMSW__
    // To get the newer version of the font on MSW, we use font wxSYS_DEFAULT_GUI_FONT with family set to wxFONTFAMILY_TELETYPE
    wxFont m_textCtrlMacrosFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    m_textCtrlMacrosFont.SetFamily(wxFONTFAMILY_TELETYPE);
    #else
    wxFont m_textCtrlMacrosFont = wxSystemSettings::GetFont(wxSYS_ANSI_FIXED_FONT);
    m_textCtrlMacrosFont.SetFamily(wxFONTFAMILY_TELETYPE);
    #endif
    m_textCtrlMacros->SetFont(m_textCtrlMacrosFont);
    m_textCtrlMacros->SetToolTip(_("Add here macros to pass to clang when generating PCH files\nOne macro per line"));
    
    bSizer221->Add(m_textCtrlMacros, 1, wxALL|wxEXPAND, 5);
    
    wxBoxSizer* boxSizer3 = new wxBoxSizer(wxHORIZONTAL);
    
    bSizer221->Add(boxSizer3, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
    
    m_checkBoxCpp11 = new wxCheckBox(m_panel6, wxID_ANY, _("Enable C++11 Standard"), wxDefaultPosition, wxSize(-1,-1), 0);
    m_checkBoxCpp11->SetValue(false);
    
    boxSizer3->Add(m_checkBoxCpp11, 0, wxALL, 5);
    
    m_checkBoxCpp14 = new wxCheckBox(m_panel6, wxID_ANY, _("Enable C++14 Standard"), wxDefaultPosition, wxSize(-1,-1), 0);
    m_checkBoxCpp14->SetValue(false);
    
    boxSizer3->Add(m_checkBoxCpp14, 0, wxALL, 5);
    
    m_checkBoxSWTLW = new wxCheckBox(m_panel6, wxID_ANY, _("Sync to Workspace File"), wxDefaultPosition, wxSize(-1,-1), 0);
    m_checkBoxSWTLW->SetValue(false);
    m_checkBoxSWTLW->SetToolTip(_("When enabled search paths folders for Code Completion will be synced between the Workspace file and the local search paths database."));
    
    boxSizer3->Add(m_checkBoxSWTLW, 0, wxALL, 5);
    
    SetName(wxT("CodeCompletionBasePage"));
    SetSize(500,300);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    // Connect events
    m_textCtrlSearchPaths->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CodeCompletionBasePage::OnCCContentModified), NULL, this);
    m_textCtrlMacros->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CodeCompletionBasePage::OnCCContentModified), NULL, this);
    
}

CodeCompletionBasePage::~CodeCompletionBasePage()
{
    m_textCtrlSearchPaths->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CodeCompletionBasePage::OnCCContentModified), NULL, this);
    m_textCtrlMacros->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(CodeCompletionBasePage::OnCCContentModified), NULL, this);
    
}
