/****************************************************************************
** Form implementation generated from reading ui file 'tableeditor.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "tableeditor.h"

#include <ntqvariant.h>
#include <ntqtable.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqwidget.h>
#include <ntqlistbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

/*
 *  Constructs a TableEditorBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
TableEditorBase::TableEditorBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "TableEditorBase" );
    setSizeGripEnabled( true );
    TableEditorBaseLayout = new TQGridLayout( this, 1, 1, 11, 6, "TableEditorBaseLayout"); 

    table = new TQTable( this, "table" );
    table->setNumRows( 1 );
    table->setNumCols( 1 );
    table->setReadOnly( true );

    TableEditorBaseLayout->addWidget( table, 0, 0 );

    Layout11 = new TQHBoxLayout( 0, 0, 6, "Layout11"); 

    buttonHelp = new TQPushButton( this, "buttonHelp" );
    buttonHelp->setAutoDefault( true );
    Layout11->addWidget( buttonHelp );
    Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout11->addItem( Horizontal_Spacing2 );

    buttonApply = new TQPushButton( this, "buttonApply" );
    buttonApply->setAutoDefault( true );
    Layout11->addWidget( buttonApply );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( true );
    buttonOk->setDefault( true );
    Layout11->addWidget( buttonOk );

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( true );
    Layout11->addWidget( buttonCancel );

    TableEditorBaseLayout->addMultiCellLayout( Layout11, 1, 1, 0, 1 );

    TabWidget = new TQTabWidget( this, "TabWidget" );

    columns_tab = new TQWidget( TabWidget, "columns_tab" );
    columns_tabLayout = new TQGridLayout( columns_tab, 1, 1, 11, 6, "columns_tabLayout"); 
    Spacer3 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    columns_tabLayout->addItem( Spacer3, 4, 2 );

    listColumns = new TQListBox( columns_tab, "listColumns" );

    columns_tabLayout->addMultiCellWidget( listColumns, 0, 5, 0, 0 );
    Spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    columns_tabLayout->addItem( Spacer2, 3, 1 );

    buttonColumnUp = new TQPushButton( columns_tab, "buttonColumnUp" );
    buttonColumnUp->setPixmap( TQPixmap::fromMimeSource( "designer_s_up.png" ) );

    columns_tabLayout->addWidget( buttonColumnUp, 4, 1 );

    buttonColumnDown = new TQPushButton( columns_tab, "buttonColumnDown" );
    buttonColumnDown->setPixmap( TQPixmap::fromMimeSource( "designer_s_down.png" ) );

    columns_tabLayout->addWidget( buttonColumnDown, 5, 1 );

    buttonDeleteColumn = new TQPushButton( columns_tab, "buttonDeleteColumn" );

    columns_tabLayout->addWidget( buttonDeleteColumn, 1, 1 );

    buttonNewColumn = new TQPushButton( columns_tab, "buttonNewColumn" );

    columns_tabLayout->addWidget( buttonNewColumn, 0, 1 );

    Layout6 = new TQGridLayout( 0, 1, 1, 0, 6, "Layout6"); 

    labelTable = new TQLabel( columns_tab, "labelTable" );

    Layout6->addWidget( labelTable, 0, 0 );

    Layout2 = new TQHBoxLayout( 0, 0, 6, "Layout2"); 

    labelColumnPixmap = new TQLabel( columns_tab, "labelColumnPixmap" );
    Layout2->addWidget( labelColumnPixmap );

    buttonDeleteColPixmap = new TQPushButton( columns_tab, "buttonDeleteColPixmap" );
    buttonDeleteColPixmap->setMaximumSize( TQSize( 30, 22 ) );
    buttonDeleteColPixmap->setPixmap( TQPixmap::fromMimeSource( "designer_s_editcut.png" ) );
    Layout2->addWidget( buttonDeleteColPixmap );

    buttonChooseColPixmap = new TQPushButton( columns_tab, "buttonChooseColPixmap" );
    buttonChooseColPixmap->setMaximumSize( TQSize( 30, 22 ) );
    Layout2->addWidget( buttonChooseColPixmap );

    Layout6->addLayout( Layout2, 3, 1 );

    TextLabel2 = new TQLabel( columns_tab, "TextLabel2" );

    Layout6->addWidget( TextLabel2, 2, 0 );

    Label2 = new TQLabel( columns_tab, "Label2" );

    Layout6->addWidget( Label2, 3, 0 );

    labelFields = new TQLabel( columns_tab, "labelFields" );

    Layout6->addWidget( labelFields, 1, 0 );

    editColumnText = new TQLineEdit( columns_tab, "editColumnText" );

    Layout6->addWidget( editColumnText, 2, 1 );

    comboFields = new TQComboBox( false, columns_tab, "comboFields" );
    comboFields->setEditable( true );

    Layout6->addWidget( comboFields, 1, 1 );

    labelTableValue = new TQLabel( columns_tab, "labelTableValue" );

    Layout6->addWidget( labelTableValue, 0, 1 );

    columns_tabLayout->addMultiCellLayout( Layout6, 2, 2, 1, 2 );
    TabWidget->insertTab( columns_tab, TQString::fromLatin1("") );

    rows_tab = new TQWidget( TabWidget, "rows_tab" );
    rows_tabLayout = new TQGridLayout( rows_tab, 1, 1, 11, 6, "rows_tabLayout"); 
    Spacer3_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    rows_tabLayout->addItem( Spacer3_2, 4, 2 );

    buttonRowUp = new TQPushButton( rows_tab, "buttonRowUp" );
    buttonRowUp->setPixmap( TQPixmap::fromMimeSource( "designer_s_up.png" ) );

    rows_tabLayout->addWidget( buttonRowUp, 4, 1 );

    listRows = new TQListBox( rows_tab, "listRows" );

    rows_tabLayout->addMultiCellWidget( listRows, 0, 5, 0, 0 );

    buttonRowDown = new TQPushButton( rows_tab, "buttonRowDown" );
    buttonRowDown->setPixmap( TQPixmap::fromMimeSource( "designer_s_down.png" ) );

    rows_tabLayout->addWidget( buttonRowDown, 5, 1 );
    Spacer2_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    rows_tabLayout->addItem( Spacer2_2, 3, 1 );

    buttonNewRow = new TQPushButton( rows_tab, "buttonNewRow" );

    rows_tabLayout->addWidget( buttonNewRow, 0, 1 );

    buttonDeleteRow = new TQPushButton( rows_tab, "buttonDeleteRow" );

    rows_tabLayout->addWidget( buttonDeleteRow, 1, 1 );

    Layout7_2 = new TQGridLayout( 0, 1, 1, 0, 6, "Layout7_2"); 

    TextLabel2_3 = new TQLabel( rows_tab, "TextLabel2_3" );

    Layout7_2->addWidget( TextLabel2_3, 0, 0 );

    Label2_2 = new TQLabel( rows_tab, "Label2_2" );

    Layout7_2->addWidget( Label2_2, 1, 0 );

    Layout2_2 = new TQHBoxLayout( 0, 0, 6, "Layout2_2"); 

    labelRowPixmap = new TQLabel( rows_tab, "labelRowPixmap" );
    Layout2_2->addWidget( labelRowPixmap );

    buttonDeleteRowPixmap = new TQPushButton( rows_tab, "buttonDeleteRowPixmap" );
    buttonDeleteRowPixmap->setMaximumSize( TQSize( 30, 22 ) );
    buttonDeleteRowPixmap->setPixmap( TQPixmap::fromMimeSource( "designer_s_editcut.png" ) );
    Layout2_2->addWidget( buttonDeleteRowPixmap );

    buttonChooseRowPixmap = new TQPushButton( rows_tab, "buttonChooseRowPixmap" );
    buttonChooseRowPixmap->setMaximumSize( TQSize( 30, 22 ) );
    Layout2_2->addWidget( buttonChooseRowPixmap );

    Layout7_2->addLayout( Layout2_2, 1, 1 );

    editRowText = new TQLineEdit( rows_tab, "editRowText" );

    Layout7_2->addWidget( editRowText, 0, 1 );

    rows_tabLayout->addMultiCellLayout( Layout7_2, 2, 2, 1, 2 );
    TabWidget->insertTab( rows_tab, TQString::fromLatin1("") );

    TableEditorBaseLayout->addWidget( TabWidget, 0, 1 );
    languageChange();
    resize( TQSize(484, 406).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonApply, TQ_SIGNAL( clicked() ), this, TQ_SLOT( applyClicked() ) );
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( okClicked() ) );
    connect( listColumns, TQ_SIGNAL( currentChanged(TQListBoxItem*) ), this, TQ_SLOT( currentColumnChanged(TQListBoxItem*) ) );
    connect( listColumns, TQ_SIGNAL( selectionChanged(TQListBoxItem*) ), this, TQ_SLOT( currentColumnChanged(TQListBoxItem*) ) );
    connect( editColumnText, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( columnTextChanged(const TQString&) ) );
    connect( buttonNewColumn, TQ_SIGNAL( clicked() ), this, TQ_SLOT( newColumnClicked() ) );
    connect( buttonDeleteColumn, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteColumnClicked() ) );
    connect( buttonColumnUp, TQ_SIGNAL( clicked() ), this, TQ_SLOT( columnUpClicked() ) );
    connect( buttonColumnDown, TQ_SIGNAL( clicked() ), this, TQ_SLOT( columnDownClicked() ) );
    connect( comboFields, TQ_SIGNAL( activated(const TQString&) ), this, TQ_SLOT( currentFieldChanged(const TQString&) ) );
    connect( listRows, TQ_SIGNAL( selectionChanged(TQListBoxItem*) ), this, TQ_SLOT( currentRowChanged(TQListBoxItem*) ) );
    connect( listRows, TQ_SIGNAL( currentChanged(TQListBoxItem*) ), this, TQ_SLOT( currentRowChanged(TQListBoxItem*) ) );
    connect( buttonNewRow, TQ_SIGNAL( clicked() ), this, TQ_SLOT( newRowClicked() ) );
    connect( buttonDeleteRow, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteRowClicked() ) );
    connect( buttonRowUp, TQ_SIGNAL( clicked() ), this, TQ_SLOT( rowUpClicked() ) );
    connect( buttonRowDown, TQ_SIGNAL( clicked() ), this, TQ_SLOT( rowDownClicked() ) );
    connect( buttonChooseRowPixmap, TQ_SIGNAL( clicked() ), this, TQ_SLOT( chooseRowPixmapClicked() ) );
    connect( buttonDeleteColPixmap, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteColPixmapClicked() ) );
    connect( editRowText, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( rowTextChanged(const TQString&) ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( buttonChooseColPixmap, TQ_SIGNAL( clicked() ), this, TQ_SLOT( chooseColPixmapClicked() ) );
    connect( buttonDeleteRowPixmap, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteRowPixmapClicked() ) );

    // tab order
    setTabOrder( buttonOk, buttonCancel );
    setTabOrder( buttonCancel, table );
    setTabOrder( table, TabWidget );
    setTabOrder( TabWidget, listColumns );
    setTabOrder( listColumns, buttonNewColumn );
    setTabOrder( buttonNewColumn, buttonDeleteColumn );
    setTabOrder( buttonDeleteColumn, comboFields );
    setTabOrder( comboFields, editColumnText );
    setTabOrder( editColumnText, buttonDeleteColPixmap );
    setTabOrder( buttonDeleteColPixmap, buttonChooseColPixmap );
    setTabOrder( buttonChooseColPixmap, buttonColumnUp );
    setTabOrder( buttonColumnUp, buttonColumnDown );
    setTabOrder( buttonColumnDown, buttonApply );
    setTabOrder( buttonApply, listRows );
    setTabOrder( listRows, buttonNewRow );
    setTabOrder( buttonNewRow, buttonDeleteRow );
    setTabOrder( buttonDeleteRow, editRowText );
    setTabOrder( editRowText, buttonDeleteRowPixmap );
    setTabOrder( buttonDeleteRowPixmap, buttonChooseRowPixmap );
    setTabOrder( buttonChooseRowPixmap, buttonRowUp );
    setTabOrder( buttonRowUp, buttonRowDown );
    setTabOrder( buttonRowDown, buttonHelp );

    // buddies
    TextLabel2->setBuddy( editColumnText );
    labelFields->setBuddy( comboFields );
    TextLabel2_3->setBuddy( editRowText );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void TableEditorBase::languageChange()
{
    setCaption( tr( "Edit Table" ) );
    buttonHelp->setText( tr( "&Help" ) );
    buttonApply->setText( tr( "&Apply" ) );
    TQWhatsThis::add( buttonApply, tr( "Apply all changes." ) );
    buttonOk->setText( tr( "&OK" ) );
    TQWhatsThis::add( buttonOk, tr( "Close the dialog and apply all the changes." ) );
    buttonCancel->setText( tr( "&Cancel" ) );
    TQWhatsThis::add( buttonCancel, tr( "Close the dialog and discard any changes." ) );
    buttonColumnUp->setText( TQString::null );
    TQToolTip::add( buttonColumnUp, tr( "Move up" ) );
    TQWhatsThis::add( buttonColumnUp, tr( "<b>Move the selected item up.</b><p>The top-most column will be the first column of the list.</p>" ) );
    buttonColumnDown->setText( TQString::null );
    TQToolTip::add( buttonColumnDown, tr( "Move down" ) );
    TQWhatsThis::add( buttonColumnDown, tr( "<b>Move the selected item down.</b><p>The top-most column will be the first column of the list.</p>" ) );
    buttonDeleteColumn->setText( tr( "&Delete Column" ) );
    buttonNewColumn->setText( tr( "&New Column" ) );
    labelTable->setText( tr( "Table:" ) );
    labelColumnPixmap->setText( tr( "Label4" ) );
    buttonDeleteColPixmap->setText( TQString::null );
    TQToolTip::add( buttonDeleteColPixmap, tr( "Delete Pixmap" ) );
    TQWhatsThis::add( buttonDeleteColPixmap, tr( "<b>Delete the selected item's pixmap.</b><p>The pixmap in the current column of the selected item will be deleted.</p>" ) );
    buttonChooseColPixmap->setText( tr( "..." ) );
    TQToolTip::add( buttonChooseColPixmap, tr( "Select a Pixmap" ) );
    TQWhatsThis::add( buttonChooseColPixmap, tr( "<b>Select a pixmap file for the item.</b><p>The pixmap will be changed in the current column of the selected item.</p>" ) );
    TextLabel2->setText( tr( "&Label:" ) );
    Label2->setText( tr( "Pixmap:" ) );
    labelFields->setText( tr( "&Field:" ) );
    labelTableValue->setText( tr( "<no table>" ) );
    TabWidget->changeTab( columns_tab, tr( "Co&lumns" ) );
    buttonRowUp->setText( TQString::null );
    TQToolTip::add( buttonRowUp, tr( "Move up" ) );
    TQWhatsThis::add( buttonRowUp, tr( "<b>Move the selected item up.</b><p>The top-most column will be the first column of the list.</p>" ) );
    buttonRowDown->setText( TQString::null );
    TQToolTip::add( buttonRowDown, tr( "Move down" ) );
    TQWhatsThis::add( buttonRowDown, tr( "<b>Move the selected item down.</b><p>The top-most column will be the first column of the list.</p>" ) );
    buttonNewRow->setText( tr( "&New Row" ) );
    buttonDeleteRow->setText( tr( "&Delete Row" ) );
    TextLabel2_3->setText( tr( "&Label:" ) );
    Label2_2->setText( tr( "Pixmap:" ) );
    labelRowPixmap->setText( tr( "Label4" ) );
    buttonDeleteRowPixmap->setText( TQString::null );
    TQToolTip::add( buttonDeleteRowPixmap, tr( "Delete Pixmap" ) );
    TQWhatsThis::add( buttonDeleteRowPixmap, tr( "<b>Delete the selected item's pixmap.</b><p>The pixmap in the current column of the selected item will be deleted.</p>" ) );
    buttonChooseRowPixmap->setText( tr( "..." ) );
    TQToolTip::add( buttonChooseRowPixmap, tr( "Select a Pixmap" ) );
    TQWhatsThis::add( buttonChooseRowPixmap, tr( "<b>Select a pixmap file for the item.</b><p>The pixmap will be changed in the current column of the selected item.</p>" ) );
    TabWidget->changeTab( rows_tab, tr( "&Rows" ) );
}

void TableEditorBase::init()
{
}

void TableEditorBase::destroy()
{
}

void TableEditorBase::applyClicked()
{
    tqWarning( "TableEditorBase::applyClicked(): Not implemented yet" );
}

void TableEditorBase::chooseRowPixmapClicked()
{
    tqWarning( "TableEditorBase::chooseRowPixmapClicked(): Not implemented yet" );
}

void TableEditorBase::columnTextChanged(const TQString&)
{
    tqWarning( "TableEditorBase::columnTextChanged(const TQString&): Not implemented yet" );
}

void TableEditorBase::columnUpClicked()
{
    tqWarning( "TableEditorBase::columnUpClicked(): Not implemented yet" );
}

void TableEditorBase::currentColumnChanged(TQListBoxItem*)
{
    tqWarning( "TableEditorBase::currentColumnChanged(TQListBoxItem*): Not implemented yet" );
}

void TableEditorBase::currentFieldChanged(const TQString&)
{
    tqWarning( "TableEditorBase::currentFieldChanged(const TQString&): Not implemented yet" );
}

void TableEditorBase::currentRowChanged(TQListBoxItem*)
{
    tqWarning( "TableEditorBase::currentRowChanged(TQListBoxItem*): Not implemented yet" );
}

void TableEditorBase::deleteColPixmapClicked()
{
    tqWarning( "TableEditorBase::deleteColPixmapClicked(): Not implemented yet" );
}

void TableEditorBase::deleteColumnClicked()
{
    tqWarning( "TableEditorBase::deleteColumnClicked(): Not implemented yet" );
}

void TableEditorBase::deleteRowClicked()
{
    tqWarning( "TableEditorBase::deleteRowClicked(): Not implemented yet" );
}

void TableEditorBase::deleteRowPixmapClicked()
{
    tqWarning( "TableEditorBase::deleteRowPixmapClicked(): Not implemented yet" );
}

void TableEditorBase::newColumnClicked()
{
    tqWarning( "TableEditorBase::newColumnClicked(): Not implemented yet" );
}

void TableEditorBase::newRowClicked()
{
    tqWarning( "TableEditorBase::newRowClicked(): Not implemented yet" );
}

void TableEditorBase::chooseColPixmapClicked()
{
    tqWarning( "TableEditorBase::chooseColPixmapClicked(): Not implemented yet" );
}

void TableEditorBase::okClicked()
{
    tqWarning( "TableEditorBase::okClicked(): Not implemented yet" );
}

void TableEditorBase::rowDownClicked()
{
    tqWarning( "TableEditorBase::rowDownClicked(): Not implemented yet" );
}

void TableEditorBase::rowTextChanged(const TQString&)
{
    tqWarning( "TableEditorBase::rowTextChanged(const TQString&): Not implemented yet" );
}

void TableEditorBase::rowUpClicked()
{
    tqWarning( "TableEditorBase::rowUpClicked(): Not implemented yet" );
}

void TableEditorBase::columnDownClicked()
{
    tqWarning( "TableEditorBase::columnDownClicked(): Not implemented yet" );
}

