summaryrefslogtreecommitdiffstats
path: root/kpovmodeler/pmsolidobjectedit.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit47d455dd55be855e4cc691c32f687f723d9247ee (patch)
tree52e236aaa2576bdb3840ebede26619692fed6d7d /kpovmodeler/pmsolidobjectedit.cpp
downloadtdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.tar.gz
tdegraphics-47d455dd55be855e4cc691c32f687f723d9247ee.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kpovmodeler/pmsolidobjectedit.cpp')
-rw-r--r--kpovmodeler/pmsolidobjectedit.cpp82
1 files changed, 82 insertions, 0 deletions
diff --git a/kpovmodeler/pmsolidobjectedit.cpp b/kpovmodeler/pmsolidobjectedit.cpp
new file mode 100644
index 00000000..e6aa3765
--- /dev/null
+++ b/kpovmodeler/pmsolidobjectedit.cpp
@@ -0,0 +1,82 @@
+/*
+**************************************************************************
+ description
+ --------------------
+ copyright : (C) 2000-2001 by Andreas Zehender
+ email : zehender@kde.org
+**************************************************************************
+
+**************************************************************************
+* *
+* This program is free software; you can redistribute it and/or modify *
+* it under the terms of the GNU General Public License as published by *
+* the Free Software Foundation; either version 2 of the License, or *
+* (at your option) any later version. *
+* *
+**************************************************************************/
+
+
+#include "pmsolidobjectedit.h"
+#include "pmsolidobject.h"
+
+#include <qcheckbox.h>
+#include <qlayout.h>
+#include <klocale.h>
+
+PMSolidObjectEdit::PMSolidObjectEdit( QWidget* parent, const char* name )
+ : Base( parent, name )
+{
+ m_pDisplayedObject = 0;
+}
+
+void PMSolidObjectEdit::createBottomWidgets( )
+{
+ m_pInverseButton = new QCheckBox( i18n( "Inverse" ), this );
+ m_pHollowButton = new QCheckBox( i18n( "Hollow" ), this );
+
+ m_pHollowButton->setTristate( true );
+
+ topLayout( )->addWidget( m_pInverseButton );
+ topLayout( )->addWidget( m_pHollowButton );
+
+ connect( m_pHollowButton, SIGNAL( clicked( ) ), SIGNAL( dataChanged( ) ) );
+ connect( m_pInverseButton, SIGNAL( clicked( ) ), SIGNAL( dataChanged( ) ) );
+
+ Base::createBottomWidgets( );
+}
+
+void PMSolidObjectEdit::displayObject( PMObject* o )
+{
+ if( o->isA( "SolidObject" ) )
+ {
+ bool readOnly = o->isReadOnly( );
+
+ m_pDisplayedObject = ( PMSolidObject* ) o;
+ setCheckBox( m_pHollowButton, m_pDisplayedObject->hollow( ) );
+ m_pInverseButton->setChecked( m_pDisplayedObject->inverse( ) );
+
+ m_pHollowButton->setEnabled( !readOnly );
+ m_pInverseButton->setEnabled( !readOnly );
+
+ Base::displayObject( o );
+ }
+ else
+ kdError( PMArea ) << "PMSolidObjectEdit: Can't display object\n";
+}
+
+void PMSolidObjectEdit::saveContents( )
+{
+ if( m_pDisplayedObject )
+ {
+ m_pDisplayedObject->setHollow( checkBoxState( m_pHollowButton ) );
+ m_pDisplayedObject->setInverse( m_pInverseButton->isChecked( ) );
+ Base::saveContents( );
+ }
+}
+
+bool PMSolidObjectEdit::isDataValid( )
+{
+ return Base::isDataValid( );
+}
+
+#include "pmsolidobjectedit.moc"