1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
//////////////////////////////////////////////////////////////////////////
//
// pgAdmin III - PostgreSQL Tools
// Copyright (C) 2002 - 2014, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
// ddTextTableItemFigure.h -
//
//////////////////////////////////////////////////////////////////////////
#ifndef DDTEXTTABLEITEMFIGURE_H
#define DDTEXTTABLEITEMFIGURE_H
#include <wx/arrstr.h>
#include "hotdraw/figures/hdSimpleTextFigure.h"
#include "dd/dditems/utilities/ddDataType.h"
enum
{
MNU_DDADDCOLUMN = 321,
MNU_DELCOLUMN,
MNU_RENAMECOLUMN,
MNU_AUTONAMCOLUMN,
MNU_NOTNULL,
MNU_PKEY,
MNU_UKEY,
MNU_TYPESERIAL,
MNU_TYPEBOOLEAN,
MNU_TYPEINTEGER,
MNU_TYPEMONEY,
MNU_TYPEVARCHAR,
MNU_TYPEOTHER,
MNU_TYPEPKEY_CONSTRAINTNAME,
MNU_TYPEUKEY_CONSTRAINTNAME,
MNU_DELTABLE
};
class ddColumnFigure;
class ddTableFigure;
class ddTextTableItemFigure : public hdSimpleTextFigure
{
public:
ddTextTableItemFigure(wxString &columnName, ddDataType dataType, ddColumnFigure *owner);
~ddTextTableItemFigure();
virtual wxString &getText(bool extended = false);
wxString getType(bool raw = false);
virtual void setAlias(wxString alias);
virtual wxString getAlias();
virtual void setOneTimeNoAlias();
virtual void createMenu(wxMenu &mnu);
virtual const wxArrayString dataTypes();
virtual void OnGenericPopupClick(wxCommandEvent &event, hdDrawingView *view);
virtual void setText(wxString textString);
virtual ddColumnFigure *getOwnerColumn();
virtual void setOwnerColumn(ddColumnFigure *column);
virtual void setShowDataType(bool value);
virtual bool getShowDataType()
{
return showDataType;
};
hdITool *CreateFigureTool(hdDrawingView *view, hdITool *defaultTool);
virtual void displayBoxUpdate();
void recalculateDisplayBox();
int getTextWidth();
int getTextHeight();
ddDataType getDataType();
void setDataType(ddDataType type);
void setOwnerTable(ddTableFigure *table); //only used by columns working as table title figure for setAlias method
int getPrecision();
int getScale();
void setPrecision(int value);
void setScale(int value);
protected:
ddColumnFigure *ownerColumn;
ddTableFigure *ownerTable;
wxString colAlias;
private:
ddDataType columnType;
wxString out;
bool showDataType;
bool showAlias;
bool oneTimeNoAlias;
int precision;
int scale;
};
#endif
|