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

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

#include "editfunctionpage.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqbuttongroup.h>
#include <ntqcheckbox.h>
#include <ntqradiobutton.h>
#include <ntqcombobox.h>
#include <ntqframe.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "klineedit.h"
#include "kcolorbutton.h"
#include "knuminput.h"
#include "kpushbutton.h"

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

    groupBox1 = new TQGroupBox( this, "groupBox1" );
    groupBox1->setFrameShape( TQGroupBox::GroupBoxPanel );
    groupBox1->setFrameShadow( TQGroupBox::Sunken );
    groupBox1->setColumnLayout(0, TQt::Vertical );
    groupBox1->layout()->setSpacing( 6 );
    groupBox1->layout()->setMargin( 11 );
    groupBox1Layout = new TQVBoxLayout( groupBox1->layout() );
    groupBox1Layout->setAlignment( TQt::AlignTop );

    textLabel1_4 = new TQLabel( groupBox1, "textLabel1_4" );
    groupBox1Layout->addWidget( textLabel1_4 );

    equation = new KLineEdit( groupBox1, "equation" );
    equation->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, equation->sizePolicy().hasHeightForWidth() ) );
    groupBox1Layout->addWidget( equation );
    EditFunctionPageLayout->addWidget( groupBox1 );

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

    hide = new TQCheckBox( buttonGroup1, "hide" );
    buttonGroup1Layout->addWidget( hide );
    EditFunctionPageLayout->addWidget( buttonGroup1 );

    parameterValues = new TQButtonGroup( this, "parameterValues" );
    parameterValues->setColumnLayout(0, TQt::Vertical );
    parameterValues->layout()->setSpacing( 6 );
    parameterValues->layout()->setMargin( 11 );
    parameterValuesLayout = new TQGridLayout( parameterValues->layout() );
    parameterValuesLayout->setAlignment( TQt::AlignTop );

    useSlider = new TQRadioButton( parameterValues, "useSlider" );

    parameterValuesLayout->addWidget( useSlider, 3, 0 );

    listOfSliders = new TQComboBox( false, parameterValues, "listOfSliders" );
    listOfSliders->setEnabled( false );

    parameterValuesLayout->addMultiCellWidget( listOfSliders, 3, 3, 1, 2 );

    useList = new TQRadioButton( parameterValues, "useList" );

    parameterValuesLayout->addWidget( useList, 2, 0 );

    cmdParameter = new KPushButton( parameterValues, "cmdParameter" );
    cmdParameter->setEnabled( false );

    parameterValuesLayout->addMultiCellWidget( cmdParameter, 2, 2, 1, 2 );

    useNoParameter = new TQRadioButton( parameterValues, "useNoParameter" );
    useNoParameter->setChecked( true );

    parameterValuesLayout->addMultiCellWidget( useNoParameter, 0, 1, 0, 2 );
    EditFunctionPageLayout->addWidget( parameterValues );

    frame5 = new TQFrame( this, "frame5" );
    frame5->setFrameShape( TQFrame::Box );
    frame5->setFrameShadow( TQFrame::Sunken );
    frame5Layout = new TQGridLayout( frame5, 1, 1, 11, 6, "frame5Layout"); 

    customMinRange = new TQCheckBox( frame5, "customMinRange" );

    frame5Layout->addMultiCellWidget( customMinRange, 0, 0, 0, 1 );

    textLabel1 = new TQLabel( frame5, "textLabel1" );

    frame5Layout->addWidget( textLabel1, 1, 0 );

    min = new KLineEdit( frame5, "min" );
    min->setEnabled( false );

    frame5Layout->addWidget( min, 1, 1 );

    customMaxRange = new TQCheckBox( frame5, "customMaxRange" );

    frame5Layout->addMultiCellWidget( customMaxRange, 2, 2, 0, 1 );

    max = new KLineEdit( frame5, "max" );
    max->setEnabled( false );

    frame5Layout->addWidget( max, 3, 1 );

    textLabel1_2 = new TQLabel( frame5, "textLabel1_2" );

    frame5Layout->addWidget( textLabel1_2, 3, 0 );
    EditFunctionPageLayout->addWidget( frame5 );

    frame6 = new TQFrame( this, "frame6" );
    frame6->setFrameShape( TQFrame::Box );
    frame6->setFrameShadow( TQFrame::Sunken );
    frame6Layout = new TQGridLayout( frame6, 1, 1, 11, 6, "frame6Layout"); 

    textLabel2 = new TQLabel( frame6, "textLabel2" );

    frame6Layout->addWidget( textLabel2, 1, 0 );

    color = new KColorButton( frame6, "color" );

    frame6Layout->addWidget( color, 1, 1 );

    textLabel1_3 = new TQLabel( frame6, "textLabel1_3" );

    frame6Layout->addWidget( textLabel1_3, 0, 0 );

    lineWidth = new KIntNumInput( frame6, "lineWidth" );
    lineWidth->setProperty( "minValue", 1 );

    frame6Layout->addWidget( lineWidth, 0, 1 );

    TextLabel2 = new TQLabel( frame6, "TextLabel2" );

    frame6Layout->addWidget( TextLabel2, 0, 2 );
    EditFunctionPageLayout->addWidget( frame6 );
    spacer8 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    EditFunctionPageLayout->addItem( spacer8 );
    languageChange();
    resize( TQSize(313, 519).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( useList, TQ_SIGNAL( toggled(bool) ), cmdParameter, TQ_SLOT( setEnabled(bool) ) );
    connect( useList, TQ_SIGNAL( toggled(bool) ), listOfSliders, TQ_SLOT( setDisabled(bool) ) );
    connect( useSlider, TQ_SIGNAL( toggled(bool) ), cmdParameter, TQ_SLOT( setDisabled(bool) ) );
    connect( useSlider, TQ_SIGNAL( toggled(bool) ), listOfSliders, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( equation, hide );
    setTabOrder( hide, useList );
    setTabOrder( useList, cmdParameter );
    setTabOrder( cmdParameter, listOfSliders );
    setTabOrder( listOfSliders, customMinRange );
    setTabOrder( customMinRange, min );
    setTabOrder( min, max );
    setTabOrder( max, lineWidth );
    setTabOrder( lineWidth, color );

    // buddies
    textLabel1_4->setBuddy( equation );
    textLabel1->setBuddy( min );
    textLabel1_2->setBuddy( max );
    textLabel2->setBuddy( color );
    textLabel1_3->setBuddy( lineWidth );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void EditFunctionPage::languageChange()
{
    setCaption( tr2i18n( "Edit Function Plot" ) );
    groupBox1->setTitle( tr2i18n( "Definition" ) );
    textLabel1_4->setText( tr2i18n( "&Equation:" ) );
    TQToolTip::add( equation, tr2i18n( "enter an equation, for instance f(x)=x^2" ) );
    TQWhatsThis::add( equation, tr2i18n( "Enter an equation for the function.\n"
"Example: f(x)=x^2" ) );
    buttonGroup1->setTitle( tr2i18n( "Extensions" ) );
    hide->setText( tr2i18n( "&Hide" ) );
    TQToolTip::add( hide, tr2i18n( "hide the plot" ) );
    TQWhatsThis::add( hide, tr2i18n( "Check this box if you want to hide the plot of the function." ) );
    parameterValues->setTitle( tr2i18n( "Parameter Values" ) );
    useSlider->setText( tr2i18n( "Use" ) );
    TQToolTip::add( useSlider, tr2i18n( "change parameter value by moving a slider" ) );
    TQWhatsThis::add( useSlider, tr2i18n( "Check this to change the parameter value by moving a slider. Select the slider from the list box on the right. The values vary from 0 (left) to 100 (right)." ) );
    TQToolTip::add( listOfSliders, tr2i18n( "Select a slider" ) );
    TQWhatsThis::add( listOfSliders, tr2i18n( "Select one of the sliders to change the parameter value dynamically. The values vary from 0 (left) to 100 (right)." ) );
    useList->setText( tr2i18n( "Values from a list" ) );
    TQToolTip::add( useList, tr2i18n( "read parameter values from a list" ) );
    TQWhatsThis::add( useList, tr2i18n( "Check this to let KmPlot use parameter values given in a list. Edit this list by clicking the button on the right." ) );
    cmdParameter->setProperty( "text", tr2i18n( "Edit List..." ) );
    TQToolTip::add( cmdParameter, tr2i18n( "Edit the list of parameters" ) );
    TQWhatsThis::add( cmdParameter, tr2i18n( "Click here to open a list of parameter values. Here you can add, remove, and change them." ) );
    useNoParameter->setText( tr2i18n( "Disable parameter values" ) );
    TQToolTip::add( useNoParameter, tr2i18n( "Do not use any parameter values" ) );
    TQWhatsThis::add( useNoParameter, tr2i18n( "By having this option selected parameter values are disabled in the function." ) );
    customMinRange->setText( tr2i18n( "Custom plot m&inimum-range:" ) );
    TQToolTip::add( customMinRange, tr2i18n( "Customize the minimum plot range" ) );
    TQWhatsThis::add( customMinRange, tr2i18n( "Check this button and enter the plot range boundarys below." ) );
    textLabel1->setText( tr2i18n( "&Min:" ) );
    TQToolTip::add( min, tr2i18n( "lower boundary of the plot range" ) );
    TQWhatsThis::add( min, tr2i18n( "Enter the lower boundary of the plot range. Expressions like 2*pi are allowed, too." ) );
    customMaxRange->setText( tr2i18n( "Custom plot m&aximum-range:" ) );
    TQToolTip::add( customMaxRange, tr2i18n( "Customize the maximum plot range" ) );
    TQWhatsThis::add( customMaxRange, tr2i18n( "Check this button and enter the plot range boundarys below." ) );
    TQToolTip::add( max, tr2i18n( "upper boundary of the plot range" ) );
    TQWhatsThis::add( max, tr2i18n( "Enter the upper boundary of the plot range. Expressions like 2*pi are allowed, too." ) );
    textLabel1_2->setText( tr2i18n( "Ma&x:" ) );
    textLabel2->setText( tr2i18n( "Co&lor:" ) );
    color->setProperty( "text", TQString::null );
    TQToolTip::add( color, tr2i18n( "color of the plot line" ) );
    TQWhatsThis::add( color, tr2i18n( "Click this button to choose a color for the plot line." ) );
    textLabel1_3->setText( tr2i18n( "Line &width:" ) );
    TQToolTip::add( lineWidth, tr2i18n( "width of the plot line" ) );
    TQWhatsThis::add( lineWidth, tr2i18n( "Change the width of the plot line in steps of 0.1mm." ) );
    TextLabel2->setText( tr2i18n( "0.1mm" ) );
}

void EditFunctionPage::slotHelp()
{
    tqWarning( "EditFunctionPage::slotHelp(): Not implemented yet" );
}

void EditFunctionPage::customRange_toggled(bool)
{
    tqWarning( "EditFunctionPage::customRange_toggled(bool): Not implemented yet" );
}

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

TQMetaObject *EditFunctionPage::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_EditFunctionPage( "EditFunctionPage", &EditFunctionPage::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* EditFunctionPage::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 = {"slotHelp", 0, 0 };
    static const TQUParameter param_slot_1[] = {
	{ 0, &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"customRange_toggled", 1, param_slot_1 };
    static const TQUMethod slot_2 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "slotHelp()", &slot_0, TQMetaData::Public },
	{ "customRange_toggled(bool)", &slot_1, TQMetaData::Public },
	{ "languageChange()", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"EditFunctionPage", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_EditFunctionPage.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool EditFunctionPage::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotHelp(); break;
    case 1: customRange_toggled((bool)static_QUType_bool.get(_o+1)); break;
    case 2: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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