lib

KoChangeCaseDia.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2001 Montel Laurent <lmontel@mandrakesoft.com>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include <tdelocale.h>
21
22#include <tqvbox.h>
23#include <tqwhatsthis.h>
24#include <tqbuttongroup.h>
25#include <tqradiobutton.h>
26
27#include "KoChangeCaseDia.h"
28
29
30KoChangeCaseDia::KoChangeCaseDia( TQWidget *parent, const char *name )
31 : KDialogBase( parent, name , true, "", Ok|Cancel, Ok, true )
32{
33
34 setCaption( i18n("Change Case") );
35 TQVBox *page = makeVBoxMainWidget();
36
37 TQButtonGroup *grp = new TQButtonGroup( 1, TQt::Horizontal, i18n( "Case" ),page );
38 grp->setRadioButtonExclusive( true );
39 grp->layout();
40 m_upperCase=new TQRadioButton( i18n("&Uppercase"), grp );
41 m_lowerCase=new TQRadioButton( i18n("&Lowercase"), grp );
42
43 m_titleCase=new TQRadioButton( i18n("T&itle case"), grp );
44
45 m_toggleCase=new TQRadioButton( i18n("&Toggle case"), grp );
46 m_sentenceCase=new TQRadioButton( i18n("Sentence case"), grp );
47 TQWhatsThis::add( m_sentenceCase, i18n("Convert first letter of a sentence to uppercase."));
48
49 m_upperCase->setChecked(true);
50 grp->setRadioButtonExclusive( true );
51
52}
53
54KoChangeCaseDia::TypeOfCase KoChangeCaseDia::getTypeOfCase()
55{
56 TypeOfCase type=UpperCase;
57 if( m_upperCase->isChecked())
58 type=UpperCase;
59 else if(m_lowerCase->isChecked())
60 type=LowerCase;
61 else if(m_titleCase->isChecked())
62 type=TitleCase;
63 else if( m_toggleCase->isChecked())
64 type=ToggleCase;
65 else if( m_sentenceCase->isChecked())
66 type=SentenceCase;
67 return type;
68}
69
70#include "KoChangeCaseDia.moc"
const char * name(StdAction id)