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

#include "newform.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqiconview.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

    helpButton = new TQPushButton( this, "helpButton" );
    helpButton->setAutoDefault( true );
    Layout1->addWidget( helpButton );
    Horizontal_Spacing2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout1->addItem( Horizontal_Spacing2 );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( true );
    buttonOk->setDefault( true );
    Layout1->addWidget( buttonOk );

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( true );
    Layout1->addWidget( buttonCancel );

    NewFormBaseLayout->addMultiCellLayout( Layout1, 2, 2, 0, 2 );

    templateView = new TQIconView( this, "templateView" );
    templateView->setGridX( 120 );
    templateView->setResizeMode( TQIconView::Adjust );
    templateView->setItemsMovable( false );
    templateView->setWordWrapIconText( true );

    NewFormBaseLayout->addMultiCellWidget( templateView, 1, 1, 0, 2 );

    labelProject = new TQLabel( this, "labelProject" );

    NewFormBaseLayout->addWidget( labelProject, 0, 0 );

    projectCombo = new TQComboBox( false, this, "projectCombo" );

    NewFormBaseLayout->addWidget( projectCombo, 0, 1 );
    Spacer2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    NewFormBaseLayout->addItem( Spacer2, 0, 2 );
    languageChange();
    resize( TQSize(557, 436).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( projectCombo, TQ_SIGNAL( activated(const TQString&) ), this, TQ_SLOT( projectChanged(const TQString&) ) );
    connect( templateView, TQ_SIGNAL( currentChanged(TQIconViewItem*) ), this, TQ_SLOT( itemChanged(TQIconViewItem*) ) );
    connect( templateView, TQ_SIGNAL( doubleClicked(TQIconViewItem*) ), this, TQ_SLOT( accept() ) );
    connect( templateView, TQ_SIGNAL( returnPressed(TQIconViewItem*) ), this, TQ_SLOT( accept() ) );

    // tab order
    setTabOrder( templateView, helpButton );
    setTabOrder( helpButton, buttonOk );
    setTabOrder( buttonOk, buttonCancel );

    // buddies
    labelProject->setBuddy( projectCombo );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void NewFormBase::languageChange()
{
    setCaption( tr( "New File" ) );
    TQWhatsThis::add( this, tr( "<b>New Form</b><p>Select a template for the new form and click the <b>OK</b>-button to create it.</p>" ) );
    helpButton->setText( tr( "&Help" ) );
    buttonOk->setText( tr( "&OK" ) );
    TQWhatsThis::add( buttonOk, tr( "Create a new form using the selected template." ) );
    buttonCancel->setText( tr( "&Cancel" ) );
    TQWhatsThis::add( buttonCancel, tr( "Close the dialog without creating a new form." ) );
    TQWhatsThis::add( templateView, tr( "Displays a list of the available templates." ) );
    labelProject->setText( tr( "&Insert into:" ) );
}

void NewFormBase::itemChanged(TQIconViewItem*)
{
    tqWarning( "NewFormBase::itemChanged(TQIconViewItem*): Not implemented yet" );
}

void NewFormBase::projectChanged(const TQString&)
{
    tqWarning( "NewFormBase::projectChanged(const TQString&): Not implemented yet" );
}

