/****************************************************************************
** Form implementation generated from reading ui file 'tobrowsertableui.ui'
**
** Created: Tue Sep 18 08:21:21 2007
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.8   edited Jan 11 14:47 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "tobrowsertableui.h"

#include <qvariant.h>
#include <qscrollview.h>
#include <qpushbutton.h>
#include <qtoolbutton.h>
#include <qtabwidget.h>
#include <qwidget.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qcombobox.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>

#include "toresultcombo.h"
#include "tohighlightedtext.h"
#include "qscrollview.h"
static const char* const image0_data[] = { 
"16 16 14 1",
". c None",
"# c #000000",
"i c #181841",
"e c #20205a",
"k c #202462",
"c c #292873",
"l c #292c7b",
"h c #313083",
"b c #393cac",
"d c #4140b4",
"f c #4a4ccd",
"j c #5a59f6",
"g c #5a5df6",
"a c #5a5dff",
"................",
".###..###..##...",
"#..#.#..#..#....",
"##...#...#.#....",
"..#..#####.#....",
"...#.#aab#.#....",
"#..##cdaef##..#.",
".##.#ghiha#####.",
"....#aajkl#.....",
".....#aaa#......",
"......#####.....",
".........###....",
"..........###...",
"...........##...",
"................",
"................"};

static const char* const image1_data[] = { 
"16 16 3 1",
". c None",
"# c #000000",
"a c #00ff00",
"..........###...",
"..........#a#...",
"..........#a#...",
".......####a####",
".......#aaaaaaa#",
".......####a####",
"..........#a#...",
"..........#a#...",
"..........###...",
"................",
"................",
"................",
"................",
"................",
"................",
"................"};

static const char* const image2_data[] = { 
"16 16 3 1",
". c None",
"# c #000000",
"a c #ff0000",
"................",
"................",
"................",
".......#########",
".......#aaaaaaa#",
".......#########",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................",
"................"};


/*
 *  Constructs a toBrowserTableUI as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
toBrowserTableUI::toBrowserTableUI( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl ),
      image0( (const char **) image0_data ),
      image1( (const char **) image1_data ),
      image2( (const char **) image2_data )
{
    if ( !name )
	setName( "toBrowserTableUI" );
    toBrowserTableUILayout = new QGridLayout( this, 1, 1, 11, 6, "toBrowserTableUILayout"); 

    PushButton1 = new QPushButton( this, "PushButton1" );
    PushButton1->setDefault( TRUE );

    toBrowserTableUILayout->addWidget( PushButton1, 1, 2 );

    PushButton2 = new QPushButton( this, "PushButton2" );

    toBrowserTableUILayout->addWidget( PushButton2, 1, 3 );

    ToolButton1 = new QToolButton( this, "ToolButton1" );
    ToolButton1->setFocusPolicy( QToolButton::StrongFocus );
    ToolButton1->setPixmap( image0 );

    toBrowserTableUILayout->addWidget( ToolButton1, 1, 0 );
    Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    toBrowserTableUILayout->addItem( Spacer1, 1, 1 );

    Tabs = new QTabWidget( this, "Tabs" );

    tab = new QWidget( Tabs, "tab" );
    tabLayout = new QVBoxLayout( tab, 11, 6, "tabLayout"); 

    SchemaLabel = new QLabel( tab, "SchemaLabel" );
    tabLayout->addWidget( SchemaLabel );

    Schema = new toResultCombo( tab, "Schema" );
    tabLayout->addWidget( Schema );

    TextLabel1 = new QLabel( tab, "TextLabel1" );
    tabLayout->addWidget( TextLabel1 );

    Name = new QLineEdit( tab, "Name" );
    tabLayout->addWidget( Name );

    TextLabel1_3 = new QLabel( tab, "TextLabel1_3" );
    tabLayout->addWidget( TextLabel1_3 );

    Comment = new QLineEdit( tab, "Comment" );
    tabLayout->addWidget( Comment );

    TablespaceLabel = new QLabel( tab, "TablespaceLabel" );
    tabLayout->addWidget( TablespaceLabel );

    Tablespace = new QComboBox( FALSE, tab, "Tablespace" );
    tabLayout->addWidget( Tablespace );

    TextLabel1_3_2 = new QLabel( tab, "TextLabel1_3_2" );
    tabLayout->addWidget( TextLabel1_3_2 );

    ExtraDeclarations = new toHighlightedText( tab, "ExtraDeclarations" );
    ExtraDeclarations->setFocusPolicy( toHighlightedText::WheelFocus );
    tabLayout->addWidget( ExtraDeclarations );

    TextLabel1_3_2_2 = new QLabel( tab, "TextLabel1_3_2_2" );
    tabLayout->addWidget( TextLabel1_3_2_2 );

    StorageDeclarations = new toHighlightedText( tab, "StorageDeclarations" );
    StorageDeclarations->setFocusPolicy( toHighlightedText::WheelFocus );
    tabLayout->addWidget( StorageDeclarations );

    ParallelLabel = new QLabel( tab, "ParallelLabel" );
    tabLayout->addWidget( ParallelLabel );

    ParallelDeclarations = new toHighlightedText( tab, "ParallelDeclarations" );
    ParallelDeclarations->setFocusPolicy( toHighlightedText::WheelFocus );
    tabLayout->addWidget( ParallelDeclarations );
    Tabs->insertTab( tab, QString::fromLatin1("") );

    ColumnTab = new QWidget( Tabs, "ColumnTab" );
    ColumnTabLayout = new QGridLayout( ColumnTab, 1, 1, 11, 6, "ColumnTabLayout"); 

    ColumnList = new QScrollView( ColumnTab, "ColumnList" );
    ColumnList->setFocusPolicy( QScrollView::StrongFocus );

    ColumnTabLayout->addMultiCellWidget( ColumnList, 1, 1, 0, 3 );

    AddColumn = new QToolButton( ColumnTab, "AddColumn" );
    AddColumn->setFocusPolicy( QToolButton::TabFocus );
    AddColumn->setPixmap( image1 );

    ColumnTabLayout->addWidget( AddColumn, 0, 2 );

    RemoveColumn = new QToolButton( ColumnTab, "RemoveColumn" );
    RemoveColumn->setFocusPolicy( QToolButton::TabFocus );
    RemoveColumn->setPixmap( image2 );

    ColumnTabLayout->addWidget( RemoveColumn, 0, 3 );
    spacer3 = new QSpacerItem( 340, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
    ColumnTabLayout->addItem( spacer3, 0, 1 );

    CustomDeclarations = new QCheckBox( ColumnTab, "CustomDeclarations" );

    ColumnTabLayout->addWidget( CustomDeclarations, 0, 0 );
    Tabs->insertTab( ColumnTab, QString::fromLatin1("") );

    toBrowserTableUILayout->addMultiCellWidget( Tabs, 0, 0, 0, 3 );
    languageChange();
    resize( QSize(651, 561).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( PushButton1, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( PushButton2, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( ToolButton1, SIGNAL( clicked() ), this, SLOT( displaySQL() ) );
    connect( AddColumn, SIGNAL( clicked() ), this, SLOT( addColumn() ) );
    connect( RemoveColumn, SIGNAL( clicked() ), this, SLOT( removeColumn() ) );
    connect( CustomDeclarations, SIGNAL( toggled(bool) ), this, SLOT( toggleCustom(bool) ) );

    // tab order
    setTabOrder( Tabs, Name );
    setTabOrder( Name, Comment );
    setTabOrder( Comment, Tablespace );
    setTabOrder( Tablespace, ExtraDeclarations );
    setTabOrder( ExtraDeclarations, ToolButton1 );
    setTabOrder( ToolButton1, PushButton1 );
    setTabOrder( PushButton1, PushButton2 );
    setTabOrder( PushButton2, AddColumn );
    setTabOrder( AddColumn, RemoveColumn );
    setTabOrder( RemoveColumn, ColumnList );

    // buddies
    SchemaLabel->setBuddy( Name );
    TextLabel1->setBuddy( Name );
    TextLabel1_3->setBuddy( Comment );
    TablespaceLabel->setBuddy( Tablespace );
    TextLabel1_3_2->setBuddy( ExtraDeclarations );
    TextLabel1_3_2_2->setBuddy( StorageDeclarations );
    ParallelLabel->setBuddy( ParallelDeclarations );
}

/*
 *  Destroys the object and frees any allocated resources
 */
