Various Improvements

This commit is contained in:
Timothy Warren 2012-01-30 11:22:44 -05:00
parent 6e4d7aa735
commit c6da8310d9
2 changed files with 45 additions and 4 deletions

View File

@ -26,7 +26,7 @@ class DB_PDO extends PDO {
parent::__construct($dsn, $username, $password, $driver_options);
}
// --------------------------------------------------------------------------
// -------------------------------------------------------------------------
/**
* PHP magic method to facilitate dynamic methods
@ -46,7 +46,7 @@ class DB_PDO extends PDO {
}
}
// --------------------------------------------------------------------------
// -------------------------------------------------------------------------
/**
* PHP magic methods to call non-static methods statically
@ -62,7 +62,7 @@ class DB_PDO extends PDO {
}
}
// --------------------------------------------------------------------------
// -------------------------------------------------------------------------
/**
* Simplifies prepared statements for database queries

View File

@ -53,6 +53,12 @@ class Main extends GtkWindow {
// Add the menubar
$main_vbox->pack_start($this->_create_menu(), FALSE, FALSE);
// Add the toolbar
//$main_vbox->pack_start($this->_create_toolbar(), FALSE, FALSE);
// Add the info box
$main_vbox->pack_start($this->_create_infobox(), FALSE, FALSE);
// Add the main interface area hbox
$main_vbox->pack_start($main_hbox, FALSE, FALSE);
@ -61,6 +67,23 @@ class Main extends GtkWindow {
$this->show_all();
}
/**
* Create the main toolbar
*
* @return GtkToolBar
*/
private function _create_toolbar()
{
$tbar = new GtkToolBar();
$open = new GtkToolButton();
$open->set_stock_id(Gtk::STOCK_OPEN);
$tbar->insert($open);
return $tbar;
}
/**
* Create the menu for the program
*
@ -84,6 +107,10 @@ class Main extends GtkWindow {
//File Menu
{
//Set up the open item
$open = new GtkImageMenuItem(GTK::STOCK_OPEN);
$file_menu->append($open);
//Set up the quit item
$quit = new GtkImageMenuItem(GTK::STOCK_QUIT);
$quit->connect_simple('activate', array($this, 'quit'));
@ -108,6 +135,21 @@ class Main extends GtkWindow {
return $menu_bar;
}
/**
* Display Info box for errors/message
*/
function _create_infobox()
{
$this->infobar = new GtkInfoBar();
$this->messagelabel = new GtkLabel('Welcome to OpenSQLManager!');
$contentarea = $this->infobar->get_content_area();
$contentarea->add($this->messagelabel);
$this->infobar->add_button(GTK::STOCK_OK, GTK::RESPONSE_OK);
$this->infobar->connect_simple('response', array($this->infobar, 'hide'));
return ($this->infobar);
}
/**
* Display About menu with version information
*/
@ -135,7 +177,6 @@ class Main extends GtkWindow {
{
Gtk::main_quit();
}
}
// End of main.php