mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-27 00:24:00 -06:00
NEW:add fan control
Change-Id: I3b5c7cf638306aaac81459c2f25e37008a5a8a2f
This commit is contained in:
parent
59773eee02
commit
b61da88d51
24 changed files with 1240 additions and 28 deletions
|
@ -50,4 +50,46 @@ private:
|
|||
StateColor text_color;
|
||||
};
|
||||
|
||||
class FanSwitchButton : public StaticBox
|
||||
{
|
||||
public:
|
||||
FanSwitchButton(wxWindow* parent, ScalableBitmap& img_on, ScalableBitmap& img_off, long style = 0);
|
||||
void SetLabels(wxString const& lbl_on, wxString const& lbl_off);
|
||||
void SetImages(ScalableBitmap& img_on, ScalableBitmap& img_off);
|
||||
void SetTextColor(StateColor const& color);
|
||||
void SetValue(bool value);
|
||||
void SetPadding(int padding);
|
||||
|
||||
bool GetValue() { return m_on_off; }
|
||||
void Rescale();
|
||||
void setFanValue(int val);
|
||||
|
||||
private:
|
||||
void messureSize();
|
||||
void paintEvent(wxPaintEvent& evt);
|
||||
void render(wxDC& dc);
|
||||
void mouseDown(wxMouseEvent& event);
|
||||
void mouseReleased(wxMouseEvent& event);
|
||||
void mouseEnterWindow(wxMouseEvent& event);
|
||||
void mouseLeaveWindow(wxMouseEvent& event);
|
||||
void sendButtonEvent();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
private:
|
||||
ScalableBitmap m_on;
|
||||
ScalableBitmap m_off;
|
||||
bool m_on_off;
|
||||
int m_padding; // size between icon and text
|
||||
bool pressedDown = false;
|
||||
bool hover = false;
|
||||
|
||||
wxSize textSize;
|
||||
wxSize minSize;
|
||||
int m_speed;
|
||||
|
||||
wxString labels[2];
|
||||
StateColor text_color;
|
||||
};
|
||||
|
||||
#endif // !slic3r_GUI_SwitchButton_hpp_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue