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

#include "finddialog.h"

#include <ntqvariant.h>
#include <ntqlineedit.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "../interfaces/editorinterface.h"
#include "finddialog.ui.h"

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

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

    TextLabel1 = new TQLabel( this, "TextLabel1" );
    Layout1->addWidget( TextLabel1 );

    comboFind = new TQComboBox( false, this, "comboFind" );
    comboFind->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, comboFind->sizePolicy().hasHeightForWidth() ) );
    comboFind->setEditable( true );
    Layout1->addWidget( comboFind );

    FindDialogLayout->addMultiCellLayout( Layout1, 0, 0, 0, 1 );

    Layout2 = new TQHBoxLayout( 0, 0, 6, "Layout2"); 
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout2->addItem( Spacer1 );

    PushButton1 = new TQPushButton( this, "PushButton1" );
    PushButton1->setDefault( true );
    Layout2->addWidget( PushButton1 );

    PushButton2 = new TQPushButton( this, "PushButton2" );
    Layout2->addWidget( PushButton2 );

    FindDialogLayout->addMultiCellLayout( Layout2, 2, 2, 0, 1 );

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

    radioForward = new TQRadioButton( ButtonGroup2, "radioForward" );
    radioForward->setChecked( true );
    ButtonGroup2Layout->addWidget( radioForward );

    radioBackward = new TQRadioButton( ButtonGroup2, "radioBackward" );
    ButtonGroup2Layout->addWidget( radioBackward );

    FindDialogLayout->addWidget( ButtonGroup2, 1, 1 );

    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 );

    checkWords = new TQCheckBox( ButtonGroup1, "checkWords" );
    ButtonGroup1Layout->addWidget( checkWords );

    checkCase = new TQCheckBox( ButtonGroup1, "checkCase" );
    ButtonGroup1Layout->addWidget( checkCase );

    checkBegin = new TQCheckBox( ButtonGroup1, "checkBegin" );
    ButtonGroup1Layout->addWidget( checkBegin );

    FindDialogLayout->addWidget( ButtonGroup1, 1, 0 );
    languageChange();
    resize( TQSize(285, 189).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( PushButton1, TQ_SIGNAL( clicked() ), this, TQ_SLOT( doFind() ) );
    connect( PushButton2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );

    // tab order
    setTabOrder( comboFind, checkWords );
    setTabOrder( checkWords, checkCase );
    setTabOrder( checkCase, checkBegin );
    setTabOrder( checkBegin, radioForward );
    setTabOrder( radioForward, radioBackward );
    setTabOrder( radioBackward, PushButton1 );
    setTabOrder( PushButton1, PushButton2 );

    // buddies
    TextLabel1->setBuddy( comboFind );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void FindDialog::languageChange()
{
    setCaption( tr( "Find Text" ) );
    TextLabel1->setText( tr( "F&ind:" ) );
    PushButton1->setText( tr( "&Find" ) );
    PushButton2->setText( tr( "&Close" ) );
    ButtonGroup2->setTitle( tr( "Direction" ) );
    radioForward->setText( tr( "Forwar&d" ) );
    radioBackward->setText( tr( "Bac&kward" ) );
    ButtonGroup1->setTitle( tr( "Options" ) );
    checkWords->setText( tr( "&Whole words only" ) );
    checkCase->setText( tr( "Case &sensitive" ) );
    checkBegin->setText( tr( "Start at &Beginning" ) );
}

