mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-20 15:21:21 -06:00
Add the full source of BambuStudio
using version 1.0.10
This commit is contained in:
parent
30bcadab3e
commit
1555904bef
3771 changed files with 1251328 additions and 0 deletions
94
src/slic3r/GUI/Widgets/SpinInput.hpp
Normal file
94
src/slic3r/GUI/Widgets/SpinInput.hpp
Normal file
|
@ -0,0 +1,94 @@
|
|||
#ifndef slic3r_GUI_SpinInput_hpp_
|
||||
#define slic3r_GUI_SpinInput_hpp_
|
||||
|
||||
#include <wx/textctrl.h>
|
||||
#include "../wxExtensions.hpp"
|
||||
#include "StateHandler.hpp"
|
||||
|
||||
class Button;
|
||||
|
||||
class SpinInput : public wxWindow
|
||||
{
|
||||
|
||||
bool hover;
|
||||
wxSize labelSize;
|
||||
double radius;
|
||||
StateHandler state_handler;
|
||||
StateColor text_color;
|
||||
StateColor border_color;
|
||||
StateColor background_color;
|
||||
wxTextCtrl * text_ctrl;
|
||||
Button * button_inc;
|
||||
Button * button_dec;
|
||||
wxTimer timer;
|
||||
|
||||
int val;
|
||||
int min;
|
||||
int max;
|
||||
int delta;
|
||||
|
||||
static const int SpinInputWidth = 200;
|
||||
static const int SpinInputHeight = 50;
|
||||
|
||||
public:
|
||||
SpinInput(wxWindow * parent,
|
||||
wxString text,
|
||||
wxString label = "",
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize & size = wxDefaultSize,
|
||||
long style = 0,
|
||||
int min = 0, int max = 100, int initial = 0);
|
||||
|
||||
void SetCornerRadius(double radius);
|
||||
|
||||
void SetLabel(const wxString &label) wxOVERRIDE;
|
||||
|
||||
void SetTextColor(StateColor const & color);
|
||||
|
||||
void SetBackgroundColor(StateColor const & color);
|
||||
|
||||
void SetSize(wxSize const &size);
|
||||
|
||||
void Rescale();
|
||||
|
||||
virtual bool Enable(bool enable = true) wxOVERRIDE;
|
||||
|
||||
wxTextCtrl * GetTextCtrl() { return text_ctrl; }
|
||||
|
||||
void SetValue(const wxString &text);
|
||||
|
||||
void SetValue (int value);
|
||||
|
||||
int GetValue () const;
|
||||
|
||||
void SetRange(int min, int max);
|
||||
|
||||
protected:
|
||||
void DoSetToolTipText(wxString const &tip) override;
|
||||
|
||||
private:
|
||||
void paintEvent(wxPaintEvent& evt);
|
||||
|
||||
void render(wxDC& dc);
|
||||
|
||||
void messureSize();
|
||||
|
||||
Button *createButton(bool inc);
|
||||
|
||||
// some useful events
|
||||
void mouseMoved(wxMouseEvent& event);
|
||||
void mouseWheelMoved(wxMouseEvent& event);
|
||||
void mouseEnterWindow(wxMouseEvent& event);
|
||||
void mouseLeaveWindow(wxMouseEvent& event);
|
||||
void keyPressed(wxKeyEvent& event);
|
||||
void keyReleased(wxKeyEvent& event);
|
||||
void onTimer(wxTimerEvent &evnet);
|
||||
void onTextLostFocus(wxEvent &event);
|
||||
void onTextEnter(wxCommandEvent &event);
|
||||
|
||||
void sendSpinEvent();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // !slic3r_GUI_SpinInput_hpp_
|
Loading…
Add table
Add a link
Reference in a new issue