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

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

#include "spectrumview.h"

#include <ntqvariant.h>
#include <spectrumwidget.h>
#include <kpushbutton.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqspinbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "spectrumwidget.h"

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

    m_spectrumWidget = new SpectrumWidget( this, "m_spectrumWidget" );
    SpectrumViewLayout->addWidget( m_spectrumWidget );

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

    label1 = new TQLabel( this, "label1" );
    layout2->addWidget( label1 );

    minimumValue = new TQSpinBox( this, "minimumValue" );
    minimumValue->setMaxValue( 999 );
    minimumValue->setMinValue( 1 );
    minimumValue->setValue( 380 );
    layout2->addWidget( minimumValue );

    label2 = new TQLabel( this, "label2" );
    layout2->addWidget( label2 );

    maximumValue = new TQSpinBox( this, "maximumValue" );
    maximumValue->setMaxValue( 1000 );
    maximumValue->setMinValue( 2 );
    maximumValue->setValue( 780 );
    layout2->addWidget( maximumValue );
    SpectrumViewLayout->addLayout( layout2 );

    layout4 = new TQHBoxLayout( 0, 0, 6, "layout4"); 
    spacer4 = new TQSpacerItem( 211, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout4->addItem( spacer4 );

    exportButton = new KPushButton( this, "exportButton" );
    layout4->addWidget( exportButton );
    SpectrumViewLayout->addLayout( layout4 );
    spacer3 = new TQSpacerItem( 21, 1, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    SpectrumViewLayout->addItem( spacer3 );
    languageChange();
    resize( TQSize(469, 316).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( minimumValue, TQ_SIGNAL( valueChanged(int) ), m_spectrumWidget, TQ_SLOT( setLeftBorder(int) ) );
    connect( maximumValue, TQ_SIGNAL( valueChanged(int) ), m_spectrumWidget, TQ_SLOT( setRightBorder(int) ) );
    connect( exportButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotExportAsImage() ) );

    // buddies
    label1->setBuddy( minimumValue );
    label2->setBuddy( maximumValue );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void SpectrumView::languageChange()
{
    TQToolTip::add( this, tr2i18n( "This page gives an overview about the spectrum this element. With the mouse you can zoom into the spectrum." ) );
    TQWhatsThis::add( this, tr2i18n( "This page gives an overview about the spectrum this element" ) );
    TQToolTip::add( m_spectrumWidget, tr2i18n( "This is the spectrum of the element" ) );
    TQWhatsThis::add( m_spectrumWidget, tr2i18n( "This is the spectrum of the element" ) );
    label1->setText( tr2i18n( "&Minimum value:" ) );
    TQToolTip::add( minimumValue, tr2i18n( "This sets the leftmost wavelength of the spectrum" ) );
    TQWhatsThis::add( minimumValue, tr2i18n( "This sets the leftmost wavelength of the spectrum" ) );
    label2->setText( tr2i18n( "Maximum &value:" ) );
    TQToolTip::add( maximumValue, tr2i18n( "This sets the rightmost wavelength of the spectrum" ) );
    TQWhatsThis::add( maximumValue, tr2i18n( "This sets the rightmost wavelength of the spectrum" ) );
    exportButton->setText( TQString::null );
    TQToolTip::add( exportButton, tr2i18n( "Using this button you can export the spectrum as a graphic" ) );
    TQWhatsThis::add( exportButton, tr2i18n( "Using this button you can export the spectrum as a graphic" ) );
}

void SpectrumView::slotExportAsImage()
{
    tqWarning( "SpectrumView::slotExportAsImage(): Not implemented yet" );
}

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

TQMetaObject *SpectrumView::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_SpectrumView( "SpectrumView", &SpectrumView::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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