#include "wx/plot/plot.h"
#include "wx/bmpbuttn.h"
+#include "wx/module.h"
#include <math.h>
#include "wx/plot/plot_dwn.xpm"
#endif
+//----------------------------------------------------------------------------
+// event types
+//----------------------------------------------------------------------------
+
+const int wxEVT_PLOT_SEL_CHANGING = wxNewEventType();
+const int wxEVT_PLOT_SEL_CHANGED = wxNewEventType();
+const int wxEVT_PLOT_CLICKED = wxNewEventType();
+const int wxEVT_PLOT_DOUBLECLICKED = wxNewEventType();
+const int wxEVT_PLOT_ZOOM_IN = wxNewEventType();
+const int wxEVT_PLOT_ZOOM_OUT = wxNewEventType();
+const int wxEVT_PLOT_VALUE_SEL_CREATING = wxNewEventType();
+const int wxEVT_PLOT_VALUE_SEL_CREATED = wxNewEventType();
+const int wxEVT_PLOT_VALUE_SEL_CHANGING = wxNewEventType();
+const int wxEVT_PLOT_VALUE_SEL_CHANGED = wxNewEventType();
+const int wxEVT_PLOT_AREA_SEL_CREATING = wxNewEventType();
+const int wxEVT_PLOT_AREA_SEL_CREATED = wxNewEventType();
+const int wxEVT_PLOT_AREA_SEL_CHANGING = wxNewEventType();
+const int wxEVT_PLOT_AREA_SEL_CHANGED = wxNewEventType();
+const int wxEVT_PLOT_BEGIN_X_LABEL_EDIT = wxNewEventType();
+const int wxEVT_PLOT_END_X_LABEL_EDIT = wxNewEventType();
+const int wxEVT_PLOT_BEGIN_Y_LABEL_EDIT = wxNewEventType();
+const int wxEVT_PLOT_END_Y_LABEL_EDIT = wxNewEventType();
+const int wxEVT_PLOT_BEGIN_TITLE_EDIT = wxNewEventType();
+const int wxEVT_PLOT_END_TITLE_EDIT = wxNewEventType();
+const int wxEVT_PLOT_AREA_CREATE = wxNewEventType();
+
//----------------------------------------------------------------------------
// accessor functions for the bitmaps (may return NULL, check for it!)
//----------------------------------------------------------------------------
static wxBitmap *GetUpBitmap();
static wxBitmap *GetDownBitmap();
-//----------------------------------------------------------------------------
-// event types
-//----------------------------------------------------------------------------
-
-int wxEVT_PLOT_SEL_CHANGING;
-int wxEVT_PLOT_SEL_CHANGED;
-int wxEVT_PLOT_CLICKED;
-int wxEVT_PLOT_DOUBLECLICKED;
-int wxEVT_PLOT_ZOOM_IN;
-int wxEVT_PLOT_ZOOM_OUT;
-int wxEVT_PLOT_VALUE_SEL_CREATING;
-int wxEVT_PLOT_VALUE_SEL_CREATED;
-int wxEVT_PLOT_VALUE_SEL_CHANGING;
-int wxEVT_PLOT_VALUE_SEL_CHANGED;
-int wxEVT_PLOT_AREA_SEL_CREATING;
-int wxEVT_PLOT_AREA_SEL_CREATED;
-int wxEVT_PLOT_AREA_SEL_CHANGING;
-int wxEVT_PLOT_AREA_SEL_CHANGED;
-int wxEVT_PLOT_BEGIN_X_LABEL_EDIT;
-int wxEVT_PLOT_END_X_LABEL_EDIT;
-int wxEVT_PLOT_BEGIN_Y_LABEL_EDIT;
-int wxEVT_PLOT_END_Y_LABEL_EDIT;
-int wxEVT_PLOT_BEGIN_TITLE_EDIT;
-int wxEVT_PLOT_END_TITLE_EDIT;
-int wxEVT_PLOT_AREA_CREATE;
-
//-----------------------------------------------------------------------------
// consts
//-----------------------------------------------------------------------------
m_area->DeleteCurve( curve );
m_area->Refresh( FALSE );
+
+ if (curve == m_current) m_current = (wxPlotCurve *) NULL;
}
wxPlotCurve *wxPlotWindow::GetCurrent()
return s_bitmap;
}
-
-//----------------------------------------------------------------------------
-// wxPlotModule
-//----------------------------------------------------------------------------
-
-class wxPlotModule : public wxModule
-{
-public:
- bool OnInit();
- void OnExit();
-
-private:
- DECLARE_CLASS(wxPlotModule)
-};
-
-IMPLEMENT_DYNAMIC_CLASS(wxPlotModule, wxModule)
-
-bool wxPlotModule::OnInit()
-{
- wxEVT_PLOT_SEL_CHANGING = wxNewId();
- wxEVT_PLOT_SEL_CHANGED = wxNewId();
- wxEVT_PLOT_CLICKED = wxNewId();
- wxEVT_PLOT_DOUBLECLICKED = wxNewId();
- wxEVT_PLOT_ZOOM_IN = wxNewId();
- wxEVT_PLOT_ZOOM_OUT = wxNewId();
- wxEVT_PLOT_VALUE_SEL_CREATING = wxNewId();
- wxEVT_PLOT_VALUE_SEL_CREATED = wxNewId();
- wxEVT_PLOT_VALUE_SEL_CHANGING = wxNewId();
- wxEVT_PLOT_VALUE_SEL_CHANGED = wxNewId();
- wxEVT_PLOT_AREA_SEL_CREATING = wxNewId();
- wxEVT_PLOT_AREA_SEL_CREATED = wxNewId();
- wxEVT_PLOT_AREA_SEL_CHANGING = wxNewId();
- wxEVT_PLOT_AREA_SEL_CHANGED = wxNewId();
- wxEVT_PLOT_BEGIN_X_LABEL_EDIT = wxNewId();
- wxEVT_PLOT_END_X_LABEL_EDIT = wxNewId();
- wxEVT_PLOT_BEGIN_Y_LABEL_EDIT = wxNewId();
- wxEVT_PLOT_END_Y_LABEL_EDIT = wxNewId();
- wxEVT_PLOT_BEGIN_TITLE_EDIT = wxNewId();
- wxEVT_PLOT_END_TITLE_EDIT = wxNewId();
- wxEVT_PLOT_AREA_CREATE = wxNewId();
-
- return TRUE;
-}
-
-void wxPlotModule::OnExit()
-{
-}
-
-