mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-10 07:15:08 -06:00
Finished porting of the status bar to C++.
This commit is contained in:
parent
36faa090fc
commit
2c9dc4dbbf
7 changed files with 10 additions and 25 deletions
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -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(); %};
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue