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

#include "GUI.h"

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

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_STATIC;
#else
    return wxBORDER_DEFAULT;
#endif
} // DoGetBorderSimpleBit
bool bBitmapLoaded = false;
} // namespace

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

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

    m_splitter1 = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)),
                                       wxSP_LIVE_UPDATE | wxSP_NO_XP_THEME | wxSP_3DSASH | wxBORDER_NONE);
    m_splitter1->SetSashGravity(0.5);
    m_splitter1->SetMinimumPaneSize(0);

    boxSizer188->Add(m_splitter1, 1, wxEXPAND, WXC_FROM_DIP(5));

    m_panel13 =
        new wxPanel(m_splitter1, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_splitter1, wxSize(-1, -1)), wxTAB_TRAVERSAL);

    wxBoxSizer* bSizer23 = new wxBoxSizer(wxVERTICAL);
    m_panel13->SetSizer(bSizer23);

    wxBoxSizer* bSizer25 = new wxBoxSizer(wxHORIZONTAL);

    bSizer23->Add(bSizer25, 1, wxEXPAND, WXC_FROM_DIP(5));

    m_scintillaSQL =
        new wxStyledTextCtrl(m_panel13, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panel13, wxSize(-1, -1)), 0);
    // Configure the fold margin
    m_scintillaSQL->SetMarginType(4, wxSTC_MARGIN_SYMBOL);
    m_scintillaSQL->SetMarginMask(4, wxSTC_MASK_FOLDERS);
    m_scintillaSQL->SetMarginSensitive(4, true);
    m_scintillaSQL->SetMarginWidth(4, 0);

    // Configure the tracker margin
    m_scintillaSQL->SetMarginWidth(1, 0);

    // Configure the symbol margin
    m_scintillaSQL->SetMarginType(2, wxSTC_MARGIN_SYMBOL);
    m_scintillaSQL->SetMarginMask(2, ~(wxSTC_MASK_FOLDERS));
    m_scintillaSQL->SetMarginWidth(2, 0);
    m_scintillaSQL->SetMarginSensitive(2, true);

    // Configure the line numbers margin
    m_scintillaSQL->SetMarginType(0, wxSTC_MARGIN_NUMBER);
    m_scintillaSQL->SetMarginWidth(0, 0);

    // Configure the line symbol margin
    m_scintillaSQL->SetMarginType(3, wxSTC_MARGIN_FORE);
    m_scintillaSQL->SetMarginMask(3, 0);
    m_scintillaSQL->SetMarginWidth(3, 0);
    // Select the lexer
    m_scintillaSQL->SetLexer(wxSTC_LEX_SQL);
    // Set default font / styles
    m_scintillaSQL->StyleClearAll();
    m_scintillaSQL->SetWrapMode(0);
    m_scintillaSQL->SetIndentationGuides(0);
    m_scintillaSQL->SetKeyWords(0, wxT(""));
    m_scintillaSQL->SetKeyWords(1, wxT(""));
    m_scintillaSQL->SetKeyWords(2, wxT(""));
    m_scintillaSQL->SetKeyWords(3, wxT(""));
    m_scintillaSQL->SetKeyWords(4, wxT(""));

    bSizer25->Add(m_scintillaSQL, 1, wxALL | wxEXPAND, WXC_FROM_DIP(2));

    m_panel14 =
        new wxPanel(m_splitter1, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_splitter1, wxSize(-1, -1)), wxTAB_TRAVERSAL);
    m_splitter1->SplitHorizontally(m_panel13, m_panel14, 0);

    wxBoxSizer* bSizer24 = new wxBoxSizer(wxVERTICAL);
    m_panel14->SetSizer(bSizer24);

    m_table = new clTableWithPagination(m_panel14, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panel14, wxSize(-1, -1)),
                                        wxTAB_TRAVERSAL);

    bSizer24->Add(m_table, 1, wxEXPAND, WXC_FROM_DIP(5));

    SetName(wxT("_SqlCommandPanel"));
    SetSize(wxDLG_UNIT(this, wxSize(-1, -1)));
    if (GetSizer()) {
        GetSizer()->Fit(this);
    }
}

