OrcaSlicer/src/slic3r/GUI/Widgets/StepCtrl.hpp
lane.wei e9e4d75877 Update the codes to 01.01.00.10 for the formal release
1. first formal version of macos
2. add the bambu networking plugin install logic
3. auto compute the wipe volume when filament change
4. add the logic of wiping into support
5. refine the GUI layout and icons, improve the gui apperance in lots of
   small places
6. serveral improve to support
7. support AMS auto-mapping
8. disable lots of unstable features: such as params table, media file download, HMS
9. fix serveral kinds of bugs
10. update the document of building
11. ...
2022-07-22 20:35:34 +08:00

101 lines
2.2 KiB
C++

#ifndef slic3r_GUI_StepCtrlBase_hpp_
#define slic3r_GUI_StepCtrlBase_hpp_
#include "StaticBox.hpp"
wxDECLARE_EVENT( EVT_STEP_CHANGING, wxCommandEvent );
wxDECLARE_EVENT( EVT_STEP_CHANGED, wxCommandEvent );
class StepCtrlBase : public StaticBox
{
protected:
wxFont font_tip;
StateColor clr_bar;
StateColor clr_step;
StateColor clr_text;
StateColor clr_tip;
int radius = 7;
int bar_width = 4;
std::vector<wxString> steps;
std::vector<wxString> tips;
int step = -1;
wxPoint drag_offset;
wxPoint pos_thumb;
public:
StepCtrlBase(wxWindow * parent,
wxWindowID id,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = 0);
~StepCtrlBase();
public:
bool SetTipFont(wxFont const & font);
public:
int AppendItem(const wxString &item, wxString const & tip = {});
void DeleteAllItems();
unsigned int GetCount() const;
int GetSelection() const;
void SelectItem(int item);
void Idle();
wxString GetItemText(unsigned int item) const;
void SetItemText(unsigned int item, wxString const &value);
private:
// some useful events
bool sendStepCtrlEvent(bool changing = false);
};
class StepCtrl : public StepCtrlBase
{
ScalableBitmap bmp_thumb;
public:
StepCtrl(wxWindow * parent,
wxWindowID id,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = 0);
virtual void Rescale();
private:
void mouseDown(wxMouseEvent &event);
void mouseMove(wxMouseEvent &event);
void mouseUp(wxMouseEvent &event);
void doRender(wxDC &dc) override;
DECLARE_EVENT_TABLE()
};
class StepIndicator : public StepCtrlBase
{
ScalableBitmap bmp_ok;
public:
StepIndicator(wxWindow *parent,
wxWindowID id,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = 0);
virtual void Rescale();
void SelectNext();
private:
void doRender(wxDC &dc) override;
};
#endif // !slic3r_GUI_StepCtrlBase_hpp_