This commit is contained in:
sunsets
2023-09-11 11:10:12 +08:00
parent 205d475acb
commit 39bb8169a0
11 changed files with 69 additions and 5 deletions

View File

@@ -50,9 +50,9 @@ if (SLIC3R_GUI)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux") if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set (wxWidgets_CONFIG_OPTIONS "--toolkit=gtk${SLIC3R_GTK}") set (wxWidgets_CONFIG_OPTIONS "--toolkit=gtk${SLIC3R_GTK}")
if (SLIC3R_WX_STABLE) if (SLIC3R_WX_STABLE)
find_package(wxWidgets 3.0 REQUIRED COMPONENTS base core adv html gl) find_package(wxWidgets 3.0 REQUIRED COMPONENTS base core adv html gl aui net webview)
else () else ()
find_package(wxWidgets 3.1 QUIET COMPONENTS base core adv html gl) find_package(wxWidgets 3.1 REQUIRED COMPONENTS base core adv html gl aui net webview)
if (NOT wxWidgets_FOUND) if (NOT wxWidgets_FOUND)
message(FATAL_ERROR "\nCould not find wxWidgets 3.1.\n" message(FATAL_ERROR "\nCould not find wxWidgets 3.1.\n"
@@ -62,7 +62,7 @@ if (SLIC3R_GUI)
include(${wxWidgets_USE_FILE}) include(${wxWidgets_USE_FILE})
else () else ()
find_package(wxWidgets 3.2 REQUIRED COMPONENTS html adv gl core base webview aui net media) find_package(wxWidgets 3.2 REQUIRED COMPONENTS html adv gl core base webview aui net)
endif () endif ()
if(UNIX) if(UNIX)

View File

@@ -1027,6 +1027,8 @@ void Choice::BUILD() {
set_selection(); set_selection();
} }
}*/ }*/
//B35
#if defined(__WIN32__) || defined(__WXMAC__)
if (m_opt.enum_def) { if (m_opt.enum_def) {
if (auto& labels = m_opt.enum_def->labels(); !labels.empty()) if (auto& labels = m_opt.enum_def->labels(); !labels.empty())
{ {
@@ -1059,6 +1061,17 @@ void Choice::BUILD() {
set_selection(); set_selection();
} }
} }
#elif defined __linux__
if (m_opt.enum_def) {
if (auto& labels = m_opt.enum_def->labels(); !labels.empty()) {
bool localized = m_opt.enum_def->has_labels();
for (const std::string& el : labels)
temp->Append(localized ? _(from_u8(el)) : from_u8(el));
set_selection();
}
}
#endif
temp->Bind(wxEVT_MOUSEWHEEL, [this](wxMouseEvent& e) { temp->Bind(wxEVT_MOUSEWHEEL, [this](wxMouseEvent& e) {
if (m_suppress_scroll && !m_is_dropped) if (m_suppress_scroll && !m_is_dropped)

View File

@@ -26,6 +26,11 @@
#include <wx/timer.h> #include <wx/timer.h>
//B35
#if defined __linux__
#include <boost/log/trivial.hpp>
#endif
namespace Slic3r { namespace Slic3r {
namespace GUI { namespace GUI {

View File

@@ -859,7 +859,10 @@ void MainFrame::create_preset_tabs()
add_created_tab(new TabPrinter(m_tabpanel), wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptFFF ? "printer" : "sla_printer"); add_created_tab(new TabPrinter(m_tabpanel), wxGetApp().preset_bundle->printers.get_edited_preset().printer_technology() == ptFFF ? "printer" : "sla_printer");
//B4 //B4
m_printer_view = new PrinterWebView(m_tabpanel); m_printer_view = new PrinterWebView(m_tabpanel);
m_printer_view->Hide(); //B35
#if defined(__WIN32__) || defined(__WXMAC__)
m_printer_view->Hide();
#endif
#ifdef _MSW_DARK_MODE #ifdef _MSW_DARK_MODE
if (!wxGetApp().tabs_as_menu()) if (!wxGetApp().tabs_as_menu())
dynamic_cast<Notebook *>(m_tabpanel)->AddPage(m_printer_view, _L("Device"), "tab_monitor_active"); dynamic_cast<Notebook *>(m_tabpanel)->AddPage(m_printer_view, _L("Device"), "tab_monitor_active");
@@ -873,7 +876,10 @@ void MainFrame::create_preset_tabs()
if (strlang != "") if (strlang != "")
url = wxString::Format("file://%s/web/guide/index.html?lang=%s", from_u8(resources_dir()), strlang); url = wxString::Format("file://%s/web/guide/index.html?lang=%s", from_u8(resources_dir()), strlang);
m_guide_view->load_url(url); m_guide_view->load_url(url);
m_guide_view->Hide(); //B35
#if defined(__WIN32__) || defined(__WXMAC__)
m_guide_view->Hide();
#endif
#ifdef _MSW_DARK_MODE #ifdef _MSW_DARK_MODE
if (!wxGetApp().tabs_as_menu()) if (!wxGetApp().tabs_as_menu())
dynamic_cast<Notebook *>(m_tabpanel)->AddPage(m_guide_view, _L("Guide"), "userguide"); dynamic_cast<Notebook *>(m_tabpanel)->AddPage(m_guide_view, _L("Guide"), "userguide");

View File

@@ -25,6 +25,11 @@
#include "wx/textctrl.h" #include "wx/textctrl.h"
#include <wx/timer.h> #include <wx/timer.h>
//B35
#if defined __linux__
#include <boost/log/trivial.hpp>
#endif
namespace Slic3r { namespace Slic3r {
namespace GUI { namespace GUI {

View File

@@ -5,6 +5,12 @@
#include "../wxExtensions.hpp" #include "../wxExtensions.hpp"
#include "StateHandler.hpp" #include "StateHandler.hpp"
#include "PopupWindow.hpp" #include "PopupWindow.hpp"
//B35
#if defined __linux__
#include <boost/date_time/posix_time/posix_time.hpp>
#include "wx/dcbuffer.h"
#include "wx/display.h"
#endif
#define DD_NO_CHECK_ICON 0x0001 #define DD_NO_CHECK_ICON 0x0001
#define DD_NO_TEXT 0x0002 #define DD_NO_TEXT 0x0002

View File

@@ -6,6 +6,11 @@
#define LB_HYPERLINK 0x0020 #define LB_HYPERLINK 0x0020
#define LB_PROPAGATE_MOUSE_EVENT 0x0040 #define LB_PROPAGATE_MOUSE_EVENT 0x0040
//B35
#if defined __linux__
#include <wx/settings.h>
#include "wx/dcclient.h"
#endif
class Label : public wxStaticText class Label : public wxStaticText
{ {

View File

@@ -3,6 +3,13 @@
#include "../wxExtensions.hpp" #include "../wxExtensions.hpp"
//B35
#if defined __linux__
#include <wx/panel.h>
#include <wx/wx.h>
#endif
class RoundedRectangle : public wxWindow class RoundedRectangle : public wxWindow
{ {
public: public:

View File

@@ -5,6 +5,13 @@
#include "StateColor.hpp" #include "StateColor.hpp"
//B35
#if defined __linux__
#include<memory>
#include <wx/wx.h>
#endif
wxDECLARE_EVENT(EVT_ENABLE_CHANGED, wxCommandEvent); wxDECLARE_EVENT(EVT_ENABLE_CHANGED, wxCommandEvent);
class StateHandler : public wxEvtHandler class StateHandler : public wxEvtHandler

View File

@@ -19,6 +19,11 @@
#elif defined __linux__ #elif defined __linux__
#include <gtk/gtk.h> #include <gtk/gtk.h>
#define WEBKIT_API #define WEBKIT_API
//B35
#if defined __linux__
#include <boost/log/trivial.hpp>
#endif
struct WebKitWebView; struct WebKitWebView;
struct WebKitJavascriptResult; struct WebKitJavascriptResult;
extern "C" { extern "C" {

View File

@@ -14,6 +14,11 @@
#include <boost/system/error_code.hpp> #include <boost/system/error_code.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
//B35
#if defined __linux__
#include <boost/array.hpp>
#endif
namespace Slic3r { namespace Slic3r {