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

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

#include "klatinresultsdialog.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a KLatinResultsDialog 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.
 */
KLatinResultsDialog::KLatinResultsDialog( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "KLatinResultsDialog" );
    KLatinResultsDialogLayout = new TQVBoxLayout( this, 11, 6, "KLatinResultsDialogLayout"); 

    ResultsLabel = new TQLabel( this, "ResultsLabel" );
    TQFont ResultsLabel_font(  ResultsLabel->font() );
    ResultsLabel_font.setPointSize( 16 );
    ResultsLabel->setFont( ResultsLabel_font ); 
    ResultsLabel->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignCenter ) );
    KLatinResultsDialogLayout->addWidget( ResultsLabel );

    ResultsView = new TQListView( this, "ResultsView" );
    ResultsView->addColumn( tr2i18n( "Question" ) );
    ResultsView->header()->setClickEnabled( false, ResultsView->header()->count() - 1 );
    ResultsView->addColumn( tr2i18n( "Your Answer" ) );
    ResultsView->header()->setClickEnabled( false, ResultsView->header()->count() - 1 );
    ResultsView->addColumn( tr2i18n( "Correct Answer" ) );
    ResultsView->header()->setClickEnabled( false, ResultsView->header()->count() - 1 );
    ResultsView->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)3, 0, 0, ResultsView->sizePolicy().hasHeightForWidth() ) );
    ResultsView->setShowSortIndicator( false );
    ResultsView->setResizeMode( TQListView::AllColumns );
    KLatinResultsDialogLayout->addWidget( ResultsView );

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

    PercentageLabel = new TQLabel( this, "PercentageLabel" );
    layout83->addWidget( PercentageLabel );

    PercentageValue = new TQLabel( this, "PercentageValue" );
    PercentageValue->setAlignment( int( TQLabel::AlignCenter ) );
    layout83->addWidget( PercentageValue );

    AttemptedLabel = new TQLabel( this, "AttemptedLabel" );
    layout83->addWidget( AttemptedLabel );

    AttemptedValue = new TQLabel( this, "AttemptedValue" );
    AttemptedValue->setAlignment( int( TQLabel::AlignCenter ) );
    layout83->addWidget( AttemptedValue );
    KLatinResultsDialogLayout->addLayout( layout83 );

    layout70 = new TQHBoxLayout( 0, 0, 6, "layout70"); 
    spacer23 = new TQSpacerItem( 291, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout70->addItem( spacer23 );

    CloseButton = new KPushButton( this, "CloseButton" );
    CloseButton->setDefault( true );
    layout70->addWidget( CloseButton );
    KLatinResultsDialogLayout->addLayout( layout70 );
    languageChange();
    resize( TQSize(408, 309).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( CloseButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( close() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KLatinResultsDialog::languageChange()
{
    setCaption( tr2i18n( "Results" ) );
    ResultsLabel->setText( tr2i18n( "<b>Your Results</b>" ) );
    ResultsView->header()->setLabel( 0, tr2i18n( "Question" ) );
    ResultsView->header()->setLabel( 1, tr2i18n( "Your Answer" ) );
    ResultsView->header()->setLabel( 2, tr2i18n( "Correct Answer" ) );
    TQWhatsThis::add( ResultsView, tr2i18n( "Table of results" ) );
    PercentageLabel->setText( tr2i18n( "Percentage:" ) );
    TQToolTip::add( PercentageLabel, tr2i18n( "Percentage of correct answers" ) );
    TQWhatsThis::add( PercentageLabel, tr2i18n( "This shows the percentage of the questions you answered correctly out of those attempted." ) );
    PercentageValue->setText( TQString::null );
    TQToolTip::add( PercentageValue, tr2i18n( "Percentage of correct answers" ) );
    TQWhatsThis::add( PercentageValue, tr2i18n( "This shows the percentage of the questions you answered correctly out of those attempted." ) );
    AttemptedLabel->setText( tr2i18n( "Number attempted:" ) );
    TQToolTip::add( AttemptedLabel, tr2i18n( "Number of questions attempted" ) );
    TQWhatsThis::add( AttemptedLabel, tr2i18n( "This shows the number of questions you answered." ) );
    AttemptedValue->setText( TQString::null );
    TQToolTip::add( AttemptedValue, tr2i18n( "Number of questions attempted" ) );
    TQWhatsThis::add( AttemptedValue, tr2i18n( "This shows the number of questions you answered." ) );
    CloseButton->setText( tr2i18n( "&Close" ) );
    TQToolTip::add( CloseButton, tr2i18n( "Close this dialog" ) );
    TQWhatsThis::add( CloseButton, tr2i18n( "Close this dialog and return to KLatin's main window." ) );
}

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

TQMetaObject *KLatinResultsDialog::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KLatinResultsDialog( "KLatinResultsDialog", &KLatinResultsDialog::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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