diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 15 | ||||
-rw-r--r-- | main.cpp | 18 | ||||
-rw-r--r-- | tracker_frame.cpp | 29 | ||||
-rw-r--r-- | tracker_frame.h | 19 |
5 files changed, 82 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore | |||
@@ -0,0 +1 @@ | |||
build/ | |||
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..dffa7ab --- /dev/null +++ b/CMakeLists.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | cmake_minimum_required (VERSION 3.1) | ||
2 | project (lingo_ap_tracker) | ||
3 | |||
4 | set(CMAKE_BUILD_TYPE Debug) | ||
5 | |||
6 | find_package(wxWidgets COMPONENTS core base) | ||
7 | include(${wxWidgets_USE_FILE}) | ||
8 | |||
9 | add_executable(lingo_ap_tracker | ||
10 | main.cpp | ||
11 | tracker_frame.cpp | ||
12 | ) | ||
13 | set_property(TARGET lingo_ap_tracker PROPERTY CXX_STANDARD 17) | ||
14 | set_property(TARGET lingo_ap_tracker PROPERTY CXX_STANDARD_REQUIRED ON) | ||
15 | target_link_libraries(lingo_ap_tracker ${wxWidgets_LIBRARIES}) | ||
diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..940fecc --- /dev/null +++ b/main.cpp | |||
@@ -0,0 +1,18 @@ | |||
1 | #include <wx/wxprec.h> | ||
2 | |||
3 | #ifndef WX_PRECOMP | ||
4 | #include <wx/wx.h> | ||
5 | #endif | ||
6 | |||
7 | #include "tracker_frame.h" | ||
8 | |||
9 | class TrackerApp : public wxApp { | ||
10 | public: | ||
11 | virtual bool OnInit() { | ||
12 | TrackerFrame *frame = new TrackerFrame(); | ||
13 | frame->Show(true); | ||
14 | return true; | ||
15 | } | ||
16 | }; | ||
17 | |||
18 | wxIMPLEMENT_APP(TrackerApp); | ||
diff --git a/tracker_frame.cpp b/tracker_frame.cpp new file mode 100644 index 0000000..83f42a6 --- /dev/null +++ b/tracker_frame.cpp | |||
@@ -0,0 +1,29 @@ | |||
1 | #include "tracker_frame.h" | ||
2 | |||
3 | TrackerFrame::TrackerFrame() | ||
4 | : wxFrame(nullptr, wxID_ANY, "Lingo Archipelago Tracker") { | ||
5 | wxMenu *menuFile = new wxMenu(); | ||
6 | menuFile->Append(wxID_EXIT); | ||
7 | |||
8 | wxMenu *menuHelp = new wxMenu(); | ||
9 | menuHelp->Append(wxID_ABOUT); | ||
10 | |||
11 | wxMenuBar *menuBar = new wxMenuBar(); | ||
12 | menuBar->Append(menuFile, "&File"); | ||
13 | menuBar->Append(menuHelp, "&Help"); | ||
14 | |||
15 | SetMenuBar(menuBar); | ||
16 | |||
17 | CreateStatusBar(); | ||
18 | SetStatusText("Not connected to Archipelago."); | ||
19 | |||
20 | Bind(wxEVT_MENU, &TrackerFrame::OnAbout, this, wxID_ABOUT); | ||
21 | Bind(wxEVT_MENU, &TrackerFrame::OnExit, this, wxID_EXIT); | ||
22 | } | ||
23 | |||
24 | void TrackerFrame::OnAbout(wxCommandEvent &event) { | ||
25 | wxMessageBox("Lingo Archipelago Tracker by hatkirby", | ||
26 | "About lingo-ap-tracker", wxOK | wxICON_INFORMATION); | ||
27 | } | ||
28 | |||
29 | void TrackerFrame::OnExit(wxCommandEvent &event) { Close(true); } | ||
diff --git a/tracker_frame.h b/tracker_frame.h new file mode 100644 index 0000000..60ded2e --- /dev/null +++ b/tracker_frame.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef TRACKER_FRAME_H_86BD8DFB | ||
2 | #define TRACKER_FRAME_H_86BD8DFB | ||
3 | |||
4 | #include <wx/wxprec.h> | ||
5 | |||
6 | #ifndef WX_PRECOMP | ||
7 | #include <wx/wx.h> | ||
8 | #endif | ||
9 | |||
10 | class TrackerFrame : public wxFrame { | ||
11 | public: | ||
12 | TrackerFrame(); | ||
13 | |||
14 | private: | ||
15 | void OnExit(wxCommandEvent &event); | ||
16 | void OnAbout(wxCommandEvent &event); | ||
17 | }; | ||
18 | |||
19 | #endif /* end of include guard: TRACKER_FRAME_H_86BD8DFB */ | ||