#include "Engine/Canvas.ang"
/*
Class: Widget
This is the base class for all visible and interactive objects in IrreGUI.
*/
// IObject is a base class interface that I can easily store in C++ containers. *hinthinthinthinthinthinthinthinthinthinthinthint*
class Widget : IObject
{
Widget(Widget@ parent)
{
@m_Parent = @parent;
m_Pos.X = m_Pos.Y = m_Pos.Z = 0.f;
}
void set_Pos(Vector p)
{
m_Pos = p;
m_Geometry.SetPos(m_Pos);
for(uint i=0;i<m_Children.size;i++)
{
Widget@ w = @m_Children;
// I am unable to call w.Pos = w.Pos + p; within set_Pos.
SetPosWorkaround(w,p);
}
}
private void SetPosWorkaround(Widget@ w,Vector p) { w.Pos = w.Pos + p; }
const Vector get_Pos() { return m_Pos; }
private Rect m_Geometry;
private Vector m_Pos;
private Widget@ m_Parent;
private Widget@[] m_Children;
private bool m_IsFocused;
};
// vim: syntax=cpp
The compiler complains that Pos is not a member of Widget.
Is this a bug or a feature?