#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './TrigGrapherD.ui'
**
** Created: Sun Oct 8 09:57:16 2006
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.6   edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "TrigGrapherD.h"

#include <qvariant.h>
#include <q3frame.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qcombobox.h>
//Added by qt3to4:
#include <Q3GridLayout>
#include <knuminput.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <q3whatsthis.h>
#include "knuminput.h"

/*
 *  Constructs a TrigGrapherD as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
TrigGrapherD::TrigGrapherD( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "TrigGrapherD" );
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    setMinimumSize( QSize( 800, 550 ) );
    setMaximumSize( QSize( 800, 550 ) );
    TrigGrapherDLayout = new Q3GridLayout( this, 1, 1, 11, 6, "TrigGrapherDLayout"); 

    TrigGraphFrame = new Q3Frame( this, "TrigGraphFrame" );
    TrigGraphFrame->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TrigGraphFrame->sizePolicy().hasHeightForWidth() ) );
    TrigGraphFrame->setMinimumSize( QSize( 450, 450 ) );
    TrigGraphFrame->setFrameShape( Q3Frame::StyledPanel );
    TrigGraphFrame->setFrameShadow( Q3Frame::Raised );

    TrigGrapherDLayout->addWidget( TrigGraphFrame, 0, 0 );

    SpinFrame = new Q3Frame( this, "SpinFrame" );
    SpinFrame->setFrameShape( Q3Frame::StyledPanel );
    SpinFrame->setFrameShadow( Q3Frame::Raised );

    showTickMarks = new QCheckBox( SpinFrame, "showTickMarks" );
    showTickMarks->setGeometry( QRect( 20, 410, 20, 20 ) );
    showTickMarks->setChecked( TRUE );

    textLabel1_3_2 = new QLabel( SpinFrame, "textLabel1_3_2" );
    textLabel1_3_2->setGeometry( QRect( 40, 410, 124, 21 ) );

    textLabel1_3 = new QLabel( SpinFrame, "textLabel1_3" );
    textLabel1_3->setGeometry( QRect( 40, 380, 82, 21 ) );

    textLabel2 = new QLabel( SpinFrame, "textLabel2" );
    textLabel2->setGeometry( QRect( 190, 380, 126, 20 ) );

    showTickLabels = new QCheckBox( SpinFrame, "showTickLabels" );
    showTickLabels->setGeometry( QRect( 170, 380, 20, 20 ) );
    showTickLabels->setChecked( TRUE );

    showDescriptions = new QCheckBox( SpinFrame, "showDescriptions" );
    showDescriptions->setGeometry( QRect( 170, 410, 20, 20 ) );
    showDescriptions->setChecked( TRUE );

    textLabel2_2 = new QLabel( SpinFrame, "textLabel2_2" );
    textLabel2_2->setGeometry( QRect( 190, 410, 106, 20 ) );

    textLabel1 = new QLabel( SpinFrame, "textLabel1" );
    textLabel1->setGeometry( QRect( 20, 10, 274, 30 ) );
    QFont textLabel1_font(  textLabel1->font() );
    textLabel1_font.setPointSize( 14 );
    textLabel1->setFont( textLabel1_font ); 

    textLabel1_2_3 = new QLabel( SpinFrame, "textLabel1_2_3" );
    textLabel1_2_3->setGeometry( QRect( 240, 130, 33, 30 ) );
    QFont textLabel1_2_3_font(  textLabel1_2_3->font() );
    textLabel1_2_3_font.setPointSize( 20 );
    textLabel1_2_3->setFont( textLabel1_2_3_font ); 

    textLabel1_2 = new QLabel( SpinFrame, "textLabel1_2" );
    textLabel1_2->setGeometry( QRect( 10, 130, 33, 30 ) );
    QFont textLabel1_2_font(  textLabel1_2->font() );
    textLabel1_2_font.setPointSize( 20 );
    textLabel1_2->setFont( textLabel1_2_font ); 

    showAxis = new QCheckBox( SpinFrame, "showAxis" );
    showAxis->setEnabled( TRUE );
    showAxis->setGeometry( QRect( 20, 380, 20, 20 ) );
    showAxis->setChecked( TRUE );

    ratio_box = new QComboBox( FALSE, SpinFrame, "ratio_box" );
    ratio_box->setGeometry( QRect( 110, 130, 70, 31 ) );
    ratio_box->setMaxCount( 3 );

    spin_a_val = new KDoubleSpinBox( SpinFrame, "spin_a_val" );
    spin_a_val->setGeometry( QRect( 50, 130, 60, 30 ) );
    QFont spin_a_val_font(  spin_a_val->font() );
    spin_a_val_font.setPointSize( 14 );
    spin_a_val->setFont( spin_a_val_font ); 
    spin_a_val->setMouseTracking( TRUE );
    spin_a_val->setFocusPolicy( KDoubleSpinBox::WheelFocus );
    spin_a_val->setWrapping( TRUE );
    spin_a_val->setMaxValue( 5 );
    spin_a_val->setMinValue( -5 );
    spin_a_val->setLineStep( 0.1 );
    spin_a_val->setValue( 1 );

    spin_b_val = new KDoubleSpinBox( SpinFrame, "spin_b_val" );
    spin_b_val->setGeometry( QRect( 180, 130, 60, 30 ) );
    QFont spin_b_val_font(  spin_b_val->font() );
    spin_b_val_font.setPointSize( 14 );
    spin_b_val->setFont( spin_b_val_font ); 
    spin_b_val->setMouseTracking( TRUE );
    spin_b_val->setFocusPolicy( KDoubleSpinBox::WheelFocus );
    spin_b_val->setWrapping( TRUE );
    spin_b_val->setMaxValue( 5 );
    spin_b_val->setMinValue( -5 );
    spin_b_val->setLineStep( 0.1 );
    spin_b_val->setValue( 1 );

    TrigGrapherDLayout->addWidget( SpinFrame, 0, 1 );
    languageChange();
    resize( QSize(800, 550).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( spin_a_val, SIGNAL( valueChanged(double) ), this, SLOT( slotUpdateTrigGraph() ) );
    connect( ratio_box, SIGNAL( activated(int) ), this, SLOT( slotUpdateTrigGraph() ) );
    connect( spin_b_val, SIGNAL( valueChanged(double) ), this, SLOT( slotUpdateTrigGraph() ) );
    connect( showAxis, SIGNAL( toggled(bool) ), this, SLOT( slotUpdateTrigGraph() ) );
    connect( showDescriptions, SIGNAL( toggled(bool) ), this, SLOT( slotUpdateTrigGraph() ) );
    connect( showTickLabels, SIGNAL( toggled(bool) ), this, SLOT( slotUpdateTrigGraph() ) );
    connect( showTickMarks, SIGNAL( toggled(bool) ), this, SLOT( slotUpdateTrigGraph() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void TrigGrapherD::languageChange()
{
    setCaption( tr2i18n( "TrigGraph" ) );
    showTickMarks->setText( tr2i18n( "checkBox2" ) );
    textLabel1_3_2->setText( tr2i18n( "Show Axis Tick Marks" ) );
    textLabel1_3->setText( tr2i18n( "Show X/Y Axis" ) );
    textLabel2->setText( tr2i18n( "Show Axis Tick Labels" ) );
    showTickLabels->setText( tr2i18n( "checkBox3" ) );
    showDescriptions->setText( tr2i18n( "checkBox4" ) );
    textLabel2_2->setText( tr2i18n( "Show Descriptions" ) );
    textLabel1->setText( tr2i18n( "Trig Graph Std form Y=a(Ratio)bx+c" ) );
    textLabel1_2_3->setText( tr2i18n( "X" ) );
    textLabel1_2->setText( tr2i18n( "Y=" ) );
    showAxis->setText( tr2i18n( "checkBox1" ) );
}

void TrigGrapherD::slotUpdateTrigGraph()
{
    qWarning( "TrigGrapherD::slotUpdateTrigGraph(): Not implemented yet" );
}

#include "TrigGrapherD.moc"
