#include "simapi.h"
/****************************************************************************
** Form implementation generated from reading ui file './fontconfigbase.ui'
**
** Created: вт мар 30 18:17:42 2004
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.1.2   edited Dec 19 11:45 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "fontconfigbase.h"

#include <qvariant.h>
#include <qwidget.h>
#include <qcheckbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>

#include "fontedit.h"
#include "qcolorbutton.h"
static const char* const img0_fontconfigbase[] = { 
"22 22 2 1",
". c None",
"# c #a4c610",
"........######........",
".....###########......",
"....##############....",
"...################...",
"..######......######..",
"..#####........#####..",
".#####.......#..#####.",
".####.......###..####.",
"####.......#####..####",
"####......#####...####",
"####....#######...####",
"####....######....####",
"####...########...####",
".####.##########..####",
".####..####.#########.",
".#####..##...########.",
"..#####.......#######.",
"..######......######..",
"...###################",
"....##################",
"......###########.###.",
"........######.....#.."};

static const char* const img1_fontconfigbase[] = { 
"22 22 2 1",
". c None",
"# c #a1c410",
"........######........",
".....###########......",
"....##############....",
"...################...",
"..######......######..",
"..#####........#####..",
".#####.......#..#####.",
".####.......###..####.",
"####.......#####..####",
"####......#####...####",
"####....#######...####",
"####....######....####",
"####...########...####",
".####.##########..####",
".####..####.#########.",
".#####..##...########.",
"..#####.......#######.",
"..######......######..",
"...###################",
"....##################",
"......###########.###.",
"........######.....#.."};


/* 
 *  Constructs a FontConfigBase as a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f'.
 */
FontConfigBase::FontConfigBase( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl ),
      image0( (const char **) img0_fontconfigbase ),
      image1( (const char **) img1_fontconfigbase )
{
    if ( !name )
	setName( "FontConfig" );
    FontConfigLayout = new QGridLayout( this, 1, 1, 11, 6, "FontConfigLayout"); 

    chkSystem = new QCheckBox( this, "chkSystem" );

    FontConfigLayout->addMultiCellWidget( chkSystem, 0, 0, 0, 1 );

    TextLabel1 = new QLabel( this, "TextLabel1" );
    TextLabel1->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignLeft ) );

    FontConfigLayout->addMultiCellWidget( TextLabel1, 1, 1, 0, 1 );

    edtFont = new FontEdit( this, "edtFont" );

    FontConfigLayout->addMultiCellWidget( edtFont, 2, 2, 0, 1 );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    FontConfigLayout->addItem( spacer, 10, 0 );

    TextLabel2_2 = new QLabel( this, "TextLabel2_2" );
    TextLabel2_2->setProperty( "sizePolicy", QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, 0, 0, TextLabel2_2->sizePolicy().hasHeightForWidth() ) );
    TextLabel2_2->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    FontConfigLayout->addWidget( TextLabel2_2, 9, 0 );

    btnBgColor = new QColorButton( this, "btnBgColor" );

    FontConfigLayout->addWidget( btnBgColor, 9, 1 );

    btnBtnColor = new QColorButton( this, "btnBtnColor" );

    FontConfigLayout->addWidget( btnBtnColor, 8, 1 );

    TextLabel1_2 = new QLabel( this, "TextLabel1_2" );
    TextLabel1_2->setProperty( "sizePolicy", QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, 0, 0, TextLabel1_2->sizePolicy().hasHeightForWidth() ) );
    TextLabel1_2->setProperty( "alignment", int( QLabel::AlignVCenter | QLabel::AlignRight ) );

    FontConfigLayout->addWidget( TextLabel1_2, 8, 0 );

    chkColors = new QCheckBox( this, "chkColors" );

    FontConfigLayout->addMultiCellWidget( chkColors, 7, 7, 0, 1 );

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

    FontConfigLayout->addMultiCellWidget( TextLabel2, 3, 3, 0, 1 );

    edtMenu = new FontEdit( this, "edtMenu" );

    FontConfigLayout->addMultiCellWidget( edtMenu, 4, 4, 0, 1 );
    languageChange();
    resize( QSize(365, 244).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void FontConfigBase::languageChange()
{
    setProperty( "caption", i18n( "Form1" ) );
    chkSystem->setProperty( "text", i18n( "Use &system fonts" ) );
    TextLabel1->setProperty( "text", i18n( "Base font:" ) );
    TextLabel2_2->setProperty( "text", i18n( "Background color:" ) );
    TextLabel1_2->setProperty( "text", i18n( "Button color:" ) );
    chkColors->setProperty( "text", i18n( "Use system &colors" ) );
    TextLabel2->setProperty( "text", i18n( "Menu font:" ) );
}

#include "fontconfigbase.moc"
