mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 19:12:17 +00:00
Example implementation of C++ to Perl callbacks using wxWidgets command events.
This commit is contained in:
@@ -269,14 +269,34 @@ void Tab::load_key_value(std::string opt_key, boost::any value)
|
||||
update();
|
||||
}
|
||||
|
||||
extern wxFrame *g_wxMainFrame;
|
||||
|
||||
void Tab::on_value_change(std::string opt_key, boost::any value)
|
||||
{
|
||||
// if (m_on_value_change != nullptr)
|
||||
// m_on_value_change(opt_key, value);
|
||||
if (m_event_value_change > 0) {
|
||||
wxCommandEvent event(m_event_value_change);
|
||||
event.SetString(opt_key);
|
||||
g_wxMainFrame->ProcessWindowEvent(event);
|
||||
}
|
||||
update();
|
||||
};
|
||||
|
||||
// Call a callback to update the selection of presets on the platter:
|
||||
// To update the content of the selection boxes,
|
||||
// to update the filament colors of the selection boxes,
|
||||
// to update the "dirty" flags of the selection boxes,
|
||||
// to uddate number of "filament" selection boxes when the number of extruders change.
|
||||
void Tab::on_presets_changed(/*std::vector<std::string> reload_dependent_tabs*/){
|
||||
if (m_on_presets_changed != nullptr)
|
||||
m_on_presets_changed(/*m_presets, reload_dependent_tabs*/);
|
||||
void Tab::on_presets_changed(/*std::vector<std::string> reload_dependent_tabs*/)
|
||||
{
|
||||
// if (m_on_presets_changed != nullptr)
|
||||
// m_on_presets_changed(/*m_presets, reload_dependent_tabs*/);
|
||||
if (m_event_presets_changed > 0) {
|
||||
wxCommandEvent event(m_event_presets_changed);
|
||||
//event.SetString(opt_key);
|
||||
g_wxMainFrame->ProcessWindowEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void Tab::reload_compatible_printers_widget()
|
||||
|
||||
Reference in New Issue
Block a user