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

#include "cppchecksettingsdlgbase.h"

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

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

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

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

    m_staticText46 = new wxStaticText(this, wxID_ANY, _("Configure cppcheck command here:"), wxDefaultPosition,
                                      wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    bSizer1->Add(m_staticText46, 0, wxALL, WXC_FROM_DIP(5));

    m_stcCommand =
        new clThemedSTC(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBORDER_STATIC);
    // Configure the fold margin
    m_stcCommand->SetMarginType(4, wxSTC_MARGIN_SYMBOL);
    m_stcCommand->SetMarginMask(4, wxSTC_MASK_FOLDERS);
    m_stcCommand->SetMarginSensitive(4, true);
    m_stcCommand->SetMarginWidth(4, 0);

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

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

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

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

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

    m_stdBtnSizer43 = new wxStdDialogButtonSizer();

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

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

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

    SetName(wxT("CppCheckSettingsDialogBase"));
    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);
    }
}

CppCheckSettingsDialogBase::~CppCheckSettingsDialogBase() {}

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

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

    m_staticText12 = new wxStaticText(this, wxID_ANY, _("Description to show in the dialog"), wxDefaultPosition,
                                      wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    bSizer1->Add(m_staticText12, 0, wxALL, WXC_FROM_DIP(5));

    m_txtDescription = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_txtDescription->SetToolTip(
        _("This is what you'll see in the settings dialog. Put whatever you like here; it's not used internally"));
#if wxVERSION_NUMBER >= 3000
    m_txtDescription->SetHint(wxT(""));
#endif

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

    m_staticText13 = new wxStaticText(this, wxID_ANY, _("The ID string that cppchecker will recognise"),
                                      wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);

    bSizer1->Add(m_staticText13, 0, wxALL, WXC_FROM_DIP(5));

    m_txtKey = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_txtKey->SetToolTip(
        _("Enter here the unique ID string that cppchecker can recognise. Examples are \"operatorEqVarError\" and "
          "\"uninitMemberVar\". You can find these by grepping the cppchecker source, or by running cppchecker on your "
          "app in a terminal and passing the additional parameter '--xml'."));
#if wxVERSION_NUMBER >= 3000
    m_txtKey->SetHint(wxT(""));
#endif

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

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

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

    wxBoxSizer* bSizer2 = new wxBoxSizer(wxHORIZONTAL);

    bSizer1->Add(bSizer2, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));

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

    bSizer2->Add(m_buttonOK, 0, wxALL, WXC_FROM_DIP(5));

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

    bSizer2->Add(m_buttonCancel, 0, wxALL, WXC_FROM_DIP(5));

    SetName(wxT("CppCheckAddSuppressionDialogBase"));
    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_buttonOK->Bind(wxEVT_UPDATE_UI, &CppCheckAddSuppressionDialogBase::OnOKButtonUpdateUI, this);
}

CppCheckAddSuppressionDialogBase::~CppCheckAddSuppressionDialogBase()
{
    m_buttonOK->Unbind(wxEVT_UPDATE_UI, &CppCheckAddSuppressionDialogBase::OnOKButtonUpdateUI, this);
}
