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

#include "listboxeditor.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqlistbox.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include <ntqimage.h>
#include <ntqpixmap.h>

/*
 *  Constructs a ListBoxEditorBase 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.
 */
ListBoxEditorBase::ListBoxEditorBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "ListBoxEditorBase" );
    setSizeGripEnabled( true );
    ListBoxEditorBaseLayout = new TQGridLayout( this, 1, 1, 11, 6, "ListBoxEditorBaseLayout"); 

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

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

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

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

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

    ListBoxEditorBaseLayout->addMultiCellLayout( Layout1, 5, 5, 0, 2 );

    preview = new TQListBox( this, "preview" );

    ListBoxEditorBaseLayout->addMultiCellWidget( preview, 0, 4, 0, 0 );

    GroupBox1 = new TQGroupBox( this, "GroupBox1" );
    GroupBox1->setColumnLayout(0, TQt::Vertical );
    GroupBox1->layout()->setSpacing( 6 );
    GroupBox1->layout()->setMargin( 11 );
    GroupBox1Layout = new TQGridLayout( GroupBox1->layout() );
    GroupBox1Layout->setAlignment( TQt::AlignTop );

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

    GroupBox1Layout->addWidget( Label2, 1, 0 );

    itemPixmap = new TQLabel( GroupBox1, "itemPixmap" );

    GroupBox1Layout->addWidget( itemPixmap, 1, 1 );

    itemDeletePixmap = new TQPushButton( GroupBox1, "itemDeletePixmap" );
    itemDeletePixmap->setMaximumSize( TQSize( 30, 22 ) );
    itemDeletePixmap->setPixmap( TQPixmap::fromMimeSource( "designer_s_editcut.png" ) );

    GroupBox1Layout->addWidget( itemDeletePixmap, 1, 2 );

    itemChoosePixmap = new TQPushButton( GroupBox1, "itemChoosePixmap" );
    itemChoosePixmap->setMaximumSize( TQSize( 30, 22 ) );

    GroupBox1Layout->addWidget( itemChoosePixmap, 1, 3 );

    Label1 = new TQLabel( GroupBox1, "Label1" );

    GroupBox1Layout->addWidget( Label1, 0, 0 );

    itemText = new TQLineEdit( GroupBox1, "itemText" );
    itemText->setMinimumSize( TQSize( 0, 0 ) );

    GroupBox1Layout->addMultiCellWidget( itemText, 0, 0, 1, 3 );

    ListBoxEditorBaseLayout->addMultiCellWidget( GroupBox1, 0, 4, 2, 2 );

    itemNew = new TQPushButton( this, "itemNew" );

    ListBoxEditorBaseLayout->addWidget( itemNew, 0, 1 );

    itemDelete = new TQPushButton( this, "itemDelete" );

    ListBoxEditorBaseLayout->addWidget( itemDelete, 1, 1 );
    Vertical_Spacing1 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    ListBoxEditorBaseLayout->addItem( Vertical_Spacing1, 2, 1 );

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

    ListBoxEditorBaseLayout->addWidget( itemUp, 3, 1 );

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

    ListBoxEditorBaseLayout->addWidget( itemDown, 4, 1 );
    languageChange();
    resize( TQSize(482, 229).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( itemNew, TQ_SIGNAL( clicked() ), this, TQ_SLOT( insertNewItem() ) );
    connect( itemDelete, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deleteCurrentItem() ) );
    connect( itemText, TQ_SIGNAL( textChanged( const TQString & ) ), this, TQ_SLOT( currentTextChanged(const TQString&) ) );
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( okClicked() ) );
    connect( buttonApply, TQ_SIGNAL( clicked() ), this, TQ_SLOT( applyClicked() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( cancelClicked() ) );
    connect( itemChoosePixmap, TQ_SIGNAL( clicked() ), this, TQ_SLOT( choosePixmap() ) );
    connect( itemDeletePixmap, TQ_SIGNAL( clicked() ), this, TQ_SLOT( deletePixmap() ) );
    connect( itemUp, TQ_SIGNAL( clicked() ), this, TQ_SLOT( moveItemUp() ) );
    connect( itemDown, TQ_SIGNAL( clicked() ), this, TQ_SLOT( moveItemDown() ) );
    connect( preview, TQ_SIGNAL( selectionChanged(TQListBoxItem*) ), this, TQ_SLOT( currentItemChanged(TQListBoxItem*) ) );
    connect( preview, TQ_SIGNAL( currentChanged( TQListBoxItem * ) ), this, TQ_SLOT( currentItemChanged(TQListBoxItem*) ) );

    // tab order
    setTabOrder( buttonOk, buttonCancel );
    setTabOrder( buttonCancel, preview );
    setTabOrder( preview, itemNew );
    setTabOrder( itemNew, itemDelete );
    setTabOrder( itemDelete, itemUp );
    setTabOrder( itemUp, itemDown );
    setTabOrder( itemDown, itemText );
    setTabOrder( itemText, itemDeletePixmap );
    setTabOrder( itemDeletePixmap, itemChoosePixmap );
    setTabOrder( itemChoosePixmap, helpButton );
    setTabOrder( helpButton, buttonApply );

    // buddies
    Label2->setBuddy( itemChoosePixmap );
    Label1->setBuddy( itemText );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ListBoxEditorBase::languageChange()
{
    setCaption( tr( "Edit Listbox" ) );
    TQWhatsThis::add( this, tr( "<b>Edit Listbox</b><p>Add, edit or delete items in the listbox.</p><p>Click the <b>New Item</b>-button to create a new listbox entry, then enter text and choose a pixmap.</p><p>Select an item from the list and click the <b>Delete Item</b>-button to remove the item from the list.</p>" ) );
    helpButton->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." ) );
    TQToolTip::add( preview, tr( "Item list" ) );
    TQWhatsThis::add( preview, tr( "The list of items." ) );
    GroupBox1->setTitle( tr( "&Item Properties" ) );
    Label2->setText( tr( "&Pixmap:" ) );
    itemPixmap->setText( tr( "Label4" ) );
    itemDeletePixmap->setText( TQString::null );
    TQToolTip::add( itemDeletePixmap, tr( "Delete Pixmap" ) );
    TQWhatsThis::add( itemDeletePixmap, tr( "Delete the selected item's pixmap." ) );
    itemChoosePixmap->setText( tr( "..." ) );
    TQToolTip::add( itemChoosePixmap, tr( "Select a Pixmap" ) );
    TQWhatsThis::add( itemChoosePixmap, tr( "Choose a pixmap file for the selected item." ) );
    Label1->setText( tr( "&Text:" ) );
    TQToolTip::add( itemText, tr( "Change text" ) );
    TQWhatsThis::add( itemText, tr( "Change the selected item's text." ) );
    itemNew->setText( tr( "&New Item" ) );
    TQToolTip::add( itemNew, tr( "Add an item" ) );
    TQWhatsThis::add( itemNew, tr( "<b>Add a new item.</b><p>New items are appended to the list.</p>" ) );
    itemDelete->setText( tr( "&Delete Item" ) );
    TQToolTip::add( itemDelete, tr( "Delete Item" ) );
    TQWhatsThis::add( itemDelete, tr( "Delete the selected item" ) );
    itemUp->setText( TQString::null );
    TQToolTip::add( itemUp, tr( "Move up" ) );
    TQWhatsThis::add( itemUp, tr( "Moves the selected item up." ) );
    itemDown->setText( TQString::null );
    TQToolTip::add( itemDown, tr( "Move down" ) );
    TQWhatsThis::add( itemDown, tr( "Move the selected item down." ) );
}

void ListBoxEditorBase::init()
{
}

void ListBoxEditorBase::destroy()
{
}

void ListBoxEditorBase::insertNewItem()
{
    tqWarning( "ListBoxEditorBase::insertNewItem(): Not implemented yet" );
}

void ListBoxEditorBase::deleteCurrentItem()
{
    tqWarning( "ListBoxEditorBase::deleteCurrentItem(): Not implemented yet" );
}

void ListBoxEditorBase::currentItemChanged(TQListBoxItem*)
{
    tqWarning( "ListBoxEditorBase::currentItemChanged(TQListBoxItem*): Not implemented yet" );
}

void ListBoxEditorBase::currentTextChanged(const TQString&)
{
    tqWarning( "ListBoxEditorBase::currentTextChanged(const TQString&): Not implemented yet" );
}

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

void ListBoxEditorBase::cancelClicked()
{
    tqWarning( "ListBoxEditorBase::cancelClicked(): Not implemented yet" );
}

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

void ListBoxEditorBase::choosePixmap()
{
    tqWarning( "ListBoxEditorBase::choosePixmap(): Not implemented yet" );
}

void ListBoxEditorBase::deletePixmap()
{
    tqWarning( "ListBoxEditorBase::deletePixmap(): Not implemented yet" );
}

void ListBoxEditorBase::moveItemUp()
{
    tqWarning( "ListBoxEditorBase::moveItemUp(): Not implemented yet" );
}

void ListBoxEditorBase::moveItemDown()
{
    tqWarning( "ListBoxEditorBase::moveItemDown(): Not implemented yet" );
}

