Add the full source of BambuStudio

using version 1.0.10
This commit is contained in:
lane.wei 2022-07-15 23:37:19 +08:00 committed by Lane.Wei
parent 30bcadab3e
commit 1555904bef
3771 changed files with 1251328 additions and 0 deletions

View file

@ -0,0 +1,58 @@
#ifndef slic3r_GUI_ImageSwitchButton_hpp_
#define slic3r_GUI_ImageSwitchButton_hpp_
#include "../wxExtensions.hpp"
#include "StateColor.hpp"
#include "StateHandler.hpp"
#include "Button.hpp"
#include <wx/tglbtn.h>
class ImageSwitchButton : public StaticBox
{
public:
ImageSwitchButton(wxWindow *parent, wxBitmap &img_on, wxBitmap &img_off, long style = 0);
void SetLabels(wxString const & lbl_on, wxString const & lbl_off);
void SetImages(wxBitmap &img_on, wxBitmap &img_off);
void SetTextColor(StateColor const &color);
void SetBorderColor(StateColor const &color);
void SetBgColor(StateColor const &color);
void SetValue(bool value);
void SetPadding(int padding);
bool GetValue() { return m_on_off; }
void Rescale();
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:
wxBitmap m_on;
wxBitmap m_off;
bool m_on_off;
int m_padding; // size between icon and text
bool pressedDown = false;
bool hover = false;
wxSize textSize;
wxSize minSize;
wxString labels[2];
StateColor text_color;
StateColor bg_color;
StateColor border_color;
StateHandler state_handler;
};
#endif // !slic3r_GUI_SwitchButton_hpp_