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

#include "newclassbasedlg.h"

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

namespace
{
// return the wxBORDER_SIMPLE that matches the current application theme
wxBorder get_border_simple_theme_aware_bit()
{
#if wxVERSION_NUMBER >= 3300 && defined(__WXMSW__)
    return wxSystemSettings::GetAppearance().IsDark() ? wxBORDER_SIMPLE : wxBORDER_DEFAULT;
#else
    return wxBORDER_DEFAULT;
#endif
} // DoGetBorderSimpleBit
bool bBitmapLoaded = false;
} // namespace

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

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

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

    bSizer1->Add(fgSizer1, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

    fgSizer1->Add(m_staticText1, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_textClassName = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_textClassName->SetToolTip(_("The class name"));
    m_textClassName->SetFocus();
#if wxVERSION_NUMBER >= 3000
    m_textClassName->SetHint(wxT(""));
#endif

    fgSizer1->Add(m_textClassName, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText9 = new wxStaticText(this, wxID_ANY, _("*"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_staticText9->SetForegroundColour(wxColour(wxT("rgb(255,0,0)")));
    wxFont m_staticText9Font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    m_staticText9Font.SetWeight(wxFONTWEIGHT_BOLD);
    m_staticText9->SetFont(m_staticText9Font);

    fgSizer1->Add(m_staticText9, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    fgSizer1->Add(m_staticTextNamespace, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_textCtrlNamespace =
        new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_textCtrlNamespace->SetToolTip(_("Place this class inside a namespace"));
#if wxVERSION_NUMBER >= 3000
    m_textCtrlNamespace->SetHint(wxT(""));
#endif

    fgSizer1->Add(m_textCtrlNamespace, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

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

    fgSizer1->Add(m_staticText45, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    fgSizer1->Add(m_textCtrlParentClass, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

    m_staticText37 =
        new wxStaticText(this, wxID_ANY, _("File name:"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    fgSizer1->Add(m_staticText37, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_textCtrlFileName =
        new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_textCtrlFileName->SetToolTip(
        _("This is the base-name for the file(s) that will be generated. If the new class is called Foo, by default "
          "the files will be Foo.cpp and Foo.h. If you'd prefer different names, type the base-name here."));
#if wxVERSION_NUMBER >= 3000
    m_textCtrlFileName->SetHint(wxT(""));
#endif

    fgSizer1->Add(m_textCtrlFileName, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

    m_staticText6 =
        new wxStaticText(this, wxID_ANY, _("Block Guard:"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    fgSizer1->Add(m_staticText6, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_textCtrlBlockGuard =
        new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_textCtrlBlockGuard->SetToolTip(
        _("Set block guard to prevent multiple file inclusion. If left empty, the class name is used"));
#if wxVERSION_NUMBER >= 3000
    m_textCtrlBlockGuard->SetHint(wxT(""));
#endif

    fgSizer1->Add(m_textCtrlBlockGuard, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    fgSizer1->Add(0, 0, 1, wxEXPAND, WXC_FROM_DIP(5));

    m_staticTextVD = new wxStaticText(this, wxID_ANY, _("Virtual Directory:"), wxDefaultPosition,
                                      wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    fgSizer1->Add(m_staticTextVD, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_textCtrlVD =
        new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxTE_READONLY);
    m_textCtrlVD->SetToolTip(
        _("The new class needs to be put somewhere. Select which of the project's virtual folders to use."));
#if wxVERSION_NUMBER >= 3000
    m_textCtrlVD->SetHint(wxT(""));
#endif

    fgSizer1->Add(m_textCtrlVD, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_buttonSelectVD =
        new wxButton(this, wxID_ANY, _("..."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBU_EXACTFIT);

    fgSizer1->Add(m_buttonSelectVD, 0, wxALL, WXC_FROM_DIP(5));

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

    fgSizer1->Add(m_staticText2, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_textCtrlGenFilePath =
        new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_textCtrlGenFilePath->SetToolTip(
        _("Where on the filesystem should the new class's files be put? This will normally be the directory "
          "corresponding to the Virtual Directory; but you can enter an alternative directory here if you wish."));
#if wxVERSION_NUMBER >= 3000
    m_textCtrlGenFilePath->SetHint(wxT(""));
#endif

    fgSizer1->Add(m_textCtrlGenFilePath, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_buttonBrowseFolder =
        new wxButton(this, wxID_ANY, _("..."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBU_EXACTFIT);

    fgSizer1->Add(m_buttonBrowseFolder, 0, wxALL, WXC_FROM_DIP(5));

    m_staticLine75 =
        new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxLI_HORIZONTAL);

    bSizer1->Add(m_staticLine75, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    wxFlexGridSizer* flexGridSizer74 = new wxFlexGridSizer(0, 3, 0, 0);
    flexGridSizer74->SetFlexibleDirection(wxBOTH);
    flexGridSizer74->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);

    bSizer1->Add(flexGridSizer74, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_checkBoxHpp = new wxCheckBox(this, wxID_ANY, _("Create .hpp instead of .h"), wxDefaultPosition,
                                   wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxHpp->SetValue(false);
    m_checkBoxHpp->SetToolTip(_("If checked, the generated header file will be foo.hpp instead of foo.h"));

    flexGridSizer74->Add(m_checkBoxHpp, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_checkBoxPragmaOnce =
        new wxCheckBox(this, wxID_ANY, _("Use #pragma once"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxPragmaOnce->SetValue(false);

    flexGridSizer74->Add(m_checkBoxPragmaOnce, 0, wxALL, WXC_FROM_DIP(5));

    m_checkBoxLowercaseFileName = new wxCheckBox(this, wxID_ANY, _("Use lowercase file names"), wxDefaultPosition,
                                                 wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxLowercaseFileName->SetValue(false);

    flexGridSizer74->Add(m_checkBoxLowercaseFileName, 0, wxALL, WXC_FROM_DIP(5));

    m_checkBoxInline =
        new wxCheckBox(this, wxID_ANY, _("Inline class"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxInline->SetValue(false);
    m_checkBoxInline->SetToolTip(_("Put both the declaration and the implementation in the header file"));

    flexGridSizer74->Add(m_checkBoxInline, 0, wxALL, WXC_FROM_DIP(5));

    m_checkBoxVirtualDtor =
        new wxCheckBox(this, wxID_ANY, _("Virtual destructor"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxVirtualDtor->SetValue(false);

    flexGridSizer74->Add(m_checkBoxVirtualDtor, 0, wxALL, WXC_FROM_DIP(5));

    m_checkBoxSingleton = new wxCheckBox(this, wxID_ANY, _("This is a singleton class"), wxDefaultPosition,
                                         wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxSingleton->SetValue(false);

    flexGridSizer74->Add(m_checkBoxSingleton, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_checkBoxNonInheritable = new wxCheckBox(this, wxID_ANY, _("Prohibit further inheritance"), wxDefaultPosition,
                                              wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxNonInheritable->SetValue(false);

    flexGridSizer74->Add(m_checkBoxNonInheritable, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_checkBoxNonCopyable = new wxCheckBox(this, wxID_ANY, _("Declare this class non-copyable"), wxDefaultPosition,
                                           wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxNonCopyable->SetValue(false);

    flexGridSizer74->Add(m_checkBoxNonCopyable, 0, wxALL, WXC_FROM_DIP(5));

    m_checkBoxNonMovable = new wxCheckBox(this, wxID_ANY, _("Declare this class non-movable"), wxDefaultPosition,
                                          wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxNonMovable->SetValue(false);

    flexGridSizer74->Add(m_checkBoxNonMovable, 0, wxALL, WXC_FROM_DIP(5));

    m_stdBtnSizer30 = new wxStdDialogButtonSizer();

    bSizer1->Add(m_stdBtnSizer30, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(10));

    m_button32 = new wxButton(this, wxID_CANCEL, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_stdBtnSizer30->AddButton(m_button32);

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

    SetName(wxT("NewClassBaseDlg"));
    SetSize(wxDLG_UNIT(this, wxSize(-1, -1)));
    if(GetSizer()) {
        GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent(wxBOTH);
    } else {
        CentreOnScreen(wxBOTH);
    }
    if(!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
    // Connect events
    m_textClassName->Bind(wxEVT_COMMAND_TEXT_UPDATED, &NewClassBaseDlg::OnTextEnter, this);
    m_staticText6->Bind(wxEVT_UPDATE_UI, &NewClassBaseDlg::OnBlockGuardUI, this);
    m_textCtrlBlockGuard->Bind(wxEVT_UPDATE_UI, &NewClassBaseDlg::OnBlockGuardUI, this);
    m_buttonSelectVD->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NewClassBaseDlg::OnBrowseVD, this);
    m_buttonBrowseFolder->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NewClassBaseDlg::OnBrowseFolder, this);
    m_checkBoxLowercaseFileName->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &NewClassBaseDlg::OnUseLowerCaseFileName, this);
    m_checkBoxSingleton->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &NewClassBaseDlg::OnCheckSingleton, this);
    m_button34->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NewClassBaseDlg::OnButtonOK, this);
}

NewClassBaseDlg::~NewClassBaseDlg()
{
    m_textClassName->Unbind(wxEVT_COMMAND_TEXT_UPDATED, &NewClassBaseDlg::OnTextEnter, this);
    m_staticText6->Unbind(wxEVT_UPDATE_UI, &NewClassBaseDlg::OnBlockGuardUI, this);
    m_textCtrlBlockGuard->Unbind(wxEVT_UPDATE_UI, &NewClassBaseDlg::OnBlockGuardUI, this);
    m_buttonSelectVD->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &NewClassBaseDlg::OnBrowseVD, this);
    m_buttonBrowseFolder->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &NewClassBaseDlg::OnBrowseFolder, this);
    m_checkBoxLowercaseFileName->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &NewClassBaseDlg::OnUseLowerCaseFileName, this);
    m_checkBoxSingleton->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &NewClassBaseDlg::OnCheckSingleton, this);
    m_button34->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &NewClassBaseDlg::OnButtonOK, this);
}
