diff --git a/.vscode/settings.json b/.vscode/settings.json index b4589e2..7ba932b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -29,8 +29,8 @@ }, "cmake.configureArgs": [ "-Wno-dev", - "-DCMAKE_PREFIX_PATH:STRING=C:/Dev/fltk", - "-DTSCGUI=ON" + "-DCMAKE_PREFIX_PATH:STRING=C:/dev/wxwigets", + "-DUSE_GUI=ON" ], "cmake.options.statusBarVisibility": "visible", "cmake.generator": "Ninja", diff --git a/CMakeLists.txt b/CMakeLists.txt index 479adca..1e74741 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,6 +80,10 @@ install(TARGETS tss DESTINATION bin) if (DEFINED USE_BOOST) install(FILES ${MINGW32_DLLS} DESTINATION bin) endif() +if (DEFINED USE_GUI) +message(STATUS "USE GUI ${USE_GUI}") +add_subdirectory(gui) +endif() # ********************************************************** pack infomation if(CMAKE_SIZEOF_VOID_P EQUAL 8) diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt new file mode 100644 index 0000000..fe350bd --- /dev/null +++ b/gui/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.16) + +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +project(transm-gui LANGUAGES CXX) + +find_package(wxWidgets CONFIG REQUIRED) + +set(SOURCES +main.cxx +MainFrame.cpp +MainFrame.h +) + +add_executable(transm-gui ${SOURCES}) +target_link_libraries(transm-gui PRIVATE +wx::core wx::base +) +set_target_properties(transm-gui PROPERTIES WIN32_EXECUTABLE TRUE) \ No newline at end of file diff --git a/gui/MainFrame.cpp b/gui/MainFrame.cpp new file mode 100644 index 0000000..0a3fe4a --- /dev/null +++ b/gui/MainFrame.cpp @@ -0,0 +1,5 @@ +#include "MainFrame.h" + +CMainFrame::CMainFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title) +{ +} \ No newline at end of file diff --git a/gui/MainFrame.h b/gui/MainFrame.h new file mode 100644 index 0000000..c547949 --- /dev/null +++ b/gui/MainFrame.h @@ -0,0 +1,12 @@ +#ifndef MAINFRAME_H +#define MAINFRAME_H + +#include + +class CMainFrame : public wxFrame +{ +public: + explicit CMainFrame(const wxString& title); +}; + +#endif \ No newline at end of file diff --git a/gui/main.cxx b/gui/main.cxx new file mode 100644 index 0000000..9a593da --- /dev/null +++ b/gui/main.cxx @@ -0,0 +1,21 @@ +#include "MainFrame.h" +#include + +class CTransForm : public wxApp +{ +public: + virtual bool OnInit() + { + wxString title = wxString::Format(wxT("transm-gui")); + auto* f = new CMainFrame(title); + f->Show(true); + return true; + } + virtual int OnExit() + { + return wxApp::OnExit(); + } +}; + +IMPLEMENT_APP(CTransForm); +DECLARE_APP(CTransForm); \ No newline at end of file