/*

    This file is part of the extensible drawing editor Ipe.
    Copyright (C) 1993-2004  Otfried Cheong

    Ipe is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    As a special exception, you have permission to link Ipe with the
    CGAL library and distribute executables, as long as you follow the
    requirements of the Gnu General Public License in regard to all of
    the software in the executable aside from CGAL.

    Ipe is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
    License for more details.

    You should have received a copy of the GNU General Public License
    along with Ipe; if not, you can find it at
    "http://www.gnu.org/copyleft/gpl.html", or write to the Free
    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

*/
/****************************************************************************
** Form implementation generated from reading ui file 'ipedlgtext.ui'
**
** Created: Fri Sep 24 10:50:25 2004
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.2   edited Nov 24 13:47 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "ipedlgtext.h"

#include <qvariant.h>
#include <qmultilineedit.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a IpeDlgCreateText as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
IpeDlgCreateText::IpeDlgCreateText( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "IpeDlgCreateText" );
    setSizeGripEnabled( TRUE );
    IpeDlgCreateTextLayout = new QGridLayout( this, 1, 1, 11, 6, "IpeDlgCreateTextLayout");

    iEditor = new QMultiLineEdit( this, "iEditor" );
    iEditor->setWordWrap( QMultiLineEdit::WidgetWidth );

    IpeDlgCreateTextLayout->addMultiCellWidget( iEditor, 1, 1, 0, 3 );

    iLabel = new QLabel( this, "iLabel" );

    IpeDlgCreateTextLayout->addMultiCellWidget( iLabel, 0, 0, 0, 3 );

    iFlushLeft = new QPushButton( this, "iFlushLeft" );

    IpeDlgCreateTextLayout->addWidget( iFlushLeft, 2, 0 );
    Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    IpeDlgCreateTextLayout->addItem( Horizontal_Spacing2, 2, 1 );

    buttonOk = new QPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( TRUE );
    buttonOk->setDefault( TRUE );

    IpeDlgCreateTextLayout->addWidget( buttonOk, 2, 2 );

    buttonCancel = new QPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( TRUE );

    IpeDlgCreateTextLayout->addWidget( buttonCancel, 2, 3 );
    languageChange();
    resize( QSize(444, 302).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( UpdateData() ) );
    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( iFlushLeft, SIGNAL( clicked() ), this, SLOT( FlushLeft() ) );

    // buddies
    iLabel->setBuddy( iEditor );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void IpeDlgCreateText::languageChange()
{
    setCaption( tr( "Create text object" ) );
    iLabel->setText( tr( "Enter &LaTeX source" ) );
    iFlushLeft->setText( tr( "&Flush Left" ) );
    buttonOk->setText( tr( "&OK" ) );
    buttonCancel->setText( tr( "&Cancel" ) );
}

void IpeDlgCreateText::UpdateData()
{
    qWarning( "IpeDlgCreateText::UpdateData(): Not implemented yet" );
}

void IpeDlgCreateText::FlushLeft()
{
    qWarning( "IpeDlgCreateText::FlushLeft(): Not implemented yet" );
}

