00001
00042 #include "aiviewerarea.hpp"
00043
00044 using namespace AiFractals;
00045
00046 AiViewerArea::AiViewerArea(QWidget * parent)
00047 :QWidget( parent )
00048 {
00049
00050
00051
00052 this->m_view = new AiView(this);
00053 this->connect(m_view ,SIGNAL(zoneZooming(int,int,int,int)),
00054 this,SIGNAL(zoneZooming(int,int,int,int)));
00055 this->connect(m_view ,SIGNAL(enabledChilds(bool)),
00056 this,SIGNAL(enabledChilds(bool)));
00057
00058
00059 AiHorizontalMargin *hm = new AiHorizontalMargin(this);
00060 hm->setFixedHeight(20);
00061
00062
00063 AiVerticalMargin *vm = new AiVerticalMargin(this);
00064 vm->setFixedWidth(20);
00065
00066 QScrollArea *scroll = new QScrollArea();
00067 scroll->setWidget( m_view );
00068
00069 QGridLayout *gd = new QGridLayout();
00070 gd->addWidget(hm,0,1,Qt::AlignTop );
00071 gd->addWidget(vm,1,0,Qt::AlignLeft);
00072 gd->addWidget(scroll,1,1);
00073
00074 this->setLayout( gd );
00075
00076 }
00077
00078 AiView * AiViewerArea::view()
00079 {
00080 return m_view;
00081 }
00082
00083 void AiViewerArea::resizeEvent ( QResizeEvent * event )
00084 {
00085 m_view->makeUpdate();
00086 }
00087
00088 AiViewerArea::~AiViewerArea()
00089 {
00090 if( m_view != NULL )
00091 {
00092 delete m_view;
00093 }
00094 }