Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs
diff options
context:
space:
mode:
authorbubnikv <bubnikv@gmail.com>2018-09-14 11:59:50 +0300
committerbubnikv <bubnikv@gmail.com>2018-09-14 11:59:50 +0300
commit2c9dc4dbbf86a9c6e0b85ac1c29233ff040a2299 (patch)
tree670361b602a1e7415837e11965711e537bef7ee0 /xs
parent36faa090fcf57bdb7aceddfaa7148141165cb073 (diff)
Finished porting of the status bar to C++.
Diffstat (limited to 'xs')
-rw-r--r--xs/src/slic3r/GUI/ProgressStatusBar.cpp1
-rw-r--r--xs/src/slic3r/GUI/ProgressStatusBar.hpp3
-rw-r--r--xs/xsp/ProgressStatusBar.xsp9
3 files changed, 8 insertions, 5 deletions
diff --git a/xs/src/slic3r/GUI/ProgressStatusBar.cpp b/xs/src/slic3r/GUI/ProgressStatusBar.cpp
index 3c2bdee6a..67fcd1dcc 100644
--- a/xs/src/slic3r/GUI/ProgressStatusBar.cpp
+++ b/xs/src/slic3r/GUI/ProgressStatusBar.cpp
@@ -54,6 +54,7 @@ ProgressStatusBar::ProgressStatusBar(wxWindow *parent, int id):
cancelbutton_->Bind(wxEVT_BUTTON, [this](const wxCommandEvent&) {
if(cancel_cb_) cancel_cb_();
+ m_perl_cancel_callback.call();
cancelbutton_->Hide();
});
}
diff --git a/xs/src/slic3r/GUI/ProgressStatusBar.hpp b/xs/src/slic3r/GUI/ProgressStatusBar.hpp
index a117cacfb..91c180ba6 100644
--- a/xs/src/slic3r/GUI/ProgressStatusBar.hpp
+++ b/xs/src/slic3r/GUI/ProgressStatusBar.hpp
@@ -4,6 +4,8 @@
#include <memory>
#include <functional>
+#include "../../libslic3r/Utils.hpp"
+
class wxTimer;
class wxGauge;
class wxButton;
@@ -50,6 +52,7 @@ public:
void show_cancel_button();
void hide_cancel_button();
+ PerlCallback m_perl_cancel_callback;
private:
bool busy_ = false;
CancelFn cancel_cb_;
diff --git a/xs/xsp/ProgressStatusBar.xsp b/xs/xsp/ProgressStatusBar.xsp
index 6f41b2d2b..c089cfd7c 100644
--- a/xs/xsp/ProgressStatusBar.xsp
+++ b/xs/xsp/ProgressStatusBar.xsp
@@ -39,10 +39,9 @@
void SetStatusText(const char *txt)
%code%{ THIS->set_status_text(txt); %};
- void ShowCancelButton()
- %code%{ THIS->show_cancel_button(); %};
-
- void HideCancelButton()
- %code%{ THIS->hide_cancel_button(); %};
+ void SetCancelCallback(SV* callback)
+ %code%{ THIS->m_perl_cancel_callback.register_callback(callback); THIS->show_cancel_button();%};
+ void ResetCancelCallback()
+ %code%{ THIS->m_perl_cancel_callback.deregister_callback(); THIS->hide_cancel_button(); %};
}; \ No newline at end of file