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

#include "NewKeyShortcutBaseDlg.h"

#include "codelite_exports.h"

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

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

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

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

    m_panel1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxTAB_TRAVERSAL);

    bSizer3->Add(m_panel1, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    wxBoxSizer* boxSizer37 = new wxBoxSizer(wxVERTICAL);
    m_panel1->SetSizer(boxSizer37);

    wxBoxSizer* bSizer5 = new wxBoxSizer(wxHORIZONTAL);

    boxSizer37->Add(bSizer5, 0, 0, WXC_FROM_DIP(0));

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

    bSizer5->Add(flexGridSizer8, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticTextActionLabel =
        new wxStaticText(m_panel1, wxID_ANY, _("Action:"), wxDefaultPosition, wxDLG_UNIT(m_panel1, wxSize(-1, -1)), 0);

    flexGridSizer8->Add(m_staticTextActionLabel, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    flexGridSizer8->Add(m_staticTextAction, 0, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_staticText10 =
        new wxStaticText(m_panel1, wxID_ANY, _("Key:"), wxDefaultPosition, wxDLG_UNIT(m_panel1, wxSize(-1, -1)), 0);

    flexGridSizer8->Add(m_staticText10, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_textCtrl1 = new wxTextCtrl(m_panel1, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panel1, wxSize(-1, -1)),
                                 wxTE_PROCESS_TAB | wxTE_PROCESS_ENTER);
    m_textCtrl1->SetToolTip(
        _("Hit any keyboard key. Don't use the modifier keys (e.g. 'Shift') here, use the checkboxes below"));
    m_textCtrl1->SetFocus();
#if wxVERSION_NUMBER >= 3000
    m_textCtrl1->SetHint(wxT(""));
#endif

    flexGridSizer8->Add(m_textCtrl1, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

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

    wxBoxSizer* bSizer6 = new wxBoxSizer(wxHORIZONTAL);

    flexGridSizer8->Add(bSizer6, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));

    m_checkBoxCtrl =
        new wxCheckBox(m_panel1, wxID_ANY, _("Ctrl"), wxDefaultPosition, wxDLG_UNIT(m_panel1, wxSize(-1, -1)), 0);
    m_checkBoxCtrl->SetValue(false);

    bSizer6->Add(m_checkBoxCtrl, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_checkBoxCmd =
        new wxCheckBox(m_panel1, wxID_ANY, _("CMD"), wxDefaultPosition, wxDLG_UNIT(m_panel1, wxSize(-1, -1)), 0);
    m_checkBoxCmd->SetValue(false);

    bSizer6->Add(m_checkBoxCmd, 0, wxALL, WXC_FROM_DIP(5));

    m_checkBoxAlt =
        new wxCheckBox(m_panel1, wxID_ANY, _("Alt"), wxDefaultPosition, wxDLG_UNIT(m_panel1, wxSize(-1, -1)), 0);
    m_checkBoxAlt->SetValue(false);

    bSizer6->Add(m_checkBoxAlt, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_checkBoxShift =
        new wxCheckBox(m_panel1, wxID_ANY, _("Shift"), wxDefaultPosition, wxDLG_UNIT(m_panel1, wxSize(-1, -1)), 0);
    m_checkBoxShift->SetValue(false);

    bSizer6->Add(m_checkBoxShift, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    wxBoxSizer* boxSizer34 = new wxBoxSizer(wxVERTICAL);

    bSizer5->Add(boxSizer34, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_buttonClear =
        new wxButton(m_panel1, wxID_CLEAR, _("&Clear"), wxDefaultPosition, wxDLG_UNIT(m_panel1, wxSize(-1, -1)), 0);
    m_buttonClear->SetToolTip(_("Clear the keyboard shortcut"));

    boxSizer34->Add(m_buttonClear, 0, wxALL, WXC_FROM_DIP(5));

    m_button30 =
        new wxButton(m_panel1, ID_SUGGEST, _("Suggest..."), wxDefaultPosition, wxDLG_UNIT(m_panel1, wxSize(-1, -1)), 0);
    m_button30->SetToolTip(_("Show list of all un-assigned keyboard shortcuts"));

    boxSizer34->Add(m_button30, 0, wxALL, WXC_FROM_DIP(5));

    m_staticLine39 =
        new wxStaticLine(m_panel1, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panel1, wxSize(-1, -1)), wxLI_HORIZONTAL);

    boxSizer37->Add(m_staticLine39, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_stdBtnSizer22 = new wxStdDialogButtonSizer();

    bSizer3->Add(m_stdBtnSizer22, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(10));

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

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

    SetName(wxT("NewKeyShortcutBaseDlg"));
    SetSize(wxDLG_UNIT(this, wxSize(-1, -1)));
    if (GetSizer()) {
        GetSizer()->Fit(this);
    }
    if (GetParent()) {
        CentreOnParent();
    } else {
        CentreOnScreen();
    }
    if (!wxPersistenceManager::Get().Find(this)) {
        wxPersistenceManager::Get().RegisterAndRestore(this);
    } else {
        wxPersistenceManager::Get().Restore(this);
    }
    // Connect events
    m_textCtrl1->Bind(wxEVT_KEY_DOWN, &NewKeyShortcutBaseDlg::OnKeyDown, this);
    m_buttonClear->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NewKeyShortcutBaseDlg::OnClear, this);
    m_buttonClear->Bind(wxEVT_UPDATE_UI, &NewKeyShortcutBaseDlg::OnClearUI, this);
    m_button30->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &NewKeyShortcutBaseDlg::OnSuggest, this);
}

NewKeyShortcutBaseDlg::~NewKeyShortcutBaseDlg()
{
    m_textCtrl1->Unbind(wxEVT_KEY_DOWN, &NewKeyShortcutBaseDlg::OnKeyDown, this);
    m_buttonClear->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &NewKeyShortcutBaseDlg::OnClear, this);
    m_buttonClear->Unbind(wxEVT_UPDATE_UI, &NewKeyShortcutBaseDlg::OnClearUI, this);
    m_button30->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &NewKeyShortcutBaseDlg::OnSuggest, this);
}
