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