mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 08:17:51 -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
100
src/slic3r/GUI/Widgets/DropDown.hpp
Normal file
100
src/slic3r/GUI/Widgets/DropDown.hpp
Normal file
|
@ -0,0 +1,100 @@
|
|||
#ifndef slic3r_GUI_DropDown_hpp_
|
||||
#define slic3r_GUI_DropDown_hpp_
|
||||
|
||||
#include <wx/stattext.h>
|
||||
#include "../wxExtensions.hpp"
|
||||
#include "StateHandler.hpp"
|
||||
|
||||
#define DD_NO_CHECK_ICON 0x1000000
|
||||
#define DD_NO_TEXT 0x2000000
|
||||
#define DD_STYLE_MASK 0x3000000
|
||||
|
||||
class DropDown : public wxPopupTransientWindow
|
||||
{
|
||||
std::vector<wxString> & texts;
|
||||
std::vector<wxBitmap> & icons;
|
||||
bool need_sync = false;
|
||||
int selection = -1;
|
||||
int hover_item = -1;
|
||||
|
||||
double radius = 0;
|
||||
bool use_content_width = false;
|
||||
bool align_icon = false;
|
||||
bool text_off = false;
|
||||
|
||||
wxSize textSize;
|
||||
wxSize iconSize;
|
||||
wxSize rowSize;
|
||||
|
||||
StateHandler state_handler;
|
||||
StateColor text_color;
|
||||
StateColor border_color;
|
||||
StateColor selector_border_color;
|
||||
StateColor selector_background_color;
|
||||
ScalableBitmap check_bitmap;
|
||||
|
||||
bool pressedDown = false;
|
||||
boost::posix_time::ptime dismissTime;
|
||||
wxPoint offset; // x not used
|
||||
wxPoint dragStart;
|
||||
|
||||
public:
|
||||
DropDown(wxWindow * parent,
|
||||
std::vector<wxString> &texts,
|
||||
std::vector<wxBitmap> &icons,
|
||||
long style = 0);
|
||||
|
||||
public:
|
||||
void Invalidate(bool clear = false);
|
||||
|
||||
int GetSelection() const { return selection; }
|
||||
|
||||
void SetSelection(int n);
|
||||
|
||||
wxString GetValue() const;
|
||||
void SetValue(const wxString &value);
|
||||
|
||||
public:
|
||||
void SetCornerRadius(double radius);
|
||||
|
||||
void SetBorderColor(StateColor const & color);
|
||||
|
||||
void SetSelectorBorderColor(StateColor const & color);
|
||||
|
||||
void SetTextColor(StateColor const &color);
|
||||
|
||||
void SetSelectorBackgroundColor(StateColor const &color);
|
||||
|
||||
void SetUseContentWidth(bool use);
|
||||
|
||||
void SetAlignIcon(bool align);
|
||||
|
||||
public:
|
||||
void Rescale();
|
||||
|
||||
bool HasDismissLongTime();
|
||||
|
||||
private:
|
||||
void paintEvent(wxPaintEvent& evt);
|
||||
void paintNow();
|
||||
|
||||
void render(wxDC& dc);
|
||||
|
||||
friend class ComboBox;
|
||||
void messureSize();
|
||||
void autoPosition();
|
||||
|
||||
// some useful events
|
||||
void mouseDown(wxMouseEvent& event);
|
||||
void mouseReleased(wxMouseEvent &event);
|
||||
void mouseMove(wxMouseEvent &event);
|
||||
void mouseWheelMoved(wxMouseEvent &event);
|
||||
|
||||
void sendDropDownEvent();
|
||||
|
||||
void OnDismiss() override;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // !slic3r_GUI_DropDown_hpp_
|
Loading…
Add table
Add a link
Reference in a new issue