-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStopTimer.cpp
More file actions
98 lines (86 loc) · 2.63 KB
/
StopTimer.cpp
File metadata and controls
98 lines (86 loc) · 2.63 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#include "StopTimer.h"
//(*InternalHeaders(StopTimer)
#include <wx/string.h>
#include <wx/intl.h>
#include <wx/font.h>
//*)
//(*IdInit(StopTimer)
const long StopTimer::ID_STATICTEXT1 = wxNewId();
const long StopTimer::ID_BUTTON1 = wxNewId();
const long StopTimer::ID_BUTTON2 = wxNewId();
//*)
extern bool stopcancel;
extern bool stopyesorno;
int control_4;
BEGIN_EVENT_TABLE(StopTimer,wxDialog)
//(*EventTable(StopTimer)
//*)
END_EVENT_TABLE()
StopTimer::StopTimer(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
//(*Initialize(StopTimer)
Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("id"));
SetClientSize(wxSize(363,128));
Move(wxDefaultPosition);
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Are you sure you want to stop the 24- Hour Timer\?"), wxPoint(40,32), 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, _("Yes"), wxPoint(32,80), wxSize(112,32), 0, wxDefaultValidator, _T("ID_BUTTON1"));
Button2 = new wxButton(this, ID_BUTTON2, _("No"), wxPoint(224,80), wxSize(112,32), 0, wxDefaultValidator, _T("ID_BUTTON2"));
Button2->SetFocus();
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&StopTimer::OnButton1Click);
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&StopTimer::OnButton2Click);
Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&StopTimer::OnClose);
//*)
//stopyesorno = false;
//stopcancel = false;
//CheckBox1->SetValue(false);
control_4 = 0;
//StaticText1->SetFocus();
}
StopTimer::~StopTimer()
{
//(*Destroy(StopTimer)
//*)
}
//yes botton
void StopTimer::OnButton1Click(wxCommandEvent& event)
{
stopyesorno = true;
//CheckBox1->SetValue(true);
control_4 = 1;
//Choice1->SetSelection(1);
/*
StopWatch1.Start(0);
do {
Button1->Enable(false);
Button2->Enable(false);
}
while (StopWatch1.Time() < 2000);
*/
Destroy();
}
void StopTimer::OnButton2Click(wxCommandEvent& event)
{
stopyesorno = false;
//CheckBox1->SetValue(false);
control_4 = 2;
//Choice1->SetSelection(2);
/*
StopWatch1.Start(0);
do {
Button1->Enable(false);
Button2->Enable(false);
}
while (StopWatch1.Time() < 2000);
*/
Destroy();
}
void StopTimer::OnClose(wxCloseEvent& event)
{
if (control_4 == 0) {
//Choice1->SetSelection(0);//stopcancel = true;
stopyesorno = false;
}
Destroy();
}