10 #include <wx/dcclient.h>
13 #include <wx/propgrid/editors.h>
14 #include <wx/propgrid/propgrid.h>
23 wxPoint mousePosition = wxDefaultPosition;
40 void onPaint(wxPaintEvent& evt);
42 void onLeftDown(wxMouseEvent& evt);
44 void onLeftUp(wxMouseEvent& evt);
46 void onRightUp(wxMouseEvent& evt);
48 void onMouseMotion(wxMouseEvent& evt);
50 const static int padding = 30;
52 template <
typename TPo
int,
typename T =
int>
53 TPoint curveToWindow(
const CurvePoint& p)
const;
55 CurvePoint windowToCurve(
const wxPoint2DDouble p)
const;
65 wxPGProperty* property,
67 const wxSize& size)
const override;
69 virtual void UpdateControl(wxPGProperty* property, wxWindow* ctrl)
const override;
73 wxPGProperty* property,
74 const wxString& text)
const override;
76 virtual bool OnEvent(wxPropertyGrid* propgrid,
77 wxPGProperty* property,
78 wxWindow* wnd_primary,
79 wxEvent& event)
const override;
88 : wxStringProperty(label,
"curve")
92 static wxPGEditor* editor = wxPropertyGrid::RegisterEditorClass(
new CurveEditor(),
"MyEditor");
Generic dynamically allocated resizable storage.
Generic wrappers of lambdas, functors and other callables.
#define NAMESPACE_SPH_END
Wrapper of type value of which may or may not be present.
CurveDialog(wxWindow *parent, const Curve &curve, Function< void(const Curve &)> curveChanged)
virtual wxPGWindowList CreateControls(wxPropertyGrid *propgrid, wxPGProperty *property, const wxPoint &pos, const wxSize &size) const override
virtual void DrawValue(wxDC &dc, const wxRect &rect, wxPGProperty *property, const wxString &text) const override
virtual void UpdateControl(wxPGProperty *property, wxWindow *ctrl) const override
virtual bool OnEvent(wxPropertyGrid *propgrid, wxPGProperty *property, wxWindow *wnd_primary, wxEvent &event) const override
void setCurve(const Curve &newCurve)
CurvePanel(wxWindow *parent)
CurveProperty(const wxString &label, const Curve &curve)
void setCurve(const Curve &newCurve)
virtual const wxPGEditor * DoGetEditorClass() const override
const Curve & getCurve() const
Represents a user-defined function, defined by a set of points interpolated by either piecewise linea...
Simple 2D vector with integer coordinates. Provides conversion from and to wxPoint.