KiCad PCB EDA Suite
dialog_exit_base.cpp
Go to the documentation of this file.
1 // C++ code generated with wxFormBuilder (version May 6 2016)
3 // http://www.wxformbuilder.org/
4 //
5 // PLEASE DO "NOT" EDIT THIS FILE!
7 
8 #include "dialog_exit_base.h"
9 
11 
12 DIALOG_EXIT_BASE::DIALOG_EXIT_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
13 {
14  this->SetSizeHints( wxDefaultSize, wxDefaultSize );
15 
16  wxBoxSizer* bSizerMain;
17  bSizerMain = new wxBoxSizer( wxVERTICAL );
18 
19  wxBoxSizer* bSizerUpper;
20  bSizerUpper = new wxBoxSizer( wxHORIZONTAL );
21 
22  wxBoxSizer* bSizerBitmap;
23  bSizerBitmap = new wxBoxSizer( wxVERTICAL );
24 
25  m_bitmap = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 );
26  bSizerBitmap->Add( m_bitmap, 0, wxALL, 5 );
27 
28 
29  bSizerUpper->Add( bSizerBitmap, 0, 0, 5 );
30 
31  wxBoxSizer* bSizerMessages;
32  bSizerMessages = new wxBoxSizer( wxVERTICAL );
33 
34  m_TextInfo = new wxStaticText( this, wxID_ANY, _("Save the changes before closing?"), wxDefaultPosition, wxDefaultSize, 0 );
35  m_TextInfo->Wrap( -1 );
36  m_TextInfo->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) );
37 
38  bSizerMessages->Add( m_TextInfo, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
39 
40 
41  bSizerMessages->Add( 10, 10, 0, 0, 5 );
42 
43  m_staticText2 = new wxStaticText( this, wxID_ANY, _("If you don't save, all your changes will be permanently lost."), wxDefaultPosition, wxDefaultSize, 0 );
44  m_staticText2->Wrap( -1 );
45  bSizerMessages->Add( m_staticText2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
46 
47 
48  bSizerUpper->Add( bSizerMessages, 1, wxEXPAND, 5 );
49 
50 
51  bSizerMain->Add( bSizerUpper, 1, wxEXPAND, 5 );
52 
53  wxBoxSizer* bSizerLower;
54  bSizerLower = new wxBoxSizer( wxVERTICAL );
55 
56  m_staticline = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
57  bSizerLower->Add( m_staticline, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
58 
59  wxBoxSizer* bSizerButtons;
60  bSizerButtons = new wxBoxSizer( wxHORIZONTAL );
61 
62  m_buttonSaveAndExit = new wxButton( this, wxID_ANY, _("Save and Exit"), wxDefaultPosition, wxDefaultSize, 0 );
63  m_buttonSaveAndExit->SetDefault();
64  bSizerButtons->Add( m_buttonSaveAndExit, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
65 
66  m_buttonExitNoSave = new wxButton( this, wxID_ANY, _("Exit without Save"), wxDefaultPosition, wxDefaultSize, 0 );
67  bSizerButtons->Add( m_buttonExitNoSave, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
68 
69  m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
70  bSizerButtons->Add( m_buttonCancel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
71 
72 
73  bSizerLower->Add( bSizerButtons, 0, wxALIGN_RIGHT, 5 );
74 
75 
76  bSizerMain->Add( bSizerLower, 0, wxEXPAND, 5 );
77 
78 
79  this->SetSizer( bSizerMain );
80  this->Layout();
81  bSizerMain->Fit( this );
82 
83  this->Centre( wxBOTH );
84 
85  // Connect Events
86  m_buttonSaveAndExit->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnSaveAndExit ), NULL, this );
87  m_buttonExitNoSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnExitNoSave ), NULL, this );
88 }
89 
91 {
92  // Disconnect Events
93  m_buttonSaveAndExit->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnSaveAndExit ), NULL, this );
94  m_buttonExitNoSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_EXIT_BASE::OnExitNoSave ), NULL, this );
95 
96 }
Class DIALOG_SHIM may sit in the inheritance tree between wxDialog and any class written by wxFormBui...
Definition: dialog_shim.h:60
virtual void OnSaveAndExit(wxCommandEvent &event)
wxStaticText * m_TextInfo
wxButton * m_buttonSaveAndExit
wxButton * m_buttonCancel
wxStaticLine * m_staticline
virtual void OnExitNoSave(wxCommandEvent &event)
wxStaticBitmap * m_bitmap
wxButton * m_buttonExitNoSave
DIALOG_EXIT_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=wxEmptyString, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
wxStaticText * m_staticText2