This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
OpenSQLManager/sys/widgets/db_tabs.php

94 lines
1.8 KiB
PHP
Raw Normal View History

<?php
/**
* OpenSQLManager
*
* Free Database manager for Open Source Databases
*
2012-04-20 13:30:27 -04:00
* @package OpenSQLManager
* @author Timothy J. Warren
* @copyright Copyright (c) 2012
* @link https://github.com/aviat4ion/OpenSQLManager
2012-11-27 09:47:27 -05:00
* @license https://timshomepage.net/dbaj.txt
*/
// --------------------------------------------------------------------------
2012-05-29 14:29:20 -04:00
namespace OpenSQLManager;
/**
* Tabbed Container for database properties
2012-04-20 13:30:27 -04:00
*
* @package OpenSQLManager
* @subpackage Widgets
*/
class DB_tabs extends \wxAUINotebook {
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;
/**
* Reference to parent
*
* @var wxWindow
*/
private $parent;
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($parent)
2012-03-29 16:26:50 -04:00
{
if (empty(self::$instance))
{
self::$instance = new DB_tabs($parent);
2012-03-29 16:26:50 -04:00
}
return self::$instance;
}
// --------------------------------------------------------------------------
/**
* Create the object
*/
public function __construct($parent)
{
parent::__construct($parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_CLOSE_ON_ALL_TABS | wxAUI_NB_WINDOWLIST_BUTTON);
$this->parent = $parent;
$this->data = new \StdClass();
}
// --------------------------------------------------------------------------
/**
* 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($this);
}
$this->AddPage($widget, $label);
}
}
2012-05-14 13:25:32 -04:00
// End of db_tabs.php