00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "diagrampropertiespage.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qgroupbox.h>
00017 #include <qlabel.h>
00018 #include <qlineedit.h>
00019 #include <qspinbox.h>
00020 #include <qcheckbox.h>
00021 #include <qframe.h>
00022 #include <qtextedit.h>
00023 #include <qlayout.h>
00024 #include <qtooltip.h>
00025 #include <qwhatsthis.h>
00026
00027
00028
00029
00030
00031 DiagramPropertiesPage::DiagramPropertiesPage( QWidget* parent, const char* name, WFlags fl )
00032 : QWidget( parent, name, fl )
00033 {
00034 if ( !name )
00035 setName( "DiagramPropertiesPage" );
00036 DiagramPropertiesPageLayout = new QVBoxLayout( this, 11, 6, "DiagramPropertiesPageLayout");
00037
00038 GroupBox1 = new QGroupBox( this, "GroupBox1" );
00039 GroupBox1->setColumnLayout(0, Qt::Vertical );
00040 GroupBox1->layout()->setSpacing( 6 );
00041 GroupBox1->layout()->setMargin( 11 );
00042 GroupBox1Layout = new QVBoxLayout( GroupBox1->layout() );
00043 GroupBox1Layout->setAlignment( Qt::AlignTop );
00044
00045 Layout4 = new QHBoxLayout( 0, 0, 6, "Layout4");
00046
00047 TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
00048 Layout4->addWidget( TextLabel1 );
00049
00050 diagramName = new QLineEdit( GroupBox1, "diagramName" );
00051 Layout4->addWidget( diagramName );
00052 GroupBox1Layout->addLayout( Layout4 );
00053
00054 layout20 = new QHBoxLayout( 0, 0, 6, "layout20");
00055
00056 layout6 = new QHBoxLayout( 0, 0, 6, "layout6");
00057
00058 TextLabel4 = new QLabel( GroupBox1, "TextLabel4" );
00059 layout6->addWidget( TextLabel4 );
00060
00061 zoom = new QSpinBox( GroupBox1, "zoom" );
00062 zoom->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, zoom->sizePolicy().hasHeightForWidth() ) );
00063 zoom->setMaxValue( 500 );
00064 zoom->setMinValue( 10 );
00065 layout6->addWidget( zoom );
00066
00067 textLabel1 = new QLabel( GroupBox1, "textLabel1" );
00068 layout6->addWidget( textLabel1 );
00069 layout20->addLayout( layout6 );
00070 Spacer1 = new QSpacerItem( 50, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00071 layout20->addItem( Spacer1 );
00072
00073 showOpSigs = new QCheckBox( GroupBox1, "showOpSigs" );
00074 layout20->addWidget( showOpSigs );
00075 GroupBox1Layout->addLayout( layout20 );
00076
00077 Line1 = new QFrame( GroupBox1, "Line1" );
00078 Line1->setFrameShape( QFrame::HLine );
00079 Line1->setFrameShadow( QFrame::Sunken );
00080 Line1->setFrameShape( QFrame::HLine );
00081 GroupBox1Layout->addWidget( Line1 );
00082
00083 layout7 = new QHBoxLayout( 0, 0, 6, "layout7");
00084
00085 layout6_2 = new QHBoxLayout( 0, 0, 6, "layout6_2");
00086
00087 showGrid = new QCheckBox( GroupBox1, "showGrid" );
00088 layout6_2->addWidget( showGrid );
00089
00090 snapToGrid = new QCheckBox( GroupBox1, "snapToGrid" );
00091 layout6_2->addWidget( snapToGrid );
00092
00093 snapComponentSizeToGrid = new QCheckBox( GroupBox1, "snapComponentSizeToGrid" );
00094 layout6_2->addWidget( snapComponentSizeToGrid );
00095 layout7->addLayout( layout6_2 );
00096 Spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00097 layout7->addItem( Spacer2 );
00098 GroupBox1Layout->addLayout( layout7 );
00099
00100 layout8 = new QHBoxLayout( 0, 0, 6, "layout8");
00101
00102 Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1");
00103
00104 TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
00105 Layout1->addWidget( TextLabel2 );
00106
00107 TextLabelX = new QLabel( GroupBox1, "TextLabelX" );
00108 Layout1->addWidget( TextLabelX );
00109
00110 gridSpaceX = new QSpinBox( GroupBox1, "gridSpaceX" );
00111 gridSpaceX->setMaxValue( 100 );
00112 gridSpaceX->setMinValue( 5 );
00113 Layout1->addWidget( gridSpaceX );
00114
00115 TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
00116 Layout1->addWidget( TextLabel3 );
00117
00118 gridSpaceY = new QSpinBox( GroupBox1, "gridSpaceY" );
00119 gridSpaceY->setMaxValue( 100 );
00120 gridSpaceY->setMinValue( 5 );
00121 Layout1->addWidget( gridSpaceY );
00122 layout8->addLayout( Layout1 );
00123 Spacer3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00124 layout8->addItem( Spacer3 );
00125 GroupBox1Layout->addLayout( layout8 );
00126
00127 layout10 = new QHBoxLayout( 0, 0, 6, "layout10");
00128
00129 Layout1_2 = new QHBoxLayout( 0, 0, 6, "Layout1_2");
00130
00131 TextLabe15 = new QLabel( GroupBox1, "TextLabe15" );
00132 Layout1_2->addWidget( TextLabe15 );
00133
00134 lineWidth = new QSpinBox( GroupBox1, "lineWidth" );
00135 lineWidth->setMaxValue( 10 );
00136 lineWidth->setMinValue( 0 );
00137 Layout1_2->addWidget( lineWidth );
00138 layout10->addLayout( Layout1_2 );
00139 Spacer4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00140 layout10->addItem( Spacer4 );
00141 GroupBox1Layout->addLayout( layout10 );
00142 DiagramPropertiesPageLayout->addWidget( GroupBox1 );
00143
00144 GroupBox2 = new QGroupBox( this, "GroupBox2" );
00145 GroupBox2->setColumnLayout(0, Qt::Vertical );
00146 GroupBox2->layout()->setSpacing( 6 );
00147 GroupBox2->layout()->setMargin( 11 );
00148 GroupBox2Layout = new QGridLayout( GroupBox2->layout() );
00149 GroupBox2Layout->setAlignment( Qt::AlignTop );
00150
00151 documentation = new QTextEdit( GroupBox2, "documentation" );
00152
00153 GroupBox2Layout->addWidget( documentation, 0, 0 );
00154 DiagramPropertiesPageLayout->addWidget( GroupBox2 );
00155 languageChange();
00156 resize( QSize(388, 388).expandedTo(minimumSizeHint()) );
00157 clearWState( WState_Polished );
00158 }
00159
00160
00161
00162
00163 DiagramPropertiesPage::~DiagramPropertiesPage()
00164 {
00165
00166 }
00167
00168
00169
00170
00171
00172 void DiagramPropertiesPage::languageChange()
00173 {
00174 GroupBox1->setTitle( tr2i18n( "Diagram Properties" ) );
00175 TextLabel1->setText( tr2i18n( "Name:" ) );
00176 TextLabel4->setText( tr2i18n( "Zoom:" ) );
00177 textLabel1->setText( tr2i18n( "%" ) );
00178 showOpSigs->setText( tr2i18n( "Show operation signature" ) );
00179 showGrid->setText( tr2i18n( "Show &grid" ) );
00180 snapToGrid->setText( tr2i18n( "Snap &to grid" ) );
00181 snapComponentSizeToGrid->setText( tr2i18n( "Snap component size" ) );
00182 QWhatsThis::add( snapComponentSizeToGrid, tr2i18n( "Snap the size of the components to be a multiple of the grid spacing.\n"
00183 "If 'Snap to Grid' is enabled a component will always be aligned with the grid on all 4 sides." ) );
00184 TextLabel2->setText( tr2i18n( "Grid spacing: " ) );
00185 TextLabelX->setText( tr2i18n( "X" ) );
00186 TextLabel3->setText( tr2i18n( "Y" ) );
00187 TextLabe15->setText( tr2i18n( "Line width: " ) );
00188 GroupBox2->setTitle( tr2i18n( "Documentation" ) );
00189 }
00190
00191 #include "diagrampropertiespage.moc"