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

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

#include "paletteeditor.h"

#include <ntqvariant.h>
#include <previewframe.h>
#include <styledbutton.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "styledbutton.h"
#include "previewframe.h"

/*
 *  Constructs a PaletteEditorBase 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.
 */
PaletteEditorBase::PaletteEditorBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "PaletteEditorBase" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, sizePolicy().hasHeightForWidth() ) );
    PaletteEditorBaseLayout = new TQVBoxLayout( this, 11, 6, "PaletteEditorBaseLayout"); 

    groupAutoPalette = new TQGroupBox( this, "groupAutoPalette" );
    groupAutoPalette->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)4, 0, 0, groupAutoPalette->sizePolicy().hasHeightForWidth() ) );
    groupAutoPalette->setAlignment( int( TQGroupBox::AlignAuto ) );
    groupAutoPalette->setColumnLayout(0, TQt::Vertical );
    groupAutoPalette->layout()->setSpacing( 6 );
    groupAutoPalette->layout()->setMargin( 11 );
    groupAutoPaletteLayout = new TQHBoxLayout( groupAutoPalette->layout() );
    groupAutoPaletteLayout->setAlignment( TQt::AlignTop );

    labelMainColor = new TQLabel( groupAutoPalette, "labelMainColor" );
    labelMainColor->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, labelMainColor->sizePolicy().hasHeightForWidth() ) );
    labelMainColor->setMinimumSize( TQSize( 50, 0 ) );
    labelMainColor->setLineWidth( 1 );
    labelMainColor->setMargin( 0 );
    labelMainColor->setMidLineWidth( 0 );
    labelMainColor->setAlignment( int( TQLabel::AlignVCenter ) );
    groupAutoPaletteLayout->addWidget( labelMainColor );

    buttonMainColor = new StyledButton( groupAutoPalette, "buttonMainColor" );
    buttonMainColor->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, buttonMainColor->sizePolicy().hasHeightForWidth() ) );
    buttonMainColor->setFocusPolicy( StyledButton::StrongFocus );
    buttonMainColor->setProperty( "scale", TQVariant( false ) );
    groupAutoPaletteLayout->addWidget( buttonMainColor );

    labelMainColor2 = new TQLabel( groupAutoPalette, "labelMainColor2" );
    labelMainColor2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, labelMainColor2->sizePolicy().hasHeightForWidth() ) );
    labelMainColor2->setMinimumSize( TQSize( 50, 0 ) );
    labelMainColor2->setLineWidth( 1 );
    labelMainColor2->setMargin( 0 );
    labelMainColor2->setMidLineWidth( 0 );
    labelMainColor2->setAlignment( int( TQLabel::AlignVCenter ) );
    groupAutoPaletteLayout->addWidget( labelMainColor2 );

    buttonMainColor2 = new StyledButton( groupAutoPalette, "buttonMainColor2" );
    buttonMainColor2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, buttonMainColor2->sizePolicy().hasHeightForWidth() ) );
    buttonMainColor2->setFocusPolicy( StyledButton::StrongFocus );
    buttonMainColor2->setProperty( "scale", TQVariant( false ) );
    groupAutoPaletteLayout->addWidget( buttonMainColor2 );
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    groupAutoPaletteLayout->addItem( Spacer1 );

    btnAdvanced = new TQPushButton( groupAutoPalette, "btnAdvanced" );
    groupAutoPaletteLayout->addWidget( btnAdvanced );
    PaletteEditorBaseLayout->addWidget( groupAutoPalette );

    GroupBox126 = new TQGroupBox( this, "GroupBox126" );
    GroupBox126->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)7, 0, 0, GroupBox126->sizePolicy().hasHeightForWidth() ) );
    GroupBox126->setColumnLayout(0, TQt::Vertical );
    GroupBox126->layout()->setSpacing( 6 );
    GroupBox126->layout()->setMargin( 11 );
    GroupBox126Layout = new TQVBoxLayout( GroupBox126->layout() );
    GroupBox126Layout->setAlignment( TQt::AlignTop );

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

    TextLabel1 = new TQLabel( GroupBox126, "TextLabel1" );
    Layout2->addWidget( TextLabel1 );

    paletteCombo = new TQComboBox( false, GroupBox126, "paletteCombo" );
    Layout2->addWidget( paletteCombo );
    GroupBox126Layout->addLayout( Layout2 );

    previewFrame = new PreviewFrame( GroupBox126, "previewFrame" );
    previewFrame->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, previewFrame->sizePolicy().hasHeightForWidth() ) );
    GroupBox126Layout->addWidget( previewFrame );
    PaletteEditorBaseLayout->addWidget( GroupBox126 );

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

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

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

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( true );
    Layout3->addWidget( buttonCancel );
    PaletteEditorBaseLayout->addLayout( Layout3 );
    languageChange();
    resize( TQSize(449, 443).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonMainColor2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( onChoose2ndMainColor() ) );
    connect( paletteCombo, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( paletteSelected(int) ) );
    connect( btnAdvanced, TQ_SIGNAL( clicked() ), this, TQ_SLOT( onTune() ) );
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( buttonMainColor, TQ_SIGNAL( changed() ), this, TQ_SLOT( onChooseMainColor() ) );
    connect( buttonMainColor, TQ_SIGNAL( clicked() ), this, TQ_SLOT( onChooseMainColor() ) );
    connect( buttonMainColor2, TQ_SIGNAL( changed() ), this, TQ_SLOT( onChoose2ndMainColor() ) );

    // tab order
    setTabOrder( buttonOk, buttonCancel );
    setTabOrder( buttonCancel, buttonMainColor );
    setTabOrder( buttonMainColor, buttonMainColor2 );
    setTabOrder( buttonMainColor2, btnAdvanced );
    setTabOrder( btnAdvanced, paletteCombo );
    setTabOrder( paletteCombo, buttonHelp );

    // buddies
    labelMainColor->setBuddy( buttonMainColor );
    labelMainColor2->setBuddy( buttonMainColor2 );
    TextLabel1->setBuddy( paletteCombo );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PaletteEditorBase::languageChange()
{
    setCaption( tr2i18n( "Edit Palette" ) );
    groupAutoPalette->setTitle( tr2i18n( "Build Palette" ) );
    labelMainColor->setText( tr2i18n( "&3D effects:" ) );
    TQToolTip::add( buttonMainColor, tr2i18n( "Choose a color" ) );
    TQWhatsThis::add( buttonMainColor, tr2i18n( "Choose the effect-color for the generated palette." ) );
    labelMainColor2->setText( tr2i18n( "Back&ground:" ) );
    TQToolTip::add( buttonMainColor2, tr2i18n( "Choose a color" ) );
    TQWhatsThis::add( buttonMainColor2, tr2i18n( "Choose the background color for the generated palette." ) );
    btnAdvanced->setText( tr2i18n( "&Tune Palette..." ) );
    GroupBox126->setTitle( tr2i18n( "Preview" ) );
    TextLabel1->setText( tr2i18n( "Select &palette:" ) );
    paletteCombo->clear();
    paletteCombo->insertItem( tr2i18n( "Active Palette" ) );
    paletteCombo->insertItem( tr2i18n( "Inactive Palette" ) );
    paletteCombo->insertItem( tr2i18n( "Disabled Palette" ) );
    buttonHelp->setText( tr2i18n( "&Help" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    TQWhatsThis::add( buttonOk, tr2i18n( "Close the dialog and apply all the changes." ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
    TQWhatsThis::add( buttonCancel, tr2i18n( "Close the dialog and discard any changes." ) );
}

void PaletteEditorBase::init()
{
}

void PaletteEditorBase::destroy()
{
}

void PaletteEditorBase::onTune()
{
    tqWarning( "PaletteEditorBase::onTune(): Not implemented yet" );
}

void PaletteEditorBase::onChoose2ndMainColor()
{
    tqWarning( "PaletteEditorBase::onChoose2ndMainColor(): Not implemented yet" );
}

void PaletteEditorBase::onChooseMainColor()
{
    tqWarning( "PaletteEditorBase::onChooseMainColor(): Not implemented yet" );
}

void PaletteEditorBase::paletteSelected(int)
{
    tqWarning( "PaletteEditorBase::paletteSelected(int): Not implemented yet" );
}

/****************************************************************************
** PaletteEditorBase meta object code from reading C++ file 'paletteeditor.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 "paletteeditor.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 *PaletteEditorBase::className() const
{
    return "PaletteEditorBase";
}

TQMetaObject *PaletteEditorBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_PaletteEditorBase( "PaletteEditorBase", &PaletteEditorBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* PaletteEditorBase::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 = {"onTune", 0, 0 };
    static const TQUMethod slot_4 = {"onChoose2ndMainColor", 0, 0 };
    static const TQUMethod slot_5 = {"onChooseMainColor", 0, 0 };
    static const TQUParameter param_slot_6[] = {
	{ 0, &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_6 = {"paletteSelected", 1, param_slot_6 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "init()", &slot_1, TQMetaData::Protected },
	{ "destroy()", &slot_2, TQMetaData::Protected },
	{ "onTune()", &slot_3, TQMetaData::Protected },
	{ "onChoose2ndMainColor()", &slot_4, TQMetaData::Protected },
	{ "onChooseMainColor()", &slot_5, TQMetaData::Protected },
	{ "paletteSelected(int)", &slot_6, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"PaletteEditorBase", parentObject,
	slot_tbl, 7,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_PaletteEditorBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool PaletteEditorBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: init(); break;
    case 2: destroy(); break;
    case 3: onTune(); break;
    case 4: onChoose2ndMainColor(); break;
    case 5: onChooseMainColor(); break;
    case 6: paletteSelected((int)static_QUType_int.get(_o+1)); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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