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

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

#include "propertypanelbase.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqframe.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a PropertyPanelBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
PropertyPanelBase::PropertyPanelBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "propertyPanelBase" );
    propertyPanelBaseLayout = new TQVBoxLayout( this, 0, 6, "propertyPanelBaseLayout"); 

    titleFrame = new TQFrame( this, "titleFrame" );
    titleFrame->setFrameShape( TQFrame::NoFrame );
    titleFrame->setFrameShadow( TQFrame::Plain );
    titleFrameLayout = new TQVBoxLayout( titleFrame, 8, 0, "titleFrameLayout"); 

    selectedLabel = new TQLabel( titleFrame, "selectedLabel" );
    titleFrameLayout->addWidget( selectedLabel );
    propertyPanelBaseLayout->addWidget( titleFrame );

    spacerLayout = new TQVBoxLayout( 0, 11, 6, "spacerLayout"); 

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

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

    Layout13 = new TQVBoxLayout( 0, 0, 6, "Layout13"); 

    moduleIconLabel = new TQLabel( this, "moduleIconLabel" );
    Layout13->addWidget( moduleIconLabel );
    Layout17->addLayout( Layout13 );

    Layout16 = new TQVBoxLayout( 0, 0, 6, "Layout16"); 

    moduleNameLabel = new TQLabel( this, "moduleNameLabel" );
    Layout16->addWidget( moduleNameLabel );

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

    portComboLabel = new TQLabel( this, "portComboLabel" );
    Layout10->addWidget( portComboLabel );

    portCombo = new TQComboBox( false, this, "portCombo" );
    portCombo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, portCombo->sizePolicy().hasHeightForWidth() ) );
    Layout10->addWidget( portCombo );
    Layout16->addLayout( Layout10 );
    Spacer28 = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Preferred );
    Layout16->addItem( Spacer28 );
    Layout17->addLayout( Layout16 );
    mainBoxLayout->addLayout( Layout17 );

    portValueGroup = new TQButtonGroup( this, "portValueGroup" );
    portValueGroup->setColumnLayout(0, TQt::Vertical );
    portValueGroup->layout()->setSpacing( 6 );
    portValueGroup->layout()->setMargin( 11 );
    portValueGroupLayout = new TQVBoxLayout( portValueGroup->layout() );
    portValueGroupLayout->setAlignment( TQt::AlignTop );

    pvNotSetButton = new TQRadioButton( portValueGroup, "pvNotSetButton" );
    portValueGroupLayout->addWidget( pvNotSetButton );

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

    pvConstantButton = new TQRadioButton( portValueGroup, "pvConstantButton" );
    Layout9->addWidget( pvConstantButton );

    constantValueComboBox = new TQComboBox( false, portValueGroup, "constantValueComboBox" );
    constantValueComboBox->setEnabled( false );
    Layout9->addWidget( constantValueComboBox );

    constantValueEdit = new TQLineEdit( portValueGroup, "constantValueEdit" );
    constantValueEdit->setEnabled( false );
    Layout9->addWidget( constantValueEdit );
    portValueGroupLayout->addLayout( Layout9 );

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

    pvConnectionButton = new TQRadioButton( portValueGroup, "pvConnectionButton" );
    connectionLayout->addWidget( pvConnectionButton );
    Spacer13 = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    connectionLayout->addItem( Spacer13 );

    connectButton = new TQPushButton( portValueGroup, "connectButton" );
    connectionLayout->addWidget( connectButton );
    portValueGroupLayout->addLayout( connectionLayout );
    mainBoxLayout->addWidget( portValueGroup );
    spacerLayout->addLayout( mainBoxLayout );

    tipLabel = new TQLabel( this, "tipLabel" );
    tipLabel->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignVCenter | TQLabel::AlignLeft ) );
    spacerLayout->addWidget( tipLabel );
    Spacer3 = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    spacerLayout->addItem( Spacer3 );
    propertyPanelBaseLayout->addLayout( spacerLayout );
    languageChange();
    resize( TQSize(628, 484).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( pvConstantButton, TQ_SIGNAL( clicked() ), constantValueEdit, TQ_SLOT( setFocus() ) );
    connect( pvConstantButton, TQ_SIGNAL( toggled(bool) ), constantValueEdit, TQ_SLOT( setEnabled(bool) ) );
    connect( pvConstantButton, TQ_SIGNAL( toggled(bool) ), constantValueComboBox, TQ_SLOT( setEnabled(bool) ) );

    // buddies
    portComboLabel->setBuddy( portCombo );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PropertyPanelBase::languageChange()
{
    selectedLabel->setText( tr2i18n( "Properties of selected module/port:" ) );
    portComboLabel->setText( tr2i18n( "&Port:" ) );
    portValueGroup->setTitle( tr2i18n( "Port Value" ) );
    pvNotSetButton->setText( tr2i18n( "&Not set" ) );
    pvConstantButton->setText( tr2i18n( "Constant &value:" ) );
    pvConnectionButton->setText( tr2i18n( "From connection" ) );
    connectButton->setText( tr2i18n( "&Connect" ) );
}

void PropertyPanelBase::setTitleFont()
{
    tqWarning( "PropertyPanelBase::setTitleFont(): Not implemented yet" );
}

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

TQMetaObject *PropertyPanelBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_PropertyPanelBase( "PropertyPanelBase", &PropertyPanelBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* PropertyPanelBase::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 = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQUMethod slot_1 = {"setTitleFont", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "setTitleFont()", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"PropertyPanelBase", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_PropertyPanelBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool PropertyPanelBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: setTitleFont(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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