-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSaveOnQuit.cpp
More file actions
75 lines (65 loc) · 2.49 KB
/
SaveOnQuit.cpp
File metadata and controls
75 lines (65 loc) · 2.49 KB
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
#include "SaveOnQuit.h"
//(*InternalHeaders(SaveOnQuit)
#include <wx/string.h>
#include <wx/intl.h>
#include <wx/font.h>
//*)
//(*IdInit(SaveOnQuit)
const long SaveOnQuit::ID_STATICTEXT1 = wxNewId();
const long SaveOnQuit::ID_BUTTON1 = wxNewId();
const long SaveOnQuit::ID_BUTTON2 = wxNewId();
//*)
extern bool issaveonquit;
extern bool iscancelquit;
bool control_1;
BEGIN_EVENT_TABLE(SaveOnQuit,wxDialog)
//(*EventTable(SaveOnQuit)
//*)
END_EVENT_TABLE()
SaveOnQuit::SaveOnQuit(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
//(*Initialize(SaveOnQuit)
Create(parent, id, _("Quitting Lightput..."), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("id"));
SetClientSize(wxSize(362,120));
Move(wxDefaultPosition);
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("The Current Profile Set has changes that have not been saved,\nwould you like to save the current profile before you leave\? "), wxPoint(16,16), wxDefaultSize, 0, _T("ID_STATICTEXT1"));
wxFont StaticText1Font(8,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Sans"),wxFONTENCODING_DEFAULT);
StaticText1->SetFont(StaticText1Font);
Button1 = new wxButton(this, ID_BUTTON1, _("Save Profile Set && Quit"), wxPoint(24,80), wxSize(144,23), 0, wxDefaultValidator, _T("ID_BUTTON1"));
wxFont Button1Font(8,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Sans"),wxFONTENCODING_DEFAULT);
Button1->SetFont(Button1Font);
Button2 = new wxButton(this, ID_BUTTON2, _("Quit Without Saving"), wxPoint(200,80), wxSize(144,23), 0, wxDefaultValidator, _T("ID_BUTTON2"));
wxFont Button2Font(8,wxSWISS,wxFONTSTYLE_NORMAL,wxNORMAL,false,_T("Sans"),wxFONTENCODING_DEFAULT);
Button2->SetFont(Button2Font);
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SaveOnQuit::OnButton1Click);
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&SaveOnQuit::OnButton2Click);
Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&SaveOnQuit::OnClose);
//*)
control_1 = false;
}
SaveOnQuit::~SaveOnQuit()
{
//(*Destroy(SaveOnQuit)
//*)
}
//save and quit button
void SaveOnQuit::OnButton1Click(wxCommandEvent& event)
{
issaveonquit = true;
iscancelquit = false;
control_1 = true;
Destroy();
}
//quit without saving button
void SaveOnQuit::OnButton2Click(wxCommandEvent& event)
{
issaveonquit = false;
iscancelquit = false;
control_1 = true;
Destroy();
}
void SaveOnQuit::OnClose(wxCloseEvent& event)
{
if ((!control_1)) iscancelquit = true;
Destroy();
}