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

#include "openresourcedialogbase.h"

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

static bool bBitmapLoaded = false;

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

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

    m_textCtrlResourceName = new clThemedTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition,
                                                  wxDLG_UNIT(this, wxSize(-1, -1)), wxTE_PROCESS_ENTER);
    m_textCtrlResourceName->SetToolTip(_(
        "Type resource name to open.\nYou may use a space delimited list of words to narrow down the list of "
        "choices\ne.g. Typing: 'Open Dialog' will include results that contain both words \"Open\" _and_ \"Dialog\""));
    m_textCtrlResourceName->SetFocus();
#if wxVERSION_NUMBER >= 3000
    m_textCtrlResourceName->SetHint(wxT(""));
#endif

    mainSizer->Add(m_textCtrlResourceName, 0, wxEXPAND, WXC_FROM_DIP(5));

    m_dataview = new clThemedListCtrl(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)),
                                      wxDV_NO_HEADER | wxDV_ROW_LINES | wxDV_MULTIPLE);

    mainSizer->Add(m_dataview, 1, wxEXPAND, WXC_FROM_DIP(5));

    m_dataview->AppendTextColumn(_("Name"), wxDATAVIEW_CELL_INERT, WXC_FROM_DIP(-2), wxALIGN_LEFT,
                                 wxDATAVIEW_COL_RESIZABLE);
    m_dataview->AppendTextColumn(_("Impl"), wxDATAVIEW_CELL_INERT, WXC_FROM_DIP(-2), wxALIGN_LEFT,
                                 wxDATAVIEW_COL_RESIZABLE);
    m_dataview->AppendTextColumn(_("Full Name"), wxDATAVIEW_CELL_INERT, WXC_FROM_DIP(-2), wxALIGN_LEFT,
                                 wxDATAVIEW_COL_RESIZABLE);
    wxBoxSizer* boxSizer19 = new wxBoxSizer(wxHORIZONTAL);

    mainSizer->Add(boxSizer19, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

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

    m_checkBoxFiles =
        new wxCheckBox(this, wxID_ANY, _("Show &files"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxFiles->SetValue(false);

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

    m_checkBoxShowSymbols =
        new wxCheckBox(this, wxID_ANY, _("Show &symbols"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_checkBoxShowSymbols->SetValue(false);

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

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

    m_stdBtnSizer2 = new wxStdDialogButtonSizer();

    boxSizer19->Add(m_stdBtnSizer2, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(10));

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

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

    SetName(wxT("OpenResourceDialogBase"));
    SetSize(wxDLG_UNIT(this, wxSize(-1, -1)));
    if(GetSizer()) {
        GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent(wxBOTH);
    } else {
        CentreOnScreen(wxBOTH);
    }
    // Connect events
    m_textCtrlResourceName->Bind(wxEVT_KEY_DOWN, &OpenResourceDialogBase::OnKeyDown, this);
    m_textCtrlResourceName->Bind(wxEVT_COMMAND_TEXT_UPDATED, &OpenResourceDialogBase::OnText, this);
    m_textCtrlResourceName->Bind(wxEVT_COMMAND_TEXT_ENTER, &OpenResourceDialogBase::OnEnter, this);
    m_dataview->Bind(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, &OpenResourceDialogBase::OnEntrySelected, this);
    m_dataview->Bind(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, &OpenResourceDialogBase::OnEntryActivated, this);
    m_checkBoxFiles->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &OpenResourceDialogBase::OnCheckboxfilesCheckboxClicked,
                          this);
    m_checkBoxShowSymbols->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED,
                                &OpenResourceDialogBase::OnCheckboxshowsymbolsCheckboxClicked, this);
    m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenResourceDialogBase::OnOK, this);
    m_buttonOK->Bind(wxEVT_UPDATE_UI, &OpenResourceDialogBase::OnOKUI, this);
}

OpenResourceDialogBase::~OpenResourceDialogBase()
{
    m_textCtrlResourceName->Unbind(wxEVT_KEY_DOWN, &OpenResourceDialogBase::OnKeyDown, this);
    m_textCtrlResourceName->Unbind(wxEVT_COMMAND_TEXT_UPDATED, &OpenResourceDialogBase::OnText, this);
    m_textCtrlResourceName->Unbind(wxEVT_COMMAND_TEXT_ENTER, &OpenResourceDialogBase::OnEnter, this);
    m_dataview->Unbind(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, &OpenResourceDialogBase::OnEntrySelected, this);
    m_dataview->Unbind(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, &OpenResourceDialogBase::OnEntryActivated, this);
    m_checkBoxFiles->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &OpenResourceDialogBase::OnCheckboxfilesCheckboxClicked,
                            this);
    m_checkBoxShowSymbols->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED,
                                  &OpenResourceDialogBase::OnCheckboxshowsymbolsCheckboxClicked, this);
    m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &OpenResourceDialogBase::OnOK, this);
    m_buttonOK->Unbind(wxEVT_UPDATE_UI, &OpenResourceDialogBase::OnOKUI, this);
}
