mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -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
87
src/slic3r/GUI/Widgets/ComboBox.hpp
Normal file
87
src/slic3r/GUI/Widgets/ComboBox.hpp
Normal file
|
@ -0,0 +1,87 @@
|
|||
#ifndef slic3r_GUI_ComboBox_hpp_
|
||||
#define slic3r_GUI_ComboBox_hpp_
|
||||
|
||||
#include "TextInput.hpp"
|
||||
#include "DropDown.hpp"
|
||||
|
||||
#define CB_NO_DROP_ICON 0x1000000
|
||||
#define CB_NO_TEXT 0x2000000
|
||||
|
||||
class ComboBox : public wxWindowWithItems<TextInput, wxItemContainer>
|
||||
{
|
||||
std::vector<wxString> texts;
|
||||
std::vector<wxBitmap> icons;
|
||||
std::vector<void *> datas;
|
||||
std::vector<wxClientDataType> types;
|
||||
|
||||
DropDown drop;
|
||||
bool drop_down = false;
|
||||
bool text_off = false;
|
||||
|
||||
public:
|
||||
ComboBox(wxWindow * parent,
|
||||
wxWindowID id,
|
||||
const wxString &value = wxEmptyString,
|
||||
const wxPoint & pos = wxDefaultPosition,
|
||||
const wxSize & size = wxDefaultSize,
|
||||
int n = 0,
|
||||
const wxString choices[] = NULL,
|
||||
long style = 0);
|
||||
|
||||
DropDown & GetDropDown() { return drop; }
|
||||
|
||||
virtual bool SetFont(wxFont const & font) override;
|
||||
|
||||
public:
|
||||
int Append(const wxString &item, const wxBitmap &bitmap = wxNullBitmap);
|
||||
|
||||
int Append(const wxString &item, const wxBitmap &bitmap, void *clientData);
|
||||
|
||||
unsigned int GetCount() const override;
|
||||
|
||||
int GetSelection() const override;
|
||||
|
||||
void SetSelection(int n) override;
|
||||
|
||||
virtual void Rescale() override;
|
||||
|
||||
wxString GetValue() const;
|
||||
void SetValue(const wxString &value);
|
||||
|
||||
void SetLabel(const wxString &label) override;
|
||||
wxString GetLabel() const override;
|
||||
|
||||
void SetTextLabel(const wxString &label);
|
||||
wxString GetTextLabel() const;
|
||||
|
||||
wxString GetString(unsigned int n) const override;
|
||||
void SetString(unsigned int n, wxString const &value) override;
|
||||
|
||||
wxBitmap GetItemBitmap(unsigned int n);
|
||||
|
||||
protected:
|
||||
virtual int DoInsertItems(const wxArrayStringsAdapter &items,
|
||||
unsigned int pos,
|
||||
void ** clientData,
|
||||
wxClientDataType type) override;
|
||||
virtual void DoClear() override;
|
||||
|
||||
void DoDeleteOneItem(unsigned int pos) override;
|
||||
|
||||
void *DoGetItemClientData(unsigned int n) const override;
|
||||
void DoSetItemClientData(unsigned int n, void *data) override;
|
||||
|
||||
void OnEdit() override;
|
||||
|
||||
private:
|
||||
|
||||
// some useful events
|
||||
void mouseDown(wxMouseEvent &event);
|
||||
void mouseWheelMoved(wxMouseEvent &event);
|
||||
|
||||
void sendComboBoxEvent();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // !slic3r_GUI_ComboBox_hpp_
|
Loading…
Add table
Add a link
Reference in a new issue