-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwork.hpp
51 lines (45 loc) · 1.05 KB
/
work.hpp
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
#ifndef _MY_WORK_HPP_
#define _MY_WORK_HPP_
#include <wx/thread.h>
#include <wx/event.h>
#include <vector>
class MyCandidate;
class MyCandidateDialog;
class MyEvtPayload{
public:
int mTotalCandidate;
std::vector<MyCandidate *> mCandidateList;
};
class MyFrame;
class MyThread : public wxThread
{
public:
MyThread(MyFrame *pDst, MyCandidateDialog *pCandidateDialog)
: wxThread(wxTHREAD_DETACHED)
{
mpDst = pDst;
mbStart = false;
mbQuit = false;
mbFinish = false;
mpCandidateDialog = pCandidateDialog;
}
~MyThread(){};
bool IsStart() const {return mbStart;}
void Start(){mbStart = true;}
void Stop(){mbStart = false;}
void Quit(){mbQuit = true;}
bool HasFinish(){return mbFinish;}
protected:
void LoadDataFromFile(const wxString &strFileName);
void SaveDataToFile(const wxString &strFileName);
void Work();
protected:
bool mbStart;
bool mbQuit;
bool mbFinish;
virtual ExitCode Entry();
MyFrame *mpDst;
MyCandidateDialog *mpCandidateDialog;
std::vector<MyCandidate *> mCandidates;
};
#endif