_SqlCommandPanel::~_SqlCommandPanel() {}

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

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

    m_treeDatabases =
        new clThemedTreeCtrl(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxTR_HIDE_ROOT);

    bSizer28->Add(m_treeDatabases, 1, wxEXPAND, WXC_FROM_DIP(5));

    SetName(wxT("_DbViewerPanel"));
    SetSize(wxDLG_UNIT(this, wxSize(200, 100)));
    if (GetSizer()) {
        GetSizer()->Fit(this);
    }
    // Connect events
    m_treeDatabases->Bind(wxEVT_COMMAND_TREE_BEGIN_DRAG, &_DbViewerPanel::OnDnDStart, this);
    m_treeDatabases->Bind(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, &_DbViewerPanel::OnItemActivate, this);
    m_treeDatabases->Bind(wxEVT_COMMAND_TREE_SEL_CHANGED, &_DbViewerPanel::OnItemSelectionChange, this);
    m_treeDatabases->Bind(wxEVT_COMMAND_TREE_ITEM_MENU, &_DbViewerPanel::OnContextMenu, this);
    m_treeDatabases->Bind(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, &_DbViewerPanel::OnItemRightClick, this);
}

_DbViewerPanel::~_DbViewerPanel()
{
    m_treeDatabases->Unbind(wxEVT_COMMAND_TREE_BEGIN_DRAG, &_DbViewerPanel::OnDnDStart, this);
    m_treeDatabases->Unbind(wxEVT_COMMAND_TREE_ITEM_ACTIVATED, &_DbViewerPanel::OnItemActivate, this);
    m_treeDatabases->Unbind(wxEVT_COMMAND_TREE_SEL_CHANGED, &_DbViewerPanel::OnItemSelectionChange, this);
    m_treeDatabases->Unbind(wxEVT_COMMAND_TREE_ITEM_MENU, &_DbViewerPanel::OnContextMenu, this);
    m_treeDatabases->Unbind(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, &_DbViewerPanel::OnItemRightClick, this);
}

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

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

    m_notebook2 = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_notebook2->SetName(wxT("m_notebook2"));

    bSizer4->Add(m_notebook2, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_Sqlite =
        new wxPanel(m_notebook2, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook2, wxSize(-1, -1)), wxTAB_TRAVERSAL);
    m_notebook2->AddPage(m_Sqlite, _("Sqlite"), true);

    wxBoxSizer* bSizer27 = new wxBoxSizer(wxVERTICAL);
    m_Sqlite->SetSizer(bSizer27);

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

    bSizer27->Add(fgSizer41, 0, wxEXPAND, WXC_FROM_DIP(5));

    m_staticText11 = new wxStaticText(m_Sqlite, wxID_ANY, _("Database file:"), wxDefaultPosition,
                                      wxDLG_UNIT(m_Sqlite, wxSize(-1, -1)), 0);

    fgSizer41->Add(m_staticText11, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_filePickerSqlite = new wxFilePickerCtrl(
        m_Sqlite, wxID_ANY, wxEmptyString, _("Select a file"),
        wxT("All Files (*)|*|Database file (*.sqlite;*.tags;*.db)|*.sqlite;*.tags;*.db"), wxDefaultPosition,
        wxDLG_UNIT(m_Sqlite, wxSize(-1, -1)), wxFLP_USE_TEXTCTRL | wxFLP_SMALL | wxFLP_OPEN);
    m_filePickerSqlite->SetFocus();

    fgSizer41->Add(m_filePickerSqlite, 0, wxALL | wxEXPAND | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_listCtrlRecentFiles = new wxListCtrl(m_Sqlite, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_Sqlite, wxSize(-1, -1)),
                                           wxLC_HRULES | wxLC_SINGLE_SEL | wxLC_REPORT);

    bSizer27->Add(m_listCtrlRecentFiles, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_MySqlPanel =
        new wxPanel(m_notebook2, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook2, wxSize(-1, -1)), wxTAB_TRAVERSAL);
    m_notebook2->AddPage(m_MySqlPanel, _("MySql"), false);

    wxBoxSizer* boxSizer182 = new wxBoxSizer(wxVERTICAL);
    m_MySqlPanel->SetSizer(boxSizer182);

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

    boxSizer182->Add(fgSizer4, 1, wxEXPAND, WXC_FROM_DIP(5));

    m_staticText10 = new wxStaticText(m_MySqlPanel, wxID_ANY, _("Connection name:"), wxDefaultPosition,
                                      wxDLG_UNIT(m_MySqlPanel, wxSize(-1, -1)), 0);

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

    m_txName =
        new wxTextCtrl(m_MySqlPanel, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_MySqlPanel, wxSize(-1, -1)), 0);
    m_txName->SetToolTip(_("Name for this connection"));
    m_txName->SetFocus();
