2012-03-28 16:10:39 -04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* OpenSQLManager
|
|
|
|
*
|
|
|
|
* Free Database manager for Open Source Databases
|
|
|
|
*
|
2012-04-20 13:30:27 -04:00
|
|
|
* @package OpenSQLManager
|
2012-03-28 16:10:39 -04:00
|
|
|
* @author Timothy J. Warren
|
|
|
|
* @copyright Copyright (c) 2012
|
|
|
|
* @link https://github.com/aviat4ion/OpenSQLManager
|
|
|
|
* @license http://philsturgeon.co.uk/code/dbad-license
|
|
|
|
*/
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
2012-05-29 14:29:20 -04:00
|
|
|
namespace OpenSQLManager;
|
|
|
|
|
2012-03-28 16:10:39 -04:00
|
|
|
/**
|
|
|
|
* Tabbed Container for database properties
|
2012-04-20 13:30:27 -04:00
|
|
|
*
|
|
|
|
* @package OpenSQLManager
|
|
|
|
* @subpackage Widgets
|
2012-03-28 16:10:39 -04:00
|
|
|
*/
|
2012-05-29 14:29:20 -04:00
|
|
|
class DB_tabs extends \wxNotebook {
|
2012-03-28 16:10:39 -04:00
|
|
|
|
2012-04-02 16:56:55 -04:00
|
|
|
/**
|
|
|
|
* Current Tab Widget object
|
2012-04-19 21:55:44 -04:00
|
|
|
*
|
2012-04-02 16:56:55 -04:00
|
|
|
* @var DB_Tabs
|
|
|
|
*/
|
2012-03-29 16:26:50 -04:00
|
|
|
private static $instance;
|
2012-04-19 12:29:47 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Db Data cache
|
2012-04-19 21:55:44 -04:00
|
|
|
*
|
|
|
|
* @var array
|
2012-04-19 12:29:47 -04:00
|
|
|
*/
|
2012-04-10 15:42:12 -04:00
|
|
|
private $data;
|
2012-03-29 16:26:50 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the db tabs object if it exists, or create and return
|
|
|
|
*
|
|
|
|
* @return DB_tabs
|
|
|
|
*/
|
|
|
|
public static function &get_instance()
|
|
|
|
{
|
|
|
|
if (empty(self::$instance))
|
|
|
|
{
|
|
|
|
self::$instance = new DB_tabs();
|
|
|
|
}
|
|
|
|
|
|
|
|
return self::$instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
2012-03-28 16:10:39 -04:00
|
|
|
/**
|
|
|
|
* Create the object
|
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
parent::__construct();
|
2012-04-10 15:42:12 -04:00
|
|
|
$this->data = new StdClass();
|
2012-03-28 16:10:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a new tab with the provided label
|
|
|
|
*
|
|
|
|
* @param string $label
|
|
|
|
* @param GObject $widget
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function add_tab($label, $widget = NULL)
|
|
|
|
{
|
|
|
|
if (is_null($widget))
|
|
|
|
{
|
|
|
|
$widget = new Data_Grid();
|
|
|
|
}
|
|
|
|
|
2012-05-29 14:29:20 -04:00
|
|
|
//$this->append_page($widget, new GtkLabel($label));
|
2012-04-11 11:16:44 -04:00
|
|
|
}
|
2012-03-28 16:10:39 -04:00
|
|
|
}
|
2012-05-14 13:25:32 -04:00
|
|
|
// End of db_tabs.php
|