1 #include "canvastools.h"
2 #include "mwindowgui.h"
3 #include "trackcanvas.h"
7 CanvasTool::CanvasTool(MWindow *mwindow,
8 TrackCanvas *trackcanvas,
13 : BC_Button(x, y, data)
15 this->mwindow = mwindow;
16 this->trackcanvas = trackcanvas;
21 CanvasTool::~CanvasTool()
28 CanvasTools::CanvasTools(MWindow *mwindow,
29 TrackCanvas *trackcanvas)
30 : ArrayList<CanvasTool*>()
32 this->mwindow = mwindow;
33 this->trackcanvas = trackcanvas;
36 CanvasTools::~CanvasTools()
41 void CanvasTools::decrease_visible()
43 for(int i = 0; i < total; i++)
47 void CanvasTools::delete_invisible()
49 for(int i = total - 1; i >= 0; i--)
50 if(values[i]->visible < 1)
57 // Region is visible on track canvas
58 int CanvasTools::visible(int x, int y, int w, int h)
60 return MWindowGUI::visible(x, x + w, 0, trackcanvas->get_w()) &&
61 MWindowGUI::visible(y, y + h, 0, trackcanvas->get_h());