2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
// Name: DBTree.cpp/.h
|
|
|
|
// Purpose: Tree with Table and Views, branches show Field information
|
2000-01-28 10:25:32 -05:00
|
|
|
// Author: Mark Johnson
|
|
|
|
// Modified by: 19991129.mj10777
|
|
|
|
// Created: 19991129
|
|
|
|
// Copyright: (c) Mark Johnson
|
|
|
|
// Licence: wxWindows license
|
2000-01-31 08:20:36 -05:00
|
|
|
// RCS-ID: $Id$
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-02-21 03:05:13 -05:00
|
|
|
class MainDoc; // Declared in Doc.h file
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
class DBTreeData : public wxTreeItemData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DBTreeData(const wxString& desc) : m_desc(desc) { }
|
|
|
|
void ShowInfo(wxTreeCtrl *tree);
|
2000-02-12 09:11:17 -05:00
|
|
|
wxString m_desc;
|
2000-01-28 10:25:32 -05:00
|
|
|
};
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
class DBTree : public wxTreeCtrl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum
|
|
|
|
{ // The order here must be the same as in m_imageListNormal !
|
|
|
|
TreeIc_Logo, // logo.ico
|
|
|
|
TreeIc_DsnClosed, // dsnclose.ico
|
|
|
|
TreeIc_DsnOpen, // dsnopen.ico
|
|
|
|
TreeIc_TAB, // tab.ico
|
2000-02-10 10:36:10 -05:00
|
|
|
TreeIc_VIEW, // view.ico
|
2000-01-28 10:25:32 -05:00
|
|
|
TreeIc_COL, // col.ico
|
|
|
|
TreeIc_KEY, // key.ico
|
|
|
|
TreeIc_KEYF, // keyf.ico
|
|
|
|
TreeIc_DocOpen, // d_open.ico
|
2000-02-10 10:36:10 -05:00
|
|
|
TreeIc_DocClosed, // d_closed.ico
|
2000-01-28 10:25:32 -05:00
|
|
|
TreeIc_FolderClosed, // f_closed.ico
|
|
|
|
TreeIc_FolderOpen // f_open.ico
|
|
|
|
};
|
|
|
|
wxString Temp0, Temp1, Temp2, Temp3, Temp4, Temp5;
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
DBTree() { }
|
|
|
|
DBTree(wxWindow *parent);
|
|
|
|
DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const wxSize& size,long style);
|
|
|
|
virtual ~DBTree();
|
2000-02-21 03:05:13 -05:00
|
|
|
MainDoc *pDoc;
|
2000-01-28 10:25:32 -05:00
|
|
|
wxDbInf *ct_BrowserDB;
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
int i_TabArt; // Tab = 0 ; Page = 1;
|
|
|
|
int i_ViewNr; // View Nummer in Tab / Page
|
|
|
|
int i_Which; // Which View, Database is this/using
|
|
|
|
wxString s_DSN; // Name of the Dataset
|
|
|
|
wxMenu *popupMenu1; // OnDBClass
|
|
|
|
wxMenu *popupMenu2; // OnDBGrid & OnTableclass
|
|
|
|
wxPoint TreePos;
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
wxImageList *p_imageListNormal;
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
public:
|
|
|
|
int OnPopulate();
|
|
|
|
void OnSelChanged(wxTreeEvent& event);
|
|
|
|
void OnRightSelect(wxTreeEvent& event);
|
2000-03-15 13:52:23 -05:00
|
|
|
void OnDBGrid(wxCommandEvent& event);
|
|
|
|
void OnDBClass(wxCommandEvent& event);
|
|
|
|
void OnTableClass(wxCommandEvent& event);
|
|
|
|
void OnTableClassAll(wxCommandEvent& event);
|
2000-01-28 10:25:32 -05:00
|
|
|
void OnMouseEvent(wxMouseEvent& event);
|
|
|
|
void OnMouseMove(wxMouseEvent& event);
|
|
|
|
public:
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
// NB: due to an ugly wxMSW hack you _must_ use DECLARE_DYNAMIC_CLASS()
|
|
|
|
// if you want your overloaded OnCompareItems() to be called.
|
|
|
|
// OTOH, if you don't want it you may omit the next line - this will
|
|
|
|
// make default (alphabetical) sorting much faster under wxMSW.
|
|
|
|
DECLARE_DYNAMIC_CLASS(DBTree)
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|
2000-01-28 10:25:32 -05:00
|
|
|
#define POPUP_01_BEGIN 1100
|
|
|
|
#define DATA_SHOW 1101
|
|
|
|
#define DATA_DB 1102
|
|
|
|
#define DATA_TABLE 1103
|
|
|
|
#define DATA_TABLE_ALL 1104
|
|
|
|
#define POPUP_01_END 1117
|
2000-02-12 09:11:17 -05:00
|
|
|
//----------------------------------------------------------------------------------------
|