///|/ Copyright (c) Prusa Research 2017 - 2023 Oleksandra Iushchenko @YuSanka, Enrico Turri @enricoturri1966, Lukáš Hejl @hejllukas, David Kocík @kocikdav, Vojtěch Bubník @bubnikv, Lukáš Matěna @lukasmatena, Vojtěch Král @vojtechkral ///|/ ///|/ ported from lib/Slic3r/GUI/OptionsGroup.pm: ///|/ Copyright (c) Prusa Research 2016 - 2018 Vojtěch Bubník @bubnikv, Oleksandra Iushchenko @YuSanka ///|/ Copyright (c) Slic3r 2011 - 2015 Alessandro Ranellucci @alranel ///|/ Copyright (c) 2013 Scott Penrose ///|/ Copyright (c) 2012 Henrik Brix Andersen @henrikbrixandersen ///|/ Copyright (c) 2011 Richard Goodwin ///|/ ///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher ///|/ #ifndef slic3r_OptionsGroup_hpp_ #define slic3r_OptionsGroup_hpp_ #include #include #include #include #include "libslic3r/Config.hpp" #include "libslic3r/PrintConfig.hpp" #include "Field.hpp" #include "I18N.hpp" // Translate the ifdef #ifdef __WXOSX__ #define wxOSX true #else #define wxOSX false #endif #ifdef __WXGTK3__ #define wxGTK3 true #else #define wxGTK3 false #endif #define BORDER(a, b) ((wxOSX ? a : b)) namespace Slic3r { namespace GUI { // Thrown if the building of a parameter page is canceled. class UIBuildCanceled : public std::exception {}; class OG_CustomCtrl; /// Widget type describes a function object that returns a wxWindow (our widget) and accepts a wxWidget (parent window). using widget_t = std::function;//!std::function; /// Wraps a ConfigOptionDef and adds function object for creating a side_widget. struct Option { ConfigOptionDef opt { ConfigOptionDef() }; t_config_option_key opt_id;//! {""}; widget_t side_widget {nullptr}; bool readonly {false}; bool operator==(const Option& rhs) const { return (rhs.opt_id == this->opt_id); } Option(const ConfigOptionDef& _opt, t_config_option_key id); }; using t_option = std::unique_ptr