From 959831f4ef5a3e797f576c3de08cd65032c997ad Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 13 Jan 2013 18:54:10 +1000 Subject: Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard. --- .../tools/GUIEditor/CGUIAttributeEditor.cpp | 240 ++++++++++----------- 1 file changed, 120 insertions(+), 120 deletions(-) (limited to 'libraries/irrlicht-1.8/tools/GUIEditor/CGUIAttributeEditor.cpp') diff --git a/libraries/irrlicht-1.8/tools/GUIEditor/CGUIAttributeEditor.cpp b/libraries/irrlicht-1.8/tools/GUIEditor/CGUIAttributeEditor.cpp index 45913b6..6d61f17 100644 --- a/libraries/irrlicht-1.8/tools/GUIEditor/CGUIAttributeEditor.cpp +++ b/libraries/irrlicht-1.8/tools/GUIEditor/CGUIAttributeEditor.cpp @@ -1,120 +1,120 @@ - -#include "CGUIAttributeEditor.h" -#include "IGUIEnvironment.h" -#include "IFileSystem.h" -#include "IVideoDriver.h" -#include "IAttributes.h" -#include "IGUIFont.h" -#include "IGUIScrollBar.h" -#include "CGUIEditWorkspace.h" -#include "CGUIAttribute.h" -#include "CGUIStringAttribute.h" - -namespace irr -{ -namespace gui -{ - -using namespace core; -using namespace io; - -CGUIAttributeEditor::CGUIAttributeEditor(IGUIEnvironment* environment, s32 id, IGUIElement *parent) : - CGUIPanel(environment, parent, id, rect(0, 0, 100, 100)), - Attribs(0), Panel(0) -{ - #ifdef _DEBUG - setDebugName("CGUIAttributeEditor"); - #endif - - // create attributes - Attribs = environment->getFileSystem()->createEmptyAttributes(Environment->getVideoDriver()); - - calculateClientArea(); - resizeInnerPane(); - - // refresh attrib list - refreshAttribs(); - - IGUIScrollBar* sb = getVScrollBar(); - core::rect r = sb->getRelativePosition(); - r.LowerRightCorner.Y -= 16; - sb->setRelativePosition(r); -} - -CGUIAttributeEditor::~CGUIAttributeEditor() -{ - for (u32 i=0; iremove(); - AttribList[i]->drop(); - } - AttribList.clear(); - - Attribs->drop(); -} - - -IAttributes* CGUIAttributeEditor::getAttribs() -{ - return Attribs; -} - -void CGUIAttributeEditor::refreshAttribs() -{ - // clear the attribute list - u32 i; - for (i=0; iremove(); - AttribList[i]->drop(); - } - AttribList.clear(); - - position2di top(10, 5); - rect r(top.X, top.Y, - getClientArea().getWidth() - 10, - 5 + Environment->getSkin()->getFont()->getDimension(L"A").Height); - - // add attribute elements - u32 c = Attribs->getAttributeCount(); - for (i=0; igetAttributeTypeString(i); - str += "_attribute"; - CGUIAttribute* n = (CGUIAttribute*)Environment->addGUIElement(str.c_str(), 0); - - // if this doesn't exist, use a string editor - if (!n) - n = (CGUIAttribute*)Environment->addGUIElement("string_attribute", 0); - - if (n) - { - AttribList.push_back(n); - n->setParentID(getID()); - n->grab(); - } - - // We can't set "this" as parent above as we need functionality - // of the overloaded addChild which isn't called in the constructor. - // (that's a general Irrlicht messup with too fat constructors) - addChild(n); - - AttribList[i]->setSubElement(true); - AttribList[i]->setRelativePosition(r); - AttribList[i]->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); - AttribList[i]->setAttrib(Attribs, i); - r += position2di(0, AttribList[i]->getRelativePosition().getHeight() + 5); - } -} - -void CGUIAttributeEditor::updateAttribs() -{ - for (u32 i=0; iupdateAttrib(false); -} - -} // namespace gui -} // namespace irr - + +#include "CGUIAttributeEditor.h" +#include "IGUIEnvironment.h" +#include "IFileSystem.h" +#include "IVideoDriver.h" +#include "IAttributes.h" +#include "IGUIFont.h" +#include "IGUIScrollBar.h" +#include "CGUIEditWorkspace.h" +#include "CGUIAttribute.h" +#include "CGUIStringAttribute.h" + +namespace irr +{ +namespace gui +{ + +using namespace core; +using namespace io; + +CGUIAttributeEditor::CGUIAttributeEditor(IGUIEnvironment* environment, s32 id, IGUIElement *parent) : + CGUIPanel(environment, parent, id, rect(0, 0, 100, 100)), + Attribs(0), Panel(0) +{ + #ifdef _DEBUG + setDebugName("CGUIAttributeEditor"); + #endif + + // create attributes + Attribs = environment->getFileSystem()->createEmptyAttributes(Environment->getVideoDriver()); + + calculateClientArea(); + resizeInnerPane(); + + // refresh attrib list + refreshAttribs(); + + IGUIScrollBar* sb = getVScrollBar(); + core::rect r = sb->getRelativePosition(); + r.LowerRightCorner.Y -= 16; + sb->setRelativePosition(r); +} + +CGUIAttributeEditor::~CGUIAttributeEditor() +{ + for (u32 i=0; iremove(); + AttribList[i]->drop(); + } + AttribList.clear(); + + Attribs->drop(); +} + + +IAttributes* CGUIAttributeEditor::getAttribs() +{ + return Attribs; +} + +void CGUIAttributeEditor::refreshAttribs() +{ + // clear the attribute list + u32 i; + for (i=0; iremove(); + AttribList[i]->drop(); + } + AttribList.clear(); + + position2di top(10, 5); + rect r(top.X, top.Y, + getClientArea().getWidth() - 10, + 5 + Environment->getSkin()->getFont()->getDimension(L"A").Height); + + // add attribute elements + u32 c = Attribs->getAttributeCount(); + for (i=0; igetAttributeTypeString(i); + str += "_attribute"; + CGUIAttribute* n = (CGUIAttribute*)Environment->addGUIElement(str.c_str(), 0); + + // if this doesn't exist, use a string editor + if (!n) + n = (CGUIAttribute*)Environment->addGUIElement("string_attribute", 0); + + if (n) + { + AttribList.push_back(n); + n->setParentID(getID()); + n->grab(); + } + + // We can't set "this" as parent above as we need functionality + // of the overloaded addChild which isn't called in the constructor. + // (that's a general Irrlicht messup with too fat constructors) + addChild(n); + + AttribList[i]->setSubElement(true); + AttribList[i]->setRelativePosition(r); + AttribList[i]->setAlignment(EGUIA_UPPERLEFT, EGUIA_LOWERRIGHT, EGUIA_UPPERLEFT, EGUIA_UPPERLEFT); + AttribList[i]->setAttrib(Attribs, i); + r += position2di(0, AttribList[i]->getRelativePosition().getHeight() + 5); + } +} + +void CGUIAttributeEditor::updateAttribs() +{ + for (u32 i=0; iupdateAttrib(false); +} + +} // namespace gui +} // namespace irr + -- cgit v1.1