kdeui Library API Documentation

kshortcutdialog_advanced.cpp

00001 #include <klocale.h>
00002 /****************************************************************************
00003 ** Form implementation generated from reading ui file './kshortcutdialog_advanced.ui'
00004 **
00005 ** Created: Wed Feb 4 11:24:11 2004
00006 **      by: The User Interface Compiler ($Id: qt/main.cpp   3.2.3   edited May 19 14:22 $)
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "kshortcutdialog_advanced.h"
00012 
00013 #include <qvariant.h>
00014 #include <kpushbutton.h>
00015 #include <qpushbutton.h>
00016 #include <qbuttongroup.h>
00017 #include <qradiobutton.h>
00018 #include <qcheckbox.h>
00019 #include <qlayout.h>
00020 #include <qtooltip.h>
00021 #include <qwhatsthis.h>
00022 
00023 /*
00024  *  Constructs a KShortcutDialogAdvanced as a child of 'parent', with the
00025  *  name 'name' and widget flags set to 'f'.
00026  */
00027 KShortcutDialogAdvanced::KShortcutDialogAdvanced( QWidget* parent, const char* name, WFlags fl )
00028     : QWidget( parent, name, fl )
00029 {
00030     if ( !name )
00031     setName( "KShortcutDialogAdvanced" );
00032     setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, 0, 0, sizePolicy().hasHeightForWidth() ) );
00033     KShortcutDialogAdvancedLayout = new QVBoxLayout( this, 0, KDialog::spacingHint(), "KShortcutDialogAdvancedLayout"); 
00034 
00035     m_frameMore = new QButtonGroup( this, "m_frameMore" );
00036     m_frameMore->setFrameShape( QButtonGroup::NoFrame );
00037     m_frameMore->setFrameShadow( QButtonGroup::Plain );
00038     m_frameMore->setColumnLayout(0, Qt::Vertical );
00039     m_frameMore->layout()->setSpacing( KDialog::spacingHint() );
00040     m_frameMore->layout()->setMargin( 0 );
00041     m_frameMoreLayout = new QGridLayout( m_frameMore->layout() );
00042     m_frameMoreLayout->setAlignment( Qt::AlignTop );
00043 
00044     m_btnAlternate = new QRadioButton( m_frameMore, "m_btnAlternate" );
00045     m_btnAlternate->setFocusPolicy( QRadioButton::NoFocus );
00046 
00047     m_frameMoreLayout->addWidget( m_btnAlternate, 1, 0 );
00048 
00049     m_btnPrimary = new QRadioButton( m_frameMore, "m_btnPrimary" );
00050     m_btnPrimary->setFocusPolicy( QRadioButton::NoFocus );
00051 
00052     m_frameMoreLayout->addWidget( m_btnPrimary, 0, 0 );
00053 
00054     layout6 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout6"); 
00055 
00056     m_txtAlternate = new KPushButton( m_frameMore, "m_txtAlternate" );
00057     m_txtAlternate->setPaletteBackgroundColor( QColor( 255, 255, 255 ) );
00058     m_txtAlternate->setFocusPolicy( KPushButton::ClickFocus );
00059     m_txtAlternate->setAutoDefault( FALSE );
00060     m_txtAlternate->setDefault( FALSE );
00061     layout6->addWidget( m_txtAlternate );
00062     QSpacerItem* spacer = new QSpacerItem( 21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00063     layout6->addItem( spacer );
00064 
00065     m_frameMoreLayout->addLayout( layout6, 1, 2 );
00066 
00067     layout7 = new QHBoxLayout( 0, 0, KDialog::spacingHint(), "layout7"); 
00068 
00069     m_txtPrimary = new KPushButton( m_frameMore, "m_txtPrimary" );
00070     m_txtPrimary->setPaletteBackgroundColor( QColor( 255, 255, 255 ) );
00071     m_txtPrimary->setCursor( QCursor( 4 ) );
00072     m_txtPrimary->setFocusPolicy( KPushButton::ClickFocus );
00073     m_txtPrimary->setAutoDefault( FALSE );
00074     layout7->addWidget( m_txtPrimary );
00075     QSpacerItem* spacer_2 = new QSpacerItem( 21, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00076     layout7->addItem( spacer_2 );
00077 
00078     m_frameMoreLayout->addLayout( layout7, 0, 2 );
00079 
00080     m_btnClearPrimary = new QPushButton( m_frameMore, "m_btnClearPrimary" );
00081     m_btnClearPrimary->setFlat( TRUE );
00082 
00083     m_frameMoreLayout->addWidget( m_btnClearPrimary, 0, 1 );
00084 
00085     m_btnClearAlternate = new QPushButton( m_frameMore, "m_btnClearAlternate" );
00086     m_btnClearAlternate->setFlat( TRUE );
00087 
00088     m_frameMoreLayout->addWidget( m_btnClearAlternate, 1, 1 );
00089 
00090     m_btnMultiKey = new QCheckBox( m_frameMore, "m_btnMultiKey" );
00091     m_btnMultiKey->setFocusPolicy( QCheckBox::NoFocus );
00092 
00093     m_frameMoreLayout->addWidget( m_btnMultiKey, 2, 0 );
00094     KShortcutDialogAdvancedLayout->addWidget( m_frameMore );
00095     languageChange();
00096     resize( QSize(359, 157).expandedTo(minimumSizeHint()) );
00097     clearWState( WState_Polished );
00098 
00099     // signals and slots connections
00100     connect( m_txtPrimary, SIGNAL( clicked() ), m_btnPrimary, SLOT( animateClick() ) );
00101     connect( m_txtAlternate, SIGNAL( clicked() ), m_btnAlternate, SLOT( animateClick() ) );
00102 }
00103 
00104 /*
00105  *  Destroys the object and frees any allocated resources
00106  */
00107 KShortcutDialogAdvanced::~KShortcutDialogAdvanced()
00108 {
00109     // no need to delete child widgets, Qt does it all for us
00110 }
00111 
00112 /*
00113  *  Sets the strings of the subwidgets using the current
00114  *  language.
00115  */
00116 void KShortcutDialogAdvanced::languageChange()
00117 {
00118     setCaption( tr2i18n( "KShortcutDialogAdvanced" ) );
00119     m_frameMore->setTitle( QString::null );
00120     m_btnAlternate->setText( tr2i18n( "Alternate shortcut:" ) );
00121     m_btnPrimary->setText( tr2i18n( "Primary shortcut:" ) );
00122     m_txtAlternate->setText( QString::null );
00123     m_txtPrimary->setText( QString::null );
00124     QWhatsThis::add( m_txtPrimary, tr2i18n( "The currently set shortcut or the shortcut you are entering will show up here." ) );
00125     m_btnClearPrimary->setText( tr2i18n( "x" ) );
00126     QToolTip::add( m_btnClearPrimary, tr2i18n( "Clear shortcut" ) );
00127     m_btnClearAlternate->setText( tr2i18n( "x" ) );
00128     QToolTip::add( m_btnClearAlternate, tr2i18n( "Clear shortcut" ) );
00129     m_btnMultiKey->setText( tr2i18n( "Multi-key mode" ) );
00130     QToolTip::add( m_btnMultiKey, tr2i18n( "Enable the entry of multi-key shortcuts" ) );
00131     QWhatsThis::add( m_btnMultiKey, tr2i18n( "Click this checkbox to enable the entry of multi-key shortcuts.  A multi-key shortcut consists of a sequence of up to 4 keys.  For example, you could assign \"Ctrl+F,B\" to Font-Italics and \"Ctrl+F,U\" to Font-Underline." ) );
00132 }
00133 
00134 #include "kshortcutdialog_advanced.moc"
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 4 12:34:19 2004 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2003