#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** 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>

static const char* const image0_data[] = { 
"16 16 3 1",
". c None",
"# c #000000",
"a c #000083",
"................",
".....#...#......",
".....#...#......",
".....#...#......",
".....##.##......",
"......#.#.......",
"......###.......",
".......#........",
"......a#a.......",
"......a.aaa.....",
"....aaa.a..a....",
"...a..a.a..a....",
"...a..a.a..a....",
"...a..a..aa.....",
"....aa..........",
"................"};

static const char* const image1_data[] = { 
"16 16 45 1",
". c None",
"P c #1034ee",
"D c #1038ee",
"O c #183cf6",
"G c #1840ff",
"v c #295dff",
"p c #315dff",
"s c #3165ff",
"I c #3955d5",
"C c #3965ff",
"N c #396dff",
"F c #416dee",
"f c #4175ff",
"E c #4a65cd",
"K c #4a79ff",
"Q c #526dcd",
"L c #5271cd",
"M c #5285ff",
"g c #5a71c5",
"B c #5a89f6",
"q c #6279c5",
"J c #628dff",
"A c #6295ff",
"z c #6299ff",
"l c #6a79bd",
"w c #6a89d5",
"H c #6a99f6",
"o c #6a9dff",
"# c #7385bd",
"n c #73a5ff",
"y c #73aaff",
"b c #7ba1f6",
"k c #7baeff",
"j c #8bbeff",
"m c #94c6ff",
"u c #94ceff",
"i c #9ccaff",
"e c #9cd2ff",
"a c #b4c6f6",
"x c #bde6ff",
"t c #d5e2ff",
"d c #defaff",
"c c #e6eaff",
"h c #e6ffff",
"r c #ffffff",
"......#ab#......",
".....#cdefg.....",
"....#chijkfl....",
"...#chmknnopq...",
"..#rhjnnoooosl..",
".#thunnoooooovl.",
".wxiynoooozABCD.",
".#.#.#fooCE.b##.",
"......FyzG#.....",
"......BkAv#.....",
".....#Hkopg.....",
".....#kyACI.....",
".....#jnAfD.....",
".....wkAJKD.....",
".....LMNssO#....",
".....#DDDPQ....."};

static const char* const image2_data[] = { 
"16 16 48 1",
". c None",
"N c #002cff",
"Q c #082cff",
"T c #183cf6",
"S c #2050ff",
"r c #2950e6",
"O c #2959ff",
"k c #3155e6",
"E c #315df6",
"w c #394cbd",
"K c #3965ee",
"B c #3965ff",
"J c #4159c5",
"z c #4175ff",
"R c #4a61c5",
"v c #4a7dff",
"A c #526dcd",
"I c #527dee",
"q c #6295ff",
"C c #6a85bd",
"s c #6a85c5",
"m c #6a91e6",
"P c #6a9dff",
"L c #6aa1ff",
"H c #73a5ff",
"f c #7ba1ee",
"D c #7baeff",
"d c #83aaee",
"y c #83b6ff",
"M c #83baff",
"e c #8b99b4",
"x c #8b9dc5",
"u c #8bbeff",
"p c #94caff",
"# c #9ca1b4",
"t c #9cceff",
"o c #9cd2ff",
"l c #a4b6cd",
"a c #a4baee",
"F c #a4cef6",
"j c #a4d2ff",
"c c #b4caee",
"n c #b4eaff",
"b c #bdcaee",
"G c #bdd6ff",
"i c #defaff",
"h c #e6faff",
"g c #f6ffff",
".....#abcde.....",
".....fghijk#....",
"....lmnopqr.....",
".....sptuvwl....",
".....xypyzA.....",
".....eypyBC.....",
".....lfpDE#.....",
".....ldtDE#.....",
".l...eFtyvCl..l.",
".sFGayuyyyHffIJ.",
".CKLMMyyDyDHBNA.",
"..COPyyyDDHzQR#.",
"...COPDDHHvNwl..",
"....CSqHqzNw#...",
".....CSvvQwl....",
"......srTA#....."};


