]> git.saurik.com Git - wxWidgets.git/blame - demos/dbbrowse/dbtree.h
Added DECLARE/IMLEMENT_CLASS for wxToolBarBase
[wxWidgets.git] / demos / dbbrowse / dbtree.h
CommitLineData
c92b0f9a
MJ
1//----------------------------------------------------------------------------------------
2// Name: DBTree.cpp/.h
3// Purpose: Tree with Table and Views, branches show Field information
b5ffecfc
GT
4// Author: Mark Johnson
5// Modified by: 19991129.mj10777
6// Created: 19991129
7// Copyright: (c) Mark Johnson
8// Licence: wxWindows license
c09d434d 9// RCS-ID: $Id$
c92b0f9a 10//----------------------------------------------------------------------------------------
3fa0976a 11class MainDoc; // Declared in Doc.h file
c92b0f9a 12//----------------------------------------------------------------------------------------
b5ffecfc
GT
13class DBTreeData : public wxTreeItemData
14{
15public:
16 DBTreeData(const wxString& desc) : m_desc(desc) { }
b5ffecfc 17 void ShowInfo(wxTreeCtrl *tree);
c92b0f9a 18 wxString m_desc;
b5ffecfc 19};
c92b0f9a 20//----------------------------------------------------------------------------------------
b5ffecfc
GT
21class DBTree : public wxTreeCtrl
22{
23 public:
24 enum
25 { // The order here must be the same as in m_imageListNormal !
26 TreeIc_Logo, // logo.ico
27 TreeIc_DsnClosed, // dsnclose.ico
28 TreeIc_DsnOpen, // dsnopen.ico
29 TreeIc_TAB, // tab.ico
e8c6aabe 30 TreeIc_VIEW, // view.ico
b5ffecfc
GT
31 TreeIc_COL, // col.ico
32 TreeIc_KEY, // key.ico
33 TreeIc_KEYF, // keyf.ico
b5ffecfc 34 TreeIc_DocOpen, // d_open.ico
e8c6aabe 35 TreeIc_DocClosed, // d_closed.ico
b5ffecfc
GT
36 TreeIc_FolderClosed, // f_closed.ico
37 TreeIc_FolderOpen // f_open.ico
38 };
39 wxString Temp0, Temp1, Temp2, Temp3, Temp4, Temp5;
c92b0f9a 40//----------------------------------------------------------------------------------------
b5ffecfc
GT
41 DBTree() { }
42 DBTree(wxWindow *parent);
43 DBTree(wxWindow *parent, const wxWindowID id,const wxPoint& pos, const wxSize& size,long style);
44 virtual ~DBTree();
3fa0976a 45 MainDoc *pDoc;
b5ffecfc 46 wxDbInf *ct_BrowserDB;
c92b0f9a 47//----------------------------------------------------------------------------------------
b5ffecfc
GT
48 int i_TabArt; // Tab = 0 ; Page = 1;
49 int i_ViewNr; // View Nummer in Tab / Page
50 int i_Which; // Which View, Database is this/using
51 wxString s_DSN; // Name of the Dataset
52 wxMenu *popupMenu1; // OnDBClass
53 wxMenu *popupMenu2; // OnDBGrid & OnTableclass
54 wxPoint TreePos;
c92b0f9a 55//----------------------------------------------------------------------------------------
b5ffecfc 56 wxImageList *p_imageListNormal;
c92b0f9a 57//----------------------------------------------------------------------------------------
b5ffecfc
GT
58 public:
59 int OnPopulate();
60 void OnSelChanged(wxTreeEvent& event);
61 void OnRightSelect(wxTreeEvent& event);
669f7a11
JS
62 void OnDBGrid(wxCommandEvent& event);
63 void OnDBClass(wxCommandEvent& event);
64 void OnTableClass(wxCommandEvent& event);
65 void OnTableClassAll(wxCommandEvent& event);
b5ffecfc
GT
66 void OnMouseEvent(wxMouseEvent& event);
67 void OnMouseMove(wxMouseEvent& event);
68 public:
c92b0f9a 69//----------------------------------------------------------------------------------------
b5ffecfc
GT
70 // NB: due to an ugly wxMSW hack you _must_ use DECLARE_DYNAMIC_CLASS()
71 // if you want your overloaded OnCompareItems() to be called.
72 // OTOH, if you don't want it you may omit the next line - this will
73 // make default (alphabetical) sorting much faster under wxMSW.
74 DECLARE_DYNAMIC_CLASS(DBTree)
75 DECLARE_EVENT_TABLE()
76};
c92b0f9a 77//----------------------------------------------------------------------------------------
b5ffecfc
GT
78#define POPUP_01_BEGIN 1100
79#define DATA_SHOW 1101
80#define DATA_DB 1102
81#define DATA_TABLE 1103
82#define DATA_TABLE_ALL 1104
83#define POPUP_01_END 1117
c92b0f9a 84//----------------------------------------------------------------------------------------