MatOCAD Logo

Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

PnlGraph.h

Go to the documentation of this file.
00001 
00002 
00003 
00004 #ifndef __PnlGraph_
00005 
00006 #define __PnlGraph_
00007 
00008 #include "../Parser/TParserScomponi.h"
00009 #include "../Parser/TParserValore.h"
00010 #include "../BasePanel/TBasePanel.h"
00011 
00012 
00013 #include "../StrutturaGrafici/OpzGrafico.h"
00014 
00015 #include "FinestraOpzioni2D/DlgOpzioni.h"
00016 #include "../Strutture.h"
00017 
00018 
00020 
00022 class PnlGraph : public wxPanel
00023 {
00024 private:
00025 
00026     DECLARE_CLASS(PnlGraph)
00027     DECLARE_EVENT_TABLE()
00028 
00029 
00030 
00031     
00032     wxPaintDC *sheet;
00033 
00035     wxMenu *PopLista;
00036 
00037     //Coordinate to position functions________________
00038 
00040 
00045     int calculate_y(double ordinata);
00046 
00048 
00053     int calculate_x(double ascissa);
00054     //_____________________________________________________________
00055 
00056 
00058 
00065     void draw_function(rif* pointstructure,color colore,int width);
00066 
00067 
00068     //Functions called by draw_function____________________________
00069 
00071     void draw_axis(void);
00072 
00074     void draw_grid(void);
00075 
00077     void draw_steps(void);
00078 
00079     //_____________________________________________________________
00080 
00081 
00082 
00083     //Mouse events handlers________________________________________
00084 
00086     void OnLeftUp(wxMouseEvent& event);
00087 
00089     void OnRightDown(wxMouseEvent& event);
00090 
00092     void OnMotion(wxMouseEvent& event);
00093 
00095     void OnLeftDown(wxMouseEvent& event);
00096     //_____________________________________________________________
00097 
00098 
00100     void OnPaint(wxPaintEvent& event);
00101 
00102 
00103 
00104 public:
00105 
00106 
00108 
00113     double calculate_ordinata(double y);
00114 
00116 
00121     double calculate_ascissa(double x);
00122 
00124 
00127     wxMenu* GetPopUp();
00128 
00130     PnlGraph(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSIMPLE_BORDER, const wxString& name = _T("panel"));
00131 
00133     void SettingsClick(wxCommandEvent& event);
00134 
00136     OpzGrafico options;
00137 
00138 };
00139 
00140 
00141 // ----------------------------------------------------------------------------
00142 // Events
00143 // ----------------------------------------------------------------------------
00144 
00146 
00149 BEGIN_DECLARE_EVENT_TYPES()
00150 DECLARE_EVENT_TYPE(EVT_MOUSE_POINTER_MOVED, 520)
00151 DECLARE_EVENT_TYPE(EVT_MOUSE_GRAPH_LCLICK, 521)
00152 DECLARE_EVENT_TYPE(EVT_MOUSE_GRAPH_RCLICK, 522)
00153 END_DECLARE_EVENT_TYPES()
00154 
00155 
00156 #define EVT_POINTER_MOVED(fn) \
00157     DECLARE_EVENT_TABLE_ENTRY( \
00158         EVT_MOUSE_POINTER_MOVED, -1, -1, \
00159         (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction) \
00160         & fn, \
00161         (wxObject *) NULL \
00162     ),
00163 
00164 #define EVT_GRAPH_LCLICK(fn) \
00165     DECLARE_EVENT_TABLE_ENTRY( \
00166         EVT_MOUSE_GRAPH_LCLICK, -1, -1, \
00167         (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction) \
00168         & fn , \
00169         (wxObject *) NULL \
00170     ),
00171 
00172 #define EVT_GRAPH_RCLICK(fn) \
00173     DECLARE_EVENT_TABLE_ENTRY( \
00174         EVT_MOUSE_GRAPH_RCLICK, -1, -1, \
00175         (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction) \
00176         & fn, \
00177         (wxObject *) NULL \
00178     ),
00179 
00180 
00181 #endif

 

SourceForge Logo