1 // Copyright (c) 2002 MySQL AB
2 // Use is subject to license terms.
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; version 2 of the License.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
16 
17 //---------------------------------------------------------------------------
18 #ifndef emb_samplesH
19 #define emb_samplesH
20 //---------------------------------------------------------------------------
21 #include <Classes.hpp>
22 #include <Controls.hpp>
23 #include <StdCtrls.hpp>
24 #include <Forms.hpp>
25 #include <ComCtrls.hpp>
26 #include <Grids.hpp>
27 #include <ImgList.hpp>
28 #include <ExtCtrls.hpp>
29 #include <Graphics.hpp>
30 #include <Buttons.hpp>
31 #include <deque.h>
32 //---------------------------------------------------------------------------
33 class TForm1 : public TForm
34 {
35 __published:	// IDE-managed Components
36         TGroupBox *GroupBox1;
37         TTreeView *DBView;
38         TTreeView *TableView;
39         TStringGrid *desc_table_grid;
40         TImageList *ImageList2;
41         TStatusBar *StatusBar1;
42         TImage *Image1;
43         TBitBtn *ToggleButton;
44         TTimer *Timer1;
45         TLabel *Label1;
46         TEdit *info_server;
47         TLabel *Label2;
48         void __fastcall Timer1Timer(TObject *Sender);
49         void __fastcall FormCreate(TObject *Sender);
50         void __fastcall ToggleButtonClick(TObject *Sender);
51         void __fastcall FormDestroy(TObject *Sender);
52         void __fastcall DBViewClick(TObject *Sender);
53         void __fastcall TableViewClick(TObject *Sender);
54 private:	// User declarations
55 public:		// User declarations
56         bool is_server_started;
57         AnsiString db_root_caption;
58         TTreeNode *db_root, *MySQLDbs, *tables_node, *tables_tree;
59         void __fastcall computer_ip(void);
60         bool __fastcall get_dbs(void);
61         bool __fastcall get_tables(String db_name);
62         bool __fastcall get_desc_table(String table_name);
63         bool __fastcall connect_server();
64         void __fastcall clean_desc_grid(void);
65         void __fastcall titles_grid(void);
66         void __fastcall fill_tree(deque<string> rows,
67                                   TTreeNode *root,
68                                   TTreeNode *child,
69                                   TTreeView *View,
70                                   int image_index);
71 
72         __fastcall TForm1(TComponent* Owner);
73 };
74 //---------------------------------------------------------------------------
75 extern PACKAGE TForm1 *Form1;
76 //---------------------------------------------------------------------------
77 #endif
78