languages/php/phpnewclassdlgbase.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 "phpnewclassdlgbase.h"
00013
00014
#include <qvariant.h>
00015
#include <kdialog.h>
00016
#include <qlabel.h>
00017
#include <qpushbutton.h>
00018
#include <klineedit.h>
00019
#include <qlineedit.h>
00020
#include <qtoolbutton.h>
00021
#include <qtextedit.h>
00022
#include <qlayout.h>
00023
#include <qtooltip.h>
00024
#include <qwhatsthis.h>
00025
00026
00027
00028
00029
00030
00031
00032
00033 PHPNewClassDlgBase::PHPNewClassDlgBase(
QWidget* parent,
const char* name,
bool modal, WFlags fl )
00034 :
QDialog( parent, name, modal, fl )
00035 {
00036
if ( !name )
00037 setName(
"m_ClassDLG" );
00038
m_ClassDLGLayout =
new QGridLayout(
this, 1, 1, KDialog::marginHint(), KDialog::spacingHint(),
"m_ClassDLGLayout");
00039
00040
TextLabel1 =
new QLabel(
this,
"TextLabel1" );
00041
00042
m_ClassDLGLayout->addWidget(
TextLabel1, 0, 0 );
00043
Spacer1 =
new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00044
m_ClassDLGLayout->addMultiCell(
Spacer1, 5, 5, 0, 2 );
00045
00046
m_okButton =
new QPushButton(
this,
"m_okButton" );
00047
m_okButton->setDefault( TRUE );
00048
00049
m_ClassDLGLayout->addMultiCellWidget(
m_okButton, 5, 5, 3, 4 );
00050
00051
m_cancelButton =
new QPushButton(
this,
"m_cancelButton" );
00052
00053
m_ClassDLGLayout->addMultiCellWidget(
m_cancelButton, 5, 5, 5, 6 );
00054
00055
m_baseClassEdit =
new KLineEdit(
this,
"m_baseClassEdit" );
00056
00057
m_ClassDLGLayout->addMultiCellWidget(
m_baseClassEdit, 0, 0, 4, 6 );
00058
00059
m_classNameEdit =
new QLineEdit(
this,
"m_classNameEdit" );
00060
00061
m_ClassDLGLayout->addWidget(
m_classNameEdit, 0, 1 );
00062
00063
TextLabel2 =
new QLabel(
this,
"TextLabel2" );
00064
00065
m_ClassDLGLayout->addMultiCellWidget(
TextLabel2, 0, 0, 2, 3 );
00066
00067
TextLabel4 =
new QLabel(
this,
"TextLabel4" );
00068
00069
m_ClassDLGLayout->addMultiCellWidget(
TextLabel4, 3, 3, 0, 2 );
00070
00071
TextLabel1_2 =
new QLabel(
this,
"TextLabel1_2" );
00072
00073
m_ClassDLGLayout->addWidget(
TextLabel1_2, 2, 0 );
00074
00075
TextLabel3 =
new QLabel(
this,
"TextLabel3" );
00076
00077
m_ClassDLGLayout->addWidget(
TextLabel3, 1, 0 );
00078
00079
m_dirButton =
new QToolButton(
this,
"m_dirButton" );
00080
m_dirButton->setFocusPolicy( QToolButton::TabFocus );
00081
00082
m_ClassDLGLayout->addWidget(
m_dirButton, 2, 6 );
00083
00084
m_fileNameEdit =
new QLineEdit(
this,
"m_fileNameEdit" );
00085
00086
m_ClassDLGLayout->addWidget(
m_fileNameEdit, 1, 1 );
00087
00088
m_dirEdit =
new QLineEdit(
this,
"m_dirEdit" );
00089
00090
m_ClassDLGLayout->addMultiCellWidget(
m_dirEdit, 2, 2, 1, 5 );
00091
00092
m_classTemplate =
new QTextEdit(
this,
"m_classTemplate" );
00093
00094
m_ClassDLGLayout->addMultiCellWidget(
m_classTemplate, 4, 4, 0, 6 );
00095
languageChange();
00096 resize(
QSize(439, 386).expandedTo(minimumSizeHint()) );
00097 clearWState( WState_Polished );
00098
00099
00100 connect(
m_okButton, SIGNAL( clicked() ),
this, SLOT( accept() ) );
00101 connect(
m_cancelButton, SIGNAL( clicked() ),
this, SLOT( reject() ) );
00102
00103
00104 setTabOrder(
m_classNameEdit,
m_baseClassEdit );
00105 setTabOrder(
m_baseClassEdit,
m_fileNameEdit );
00106 setTabOrder(
m_fileNameEdit,
m_dirEdit );
00107 setTabOrder(
m_dirEdit,
m_dirButton );
00108 setTabOrder(
m_dirButton,
m_classTemplate );
00109 setTabOrder(
m_classTemplate,
m_okButton );
00110 setTabOrder(
m_okButton,
m_cancelButton );
00111
00112
00113
TextLabel1->setBuddy(
m_classNameEdit );
00114
TextLabel2->setBuddy(
m_baseClassEdit );
00115
TextLabel4->setBuddy(
m_classTemplate );
00116
TextLabel1_2->setBuddy(
m_dirEdit );
00117
TextLabel3->setBuddy(
m_fileNameEdit );
00118 }
00119
00120
00121
00122
00123 PHPNewClassDlgBase::~PHPNewClassDlgBase()
00124 {
00125
00126 }
00127
00128
00129
00130
00131
00132 void PHPNewClassDlgBase::languageChange()
00133 {
00134 setCaption( tr2i18n(
"New Class" ) );
00135
TextLabel1->setText( tr2i18n(
"Class &name:" ) );
00136
m_okButton->setText( tr2i18n(
"&OK" ) );
00137
m_cancelButton->setText( tr2i18n(
"&Cancel" ) );
00138
TextLabel2->setText( tr2i18n(
"&Base class:" ) );
00139
TextLabel4->setText( tr2i18n(
"Class &template:" ) );
00140
TextLabel1_2->setText( tr2i18n(
"&Directory:" ) );
00141
TextLabel3->setText( tr2i18n(
"&File name:" ) );
00142
m_dirButton->setText( tr2i18n(
"..." ) );
00143
m_classTemplate->setText( tr2i18n(
"<?php\n"
00144
"if (!defined(\"FILENAME\")){\n"
00145
"define(\"FILENAME\",0);\n"
00146
"/*\n"
00147
"* @author AUTHOR\n"
00148
"*/\n"
00149
"\n"
00150
"class CLASSNAME extends BASECLASS {\n"
00151
" //constructor\n"
00152
" function CLASSNAME(){\n"
00153
" BASECLASS::BASECLASS();\n"
00154
" }\n"
00155
" }\n"
00156
"}\n"
00157
"?>" ) );
00158 }
00159
00160
#include "phpnewclassdlgbase.moc"
This file is part of the documentation for KDevelop Version 3.0.4.