]> Shamusworld >> Repos - architektonas/blobdiff - src/container.cpp
Initial work on BlockWidget.
[architektonas] / src / container.cpp
index 47295f40f043576fdcd24b9d37ef803af439918d..25079d972e9cb0fb3f6ba925a40a3282baa69af6 100644 (file)
@@ -191,6 +191,26 @@ class so that we can leverage that stuff here as well.
 // every object for collision.
 /*virtual*/ void Container::PointerMoved(Vector point)
 {
+       if (!isTopLevelContainer)
+       {
+               // check for selection rectangle too
+
+
+               needUpdate = true;
+
+               for(std::vector<Object *>::iterator i=objects.begin(); i!=objects.end(); i++)
+               {
+                       if ((*i)->HitTest(point))
+                       {
+                               state = OSSelected;
+                               return;
+                       }
+               }
+
+               state = OSInactive;
+               return;
+       }
+
 //     objectWasDragged = true;
 //printf("CONTAINER: PointerMoved()\n");
 
@@ -230,6 +250,13 @@ about keeping track of old states...
 
 /*virtual*/ bool Container::NeedsUpdate(void)
 {
+       // If this is *not* a top level container, then we treat it as an
+       // aggregate object.
+       if (!isTopLevelContainer)
+       {
+               return needUpdate;
+       }
+
        // Search through objects for one that needs an update; if one is found,
        // return immediately.
        for(std::vector<Object *>::iterator i=objects.begin(); i!=objects.end(); i++)