toBrowserTableUI::~toBrowserTableUI()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void toBrowserTableUI::languageChange()
{
    setCaption( tr( "Table columns" ) );
    PushButton1->setText( tr( "&Ok" ) );
    PushButton2->setText( tr( "Cancel" ) );
    ToolButton1->setText( QString::null );
    QToolTip::add( ToolButton1, tr( "Display SQL to create this constraint" ) );
    SchemaLabel->setText( tr( "&Schema" ) );
    TextLabel1->setText( tr( "&Name" ) );
    TextLabel1_3->setText( tr( "C&omment" ) );
    TablespaceLabel->setText( tr( "&Tablespace" ) );
    TextLabel1_3_2->setText( tr( "&Extra declarations" ) );
    TextLabel1_3_2_2->setText( tr( "&Storage declarations" ) );
    ParallelLabel->setText( tr( "&Parallel declarations" ) );
    Tabs->changeTab( tab, tr( "&General" ) );
    AddColumn->setText( QString::null );
    RemoveColumn->setText( QString::null );
    CustomDeclarations->setText( tr( "Custom column declarations" ) );
    Tabs->changeTab( ColumnTab, tr( "&Columns" ) );
}

void toBrowserTableUI::displaySQL()
{
    qWarning( "toBrowserTableUI::displaySQL(): Not implemented yet" );
}

void toBrowserTableUI::addColumn()
{
    qWarning( "toBrowserTableUI::addColumn(): Not implemented yet" );
}

void toBrowserTableUI::removeColumn()
{
    qWarning( "toBrowserTableUI::removeColumn(): Not implemented yet" );
}

void toBrowserTableUI::toggleCustom(bool)
{
    qWarning( "toBrowserTableUI::toggleCustom(bool): Not implemented yet" );
}

