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