~ubuntu-branches/debian/sid/pgadmin3/sid

« back to all changes in this revision

Viewing changes to pgadmin/include/gqb/gqbGraphSimple.h

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2009-07-30 12:27:16 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730122716-fddbh42on721bbs2
Tags: 1.10.0-1
* New upstream release.
* Adjusted watch file to match release candidates.
* Updated to Standards-Version 3.8.2:
  - Moved to Section: database.
  - Add DEB_BUILD_OPTIONS support for parallel building.
  - Move from findstring to filter suggestion for DEB_BUILD_OPTIONS parsing.
* pgagent got split into its own separate source package by upstream.
* Exclude Docs.vcproj from installation.
* Move doc-base.enus from pgadmin3 to pgadmin3-data package, the files are
  in there too.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//////////////////////////////////////////////////////////////////////////
 
2
//
 
3
// pgAdmin III - PostgreSQL Tools
 
4
// RCS-ID:      $Id: gqbGraphSimple.h 7758 2009-03-26 20:49:59Z dpage $
 
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
 
6
// This software is released under the BSD Licence
 
7
//
 
8
// gqbGraphsimple.h - A simple Implementation of the Graphic Interface for GQB
 
9
//
 
10
//////////////////////////////////////////////////////////////////////////
 
11
 
 
12
#ifndef GQBGRAPHSIMPLE_H
 
13
#define GQBGRAPHSIMPLE_H
 
14
 
 
15
#include <wx/dcbuffer.h>
 
16
 
 
17
// App headers
 
18
#include "gqb/gqbQueryObjs.h"
 
19
#include "gqb/gqbGraphBehavior.h"
 
20
 
 
21
// Create Array Objects used as base for gqbCollections
 
22
class gqbGraphSimple : public gqbGraphBehavior
 
23
{
 
24
public:
 
25
    gqbGraphSimple();
 
26
    void drawTable(wxBufferedDC& bdc, wxPoint *origin, gqbQueryObject *queryTable);
 
27
    void drawTempJoinLine(wxBufferedDC& bdc, wxPoint &origin, wxPoint &end);
 
28
    void calcAnchorPoint(gqbQueryJoin *join);
 
29
    void drawJoin(wxBufferedDC& bdc, wxPoint& origin, wxPoint& dest, wxPoint& anchorUsed, bool selected, type_Join joinKind);
 
30
    void UpdatePosObject(gqbQueryObject *queryTable, int x, int y, int cursorAdjustment);
 
31
    gqbColumn* getColumnAtPosition(wxPoint *clickPoint, gqbQueryObject *queryTable, int sensibility=17);
 
32
    bool clickOnJoin(gqbQueryJoin *join, wxPoint &pt, wxPoint &origin, wxPoint &dest);
 
33
    int getTitleRowHeight();
 
34
 
 
35
private:
 
36
    wxFont normalFont, TableTitleFont;
 
37
    wxBrush BackgroundLayer1, BackgroundLayer2, BackgroundTitle, selectedBrush;
 
38
    int minTableWidth, minTableHeight;
 
39
    int rowHeight, rowLeftMargin, rowRightMargin, rowTopMargin, lineClickThreshold;
 
40
    wxPen selectedPen;
 
41
    wxBitmap imgSelBoxEmpty,imgSelBoxSelected;
 
42
    bool insideLine(wxPoint &pt, wxPoint &p1, wxPoint &p2, int threshold);
 
43
    double distanceToLine(wxPoint pt, wxPoint p1, wxPoint p2);
 
44
    wxPoint findLineMiddle(wxPoint p1, wxPoint p2);
 
45
};
 
46
#endif