2018-02-02 11:38:35 +00:00
|
|
|
#ifndef slic3r_GUI_wxExtensions_hpp_
|
|
|
|
#define slic3r_GUI_wxExtensions_hpp_
|
|
|
|
|
|
|
|
#include <wx/checklst.h>
|
|
|
|
#include <wx/combo.h>
|
2018-04-06 11:37:00 +00:00
|
|
|
#include <wx/dataview.h>
|
2018-02-02 11:38:35 +00:00
|
|
|
|
|
|
|
class wxCheckListBoxComboPopup : public wxCheckListBox, public wxComboPopup
|
|
|
|
{
|
2018-02-20 13:25:40 +00:00
|
|
|
static const unsigned int DefaultWidth;
|
|
|
|
static const unsigned int DefaultHeight;
|
2018-02-20 13:44:00 +00:00
|
|
|
static const unsigned int DefaultItemHeight;
|
2018-02-02 11:38:35 +00:00
|
|
|
|
|
|
|
wxString m_text;
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual bool Create(wxWindow* parent);
|
|
|
|
virtual wxWindow* GetControl();
|
|
|
|
virtual void SetStringValue(const wxString& value);
|
|
|
|
virtual wxString GetStringValue() const;
|
|
|
|
virtual wxSize GetAdjustedSize(int minWidth, int prefHeight, int maxHeight);
|
|
|
|
|
2018-02-20 13:25:40 +00:00
|
|
|
virtual void OnKeyEvent(wxKeyEvent& evt);
|
|
|
|
|
2018-02-02 11:38:35 +00:00
|
|
|
void OnCheckListBox(wxCommandEvent& evt);
|
|
|
|
void OnListBoxSelection(wxCommandEvent& evt);
|
|
|
|
};
|
|
|
|
|
2018-04-06 11:37:00 +00:00
|
|
|
|
|
|
|
// *** wxDataViewTreeCtrlComboBox ***
|
|
|
|
|
|
|
|
class wxDataViewTreeCtrlComboPopup: public wxDataViewTreeCtrl, public wxComboPopup
|
|
|
|
{
|
|
|
|
static const unsigned int DefaultWidth;
|
|
|
|
static const unsigned int DefaultHeight;
|
|
|
|
static const unsigned int DefaultItemHeight;
|
|
|
|
|
|
|
|
wxString m_text;
|
2018-04-06 13:42:52 +00:00
|
|
|
int m_cnt_open_items{0};
|
2018-04-06 11:37:00 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
virtual bool Create(wxWindow* parent);
|
|
|
|
virtual wxWindow* GetControl() { return this; }
|
|
|
|
virtual void SetStringValue(const wxString& value) { m_text = value; }
|
|
|
|
virtual wxString GetStringValue() const { return m_text; }
|
|
|
|
virtual wxSize GetAdjustedSize(int minWidth, int prefHeight, int maxHeight);
|
|
|
|
|
|
|
|
virtual void OnKeyEvent(wxKeyEvent& evt);
|
|
|
|
void OnDataViewTreeCtrlSelection(wxCommandEvent& evt);
|
2018-04-06 13:42:52 +00:00
|
|
|
void SetItemsCnt(int cnt) { m_cnt_open_items = cnt; }
|
2018-04-06 11:37:00 +00:00
|
|
|
};
|
|
|
|
|
2018-02-02 11:38:35 +00:00
|
|
|
#endif // slic3r_GUI_wxExtensions_hpp_
|