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

#include "eosUI.h"

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

static bool bBitmapLoaded = false;

EOSProjectWizardBase::EOSProjectWizardBase(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);
        wxCrafterWdIahzInitBitmapResources();
        bBitmapLoaded = true;
    }

    wxBoxSizer* boxSizer2 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(boxSizer2);

    wxFlexGridSizer* flexGridSizer10 = new wxFlexGridSizer(0, 2, 0, 0);
    flexGridSizer10->SetFlexibleDirection(wxBOTH);
    flexGridSizer10->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
    flexGridSizer10->AddGrowableCol(1);

    boxSizer2->Add(flexGridSizer10, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText12 =
        new wxStaticText(this, wxID_ANY, _("Name:"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    flexGridSizer10->Add(m_staticText12, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_textCtrlName = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_textCtrlName->SetFocus();
#if wxVERSION_NUMBER >= 3000
    m_textCtrlName->SetHint(wxT(""));
#endif

    flexGridSizer10->Add(m_textCtrlName, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText16 =
        new wxStaticText(this, wxID_ANY, _("Path:"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    flexGridSizer10->Add(m_staticText16, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_dirPickerPath = new wxDirPickerCtrl(this, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition,
                                          wxDLG_UNIT(this, wxSize(-1, -1)),
                                          wxDIRP_SMALL | wxDIRP_DEFAULT_STYLE | wxDIRP_USE_TEXTCTRL);

    flexGridSizer10->Add(m_dirPickerPath, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText26 =
        new wxStaticText(this, wxID_ANY, _("Toolchain Path:"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    flexGridSizer10->Add(m_staticText26, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_dirPickerToolchainPath = new wxDirPickerCtrl(this, wxID_ANY, wxEmptyString, _("Select a folder"),
                                                   wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)),
                                                   wxDIRP_SMALL | wxDIRP_DEFAULT_STYLE | wxDIRP_USE_TEXTCTRL);

    flexGridSizer10->Add(m_dirPickerToolchainPath, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    flexGridSizer10->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5));

    m_checkBoxSeparateDir = new wxCheckBox(this, wxID_ANY, _("Create in a separate directory"), wxDefaultPosition,
                                           wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxSeparateDir->SetValue(true);

    flexGridSizer10->Add(m_checkBoxSeparateDir, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticTextActualPath =
        new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    boxSizer2->Add(m_staticTextActualPath, 0, wxALL | wxEXPAND, WXC_FROM_DIP(10));

    m_stdBtnSizer4 = new wxStdDialogButtonSizer();

    boxSizer2->Add(m_stdBtnSizer4, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(10));

    m_buttonOK = new wxButton(this, wxID_OK, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_buttonOK->SetDefault();
    m_stdBtnSizer4->AddButton(m_buttonOK);

    m_buttonCancel = new wxButton(this, wxID_CANCEL, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_stdBtnSizer4->AddButton(m_buttonCancel);
    m_stdBtnSizer4->Realize();

    SetName(wxT("EOSProjectWizardBase"));
    SetSize(wxDLG_UNIT(this, wxSize(500, -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_textCtrlName->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(EOSProjectWizardBase::OnNameUpdated),
                            NULL, this);
    m_dirPickerPath->Connect(wxEVT_COMMAND_DIRPICKER_CHANGED,
                             wxFileDirPickerEventHandler(EOSProjectWizardBase::OnPathChanged), NULL, this);
    m_checkBoxSeparateDir->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED,
                                   wxCommandEventHandler(EOSProjectWizardBase::OnCreateInSeparateDir), NULL, this);
    m_buttonOK->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(EOSProjectWizardBase::OnOKUI), NULL, this);
}

EOSProjectWizardBase::~EOSProjectWizardBase()
{
    m_textCtrlName->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(EOSProjectWizardBase::OnNameUpdated),
                               NULL, this);
    m_dirPickerPath->Disconnect(wxEVT_COMMAND_DIRPICKER_CHANGED,
                                wxFileDirPickerEventHandler(EOSProjectWizardBase::OnPathChanged), NULL, this);
    m_checkBoxSeparateDir->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED,
                                      wxCommandEventHandler(EOSProjectWizardBase::OnCreateInSeparateDir), NULL, this);
    m_buttonOK->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(EOSProjectWizardBase::OnOKUI), NULL, this);
}
