diff --git a/binaries/data/gui/hello.xml b/binaries/data/gui/hello.xml
index d3ec16b8d9..0489e19077 100755
--- a/binaries/data/gui/hello.xml
+++ b/binaries/data/gui/hello.xml
@@ -1,13 +1,10 @@
-
+
-
-
\ No newline at end of file
+
+
diff --git a/binaries/data/gui/objects.dtd b/binaries/data/gui/objects.dtd
index 1167920dd1..2225ff42f7 100755
--- a/binaries/data/gui/objects.dtd
+++ b/binaries/data/gui/objects.dtd
@@ -18,7 +18,7 @@
-
+
diff --git a/source/gui/CButton.cpp b/source/gui/CButton.cpp
index a582424286..ef51d34fd6 100755
--- a/source/gui/CButton.cpp
+++ b/source/gui/CButton.cpp
@@ -117,10 +117,10 @@ void CButton::Draw()
if (m_Pressed)
glColor3f(0.7f, 0.f, 0.f);
else
- glColor3f(0,1,(float)m_BaseSettings.m_Size.right/300.f);
+ glColor3f(0,1,(float)m_BaseSettings.m_Size.pixel.right/300.f);
}
else
- glColor3f((float)m_BaseSettings.m_Size.right/300.f,0,1);
+ glColor3f((float)m_BaseSettings.m_Size.pixel.right/300.f,0,1);
////////// Gee: janwas, this is just temp to see it
glDisable(GL_TEXTURE_2D);
@@ -133,11 +133,19 @@ void CButton::Draw()
// Do this
glBegin(GL_QUADS);
//glBegin(GL_TRIANGLES);
- glVertex2i(GetBaseSettings().m_Size.right, GetBaseSettings().m_Size.bottom);
+ //CRect ca = GetBaseSettings().m_Size.GetClientArea(CRect(0, 0, g_xres, g_yres));
+ CRect ca = m_CachedActualSize;
+
+ glVertex2i(ca.right, ca.bottom);
+ glVertex2i(ca.left, ca.bottom);
+ glVertex2i(ca.left, ca.top);
+ glVertex2i(ca.right, ca.top);
+
+/* glVertex2i(GetBaseSettings().m_Size.right, GetBaseSettings().m_Size.bottom);
glVertex2i(GetBaseSettings().m_Size.left, GetBaseSettings().m_Size.bottom);
glVertex2i(GetBaseSettings().m_Size.left, GetBaseSettings().m_Size.top);
glVertex2i(GetBaseSettings().m_Size.right, GetBaseSettings().m_Size.top);
-/*
+*//*
glVertex2i(GetBaseSettings().m_Size.right, GetBaseSettings().m_Size.bottom);
glVertex2i(GetBaseSettings().m_Size.left, GetBaseSettings().m_Size.bottom);
glVertex2i(GetBaseSettings().m_Size.left, GetBaseSettings().m_Size.top);
@@ -152,4 +160,4 @@ void CButton::Draw()
//glEnable(GL_DEPTH_TEST);
glPopMatrix();
-}
\ No newline at end of file
+}
diff --git a/source/gui/CButton.h b/source/gui/CButton.h
index 36eca0a416..17c5c6059a 100755
--- a/source/gui/CButton.h
+++ b/source/gui/CButton.h
@@ -94,4 +94,4 @@ public:
virtual void Draw();
};
-#endif
\ No newline at end of file
+#endif
diff --git a/source/gui/CGUI.cpp b/source/gui/CGUI.cpp
index 08a592f204..64a51758b0 100755
--- a/source/gui/CGUI.cpp
+++ b/source/gui/CGUI.cpp
@@ -239,6 +239,11 @@ void CGUI::Destroy()
m_Sprites.clear();
}
+void CGUI::UpdateResolution()
+{
+ GUI<>::RecurseObject(0, m_BaseObject, &IGUIObject::UpdateCachedSize );
+}
+
void CGUI::AddObject(IGUIObject* pObject)
{
/* try
diff --git a/source/gui/CGUI.h b/source/gui/CGUI.h
index 1a2938415a..5180c8b267 100755
--- a/source/gui/CGUI.h
+++ b/source/gui/CGUI.h
@@ -128,6 +128,17 @@ public:
*/
void AddObjectType(const CStr &str, ConstructObjectFunction pFunc) { m_ObjectTypes[str] = pFunc; }
+ /**
+ * Update Resolution, should be called every time the resolution
+ * of the opengl screen has been changed, this is becuase it needs
+ * to re-cache all its actual sizes
+ *
+ * Needs no input since screen resolution is global.
+ *
+ * @see IGUIObject#UpdateCachedSize()
+ */
+ void UpdateResolution();
+
private:
/**
* Updates the object pointers, needs to be called each
@@ -346,4 +357,4 @@ private:
//@}
};
-#endif
\ No newline at end of file
+#endif
diff --git a/source/gui/CGUISprite.cpp b/source/gui/CGUISprite.cpp
index 5357e0fff0..0baad8bcbf 100755
--- a/source/gui/CGUISprite.cpp
+++ b/source/gui/CGUISprite.cpp
@@ -31,4 +31,4 @@ void CGUISprite::Draw(const float &z, const CRect &rect, const CRect &clipping=C
glPopMatrix();
}
-}
\ No newline at end of file
+}
diff --git a/source/gui/CGUISprite.h b/source/gui/CGUISprite.h
index f35dd93c15..d2da115883 100755
--- a/source/gui/CGUISprite.h
+++ b/source/gui/CGUISprite.h
@@ -103,4 +103,4 @@ private:
std::vector m_Images;
};
-#endif
\ No newline at end of file
+#endif
diff --git a/source/gui/GUI.h b/source/gui/GUI.h
index 4bab6fa4c1..08de651eeb 100755
--- a/source/gui/GUI.h
+++ b/source/gui/GUI.h
@@ -56,6 +56,7 @@ gee@pyro.nu
//--------------------------------------------------------
#include