languages/cpp/addmethoddialogbase.cpp
Go to the documentation of this file.00001
#include <kdialog.h>
00002
#include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
#include "addmethoddialogbase.h"
00013
00014
#include <qvariant.h>
00015
#include <kdialog.h>
00016
#include <qpushbutton.h>
00017
#include <qheader.h>
00018
#include <qlistview.h>
00019
#include <qgroupbox.h>
00020
#include <qlabel.h>
00021
#include <qcombobox.h>
00022
#include <qlineedit.h>
00023
#include <qcheckbox.h>
00024
#include <qtoolbutton.h>
00025
#include <qlayout.h>
00026
#include <qtooltip.h>
00027
#include <qwhatsthis.h>
00028
00029
00030
00031
00032
00033
00034
00035
00036 AddMethodDialogBase::AddMethodDialogBase(
QWidget* parent,
const char* name,
bool modal, WFlags fl )
00037 :
QDialog( parent, name, modal, fl )
00038 {
00039
if ( !name )
00040 setName(
"AddMethodDialogBase" );
00041 setSizeGripEnabled( TRUE );
00042
AddMethodDialogBaseLayout =
new QVBoxLayout(
this, KDialog::marginHint(), KDialog::spacingHint(),
"AddMethodDialogBaseLayout");
00043
00044
methods =
new QListView(
this,
"methods" );
00045
methods->addColumn( tr2i18n(
"Inline" ) );
00046
methods->addColumn( tr2i18n(
"Access" ) );
00047
methods->addColumn( tr2i18n(
"Storage" ) );
00048
methods->addColumn( tr2i18n(
"Return Type" ) );
00049
methods->addColumn( tr2i18n(
"Declarator" ) );
00050
methods->setAllColumnsShowFocus( TRUE );
00051
methods->setResizeMode( QListView::LastColumn );
00052
AddMethodDialogBaseLayout->addWidget(
methods );
00053
00054
layout3 =
new QHBoxLayout( 0, 0, KDialog::spacingHint(),
"layout3");
00055
spacer3 =
new QSpacerItem( 111, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00056
layout3->addItem(
spacer3 );
00057
00058
addMethodButton =
new QPushButton(
this,
"addMethodButton" );
00059
layout3->addWidget(
addMethodButton );
00060
00061
deleteMethodButton =
new QPushButton(
this,
"deleteMethodButton" );
00062
layout3->addWidget(
deleteMethodButton );
00063
AddMethodDialogBaseLayout->addLayout(
layout3 );
00064
00065
groupBox1 =
new QGroupBox(
this,
"groupBox1" );
00066
groupBox1->setColumnLayout(0, Qt::Vertical );
00067
groupBox1->layout()->setSpacing( KDialog::spacingHint() );
00068
groupBox1->layout()->setMargin( KDialog::marginHint() );
00069
groupBox1Layout =
new QVBoxLayout(
groupBox1->layout() );
00070
groupBox1Layout->setAlignment( Qt::AlignTop );
00071
00072
layout4 =
new QGridLayout( 0, 1, 1, 0, KDialog::spacingHint(),
"layout4");
00073
00074
textLabel1 =
new QLabel(
groupBox1,
"textLabel1" );
00075
00076
layout4->addWidget(
textLabel1, 0, 0 );
00077
00078
returnType =
new QComboBox( FALSE,
groupBox1,
"returnType" );
00079
returnType->setEditable( TRUE );
00080
00081
layout4->addWidget(
returnType, 1, 0 );
00082
00083
declarator =
new QLineEdit(
groupBox1,
"declarator" );
00084
00085
layout4->addWidget(
declarator, 1, 1 );
00086
00087
textLabel2 =
new QLabel(
groupBox1,
"textLabel2" );
00088
00089
layout4->addWidget(
textLabel2, 0, 1 );
00090
groupBox1Layout->addLayout(
layout4 );
00091
00092
layout5 =
new QGridLayout( 0, 1, 1, 0, KDialog::spacingHint(),
"layout5");
00093
00094
storage =
new QComboBox( FALSE,
groupBox1,
"storage" );
00095
00096
layout5->addWidget(
storage, 1, 1 );
00097
00098
textLabel5 =
new QLabel(
groupBox1,
"textLabel5" );
00099
00100
layout5->addWidget(
textLabel5, 0, 1 );
00101
00102
isInline =
new QCheckBox(
groupBox1,
"isInline" );
00103
00104
layout5->addWidget(
isInline, 1, 2 );
00105
00106
textLabel3 =
new QLabel(
groupBox1,
"textLabel3" );
00107
00108
layout5->addWidget(
textLabel3, 0, 0 );
00109
00110
access =
new QComboBox( FALSE,
groupBox1,
"access" );
00111
00112
layout5->addWidget(
access, 1, 0 );
00113
groupBox1Layout->addLayout(
layout5 );
00114
AddMethodDialogBaseLayout->addWidget(
groupBox1 );
00115
00116
groupBox2 =
new QGroupBox(
this,
"groupBox2" );
00117
groupBox2->setColumnLayout(0, Qt::Vertical );
00118
groupBox2->layout()->setSpacing( KDialog::spacingHint() );
00119
groupBox2->layout()->setMargin( KDialog::marginHint() );
00120
groupBox2Layout =
new QHBoxLayout(
groupBox2->layout() );
00121
groupBox2Layout->setAlignment( Qt::AlignTop );
00122
00123
sourceFile =
new QComboBox( FALSE,
groupBox2,
"sourceFile" );
00124
sourceFile->setSizePolicy(
QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0,
sourceFile->sizePolicy().hasHeightForWidth() ) );
00125
sourceFile->setEditable( TRUE );
00126
groupBox2Layout->addWidget(
sourceFile );
00127
00128
browseButton =
new QToolButton(
groupBox2,
"browseButton" );
00129
browseButton->setFocusPolicy( QToolButton::TabFocus );
00130
groupBox2Layout->addWidget(
browseButton );
00131
AddMethodDialogBaseLayout->addWidget(
groupBox2 );
00132
00133
Layout1 =
new QHBoxLayout( 0, 0, KDialog::spacingHint(),
"Layout1");
00134
Horizontal_Spacing2 =
new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00135
Layout1->addItem(
Horizontal_Spacing2 );
00136
00137
buttonOk =
new QPushButton(
this,
"buttonOk" );
00138
buttonOk->setAutoDefault( TRUE );
00139
buttonOk->setDefault( TRUE );
00140
Layout1->addWidget(
buttonOk );
00141
00142
buttonCancel =
new QPushButton(
this,
"buttonCancel" );
00143
buttonCancel->setAutoDefault( TRUE );
00144
Layout1->addWidget(
buttonCancel );
00145
AddMethodDialogBaseLayout->addLayout(
Layout1 );
00146
languageChange();
00147 resize(
QSize(613, 568).expandedTo(minimumSizeHint()) );
00148 clearWState( WState_Polished );
00149
00150
00151 connect(
buttonOk, SIGNAL( clicked() ),
this, SLOT( accept() ) );
00152 connect(
buttonCancel, SIGNAL( clicked() ),
this, SLOT( reject() ) );
00153 connect(
addMethodButton, SIGNAL( clicked() ),
this, SLOT(
addMethod() ) );
00154 connect(
deleteMethodButton, SIGNAL( clicked() ),
this, SLOT(
deleteCurrentMethod() ) );
00155 connect(
methods, SIGNAL( selectionChanged(
QListViewItem*) ),
this, SLOT(
currentChanged(
QListViewItem*) ) );
00156 connect(
returnType, SIGNAL( activated(
const QString&) ),
this, SLOT(
updateGUI() ) );
00157 connect(
declarator, SIGNAL( textChanged(
const QString&) ),
this, SLOT(
updateGUI() ) );
00158 connect(
access, SIGNAL( activated(
const QString&) ),
this, SLOT(
updateGUI() ) );
00159 connect(
isInline, SIGNAL( toggled(
bool) ),
this, SLOT(
updateGUI() ) );
00160 connect(
storage, SIGNAL( activated(
const QString&) ),
this, SLOT(
updateGUI() ) );
00161 connect(
returnType, SIGNAL( textChanged(
const QString&) ),
this, SLOT(
updateGUI() ) );
00162 connect(
sourceFile, SIGNAL( textChanged(
const QString&) ),
this, SLOT(
updateGUI() ) );
00163 connect(
sourceFile, SIGNAL( activated(
const QString&) ),
this, SLOT(
updateGUI() ) );
00164 connect(
browseButton, SIGNAL( clicked() ),
this, SLOT(
browseImplementationFile() ) );
00165
00166
00167 setTabOrder(
methods,
addMethodButton );
00168 setTabOrder(
addMethodButton,
deleteMethodButton );
00169 setTabOrder(
deleteMethodButton,
returnType );
00170 setTabOrder(
returnType,
declarator );
00171 setTabOrder(
declarator,
access );
00172 setTabOrder(
access,
storage );
00173 setTabOrder(
storage,
isInline );
00174 setTabOrder(
isInline,
sourceFile );
00175 setTabOrder(
sourceFile,
browseButton );
00176 setTabOrder(
browseButton,
buttonOk );
00177 setTabOrder(
buttonOk,
buttonCancel );
00178
00179
00180
textLabel1->setBuddy(
returnType );
00181
textLabel2->setBuddy(
declarator );
00182
textLabel5->setBuddy(
storage );
00183
textLabel3->setBuddy(
access );
00184
init();
00185 }
00186
00187
00188
00189
00190 AddMethodDialogBase::~AddMethodDialogBase()
00191 {
00192
destroy();
00193
00194 }
00195
00196
00197
00198
00199
00200 void AddMethodDialogBase::languageChange()
00201 {
00202 setCaption( tr2i18n(
"Add Method" ) );
00203
methods->header()->setLabel( 0, tr2i18n(
"Inline" ) );
00204
methods->header()->setLabel( 1, tr2i18n(
"Access" ) );
00205
methods->header()->setLabel( 2, tr2i18n(
"Storage" ) );
00206
methods->header()->setLabel( 3, tr2i18n(
"Return Type" ) );
00207
methods->header()->setLabel( 4, tr2i18n(
"Declarator" ) );
00208
addMethodButton->setText( tr2i18n(
"&Add Method" ) );
00209
deleteMethodButton->setText( tr2i18n(
"&Delete Method" ) );
00210
groupBox1->setTitle( tr2i18n(
"Method Properties" ) );
00211
textLabel1->setText( tr2i18n(
"Return t&ype:" ) );
00212
textLabel2->setText( tr2i18n(
"D&eclarator:" ) );
00213
textLabel5->setText( tr2i18n(
"S&torage:" ) );
00214
isInline->setText( tr2i18n(
"&Inline" ) );
00215
textLabel3->setText( tr2i18n(
"Acce&ss:" ) );
00216
groupBox2->setTitle( tr2i18n(
"I&mplementation File" ) );
00217
browseButton->setText( tr2i18n(
"..." ) );
00218
buttonOk->setText( tr2i18n(
"&OK" ) );
00219
buttonOk->setAccel(
QKeySequence( QString::null ) );
00220
buttonCancel->setText( tr2i18n(
"&Cancel" ) );
00221
buttonCancel->setAccel(
QKeySequence( QString::null ) );
00222 }
00223
00224 void AddMethodDialogBase::init()
00225 {
00226 }
00227
00228 void AddMethodDialogBase::destroy()
00229 {
00230 }
00231
00232 void AddMethodDialogBase::addMethod()
00233 {
00234 qWarning(
"AddMethodDialogBase::addMethod(): Not implemented yet" );
00235 }
00236
00237 void AddMethodDialogBase::deleteCurrentMethod()
00238 {
00239 qWarning(
"AddMethodDialogBase::deleteCurrentMethod(): Not implemented yet" );
00240 }
00241
00242 void AddMethodDialogBase::currentChanged(
QListViewItem*)
00243 {
00244 qWarning(
"AddMethodDialogBase::currentChanged(QListViewItem*): Not implemented yet" );
00245 }
00246
00247 void AddMethodDialogBase::updateGUI()
00248 {
00249 qWarning(
"AddMethodDialogBase::updateGUI(): Not implemented yet" );
00250 }
00251
00252 void AddMethodDialogBase::browseImplementationFile()
00253 {
00254 qWarning(
"AddMethodDialogBase::browseImplementationFile(): Not implemented yet" );
00255 }
00256
00257
#include "addmethoddialogbase.moc"
This file is part of the documentation for KDevelop Version 3.0.4.