Add fc2dconfig program
This commit will add a new dependency: wxWidgets.
This commit is contained in:
		
							parent
							
								
									2206780a9b
								
							
						
					
					
						commit
						6d6658c610
					
				| 
						 | 
				
			
			@ -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} )
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										48
									
								
								src/fc2dconfig.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										48
									
								
								src/fc2dconfig.cpp
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,48 @@
 | 
			
		|||
#include <config.hpp>
 | 
			
		||||
 | 
			
		||||
#include <wx/wxprec.h>
 | 
			
		||||
#ifndef WX_PRECOMP
 | 
			
		||||
#include <wx/wx.h>
 | 
			
		||||
#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);
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in a new issue