OpenSQLManager/sys/windows/db_table_data.php

60 lines
1.2 KiB
PHP
Raw Normal View History

<?php
/**
* OpenSQLManager
*
* Free Database manager for Open Source Databases
*
* @author Timothy J. Warren
* @copyright Copyright (c) 2012
* @link https://github.com/aviat4ion/OpenSQLManager
* @license http://philsturgeon.co.uk/code/dbad-license
*/
// --------------------------------------------------------------------------
/**
* Popup window to display database table data
*/
class DB_Table_Data extends GTKWindow {
2012-04-19 12:29:47 -04:00
/**
* Reference to the scrolled window
2012-04-19 21:55:44 -04:00
*
* @var GtkScrolledWindow
2012-04-19 12:29:47 -04:00
*/
protected $win;
2012-04-19 12:29:47 -04:00
/**
* Create and populate the window
*
* @param array $data
* @return void
*/
public function __construct($data)
{
parent::__construct();
$this->set_title("Table Data");
$this->set_position(Gtk::WIN_POS_CENTER_ALWAYS);
$this->set_destroy_with_parent(TRUE);
2012-04-11 14:57:38 -04:00
// Add the scrolled window
$this->win = new GTKScrolledWindow();
$this->win->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
$this->add($this->win);
// Resize to a sane size
$this->set_size_request(640, 480);
2012-04-11 14:57:38 -04:00
// Layout the widgets
$view = new Data_Grid();
$view->render_data($data);
// Add the grid to the window
$this->win->add_with_viewport($view);
2012-04-11 14:57:38 -04:00
// Show everything
$this->show_all();
}
}