//#define DESTRUCTOR_TESTING
// Rendering experiment...
-#define USE_COVERAGE_LISTS
+//BAH
+//#define USE_COVERAGE_LISTS
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
#define MASK_R 0xFF000000
MASK_R, MASK_G, MASK_B, MASK_A))
{
//Could probably move this into the initializer list as well...
- closeButton = new Button(w - (cbWidth + 1), 1, cbUp, cbHover, cbDown, this);
- list.push_back(closeButton);
+// closeButton = new Button(w - (cbWidth + 1), 1, cbUp, cbHover, cbDown, this);
+// list.push_back(closeButton);
CreateBackstore();
Draw(); // Can we do this in the constructor??? Mebbe.
void Window::HandleMouseButton(uint32 x, uint32 y, bool mouseDown)
{
+#if 1
// Handle the items this window contains...
for(uint32 i=0; i<list.size(); i++)
// Make coords relative to upper right corner of this window...
list[i]->HandleMouseButton(x - extents.x, y - extents.y, mouseDown);
+#else //? This works in draggablewindow2...
+ // Handle the items this window contains...
+ for(uint32 i=0; i<list.size(); i++)
+ {
+ // Make coords relative to upper right corner of this window...
+ list[i]->HandleMouseButton(x - extents.x, y - extents.y, mouseDown);
+
+ if (list[i]->Inside(x - extents.x, y - extents.y))
+ clicked = false;
+ }
+#endif
}
void Window::Draw(void)
#endif
//Prolly don't need this since the close button will do this for us...
+//Close button isn't mandatory anymore...
needToRefreshScreen = true;
}
+// This is only called if a close button has been added
void Window::Notify(Element * e)
{
if (e == closeButton)
{
list.push_back(e);
}
+
+void Window::AddCloseButton(void)
+{
+ // Only allow this to happen once!
+ if (closeButton == NULL)
+ {
+ closeButton = new Button(extents.w - (cbWidth + 1), 1, cbUp, cbHover, cbDown, this);
+ list.push_back(closeButton);
+ }
+}