CMS 3D CMS Logo

IgControlItem.cc

Go to the documentation of this file.
00001 //<<<<<< INCLUDES                                                       >>>>>>
00002 
00003 #include "Iguana/GLBrowsers/interface/IgControlItem.h"
00004 #include <qhbox.h>
00005 #include <qlayout.h>
00006 
00007 //<<<<<< PRIVATE DEFINES                                                >>>>>>
00008 //<<<<<< PRIVATE CONSTANTS                                              >>>>>>
00009 //<<<<<< PRIVATE TYPES                                                  >>>>>>
00010 //<<<<<< PRIVATE VARIABLE DEFINITIONS                                   >>>>>>
00011 //<<<<<< PUBLIC VARIABLE DEFINITIONS                                    >>>>>>
00012 //<<<<<< CLASS STRUCTURE INITIALIZATION                                 >>>>>>
00013 //<<<<<< PRIVATE FUNCTION DEFINITIONS                                   >>>>>>
00014 //<<<<<< PUBLIC FUNCTION DEFINITIONS                                    >>>>>>
00015 //<<<<<< MEMBER FUNCTION DEFINITIONS                                    >>>>>>
00016 
00017 IgControlItem::IgControlItem (void)
00018     : m_editable (true),
00019       m_dirty (false)
00020 {}
00021 
00023 bool
00024 IgControlItem::isDirty (void) const
00025 { return m_dirty; }
00026 
00027 void
00028 IgControlItem::setDirty (bool state)
00029 {
00030     if (state && ! m_dirty)
00031     {
00032         m_dirty = true;
00033         emit dirty ();
00034     }
00035     else if (! state && m_dirty)
00036     {
00037         m_dirty = false;
00038         emit clean ();
00039     }
00040 }
00041 
00042 void
00043 IgControlItem::setDirty (void)
00044 { setDirty (true); }
00045 
00046 void
00047 IgControlItem::setClean (void)
00048 { setDirty (false); }
00049 
00051 void
00052 IgControlItem::setEditable (bool value)
00053 {
00054     m_editable = value;
00055     emit editable (value);
00056 }
00057 
00058 bool
00059 IgControlItem::isEditable (void) const
00060 { return m_editable; }
00062 QWidget *
00063 IgControlItem::makeSpacedBox (QWidget *parent, QWidget *content)
00064 { 
00065     QWidget *box = makeBox (parent, content);
00066     box->layout ()->addItem (new QSpacerItem (0, 0, QSizePolicy::Expanding));
00067 
00068     return box;
00069 }
00070 
00071 QWidget *
00072 IgControlItem::makeBox (QWidget *parent, QWidget *content)
00073 {
00074     QHBox *box = new QHBox (parent);
00075     content->reparent (box, QPoint (0, 0), true);
00076 
00077     return box;
00078 }

Generated on Tue Jun 9 17:38:38 2009 for CMSSW by  doxygen 1.5.4