1 /**********************************************************
2  * Version $Id: data_source_odbc.h 911 2011-02-14 16:38:15Z reklov_w $
3  *********************************************************/
4 
5 ///////////////////////////////////////////////////////////
6 //                                                       //
7 //                         SAGA                          //
8 //                                                       //
9 //      System for Automated Geoscientific Analyses      //
10 //                                                       //
11 //                    User Interface                     //
12 //                                                       //
13 //                    Program: SAGA                      //
14 //                                                       //
15 //-------------------------------------------------------//
16 //                                                       //
17 //                  data_source_odbc.h                   //
18 //                                                       //
19 //          Copyright (C) 2012 by Olaf Conrad            //
20 //                                                       //
21 //-------------------------------------------------------//
22 //                                                       //
23 // This file is part of 'MicroCity: Spatial Analysis and //
24 // Simulation Framework'. MicroCity is free software;you //
25 // can redistribute it and/or modify it under the terms  //
26 // of the GNU General Public License as published by the //
27 // Free Software Foundation, either version 2 of the     //
28 // License, or (at your option) any later version.       //
29 //                                                       //
30 // MicroCity is distributed in the hope that it will be  //
31 // useful, but WITHOUT ANY WARRANTY; without even the    //
32 // implied warranty of MERCHANTABILITY or FITNESS FOR A  //
33 // PARTICULAR PURPOSE. See the GNU General Public        //
34 // License for more details.                             //
35 //                                                       //
36 // You should have received a copy of the GNU General    //
37 // Public License along with this program; if not, see   //
38 // <http://www.gnu.org/licenses/>.                       //
39 //                                                       //
40 //-------------------------------------------------------//
41 //                                                       //
42 //    contact:    Olaf Conrad                            //
43 //                Institute of Geography                 //
44 //                University of Hamburg                  //
45 //                Germany                                //
46 //                                                       //
47 //    e-mail:     oconrad@saga-gis.org                   //
48 //                                                       //
49 ///////////////////////////////////////////////////////////
50 
51 //---------------------------------------------------------
52 
53 
54 ///////////////////////////////////////////////////////////
55 //														 //
56 //														 //
57 //														 //
58 ///////////////////////////////////////////////////////////
59 
60 //---------------------------------------------------------
61 #ifndef _HEADER_INCLUDED__SAGA_GUI__data_source_odbc__H
62 #define _HEADER_INCLUDED__SAGA_GUI__data_source_odbc__H
63 
64 
65 ///////////////////////////////////////////////////////////
66 //														 //
67 //														 //
68 //														 //
69 ///////////////////////////////////////////////////////////
70 
71 //---------------------------------------------------------
72 #include <wx/treectrl.h>
73 
74 
75 ///////////////////////////////////////////////////////////
76 //														 //
77 //														 //
78 //														 //
79 ///////////////////////////////////////////////////////////
80 
81 //---------------------------------------------------------
82 class CData_Source_ODBC : public wxTreeCtrl
83 {
84 public:
85 	CData_Source_ODBC(wxWindow *pParent);
86 
87 	void						Update_Source		(const wxString &Server);
88 	void						Update_Sources		(void);
89 
90 
91 private:
92 
93 	void						On_Item_Activated	(wxTreeEvent &event);
94 	void						On_Item_RClick		(wxTreeEvent &event);
95 	void						On_Item_Menu		(wxTreeEvent &event);
96 
97 	void						On_Refresh			(wxCommandEvent &event);
98 	void						On_Source_Close_All	(wxCommandEvent &event);
99 	void						On_Source_Close		(wxCommandEvent &event);
100 	void						On_Source_Open		(wxCommandEvent &event);
101 	void						On_Table_Open		(wxCommandEvent &event);
102 	void						On_Table_Delete		(wxCommandEvent &event);
103 
104 	void						Source_Close_All	(void);
105 	void						Source_Close		(const wxTreeItemId &Item);
106 	void						Source_Open			(const wxTreeItemId &Item);
107 	void						Table_Open			(const wxTreeItemId &Item);
108 	void						Table_Delete		(const wxTreeItemId &Item);
109 
110 	bool						is_Connected		(const CSG_String &Server);
111 
112 	void						Update_Item			(const wxTreeItemId &Item);
113 	void						Update_Source		(const wxTreeItemId &Item);
114 
115 
116 //---------------------------------------------------------
117 DECLARE_EVENT_TABLE()
118 };
119 
120 
121 ///////////////////////////////////////////////////////////
122 //														 //
123 //														 //
124 //														 //
125 ///////////////////////////////////////////////////////////
126 
127 //---------------------------------------------------------
128 #endif // #ifndef _HEADER_INCLUDED__SAGA_GUI__data_source_odbc__H
129