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