/*
 *  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 ),
      image0( (const char **) image0_data ),
      image1( (const char **) image1_data ),
      image2( (const char **) image2_data )
{
    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 );

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

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

    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( image0 );

    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( image1 );

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

    itemDown = new TQPushButton( this, "itemDown" );
    itemDown->setPixmap( image2 );

    ListBoxEditorBaseLayout->addWidget( itemDown, 4, 1 );
    languageChange();
    resize( TQSize(461, 196).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( tr2i18n( "Edit Listbox" ) );
    TQWhatsThis::add( this, tr2i18n( "<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( tr2i18n( "&Help" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    TQWhatsThis::add( buttonOk, tr2i18n( "Close the dialog and apply all the changes." ) );
    buttonApply->setText( tr2i18n( "&Apply" ) );
    TQWhatsThis::add( buttonApply, tr2i18n( "Apply all changes." ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
    TQWhatsThis::add( buttonCancel, tr2i18n( "Close the dialog and discard any changes." ) );
    TQToolTip::add( preview, tr2i18n( "Delete Item" ) );
    TQWhatsThis::add( preview, tr2i18n( "The list of items." ) );
    GroupBox1->setTitle( tr2i18n( "&Item Properties" ) );
    Label2->setText( tr2i18n( "&Pixmap:" ) );
    itemPixmap->setText( tr2i18n( "Label4" ) );
    itemDeletePixmap->setText( TQString::null );
    TQToolTip::add( itemDeletePixmap, tr2i18n( "Delete Pixmap" ) );
    TQWhatsThis::add( itemDeletePixmap, tr2i18n( "Delete the selected item's pixmap." ) );
    itemChoosePixmap->setText( tr2i18n( "..." ) );
    TQToolTip::add( itemChoosePixmap, tr2i18n( "Select a Pixmap" ) );
    TQWhatsThis::add( itemChoosePixmap, tr2i18n( "Choose a pixmap file for the selected item." ) );
    Label1->setText( tr2i18n( "&Text:" ) );
    TQToolTip::add( itemText, tr2i18n( "Change text" ) );
    TQWhatsThis::add( itemText, tr2i18n( "Change the selected item's text." ) );
    itemNew->setText( tr2i18n( "&New Item" ) );
    TQToolTip::add( itemNew, tr2i18n( "Add an item" ) );
    TQWhatsThis::add( itemNew, tr2i18n( "<b>Add a new item.</b><p>New items are appended to the list.</p>" ) );
    itemDelete->setText( tr2i18n( "&Delete Item" ) );
    TQToolTip::add( itemDelete, tr2i18n( "Delete Item" ) );
    TQWhatsThis::add( itemDelete, tr2i18n( "Delete the selected item" ) );
    itemUp->setText( TQString::null );
    TQToolTip::add( itemUp, tr2i18n( "Move up" ) );
    TQWhatsThis::add( itemUp, tr2i18n( "Moves the selected item up." ) );
    itemDown->setText( TQString::null );
    TQToolTip::add( itemDown, tr2i18n( "Move down" ) );
    TQWhatsThis::add( itemDown, tr2i18n( "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" );
}

/****************************************************************************
** ListBoxEditorBase meta object code from reading C++ file 'listboxeditor.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "listboxeditor.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *ListBoxEditorBase::className() const
{
    return "ListBoxEditorBase";
}

TQMetaObject *ListBoxEditorBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ListBoxEditorBase( "ListBoxEditorBase", &ListBoxEditorBase::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString ListBoxEditorBase::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "ListBoxEditorBase", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString ListBoxEditorBase::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "ListBoxEditorBase", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* ListBoxEditorBase::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQUMethod slot_1 = {"init", 0, 0 };
    static const TQUMethod slot_2 = {"destroy", 0, 0 };
    static const TQUMethod slot_3 = {"insertNewItem", 0, 0 };
    static const TQUMethod slot_4 = {"deleteCurrentItem", 0, 0 };
    static const TQUParameter param_slot_5[] = {
	{ 0, &static_QUType_ptr, "TQListBoxItem", TQUParameter::In }
    };
    static const TQUMethod slot_5 = {"currentItemChanged", 1, param_slot_5 };
    static const TQUParameter param_slot_6[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_6 = {"currentTextChanged", 1, param_slot_6 };
    static const TQUMethod slot_7 = {"okClicked", 0, 0 };
    static const TQUMethod slot_8 = {"cancelClicked", 0, 0 };
    static const TQUMethod slot_9 = {"applyClicked", 0, 0 };
    static const TQUMethod slot_10 = {"choosePixmap", 0, 0 };
    static const TQUMethod slot_11 = {"deletePixmap", 0, 0 };
    static const TQUMethod slot_12 = {"moveItemUp", 0, 0 };
    static const TQUMethod slot_13 = {"moveItemDown", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "init()", &slot_1, TQMetaData::Protected },
	{ "destroy()", &slot_2, TQMetaData::Protected },
	{ "insertNewItem()", &slot_3, TQMetaData::Protected },
	{ "deleteCurrentItem()", &slot_4, TQMetaData::Protected },
	{ "currentItemChanged(TQListBoxItem*)", &slot_5, TQMetaData::Protected },
	{ "currentTextChanged(const TQString&)", &slot_6, TQMetaData::Protected },
	{ "okClicked()", &slot_7, TQMetaData::Protected },
	{ "cancelClicked()", &slot_8, TQMetaData::Protected },
	{ "applyClicked()", &slot_9, TQMetaData::Protected },
	{ "choosePixmap()", &slot_10, TQMetaData::Protected },
	{ "deletePixmap()", &slot_11, TQMetaData::Protected },
	{ "moveItemUp()", &slot_12, TQMetaData::Protected },
	{ "moveItemDown()", &slot_13, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ListBoxEditorBase", parentObject,
	slot_tbl, 14,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ListBoxEditorBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* ListBoxEditorBase::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "ListBoxEditorBase" ) )
	return this;
    return TQDialog::tqt_cast( clname );
}

bool ListBoxEditorBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: init(); break;
    case 2: destroy(); break;
    case 3: insertNewItem(); break;
    case 4: deleteCurrentItem(); break;
    case 5: currentItemChanged((TQListBoxItem*)static_QUType_ptr.get(_o+1)); break;
    case 6: currentTextChanged((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 7: okClicked(); break;
    case 8: cancelClicked(); break;
    case 9: applyClicked(); break;
    case 10: choosePixmap(); break;
    case 11: deletePixmap(); break;
    case 12: moveItemUp(); break;
    case 13: moveItemDown(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

bool ListBoxEditorBase::tqt_emit( int _id, TQUObject* _o )
{
    return TQDialog::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool ListBoxEditorBase::tqt_property( int id, int f, TQVariant* v)
{
    return TQDialog::tqt_property( id, f, v);
}

bool ListBoxEditorBase::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
