File: AutoSaveUI.cpp

package info (click to toggle)
codelite 12.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 95,112 kB
  • sloc: cpp: 424,040; ansic: 18,284; php: 9,569; lex: 4,186; yacc: 2,820; python: 2,294; sh: 312; makefile: 51; xml: 13
file content (87 lines) | stat: -rw-r--r-- 3,691 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: AutoSaveUI.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////

#include "AutoSaveUI.h"


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

static bool bBitmapLoaded = false;


AutoSaveDlgBase::AutoSaveDlgBase(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);
        wxCrafter7A2fyVInitBitmapResources();
        bBitmapLoaded = true;
    }
    
    wxBoxSizer* boxSizer2 = new wxBoxSizer(wxVERTICAL);
    this->SetSizer(boxSizer2);
    
    wxFlexGridSizer* flexGridSizer8 = new wxFlexGridSizer(0, 2, 0, 0);
    flexGridSizer8->SetFlexibleDirection( wxBOTH );
    flexGridSizer8->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
    flexGridSizer8->AddGrowableCol(1);
    
    boxSizer2->Add(flexGridSizer8, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5));
    
    m_checkBoxEnabled = new wxCheckBox(this, wxID_ANY, _("Enable Auto Save"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0);
    m_checkBoxEnabled->SetValue(true);
    
    flexGridSizer8->Add(m_checkBoxEnabled, 0, wxALL, WXC_FROM_DIP(5));
    
    flexGridSizer8->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5));
    
    m_staticText14 = new wxStaticText(this, wxID_ANY, _("Save interval:"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0);
    m_staticText14->SetToolTip(_("Check and save modified files interval (in seconds)"));
    
    flexGridSizer8->Add(m_staticText14, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));
    
    m_spinCtrlInterval = new wxSpinCtrl(this, wxID_ANY, wxT("5"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxSP_WRAP|wxSP_ARROW_KEYS);
    m_spinCtrlInterval->SetToolTip(_("Check and save modified files interval (in seconds)"));
    m_spinCtrlInterval->SetRange(1, 100);
    m_spinCtrlInterval->SetValue(5);
    
    flexGridSizer8->Add(m_spinCtrlInterval, 0, wxALL, WXC_FROM_DIP(5));
    
    m_stdBtnSizer4 = new wxStdDialogButtonSizer();
    
    boxSizer2->Add(m_stdBtnSizer4, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));
    
    m_button6 = new wxButton(this, wxID_OK, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
    m_button6->SetDefault();
    m_stdBtnSizer4->AddButton(m_button6);
    m_stdBtnSizer4->Realize();
    
    SetName(wxT("AutoSaveDlgBase"));
    SetSize(-1,-1);
    if (GetSizer()) {
         GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent(wxBOTH);
    } else {
        CentreOnScreen(wxBOTH);
    }
    // Connect events
    m_staticText14->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(AutoSaveDlgBase::OnEnabledUI), NULL, this);
    m_spinCtrlInterval->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(AutoSaveDlgBase::OnEnabledUI), NULL, this);
    m_button6->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AutoSaveDlgBase::OnOK), NULL, this);
    
}

AutoSaveDlgBase::~AutoSaveDlgBase()
{
    m_staticText14->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(AutoSaveDlgBase::OnEnabledUI), NULL, this);
    m_spinCtrlInterval->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(AutoSaveDlgBase::OnEnabledUI), NULL, this);
    m_button6->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AutoSaveDlgBase::OnOK), NULL, this);
    
}