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

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

#include "modcalcdaylengthdlg.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <../dmsbox.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqlabel.h>
#include <ntqgroupbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "libtdeedu/extdate/extdatetimeedit.h"
#include "timebox.h"

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

    InputBox = new TQButtonGroup( this, "InputBox" );
    InputBox->setColumnLayout(0, TQt::Vertical );
    InputBox->layout()->setSpacing( 6 );
    InputBox->layout()->setMargin( 11 );
    InputBoxLayout = new TQHBoxLayout( InputBox->layout() );
    InputBoxLayout->setAlignment( TQt::AlignTop );

    layout37 = new TQGridLayout( 0, 1, 1, 0, 6, "layout37"); 

    latLabel = new TQLabel( InputBox, "latLabel" );

    layout37->addWidget( latLabel, 1, 0 );

    latBox = new dmsBox( InputBox, "latBox" );
    latBox->setMinimumSize( TQSize( 100, 16 ) );
    latBox->setFocusPolicy( dmsBox::StrongFocus );

    layout37->addWidget( latBox, 1, 1 );

    longLabel = new TQLabel( InputBox, "longLabel" );

    layout37->addWidget( longLabel, 0, 0 );

    longBox = new dmsBox( InputBox, "longBox" );
    longBox->setMinimumSize( TQSize( 100, 16 ) );
    longBox->setFocusPolicy( dmsBox::StrongFocus );

    layout37->addWidget( longBox, 0, 1 );
    InputBoxLayout->addLayout( layout37 );
    spacer11 = new TQSpacerItem( 60, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    InputBoxLayout->addItem( spacer11 );

    datLabel = new TQLabel( InputBox, "datLabel" );
    InputBoxLayout->addWidget( datLabel );

    datBox = new ExtDateEdit( InputBox, "datBox" );
    datBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, datBox->sizePolicy().hasHeightForWidth() ) );
    datBox->setMinimumSize( TQSize( 120, 0 ) );
    datBox->setFocusPolicy( ExtDateEdit::StrongFocus );
    InputBoxLayout->addWidget( datBox );
    spacer53 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    InputBoxLayout->addItem( spacer53 );
    modCalcDayLengthDlgLayout->addWidget( InputBox );

    layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); 
    spacer5 = new TQSpacerItem( 71, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout3->addItem( spacer5 );

    Compute = new KPushButton( this, "Compute" );
    layout3->addWidget( Compute );
    spacer4 = new TQSpacerItem( 51, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout3->addItem( spacer4 );

    Clear = new KPushButton( this, "Clear" );
    layout3->addWidget( Clear );
    spacer3 = new TQSpacerItem( 81, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout3->addItem( spacer3 );
    modCalcDayLengthDlgLayout->addLayout( layout3 );

    resultsBox = new TQGroupBox( this, "resultsBox" );
    resultsBox->setColumnLayout(0, TQt::Vertical );
    resultsBox->layout()->setSpacing( 6 );
    resultsBox->layout()->setMargin( 11 );
    resultsBoxLayout = new TQHBoxLayout( resultsBox->layout() );
    resultsBoxLayout->setAlignment( TQt::AlignTop );

    layout10 = new TQGridLayout( 0, 1, 1, 0, 6, "layout10"); 

    dayLBox = new timeBox( resultsBox, "dayLBox" );
    dayLBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, dayLBox->sizePolicy().hasHeightForWidth() ) );
    dayLBox->setMinimumSize( TQSize( 90, 20 ) );
    dayLBox->setFocusPolicy( timeBox::NoFocus );

    layout10->addWidget( dayLBox, 3, 1 );

    riseTimeLabel = new TQLabel( resultsBox, "riseTimeLabel" );

    layout10->addWidget( riseTimeLabel, 0, 0 );

    transitTimeBox = new timeBox( resultsBox, "transitTimeBox" );
    transitTimeBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, transitTimeBox->sizePolicy().hasHeightForWidth() ) );
    transitTimeBox->setMinimumSize( TQSize( 90, 20 ) );
    transitTimeBox->setFocusPolicy( timeBox::NoFocus );

    layout10->addWidget( transitTimeBox, 1, 1 );

    transitTimeLabel = new TQLabel( resultsBox, "transitTimeLabel" );

    layout10->addWidget( transitTimeLabel, 1, 0 );

    dayLLabel = new TQLabel( resultsBox, "dayLLabel" );

    layout10->addWidget( dayLLabel, 3, 0 );

    setTimeBox = new timeBox( resultsBox, "setTimeBox" );
    setTimeBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, setTimeBox->sizePolicy().hasHeightForWidth() ) );
    setTimeBox->setMinimumSize( TQSize( 90, 20 ) );
    setTimeBox->setFocusPolicy( timeBox::NoFocus );

    layout10->addWidget( setTimeBox, 2, 1 );

    riseTimeBox = new timeBox( resultsBox, "riseTimeBox" );
    riseTimeBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, riseTimeBox->sizePolicy().hasHeightForWidth() ) );
    riseTimeBox->setMinimumSize( TQSize( 90, 20 ) );
    riseTimeBox->setFocusPolicy( timeBox::NoFocus );

    layout10->addWidget( riseTimeBox, 0, 1 );

    setTimeLabel = new TQLabel( resultsBox, "setTimeLabel" );

    layout10->addWidget( setTimeLabel, 2, 0 );
    resultsBoxLayout->addLayout( layout10 );
    spacer12 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    resultsBoxLayout->addItem( spacer12 );

    layout20 = new TQGridLayout( 0, 1, 1, 0, 6, "layout20"); 

    azRiseLabel = new TQLabel( resultsBox, "azRiseLabel" );

    layout20->addWidget( azRiseLabel, 0, 0 );

    azSetLabel = new TQLabel( resultsBox, "azSetLabel" );

    layout20->addWidget( azSetLabel, 2, 0 );

    azRiseBox = new dmsBox( resultsBox, "azRiseBox" );
    azRiseBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, azRiseBox->sizePolicy().hasHeightForWidth() ) );
    azRiseBox->setMinimumSize( TQSize( 100, 0 ) );
    azRiseBox->setFocusPolicy( dmsBox::NoFocus );

    layout20->addWidget( azRiseBox, 0, 1 );

    elTransitLabel = new TQLabel( resultsBox, "elTransitLabel" );

    layout20->addWidget( elTransitLabel, 1, 0 );

    azSetBox = new dmsBox( resultsBox, "azSetBox" );
    azSetBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, azSetBox->sizePolicy().hasHeightForWidth() ) );
    azSetBox->setMinimumSize( TQSize( 100, 0 ) );
    azSetBox->setFocusPolicy( dmsBox::NoFocus );

    layout20->addWidget( azSetBox, 2, 1 );

    elTransitBox = new dmsBox( resultsBox, "elTransitBox" );
    elTransitBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, elTransitBox->sizePolicy().hasHeightForWidth() ) );
    elTransitBox->setMinimumSize( TQSize( 100, 0 ) );
    elTransitBox->setFocusPolicy( dmsBox::NoFocus );

    layout20->addWidget( elTransitBox, 1, 1 );
    spacer26 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout20->addItem( spacer26, 3, 0 );
    resultsBoxLayout->addLayout( layout20 );
    spacer27 = new TQSpacerItem( 30, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    resultsBoxLayout->addItem( spacer27 );
    modCalcDayLengthDlgLayout->addWidget( resultsBox );
    Spacer1 = new TQSpacerItem( 20, 110, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    modCalcDayLengthDlgLayout->addItem( Spacer1 );
    languageChange();
    resize( TQSize(578, 395).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( Clear, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotClearCoords() ) );
    connect( Compute, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotComputePosTime() ) );

    // tab order
    setTabOrder( longBox, latBox );
    setTabOrder( latBox, datBox );
    setTabOrder( datBox, Compute );
    setTabOrder( Compute, Clear );
    setTabOrder( Clear, dayLBox );
    setTabOrder( dayLBox, transitTimeBox );
    setTabOrder( transitTimeBox, setTimeBox );
    setTabOrder( setTimeBox, riseTimeBox );
    setTabOrder( riseTimeBox, elTransitBox );
    setTabOrder( elTransitBox, azSetBox );
    setTabOrder( azSetBox, azRiseBox );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void modCalcDayLengthDlg::languageChange()
{
    setCaption( tr2i18n( "Day Length" ) );
    InputBox->setTitle( tr2i18n( "Location && Date" ) );
    latLabel->setText( tr2i18n( "Latitude:" ) );
    longLabel->setText( tr2i18n( "Longitude:" ) );
    datLabel->setText( tr2i18n( "Date:" ) );
    Compute->setText( tr2i18n( "Compute" ) );
    Clear->setText( tr2i18n( "Clear" ) );
    resultsBox->setTitle( tr2i18n( "Sunrise, Noon && Sunset Data" ) );
    riseTimeLabel->setText( tr2i18n( "Sunrise:" ) );
    transitTimeLabel->setText( tr2i18n( "Noon:" ) );
    dayLLabel->setText( tr2i18n( "Day length:" ) );
    setTimeLabel->setText( tr2i18n( "Sunset:" ) );
    azRiseLabel->setText( tr2i18n( "Sunrise azimuth:" ) );
    azSetLabel->setText( tr2i18n( "Sunset azimuth:" ) );
    elTransitLabel->setText( tr2i18n( "Altitude at noon:" ) );
}

void modCalcDayLengthDlg::slotComputePosTime()
{
    tqWarning( "modCalcDayLengthDlg::slotComputePosTime(): Not implemented yet" );
}

void modCalcDayLengthDlg::slotClearCoords()
{
    tqWarning( "modCalcDayLengthDlg::slotClearCoords(): Not implemented yet" );
}

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

TQMetaObject *modCalcDayLengthDlg::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_modCalcDayLengthDlg( "modCalcDayLengthDlg", &modCalcDayLengthDlg::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* modCalcDayLengthDlg::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 = {"slotComputePosTime", 0, 0 };
    static const TQUMethod slot_1 = {"slotClearCoords", 0, 0 };
    static const TQUMethod slot_2 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "slotComputePosTime()", &slot_0, TQMetaData::Public },
	{ "slotClearCoords()", &slot_1, TQMetaData::Public },
	{ "languageChange()", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"modCalcDayLengthDlg", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_modCalcDayLengthDlg.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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