/****************************************************************************
** Form implementation generated from reading ui file 'tosearchreplaceui.ui'
**
** Created: Tue Sep 18 08:21:29 2007
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.8   edited Jan 11 14:47 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "tosearchreplaceui.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qframe.h>
#include <qbuttongroup.h>
#include <qmultilineedit.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
#include <qgroupbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a toSearchReplaceUI 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.
 */
toSearchReplaceUI::toSearchReplaceUI( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "toSearchReplaceUI" );
    toSearchReplaceUILayout = new QGridLayout( this, 1, 1, 11, 6, "toSearchReplaceUILayout"); 

    Search = new QPushButton( this, "Search" );
    Search->setEnabled( FALSE );
    Search->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, Search->sizePolicy().hasHeightForWidth() ) );

    toSearchReplaceUILayout->addWidget( Search, 0, 2 );
    Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    toSearchReplaceUILayout->addItem( Spacer1, 5, 2 );

    SearchNext = new QPushButton( this, "SearchNext" );
    SearchNext->setEnabled( FALSE );
    SearchNext->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, SearchNext->sizePolicy().hasHeightForWidth() ) );

    toSearchReplaceUILayout->addWidget( SearchNext, 1, 2 );

    Replace = new QPushButton( this, "Replace" );
    Replace->setEnabled( FALSE );
    Replace->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, Replace->sizePolicy().hasHeightForWidth() ) );

    toSearchReplaceUILayout->addWidget( Replace, 2, 2 );

    ReplaceAll = new QPushButton( this, "ReplaceAll" );
    ReplaceAll->setEnabled( FALSE );
    ReplaceAll->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, ReplaceAll->sizePolicy().hasHeightForWidth() ) );

    toSearchReplaceUILayout->addWidget( ReplaceAll, 3, 2 );

    Close = new QPushButton( this, "Close" );
    Close->setEnabled( TRUE );
    Close->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, 0, 0, Close->sizePolicy().hasHeightForWidth() ) );

    toSearchReplaceUILayout->addWidget( Close, 4, 2 );

    Line1 = new QFrame( this, "Line1" );
    Line1->setFrameShape( QFrame::VLine );
    Line1->setFrameShadow( QFrame::Sunken );
    Line1->setFrameShape( QFrame::VLine );

    toSearchReplaceUILayout->addMultiCellWidget( Line1, 0, 5, 1, 1 );

    Frame3 = new QFrame( this, "Frame3" );
    Frame3->setFrameShape( QFrame::NoFrame );
    Frame3->setFrameShadow( QFrame::Raised );
    Frame3Layout = new QVBoxLayout( Frame3, 0, 6, "Frame3Layout"); 

    ButtonGroup1 = new QButtonGroup( Frame3, "ButtonGroup1" );
    ButtonGroup1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, ButtonGroup1->sizePolicy().hasHeightForWidth() ) );
    ButtonGroup1->setColumnLayout(0, Qt::Vertical );
    ButtonGroup1->layout()->setSpacing( 6 );
    ButtonGroup1->layout()->setMargin( 11 );
    ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
    ButtonGroup1Layout->setAlignment( Qt::AlignTop );

    SearchText = new QMultiLineEdit( ButtonGroup1, "SearchText" );

    ButtonGroup1Layout->addMultiCellWidget( SearchText, 0, 0, 0, 2 );

    Exact = new QRadioButton( ButtonGroup1, "Exact" );
    Exact->setChecked( TRUE );

    ButtonGroup1Layout->addWidget( Exact, 1, 0 );

    WholeWord = new QCheckBox( ButtonGroup1, "WholeWord" );

    ButtonGroup1Layout->addWidget( WholeWord, 2, 0 );

    IgnoreCase = new QCheckBox( ButtonGroup1, "IgnoreCase" );

    ButtonGroup1Layout->addWidget( IgnoreCase, 2, 1 );

    RegExp = new QRadioButton( ButtonGroup1, "RegExp" );

    ButtonGroup1Layout->addWidget( RegExp, 1, 1 );
    Spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    ButtonGroup1Layout->addItem( Spacer2, 1, 2 );
    Frame3Layout->addWidget( ButtonGroup1 );

    GroupBox1 = new QGroupBox( Frame3, "GroupBox1" );
    GroupBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, GroupBox1->sizePolicy().hasHeightForWidth() ) );
    GroupBox1->setColumnLayout(0, Qt::Vertical );
    GroupBox1->layout()->setSpacing( 6 );
    GroupBox1->layout()->setMargin( 11 );
    GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
    GroupBox1Layout->setAlignment( Qt::AlignTop );

    ReplaceText = new QMultiLineEdit( GroupBox1, "ReplaceText" );

    GroupBox1Layout->addWidget( ReplaceText, 0, 0 );
    Frame3Layout->addWidget( GroupBox1 );

    toSearchReplaceUILayout->addMultiCellWidget( Frame3, 0, 5, 0, 0 );
    languageChange();
    resize( QSize(570, 228).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( Close, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( Search, SIGNAL( clicked() ), this, SLOT( search() ) );
    connect( SearchNext, SIGNAL( clicked() ), this, SLOT( searchNext() ) );
    connect( ReplaceAll, SIGNAL( clicked() ), this, SLOT( replaceAll() ) );
    connect( SearchText, SIGNAL( textChanged() ), this, SLOT( searchChanged() ) );
    connect( Replace, SIGNAL( clicked() ), this, SLOT( replace() ) );

    // tab order
    setTabOrder( SearchText, Exact );
    setTabOrder( Exact, RegExp );
    setTabOrder( RegExp, WholeWord );
    setTabOrder( WholeWord, IgnoreCase );
    setTabOrder( IgnoreCase, ReplaceText );
    setTabOrder( ReplaceText, Search );
    setTabOrder( Search, SearchNext );
    setTabOrder( SearchNext, Replace );
    setTabOrder( Replace, ReplaceAll );
    setTabOrder( ReplaceAll, Close );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void toSearchReplaceUI::languageChange()
{
    setCaption( tr( "Search & Replace" ) );
    Search->setText( tr( "&Search Top" ) );
    SearchNext->setText( tr( "Search &Next" ) );
    Replace->setText( tr( "&Replace" ) );
    ReplaceAll->setText( tr( "Replace &All" ) );
    Close->setText( tr( "Close" ) );
    ButtonGroup1->setTitle( tr( "Search" ) );
    Exact->setText( tr( "Exact" ) );
    QToolTip::add( Exact, tr( "Match text exactly as written" ) );
    WholeWord->setText( tr( "Match Word" ) );
    QToolTip::add( WholeWord, tr( "Only match whole words" ) );
    IgnoreCase->setText( tr( "Ignore Case" ) );
    QToolTip::add( IgnoreCase, tr( "Only match whole words" ) );
    RegExp->setText( tr( "RegExp" ) );
    QToolTip::add( RegExp, tr( "Use RegExp semantics for matching (See Qt documentation)" ) );
    GroupBox1->setTitle( tr( "Replace" ) );
}

void toSearchReplaceUI::displayHelp()
{
    qWarning( "toSearchReplaceUI::displayHelp(): Not implemented yet" );
}

void toSearchReplaceUI::replace()
{
    qWarning( "toSearchReplaceUI::replace(): Not implemented yet" );
}

void toSearchReplaceUI::replaceAll()
{
    qWarning( "toSearchReplaceUI::replaceAll(): Not implemented yet" );
}

void toSearchReplaceUI::search()
{
    qWarning( "toSearchReplaceUI::search(): Not implemented yet" );
}

void toSearchReplaceUI::searchChanged()
{
    qWarning( "toSearchReplaceUI::searchChanged(): Not implemented yet" );
}

void toSearchReplaceUI::searchNext()
{
    qWarning( "toSearchReplaceUI::searchNext(): Not implemented yet" );
}

