Big Refactoring: - deleted/renamed all _Prusa_ prefixes,

- cleaned code from commented parts
 - rescale() -> msw_rescale()
This commit is contained in:
YuSanka 2019-04-25 01:45:00 +02:00
parent be60f0a53c
commit 065448e9e5
32 changed files with 726 additions and 1139 deletions

View file

@ -37,7 +37,7 @@ using t_back_to_init = std::function<void(const std::string&)>;
wxString double_to_string(double const value, const int max_precision = 4);
class RevertButton : public /*wxButton*/PrusaButton
class RevertButton : public ScalableButton
{
bool hidden = false; // never show button if it's hidden ones
public:
@ -54,7 +54,7 @@ public:
wxWindow *parent,
const std::string& icon_name = ""
) :
PrusaButton(parent, wxID_ANY, icon_name) {}
ScalableButton(parent, wxID_ANY, icon_name) {}
// overridden from wxWindow base class
virtual bool
@ -160,7 +160,7 @@ public:
return std::move(p); //!p;
}
bool set_undo_bitmap(const /*wxBitmap*/PrusaBitmap *bmp) {
bool set_undo_bitmap(const ScalableBitmap *bmp) {
if (m_undo_bitmap != bmp) {
m_undo_bitmap = bmp;
m_Undo_btn->SetBitmap_(*bmp);
@ -169,7 +169,7 @@ public:
return false;
}
bool set_undo_to_sys_bitmap(const /*wxBitmap*/PrusaBitmap *bmp) {
bool set_undo_to_sys_bitmap(const ScalableBitmap *bmp) {
if (m_undo_to_sys_bitmap != bmp) {
m_undo_to_sys_bitmap = bmp;
m_Undo_to_sys_btn->SetBitmap_(*bmp);
@ -217,9 +217,9 @@ public:
m_side_text = side_text;
}
virtual void rescale() {
m_Undo_to_sys_btn->rescale();
m_Undo_btn->rescale();
virtual void msw_rescale() {
m_Undo_to_sys_btn->msw_rescale();
m_Undo_btn->msw_rescale();
// update em_unit value
m_em_unit = em_unit(m_parent);
@ -228,12 +228,12 @@ public:
protected:
RevertButton* m_Undo_btn = nullptr;
// Bitmap and Tooltip text for m_Undo_btn. The wxButton will be updated only if the new wxBitmap pointer differs from the currently rendered one.
const /*wxBitmap*/PrusaBitmap* m_undo_bitmap = nullptr;
const wxString* m_undo_tooltip = nullptr;
const ScalableBitmap* m_undo_bitmap = nullptr;
const wxString* m_undo_tooltip = nullptr;
RevertButton* m_Undo_to_sys_btn = nullptr;
// Bitmap and Tooltip text for m_Undo_to_sys_btn. The wxButton will be updated only if the new wxBitmap pointer differs from the currently rendered one.
const /*wxBitmap*/PrusaBitmap* m_undo_to_sys_bitmap = nullptr;
const wxString* m_undo_to_sys_tooltip = nullptr;
const ScalableBitmap* m_undo_to_sys_bitmap = nullptr;
const wxString* m_undo_to_sys_tooltip = nullptr;
wxStaticText* m_Label = nullptr;
// Color for Label. The wxColour will be updated only if the new wxColour pointer differs from the currently rendered one.
@ -290,7 +290,7 @@ public:
boost::any& get_value() override;
void rescale() override;
void msw_rescale() override;
virtual void enable();
virtual void disable();
@ -355,7 +355,7 @@ public:
return m_value = tmp_value;
}
void rescale() override;
void msw_rescale() override;
void enable() override { dynamic_cast<wxSpinCtrl*>(window)->Enable(); }
void disable() override { dynamic_cast<wxSpinCtrl*>(window)->Disable(); }
@ -384,7 +384,7 @@ public:
void set_values(const std::vector<std::string> &values);
boost::any& get_value() override;
void rescale() override;
void msw_rescale() override;
void enable() override { dynamic_cast<wxBitmapComboBox*>(window)->Enable(); };
void disable() override{ dynamic_cast<wxBitmapComboBox*>(window)->Disable(); };
@ -437,7 +437,7 @@ public:
void set_value(const boost::any& value, bool change_event = false);
boost::any& get_value() override;
void rescale() override;
void msw_rescale() override;
void enable() override {
x_textctrl->Enable();
@ -471,7 +471,7 @@ public:
boost::any& get_value()override { return m_value; }
void rescale() override;
void msw_rescale() override;
void enable() override { dynamic_cast<wxStaticText*>(window)->Enable(); };
void disable() override{ dynamic_cast<wxStaticText*>(window)->Disable(); };