mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-18 15:39:04 -07:00
Added TabIface C++ wrapper for GUI::Tab C++ class,
exported the TabIface to Perl.
This commit is contained in:
@@ -62,6 +62,7 @@ REGISTER_CLASS(Preset, "GUI::Preset");
|
||||
REGISTER_CLASS(PresetCollection, "GUI::PresetCollection");
|
||||
REGISTER_CLASS(PresetBundle, "GUI::PresetBundle");
|
||||
REGISTER_CLASS(PresetHints, "GUI::PresetHints");
|
||||
REGISTER_CLASS(TabIface, "GUI::Tab2");
|
||||
|
||||
SV* ConfigBase__as_hash(ConfigBase* THIS)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <wx/window.h>
|
||||
|
||||
#include "Tab.h"
|
||||
#include "TabIface.hpp"
|
||||
#include "AppConfig.hpp"
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
@@ -205,6 +206,19 @@ void create_preset_tabs(PresetBundle *preset_bundle, AppConfig *app_config, int
|
||||
}
|
||||
}
|
||||
|
||||
TabIface* get_preset_tab_iface(char *name)
|
||||
{
|
||||
for (size_t i = 0; i < g_wxTabPanel->GetPageCount(); ++ i) {
|
||||
Tab *tab = dynamic_cast<Tab*>(g_wxTabPanel->GetPage(i));
|
||||
if (! tab)
|
||||
continue;
|
||||
if (tab->title().ToStdString() == name) {
|
||||
return new TabIface(tab);
|
||||
}
|
||||
}
|
||||
return new TabIface(nullptr);
|
||||
}
|
||||
|
||||
void change_opt_value(DynamicPrintConfig& config, t_config_option_key opt_key, boost::any value)
|
||||
{
|
||||
try{
|
||||
|
||||
@@ -17,6 +17,7 @@ class PresetBundle;
|
||||
class PresetCollection;
|
||||
class AppConfig;
|
||||
class DynamicPrintConfig;
|
||||
class TabIface;
|
||||
|
||||
namespace GUI {
|
||||
|
||||
@@ -36,6 +37,8 @@ void set_tab_panel(wxNotebook *tab_panel);
|
||||
void add_debug_menu(wxMenuBar *menu);
|
||||
// Create a new preset tab (print, filament and printer),
|
||||
void create_preset_tabs(PresetBundle *preset_bundle, AppConfig *app_config, int event_value_change, int event_presets_changed);
|
||||
TabIface* get_preset_tab_iface(char *name);
|
||||
|
||||
// add it at the end of the tab panel.
|
||||
void add_created_tab(Tab* panel, PresetBundle *preset_bundle, AppConfig *app_config);
|
||||
// Change option value in config
|
||||
|
||||
Reference in New Issue
Block a user