mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Implemented BitmapChoiseRenderer
This commit is contained in:
parent
904bbcc006
commit
c07a193b4e
4 changed files with 183 additions and 7 deletions
|
@ -563,6 +563,40 @@ private:
|
|||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// BitmapChoiseRenderer
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class BitmapChoiseRenderer : public wxDataViewCustomRenderer
|
||||
{
|
||||
public:
|
||||
BitmapChoiseRenderer(wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT
|
||||
|
||||
, int align = wxDVR_DEFAULT_ALIGNMENT
|
||||
) : wxDataViewCustomRenderer(wxT("DataViewBitmapText"), mode, align) {}
|
||||
|
||||
bool SetValue(const wxVariant& value);
|
||||
bool GetValue(wxVariant& value) const;
|
||||
#if ENABLE_NONCUSTOM_DATA_VIEW_RENDERING && wxUSE_ACCESSIBILITY
|
||||
virtual wxString GetAccessibleDescription() const override;
|
||||
#endif // wxUSE_ACCESSIBILITY && ENABLE_NONCUSTOM_DATA_VIEW_RENDERING
|
||||
|
||||
virtual bool Render(wxRect cell, wxDC* dc, int state);
|
||||
virtual wxSize GetSize() const;
|
||||
|
||||
bool HasEditorCtrl() const override { return true; }
|
||||
wxWindow* CreateEditorCtrl(wxWindow* parent,
|
||||
wxRect labelRect,
|
||||
const wxVariant& value) override;
|
||||
bool GetValueFromEditorCtrl(wxWindow* ctrl,
|
||||
wxVariant& value) override;
|
||||
|
||||
private:
|
||||
DataViewBitmapText m_value;
|
||||
wxArrayString m_choices;
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// MyCustomRenderer
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue