mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 05:37:52 -06:00
Created PrusaCollapsiblePane for CollapsiblePane view with disclosure triangles
This commit is contained in:
parent
c07f347ff6
commit
2e7d623ee4
5 changed files with 218 additions and 59 deletions
|
@ -5,6 +5,10 @@
|
|||
#include <wx/combo.h>
|
||||
#include <wx/dataview.h>
|
||||
#include <wx/dc.h>
|
||||
#include <wx/collpane.h>
|
||||
#include <wx/wupdlock.h>
|
||||
#include <wx/button.h>
|
||||
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
|
@ -53,6 +57,63 @@ public:
|
|||
void SetItemsCnt(int cnt) { m_cnt_open_items = cnt; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
// *** PrusaCollapsiblePane ***
|
||||
// ----------------------------------------------------------------------------
|
||||
class PrusaCollapsiblePane : public wxCollapsiblePane
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
wxButton* m_pDisclosureTriangleButton = nullptr;
|
||||
wxBitmap m_bmp_close;
|
||||
wxBitmap m_bmp_open;
|
||||
#endif //__WXMSW__
|
||||
public:
|
||||
PrusaCollapsiblePane() {}
|
||||
|
||||
|
||||
PrusaCollapsiblePane( wxWindow *parent,
|
||||
wxWindowID winid,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxCP_DEFAULT_STYLE,
|
||||
const wxValidator& val = wxDefaultValidator,
|
||||
const wxString& name = wxCollapsiblePaneNameStr)
|
||||
{
|
||||
#ifdef __WXMSW__
|
||||
Create(parent, winid, label, pos, size, style, val, name);
|
||||
#else
|
||||
this->Create(parent, winid, label);
|
||||
#endif //__WXMSW__
|
||||
this->Bind(wxEVT_COLLAPSIBLEPANE_CHANGED, ([parent, this](wxCommandEvent e){
|
||||
wxWindowUpdateLocker noUpdates_cp(this);
|
||||
wxWindowUpdateLocker noUpdates(parent);
|
||||
parent->GetParent()->Layout();
|
||||
parent->Layout();
|
||||
this->Refresh();
|
||||
}));
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& val,
|
||||
const wxString& name);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
void UpdateBtnBmp();
|
||||
void Collapse(bool collapse) override;
|
||||
void SetLabel(const wxString &label) override;
|
||||
bool Layout() override;
|
||||
#endif //__WXMSW__
|
||||
|
||||
};
|
||||
|
||||
|
||||
// *****************************************************************************
|
||||
// ----------------------------------------------------------------------------
|
||||
// MyObjectTreeModelNode: a node inside MyObjectTreeModel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue