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

#include "richtextfontdialog.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqcombobox.h>
#include <ntqlabel.h>
#include <ntqtoolbutton.h>
#include <ntqframe.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "richtextfontdialog.ui.h"

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

    Layout6 = new TQGridLayout( 0, 1, 1, 0, 6, "Layout6"); 

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

    Layout6->addMultiCellWidget( fontCombo, 0, 0, 1, 2 );

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

    Layout6->addWidget( TextLabel1_2, 0, 0 );

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

    Layout6->addWidget( TextLabel2, 1, 0 );
    Spacer13 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout6->addItem( Spacer13, 2, 2 );

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

    Layout6->addWidget( TextLabel1, 2, 0 );

    fontSizeCombo = new TQComboBox( false, this, "fontSizeCombo" );
    fontSizeCombo->setEditable( true );
    fontSizeCombo->setInsertionPolicy( TQComboBox::AtTop );

    Layout6->addMultiCellWidget( fontSizeCombo, 1, 1, 1, 2 );

    colorButton = new TQToolButton( this, "colorButton" );
    colorButton->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, colorButton->sizePolicy().hasHeightForWidth() ) );
    colorButton->setMinimumSize( TQSize( 40, 20 ) );
    colorButton->setPaletteBackgroundColor( TQColor( 0, 0, 0 ) );
    colorButton->setFocusPolicy( TQToolButton::TabFocus );

    Layout6->addWidget( colorButton, 2, 1 );

    RichTextFontDialogLayout->addLayout( Layout6, 0, 0 );
    Spacer14 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    RichTextFontDialogLayout->addItem( Spacer14, 1, 0 );

    Line1 = new TQFrame( this, "Line1" );
    Line1->setFrameShape( TQFrame::HLine );
    Line1->setFrameShadow( TQFrame::Sunken );
    Line1->setFrameShape( TQFrame::HLine );

    RichTextFontDialogLayout->addWidget( Line1, 2, 0 );

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

    okButton = new TQPushButton( this, "okButton" );
    Layout15->addWidget( okButton );

    cancelButton = new TQPushButton( this, "cancelButton" );
    Layout15->addWidget( cancelButton );

    RichTextFontDialogLayout->addLayout( Layout15, 3, 0 );
    languageChange();
    resize( TQSize(255, 158).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( colorButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( selectColor() ) );
    connect( okButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( cancelButton, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );

    // tab order
    setTabOrder( fontCombo, fontSizeCombo );
    setTabOrder( fontSizeCombo, colorButton );
    setTabOrder( colorButton, okButton );
    setTabOrder( okButton, cancelButton );

    // buddies
    TextLabel1_2->setBuddy( fontCombo );
    TextLabel2->setBuddy( fontSizeCombo );
    TextLabel1->setBuddy( colorButton );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void RichTextFontDialog::languageChange()
{
    setCaption( tr( "Font Properties" ) );
    fontCombo->clear();
    fontCombo->insertItem( tr( "default" ) );
    TextLabel1_2->setText( tr( "&Font:" ) );
    TextLabel2->setText( tr( "Rel. &Size:" ) );
    TextLabel1->setText( tr( "C&olor:" ) );
    fontSizeCombo->clear();
    fontSizeCombo->insertItem( tr( "0" ) );
    fontSizeCombo->insertItem( tr( "-4" ) );
    fontSizeCombo->insertItem( tr( "-3" ) );
    fontSizeCombo->insertItem( tr( "-2" ) );
    fontSizeCombo->insertItem( tr( "-1" ) );
    fontSizeCombo->insertItem( tr( "+1" ) );
    fontSizeCombo->insertItem( tr( "+2" ) );
    fontSizeCombo->insertItem( tr( "+3" ) );
    fontSizeCombo->insertItem( tr( "+4" ) );
    colorButton->setText( TQString::null );
    okButton->setText( tr( "&OK" ) );
    cancelButton->setText( tr( "&Cancel" ) );
}

