diff --git a/CMakeLists.txt b/CMakeLists.txt index dfba7be..201e538 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,9 @@ find_package( glm REQUIRED ) message (STATUS "Found glm at: " ${GLM_INCLUDE_DIRS} ) find_package( FreeGLUT REQUIRED ) message (STATUS "Found FreeGLUT at: " ${GLUT_INCLUDE_DIR} ) +find_package( wxWidgets REQUIRED core base ) +message (STATUS "Found wxWidgets at: " ${wxWidgets_USE_FILE} ) +include( ${wxWidgets_USE_FILE} ) include_directories( ${OpenCV_INCLUDE_DIRS} ) include_directories( ${OPENGL_INCLUDE_DIR} ) include_directories( ${GLEW_INCLUDE_DIRS} ) @@ -65,3 +68,7 @@ add_executable( fc2d ) target_link_libraries( fc2d ${OpenCV_LIBS} ${OPENGL_LIBRARIES} ${WEBP_LIBRARIES} FreeGLUT::freeglut GLEW::glew zip Boxer fmt ) +add_executable( fc2dconfig + src/fc2dconfig.cpp +) +target_link_libraries( fc2dconfig ${wxWidgets_LIBRARIES} ) diff --git a/src/fc2dconfig.cpp b/src/fc2dconfig.cpp new file mode 100644 index 0000000..f9711df --- /dev/null +++ b/src/fc2dconfig.cpp @@ -0,0 +1,48 @@ +#include + +#include +#ifndef WX_PRECOMP +#include +#endif + +class ConfigurationApp : public wxApp { + public: + virtual bool OnInit(); +}; + +class ConfigurationFrame : public wxFrame { + public: + ConfigurationFrame(); + private: + void OnExit(wxCommandEvent& event); +}; + +wxIMPLEMENT_APP(ConfigurationApp); + +bool ConfigurationApp::OnInit() { + // TODO: put config file creation here + ConfigurationFrame* frame = new ConfigurationFrame(); + frame->Show(true); + return true; +} + +ConfigurationFrame::ConfigurationFrame() : wxFrame(NULL, wxID_ANY, "Configure " PROJECT_NAME) { + wxPanel* panel = new wxPanel(this, wxID_ANY); + + wxStaticText* placeholderText = new wxStaticText(panel, wxID_ANY, "There's nothing here right now, just click OK."); + wxButton* okButton = new wxButton(panel, wxID_OK, "OK"); + + wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); + sizer->Add(placeholderText, 0, wxALL | wxALIGN_LEFT, 10); + sizer->AddStretchSpacer(1); + sizer->Add(okButton, 0, wxALIGN_RIGHT | wxALL, 10); + + panel->SetSizerAndFit(sizer); + + Bind(wxEVT_BUTTON, &ConfigurationFrame::OnExit, this, wxID_OK); +} + +void ConfigurationFrame::OnExit(wxCommandEvent& event) { + // TODO: write config file here + Close(true); +}