F:/KPlato/koffice/libs/kotext/KoChangeCaseDia.cpp

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C)  2001 Montel Laurent <lmontel@mandrakesoft.com>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #include <klocale.h>
00021 #include <kvbox.h>
00022 
00023 #include <q3vbox.h>
00024 
00025 #include <QButtonGroup>
00026 #include <QGroupBox>
00027 #include <QRadioButton>
00028 
00029 #include "KoChangeCaseDia.h"
00030 
00031 
00032 KoChangeCaseDia::KoChangeCaseDia( QWidget *parent, const char *name )
00033     : KDialog( parent )
00034 {
00035     setModal( true );
00036     setObjectName( name );
00037     setButtons( Ok|Cancel );
00038     setDefaultButton( Ok );
00039     setCaption( i18n("Change Case") );
00040     showButtonSeparator( true );
00041     KVBox *page = new KVBox();
00042     setMainWidget(page);
00043 
00044     QGroupBox *grp = new QGroupBox( i18n( "Case" ), this ); // page is not possible
00045     grp->layout();
00046     m_upperCase = new QRadioButton( i18n("&Uppercase"), grp );
00047     m_lowerCase = new QRadioButton( i18n("&Lowercase"), grp );
00048     m_titleCase = new QRadioButton( i18n("T&itle case"), grp );
00049     m_toggleCase = new QRadioButton( i18n("&Toggle case"), grp );
00050     m_sentenceCase = new QRadioButton( i18n("Sentence case"), grp );
00051 
00052     QButtonGroup* btnGroup = new QButtonGroup( this );   // page is not possible
00053     btnGroup->addButton( m_upperCase );
00054     btnGroup->addButton( m_lowerCase );
00055     btnGroup->addButton( m_titleCase );
00056     btnGroup->addButton( m_toggleCase );
00057     btnGroup->addButton( m_sentenceCase );
00058     
00059     m_sentenceCase->setWhatsThis( i18n("Convert first letter of a sentence to uppercase."));
00060 
00061     m_upperCase->setChecked(true);
00062 }
00063 
00064 KoChangeCaseDia::TypeOfCase KoChangeCaseDia::getTypeOfCase()
00065 {
00066     TypeOfCase type=UpperCase;
00067     if( m_upperCase->isChecked())
00068         type=UpperCase;
00069     else if(m_lowerCase->isChecked())
00070         type=LowerCase;
00071     else if(m_titleCase->isChecked())
00072         type=TitleCase;
00073     else if( m_toggleCase->isChecked())
00074         type=ToggleCase;
00075     else if( m_sentenceCase->isChecked())
00076         type=SentenceCase;
00077     return type;
00078 }
00079 
00080 #include "KoChangeCaseDia.moc"

Généré le Wed Nov 22 23:41:07 2006 pour KPlato par  doxygen 1.5.1-p1