From: <edu...@us...> - 2003-10-19 18:00:08
|
Update of /cvsroot/aedgui/aedGUI/src In directory sc8-pr-cvs1:/tmp/cvs-serv12059/src Modified Files: Makefile.am Added Files: aedBoxSizer.cpp aedSizer.cpp Log Message: A very simple example of a possible aedSizer. Buggy! --- NEW FILE: aedBoxSizer.cpp --- #include "aedBoxSizer.h" aedBoxSizer:: aedBoxSizer(aedWindow *parent, boxType type) { m_Parent = parent; m_BoxType = type; } void aedBoxSizer:: calculateSize(void) { if (m_BoxType == aedVERTICAL) { aedRect rect = m_Parent->getMyTranslatedPosition(); Uint16 eachHeight = rint((rect.getHeight()-(m_Parent->getPositionOffset().getY())))/m_Widgets.size(); for (unsigned int i=0;i<m_Widgets.size();i++) { //aedRect widgetRect = m_Widgets[i]->getPos(); m_Widgets[i]->setPos(0, i*eachHeight); m_Widgets[i]->setSize(rect.getWidth()-(m_Parent->getPositionOffset().getX() * 2), eachHeight); } } else { } } --- NEW FILE: aedSizer.cpp --- #include "aedSizer.h" aedSizer:: aedSizer() { m_Parent = NULL; } aedSizer:: ~aedSizer() { } aedSizer:: aedSizer(aedWindow *parent) { m_Parent = parent; } void aedSizer:: addWidget(aedWindow *widget) { m_Widgets.push_back(widget); } Index: Makefile.am =================================================================== RCS file: /cvsroot/aedgui/aedGUI/src/Makefile.am,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Makefile.am 6 Oct 2003 08:39:20 -0000 1.30 --- Makefile.am 19 Oct 2003 16:47:11 -0000 1.31 *************** *** 42,45 **** aedSpinner.cpp \ aedCursor.cpp \ ! aedLog.cpp --- 42,47 ---- aedSpinner.cpp \ aedCursor.cpp \ ! aedLog.cpp \ ! aedSizer.cpp \ ! aedBoxSizer.cpp |