PrusaCollapsiblePane is used only on MSW

This commit is contained in:
YuSanka 2018-06-05 11:17:37 +02:00
parent 72541ad13e
commit dcf0b432cb
2 changed files with 5 additions and 22 deletions

View file

@ -190,7 +190,7 @@ void wxDataViewTreeCtrlComboPopup::OnDataViewTreeCtrlSelection(wxCommandEvent& e
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// *** PrusaCollapsiblePane *** // *** PrusaCollapsiblePane *** used only #ifdef __WXMSW__
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifdef __WXMSW__ #ifdef __WXMSW__
bool PrusaCollapsiblePane::Create(wxWindow *parent, wxWindowID id, const wxString& label, bool PrusaCollapsiblePane::Create(wxWindow *parent, wxWindowID id, const wxString& label,
@ -288,7 +288,6 @@ bool PrusaCollapsiblePane::Layout()
return true; return true;
} }
#endif //__WXMSW__
void PrusaCollapsiblePane::OnStateChange_(const wxSize& sz) void PrusaCollapsiblePane::OnStateChange_(const wxSize& sz)
{ {
@ -330,21 +329,12 @@ void PrusaCollapsiblePane::Collapse(bool collapse)
// update our state // update our state
m_pPane->Show(!collapse); m_pPane->Show(!collapse);
// update button label
#if defined( __WXMAC__ ) && !defined(__WXUNIVERSAL__)
m_pButton->SetOpen(!collapse);
#else
#ifdef __WXMSW__
// update button bitmap // update button bitmap
UpdateBtnBmp(); UpdateBtnBmp();
#else
// NB: this must be done after updating our "state"
m_pButton->SetLabel(GetBtnLabel());
#endif //__WXMSW__
#endif
OnStateChange_(GetBestSize()); OnStateChange_(GetBestSize());
} }
#endif //__WXMSW__
// ***************************************************************************** // *****************************************************************************
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View file

@ -75,15 +75,14 @@ public:
// *** PrusaCollapsiblePane *** // *** PrusaCollapsiblePane *** used only #ifdef __WXMSW__
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifdef __WXMSW__
class PrusaCollapsiblePane : public wxCollapsiblePane class PrusaCollapsiblePane : public wxCollapsiblePane
{ {
#ifdef __WXMSW__
wxButton* m_pDisclosureTriangleButton = nullptr; wxButton* m_pDisclosureTriangleButton = nullptr;
wxBitmap m_bmp_close; wxBitmap m_bmp_close;
wxBitmap m_bmp_open; wxBitmap m_bmp_open;
#endif //__WXMSW__
public: public:
PrusaCollapsiblePane() {} PrusaCollapsiblePane() {}
PrusaCollapsiblePane( wxWindow *parent, PrusaCollapsiblePane( wxWindow *parent,
@ -95,16 +94,11 @@ public:
const wxValidator& val = wxDefaultValidator, const wxValidator& val = wxDefaultValidator,
const wxString& name = wxCollapsiblePaneNameStr) const wxString& name = wxCollapsiblePaneNameStr)
{ {
#ifdef __WXMSW__
Create(parent, winid, label, pos, size, style, val, name); Create(parent, winid, label, pos, size, style, val, name);
#else
Create(parent, winid, label);
#endif //__WXMSW__
} }
~PrusaCollapsiblePane() {} ~PrusaCollapsiblePane() {}
#ifdef __WXMSW__
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id, wxWindowID id,
const wxString& label, const wxString& label,
@ -117,7 +111,6 @@ public:
void UpdateBtnBmp(); void UpdateBtnBmp();
void SetLabel(const wxString &label) override; void SetLabel(const wxString &label) override;
bool Layout() override; bool Layout() override;
#endif //__WXMSW__
void Collapse(bool collapse) override; void Collapse(bool collapse) override;
void OnStateChange_(const wxSize& sz); //override of OnStateChange void OnStateChange_(const wxSize& sz); //override of OnStateChange
virtual bool Show(bool show=true) override { virtual bool Show(bool show=true) override {
@ -126,7 +119,7 @@ public:
return true; return true;
} }
}; };
#endif //__WXMSW__
// ***************************************************************************** // *****************************************************************************
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------