1
//////////////////////////////////////////////////////////////////////////
3
// pgAdmin III - PostgreSQL Tools
4
// RCS-ID: $Id: explainCanvas.h 4874 2006-01-06 17:33:27Z dpage $
5
// Copyright (C) 2002 - 2006, The pgAdmin Development Team
6
// This software is released under the Artistic Licence
8
// explainCanvas.cpp - Explain Canvas
10
//////////////////////////////////////////////////////////////////////////
13
#include <wx/ogl/ogl.h>
17
#error wxUSE_DEPRECATED should be 0!
25
class ExplainCanvas : public wxShapeCanvas
28
ExplainCanvas(wxWindow *parent);
31
void ShowPopup(ExplainShape *s);
32
void SetExplainString(const wxString &str);
37
ExplainShape *rootShape, *lastShape;
42
class ExplainShape : public wxBitmapShape
45
ExplainShape(char *bmp[], const wxString &description, long tokenNo=-1, long detailNo=-1);
46
static ExplainShape *Create(long level, ExplainShape *last, const wxString &str);
48
void SetCondition(const wxString &str) { condition = str; }
49
long GetLevel() { return level; }
50
wxRealPoint GetStartPoint();
51
wxRealPoint GetEndPoint(int kidNo);
52
int GetKidno() { return kidNo; }
54
ExplainShape *GetUpper() { return upperShape; }
55
double GetAverageCost() { return (costHigh - costLow) / 2 + costLow; }
58
void OnDraw(wxDC& dc);
59
void OnLeftClick(double x, double y, int keys = 0, int attachment = 0);
61
ExplainShape *upperShape;
63
void SetLabel(const wxString &str, int tokenNo=-1, int detailNo=-1);
66
wxString description, detail, condition, label;
67
wxString cost, actual;
68
double costLow, costHigh;
71
int totalShapes; // horizontal space usage by shape and its kids
74
friend class ExplainCanvas;
75
friend class ExplainText;
79
class ExplainLine : public wxLineShape
82
ExplainLine(ExplainShape *from, ExplainShape *to, double weight=0);
86
void OnDraw(wxDC& dc);
90
class ExplainPopup : public wxDialog
93
ExplainPopup(wxWindow *w);
94
void SetShape(ExplainShape *s);
98
void OnMouseMove(wxMouseEvent &ev);
100
ExplainText *explainText;
102
DECLARE_EVENT_TABLE()