#include "simapi.h"
/****************************************************************************
** Form implementation generated from reading ui file './shortcutcfgbase.ui'
**
** Created: вт мар 30 17:54:34 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 "shortcutcfgbase.h"

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

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

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


/* 
 *  Constructs a ShortcutsConfigBase as a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f'.
 */
ShortcutsConfigBase::ShortcutsConfigBase( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl ),
      image0( (const char **) img0_shortcutcfgbase ),
      image1( (const char **) img1_shortcutcfgbase )
{
    if ( !name )
	setName( "Form1" );
    Form1Layout = new QVBoxLayout( this, 11, 6, "Form1Layout"); 

    lstKeys = new QListView( this, "lstKeys" );
    lstKeys->addColumn( i18n( "Command" ) );
    lstKeys->addColumn( i18n( "Key" ) );
    lstKeys->header()->setResizeEnabled( FALSE, lstKeys->header()->count() - 1 );
    lstKeys->addColumn( i18n( "Global" ) );
    lstKeys->header()->setResizeEnabled( FALSE, lstKeys->header()->count() - 1 );
    Form1Layout->addWidget( lstKeys );

    lblKey = new QLabel( this, "lblKey" );
    Form1Layout->addWidget( lblKey );

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

    edtKey = new QKeyButton( this, "edtKey" );
    Layout1->addWidget( edtKey );

    btnClear = new QPushButton( this, "btnClear" );
    Layout1->addWidget( btnClear );

    chkGlobal = new QCheckBox( this, "chkGlobal" );
    Layout1->addWidget( chkGlobal );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout1->addItem( spacer );
    Form1Layout->addLayout( Layout1 );
    languageChange();
    resize( QSize(309, 180).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ShortcutsConfigBase::languageChange()
{
    setProperty( "caption", i18n( "Form1" ) );
    lstKeys->header()->setLabel( 0, i18n( "Command" ) );
    lstKeys->header()->setLabel( 1, i18n( "Key" ) );
    lstKeys->header()->setLabel( 2, i18n( "Global" ) );
    lblKey->setProperty( "text", QString::null );
    btnClear->setProperty( "text", i18n( "&Clear" ) );
    chkGlobal->setProperty( "text", i18n( "Global" ) );
}

#include "shortcutcfgbase.moc"
