diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 0c3c5ff..c9e3a97 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -16,8 +16,8 @@ jobs: - uses: actions/checkout@v2 with: submodules: 'true' - - uses: microsoft/setup-msbuild@v1.0.0 - - uses: ilammy/msvc-dev-cmd@v1 + - uses: microsoft/setup-msbuild@v1.0.2 + - uses: ilammy/msvc-dev-cmd@v1.4.1 - name: Install dependencies env: diff --git a/CMakeLists.txt b/CMakeLists.txt index 588c322..dc0524c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,32 @@ if(USE_ICU) endif() if(BUILD_GUI_TOOLS) - find_package(wxWidgets REQUIRED core base xrc xml adv) + find_package(wxWidgets 3.0.4 COMPONENTS core base xrc xml adv) + + if(NOT wxWidgets_FOUND) + # We are going to use the FetchContent module to grab crashpad and its dependencies. + include(FetchContent) + + FetchContent_Declare( + wxwidgets_git + GIT_REPOSITORY https://github.com/wxWidgets/wxWidgets.git + GIT_TAG v3.1.4 + GIT_PROGRESS TRUE + GIT_SHALLOW TRUE + ) + + # Do we want static linking or not? + set(wxBUILD_SHARED OFF CACHE BOOL "Build wx libraries as shared libs") + + # We don't use FetchContent_MakeAvailable here because we don't want all wxwidgets_git targets including, just our dependency. + FetchContent_GetProperties(wxwidgets_git) + if(NOT wxwidgets_git_POPULATED) + FetchContent_Populate(wxwidgets_git) + add_subdirectory(${wxwidgets_git_SOURCE_DIR} ${wxwidgets_git_BINARY_DIR} EXCLUDE_FROM_ALL) + endif() + set(wxWidgets_LIBRARIES wxcore wxbase wxxrc wxxml wxadv) + set(wxWidgets_wxrc_EXECUTABLE wxrc) + endif() endif() # Set version info for the base config module diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0b76ab5..706f215 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,7 +50,7 @@ target_link_libraries(ini2str PUBLIC common) add_executable(strgen ini2str/strgen.cpp) target_link_libraries(strgen ini2str) -if(wxWidgets_FOUND) +if(wxWidgets_FOUND OR wxwidgets_git_POPULATED) if(NOT wxWidgets_wxrc_EXECUTABLE) message(FATAL_ERROR "wxrc resource compiler was not found, please set wxWidgets_wxrc_EXECUTABLE manually.") endif() diff --git a/src/ini2str/wxstrgen.cpp b/src/ini2str/wxstrgen.cpp index 2b5617a..db3d17c 100644 --- a/src/ini2str/wxstrgen.cpp +++ b/src/ini2str/wxstrgen.cpp @@ -25,24 +25,20 @@ class StrGenFrame: public MainFrame { public: - StrGenFrame(wxWindow *parent = NULL) : MainFrame(parent) {} + StrGenFrame(wxWindow *parent = nullptr); void OnCreateIni(wxCommandEvent &event); void OnCreateStr(wxCommandEvent &event); void OnExitToolOrMenuCommand(wxCommandEvent &event); - - wxDECLARE_EVENT_TABLE(); }; -// clang-format off -wxBEGIN_EVENT_TABLE(StrGenFrame, wxFrame) -EVT_MENU(wxID_EXIT, StrGenFrame::OnExitToolOrMenuCommand) -EVT_BUTTON(XRCID("m_buttonToIni"), StrGenFrame::OnCreateIni) -EVT_BUTTON(XRCID("m_buttonToStr"), StrGenFrame::OnCreateStr) -wxEND_EVENT_TABLE() -// clang-format on - - +StrGenFrame::StrGenFrame(wxWindow *parent) : + MainFrame(parent) +{ + Bind(wxEVT_COMMAND_MENU_SELECTED, &StrGenFrame::OnExitToolOrMenuCommand, this, wxID_EXIT); + Bind(wxEVT_BUTTON, &StrGenFrame::OnCreateIni, this, XRCID("m_buttonToIni")); + Bind(wxEVT_BUTTON, &StrGenFrame::OnCreateStr, this, XRCID("m_buttonToStr")); +} void StrGenFrame::OnCreateIni(wxCommandEvent &event) { diff --git a/src/ini2str/wxstrgenui.xrc b/src/ini2str/wxstrgenui.xrc index 18b6d13..de129e7 100644 --- a/src/ini2str/wxstrgenui.xrc +++ b/src/ini2str/wxstrgenui.xrc @@ -1,219 +1,104 @@ - - -1,180 + #f0f0f0 String Table Generator 1 0 - - wxVERTICAL + + 3 + 3 + -1,150 + 0 + 0 + + - - wxEXPAND + + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 5 + + + + -1 + + + + + wxALIGN_CENTER|wxALL + 5 + + + Select a file + *.* + + + + + + wxALL|wxEXPAND + 5 + + + 0 + 0 + + + + + + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL + 5 + + + + -1 + + + + + wxALIGN_CENTER|wxALL + 5 + + + Select a file + *.* + + + + + + wxALL|wxEXPAND + 5 + + + 0 + 0 + + + + + + wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL 5 - - wxHORIZONTAL - - - wxEXPAND - 5 - - wxVERTICAL - - - wxEXPAND - 5 - 0,0 - - - - wxALL - 5 - - - -1 - - - - - wxEXPAND - 5 - 0,0 - - - - wxALL - 5 - - - -1 - - - - - wxEXPAND - 5 - 0,0 - - - - - - wxEXPAND - 5 - - wxVERTICAL - - - wxEXPAND - 5 - 0,0 - - - - wxALL|wxEXPAND - 5 - - - Select a file - *.* - - - - - - wxEXPAND - 5 - 0,0 - - - - wxALL|wxEXPAND - 5 - - - Select a file - *.* - - - - - - wxEXPAND - 5 - 0,0 - - - - - - wxEXPAND - 5 - - wxVERTICAL - - - wxEXPAND - 5 - 0,0 - - - - wxALL|wxEXPAND - 5 - - - 0 - 0 - - - - - - wxEXPAND - 5 - 0,0 - - - - wxALL|wxEXPAND - 5 - - - 0 - 0 - - - - - - wxEXPAND - 5 - 0,0 - - - + + + + -1 - wxEXPAND + wxALIGN_CENTER_VERTICAL|wxALL 5 - - wxHORIZONTAL - - - wxEXPAND - 5 - - wxVERTICAL - - - wxEXPAND - 5 - 0,0 - - - - wxALL - 5 - - - -1 - - - - - wxEXPAND - 5 - 0,0 - - - - - - wxEXPAND - 5 - - wxVERTICAL - - - wxALL - 5 - - eng - 3 - - - - + + eng + 3 - 1