#if wxVERSION_NUMBER >= 3000
    m_txName->SetHint(wxT(""));
#endif

    fgSizer4->Add(m_txName, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText1 = new wxStaticText(m_MySqlPanel, wxID_ANY, _("Server:"), wxDefaultPosition,
                                     wxDLG_UNIT(m_MySqlPanel, wxSize(-1, -1)), 0);
    m_staticText1->SetToolTip(_("Host name / IP of the server hosting the MySQL server"));

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

    m_txServer = new wxTextCtrl(m_MySqlPanel, wxID_ANY, wxT(""), wxDefaultPosition,
                                wxDLG_UNIT(m_MySqlPanel, wxSize(150, -1)), 0);
    m_txServer->SetToolTip(_("Host name / IP of the server hosting the MySQL server"));
#if wxVERSION_NUMBER >= 3000
    m_txServer->SetHint(wxT(""));
#endif

    fgSizer4->Add(m_txServer, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText2 = new wxStaticText(m_MySqlPanel, wxID_ANY, _("User name:"), wxDefaultPosition,
                                     wxDLG_UNIT(m_MySqlPanel, wxSize(-1, -1)), 0);

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

    m_txUserName = new wxTextCtrl(m_MySqlPanel, wxID_ANY, wxT(""), wxDefaultPosition,
                                  wxDLG_UNIT(m_MySqlPanel, wxSize(150, -1)), 0);
    m_txUserName->SetToolTip(_("Database user name"));
#if wxVERSION_NUMBER >= 3000
    m_txUserName->SetHint(wxT(""));
#endif

    fgSizer4->Add(m_txUserName, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText3 = new wxStaticText(m_MySqlPanel, wxID_ANY, _("Password:"), wxDefaultPosition,
                                     wxDLG_UNIT(m_MySqlPanel, wxSize(-1, -1)), 0);

    fgSizer4->Add(m_staticText3, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_txPassword = new wxTextCtrl(m_MySqlPanel, wxID_ANY, wxT(""), wxDefaultPosition,
                                  wxDLG_UNIT(m_MySqlPanel, wxSize(150, -1)), wxTE_PASSWORD);
    m_txPassword->SetToolTip(_("Database password"));
#if wxVERSION_NUMBER >= 3000
    m_txPassword->SetHint(wxT(""));
#endif

    fgSizer4->Add(m_txPassword, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    wxArrayString m_listBox2Arr;
    m_listBox2 = new wxListBox(m_MySqlPanel, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_MySqlPanel, wxSize(-1, 100)),
                               m_listBox2Arr, 0);

    boxSizer182->Add(m_listBox2, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_PostgrePanel =
        new wxPanel(m_notebook2, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook2, wxSize(-1, -1)), wxTAB_TRAVERSAL);
    m_notebook2->AddPage(m_PostgrePanel, _("PostgreSQL"), false);

    wxBoxSizer* bSizer_1 = new wxBoxSizer(wxVERTICAL);
    m_PostgrePanel->SetSizer(bSizer_1);

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

    bSizer_1->Add(fgSizer42, 0, wxEXPAND, WXC_FROM_DIP(5));

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

    fgSizer42->Add(m_staticText101, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    fgSizer42->Add(m_txPgName, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

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

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

    fgSizer42->Add(m_txPgServer, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText35 = new wxStaticText(m_PostgrePanel, wxID_ANY, _("Port:"), wxDefaultPosition,
                                      wxDLG_UNIT(m_PostgrePanel, wxSize(-1, -1)), 0);

    fgSizer42->Add(m_staticText35, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    fgSizer42->Add(m_txPgPort, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText21 = new wxStaticText(m_PostgrePanel, wxID_ANY, _("User name:"), wxDefaultPosition,
                                      wxDLG_UNIT(m_PostgrePanel, wxSize(-1, -1)), 0);

    fgSizer42->Add(m_staticText21, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    fgSizer42->Add(m_txPgUserName, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText31 = new wxStaticText(m_PostgrePanel, wxID_ANY, _("Password:"), wxDefaultPosition,
                                      wxDLG_UNIT(m_PostgrePanel, wxSize(-1, -1)), 0);

    fgSizer42->Add(m_staticText31, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_txPgPassword = new wxTextCtrl(m_PostgrePanel, wxID_ANY, wxT(""), wxDefaultPosition,
                                    wxDLG_UNIT(m_PostgrePanel, wxSize(150, -1)), wxTE_PASSWORD);
#if wxVERSION_NUMBER >= 3000
    m_txPgPassword->SetHint(wxT(""));
#endif

    fgSizer42->Add(m_txPgPassword, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_staticText24 = new wxStaticText(m_PostgrePanel, wxID_ANY, _("Default database:"), wxDefaultPosition,
                                      wxDLG_UNIT(m_PostgrePanel, wxSize(-1, -1)), 0);

    fgSizer42->Add(m_staticText24, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    fgSizer42->Add(m_txPgDatabase, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    wxArrayString m_listBoxPgArr;
    m_listBoxPg = new wxListBox(m_PostgrePanel, wxID_ANY, wxDefaultPosition,
                                wxDLG_UNIT(m_PostgrePanel, wxSize(-1, 100)), m_listBoxPgArr, 0);

    bSizer_1->Add(m_listBoxPg, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    wxBoxSizer* bSizer28 = new wxBoxSizer(wxHORIZONTAL);

    bSizer4->Add(bSizer28, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));

    m_button36 = new wxButton(this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    bSizer28->Add(m_button36, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_button35 = new wxButton(this, wxID_OK, _("&OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_button35->SetDefault();

    bSizer28->Add(m_button35, 0, wxALL, WXC_FROM_DIP(5));

#if wxVERSION_NUMBER >= 2900
    if (!wxPersistenceManager::Get().Find(m_notebook2)) {
        wxPersistenceManager::Get().RegisterAndRestore(m_notebook2);
    } else {
        wxPersistenceManager::Get().Restore(m_notebook2);
    }
#endif

    SetName(wxT("_DBSettingsDialog"));
    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_listCtrlRecentFiles->Bind(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, &_DBSettingsDialog::OnItemActivated, this);
    m_listCtrlRecentFiles->Bind(wxEVT_COMMAND_LIST_ITEM_SELECTED, &_DBSettingsDialog::OnItemSelected, this);
    m_listCtrlRecentFiles->Bind(wxEVT_COMMAND_LIST_KEY_DOWN, &_DBSettingsDialog::OnItemKeyDown, this);
    m_txPassword->Bind(wxEVT_KEY_DOWN, &_DBSettingsDialog::OnMySqlPassKeyDown, this);
    m_listBox2->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &_DBSettingsDialog::OnHistoryClick, this);
    m_listBox2->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &_DBSettingsDialog::OnHistoryDClick, this);
    m_listBox2->Bind(wxEVT_UPDATE_UI, &_DBSettingsDialog::OnHistoruUI, this);
    m_txPgPassword->Bind(wxEVT_KEY_DOWN, &_DBSettingsDialog::OnPgSqlKeyDown, this);
    m_listBoxPg->Bind(wxEVT_COMMAND_LISTBOX_SELECTED, &_DBSettingsDialog::OnPgHistoryClick, this);
    m_listBoxPg->Bind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &_DBSettingsDialog::OnPgHistoryDClick, this);
    m_listBoxPg->Bind(wxEVT_UPDATE_UI, &_DBSettingsDialog::OnHistoruUI, this);
    m_button35->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &_DBSettingsDialog::OnDlgOK, this);
}

_DBSettingsDialog::~_DBSettingsDialog()
{
    m_listCtrlRecentFiles->Unbind(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, &_DBSettingsDialog::OnItemActivated, this);
    m_listCtrlRecentFiles->Unbind(wxEVT_COMMAND_LIST_ITEM_SELECTED, &_DBSettingsDialog::OnItemSelected, this);
    m_listCtrlRecentFiles->Unbind(wxEVT_COMMAND_LIST_KEY_DOWN, &_DBSettingsDialog::OnItemKeyDown, this);
    m_txPassword->Unbind(wxEVT_KEY_DOWN, &_DBSettingsDialog::OnMySqlPassKeyDown, this);
    m_listBox2->Unbind(wxEVT_COMMAND_LISTBOX_SELECTED, &_DBSettingsDialog::OnHistoryClick, this);
    m_listBox2->Unbind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &_DBSettingsDialog::OnHistoryDClick, this);
    m_listBox2->Unbind(wxEVT_UPDATE_UI, &_DBSettingsDialog::OnHistoruUI, this);
    m_txPgPassword->Unbind(wxEVT_KEY_DOWN, &_DBSettingsDialog::OnPgSqlKeyDown, this);
    m_listBoxPg->Unbind(wxEVT_COMMAND_LISTBOX_SELECTED, &_DBSettingsDialog::OnPgHistoryClick, this);
    m_listBoxPg->Unbind(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, &_DBSettingsDialog::OnPgHistoryDClick, this);
    m_listBoxPg->Unbind(wxEVT_UPDATE_UI, &_DBSettingsDialog::OnHistoruUI, this);
    m_button35->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &_DBSettingsDialog::OnDlgOK, this);
}

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

    wxFlexGridSizer* fgSizer13 = new wxFlexGridSizer(0, 1, 0, 0);
    fgSizer13->SetFlexibleDirection(wxBOTH);
    fgSizer13->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
    fgSizer13->AddGrowableCol(0);
    fgSizer13->AddGrowableRow(0);
    this->SetSizer(fgSizer13);

    wxStaticBoxSizer* sbSizer9 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Log")), wxVERTICAL);

    fgSizer13->Add(sbSizer9, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_textCtrl11 = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(600, 350)),
                                  wxTE_READONLY | wxTE_MULTILINE);

    sbSizer9->Add(m_textCtrl11, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));
    m_textCtrl11->SetMinSize(wxSize(600, 350));

    wxBoxSizer* bSizer13 = new wxBoxSizer(wxVERTICAL);

    fgSizer13->Add(bSizer13, 1, wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5));

    m_button18 = new wxButton(this, wxID_ANY, _("Close"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    bSizer13->Add(m_button18, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_RIGHT, WXC_FROM_DIP(5));

    SetName(wxT("_LogDialog"));
    SetMinClientSize(wxSize(640, 460));
    SetSize(wxDLG_UNIT(this, wxSize(640, 460)));
    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_button18->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &_LogDialog::OnCloseClick, this);
    m_button18->Bind(wxEVT_UPDATE_UI, &_LogDialog::OnCloseUI, this);
}

_LogDialog::~_LogDialog()
{
    m_button18->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &_LogDialog::OnCloseClick, this);
    m_button18->Unbind(wxEVT_UPDATE_UI, &_LogDialog::OnCloseUI, this);
}

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

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

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

    bSizer22->Add(fgSizer19, 1, wxEXPAND, WXC_FROM_DIP(5));

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

    fgSizer19->Add(m_staticText30, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    fgSizer19->Add(m_txPrefix, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

    fgSizer19->Add(m_staticText31, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    fgSizer19->Add(m_txPostfix, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

    fgSizer19->Add(m_staticText28, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    fgSizer19->Add(m_dirPicker, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

    fgSizer19->Add(m_staticText34, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

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

    fgSizer19->Add(fgSizer26, 1, wxEXPAND, WXC_FROM_DIP(5));

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

    fgSizer26->Add(m_txVirtualDir, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_btnBrowseVirtualDir =
        new wxButton(this, wxID_ANY, _("..."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(40, -1)), 0);

    fgSizer26->Add(m_btnBrowseVirtualDir, 0, wxALL, WXC_FROM_DIP(5));

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

    fgSizer19->Add(m_staticText36, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    wxArrayString m_choiceTemplatesArr;
    m_choiceTemplatesArr.Add(_("DatabaseLayer (wxWidgets)"));
    m_choiceTemplatesArr.Add(_("Debea (STL)"));
    m_choiceTemplatesArr.Add(_("wxDebea (wxWidgets)"));
    m_choiceTemplatesArr.Add(_("Generic classes (STL)"));
    m_choiceTemplates =
        new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), m_choiceTemplatesArr, 0);
    m_choiceTemplates->SetSelection(0);

    fgSizer19->Add(m_choiceTemplates, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

    fgSizer19->Add(m_staticText29, 0, wxALL, WXC_FROM_DIP(5));

    m_textLog = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(300, 250)),
                               wxTE_READONLY | wxTE_MULTILINE);

    fgSizer19->Add(m_textLog, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

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

    wxBoxSizer* bSizer20 = new wxBoxSizer(wxHORIZONTAL);

    bSizer22->Add(bSizer20, 0, wxALIGN_RIGHT, WXC_FROM_DIP(5));

    m_button26 = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    bSizer20->Add(m_button26, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    m_button25 = new wxButton(this, XRCID("IDC_DBE_CG_GENERATE"), _("Generate"), wxDefaultPosition,
                              wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    bSizer20->Add(m_button25, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    SetName(wxT("_ClassGenerateDialog"));
    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_btnBrowseVirtualDir->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &_ClassGenerateDialog::OnBtnBrowseClick, this);
    m_button26->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &_ClassGenerateDialog::OnCancelClick, this);
    m_button25->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &_ClassGenerateDialog::OnGenerateClick, this);
}

_ClassGenerateDialog::~_ClassGenerateDialog()
{
    m_btnBrowseVirtualDir->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &_ClassGenerateDialog::OnBtnBrowseClick, this);
    m_button26->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &_ClassGenerateDialog::OnCancelClick, this);
    m_button25->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &_ClassGenerateDialog::OnGenerateClick, this);
}

DbExplorerFrameBase::DbExplorerFrameBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos,
                                         const wxSize& size, long style)
    : wxFrame(parent, id, title, pos, size, style)
{
    if (!bBitmapLoaded) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxCrafterwyt5ghInitBitmapResources();
        bBitmapLoaded = true;
    }
    // Set icon(s) to the application/dialog
    wxIconBundle app_icons;
    {
        wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("database"));
        wxIcon icn;
        icn.CopyFromBitmap(iconBmp);
        app_icons.AddIcon(icn);
    }
    SetIcons(app_icons);

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

    SetName(wxT("DbExplorerFrameBase"));
    SetSize(wxDLG_UNIT(this, wxSize(500, 300)));
    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);
    }
}

DbExplorerFrameBase::~DbExplorerFrameBase() {}
