add getAbsolutePosition
authorFelix Domke <tmbinc@elitedvb.net>
Sat, 8 Apr 2006 00:56:43 +0000 (00:56 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sat, 8 Apr 2006 00:56:43 +0000 (00:56 +0000)
lib/gui/ewidget.cpp
lib/gui/ewidget.h

index ef784997ef7dc9e7ae263bc4b7c2cb18b4b0662d..7c50f4af47344d2f0153c36d3de0062a0f19e12d 100644 (file)
@@ -199,6 +199,21 @@ void eWidget::setTransparent(int transp)
                m_vis &=~wVisTransparent;
 }
 
+ePoint eWidget::getAbsolutePosition()
+{
+       eWidget *root = this;
+       ePoint abspos = position();
+
+       while (root && !root->m_desktop)
+       {
+               root = root->m_parent;
+               assert(root);
+               abspos += root->position();
+       }
+
+       return abspos;
+}
+
 void eWidget::mayKillFocus()
 {
        setFocus(0);
index 3ddfdc263cc02a565c84f7598eb42f5371067c88..4175eae7b67739b898a7da195c5bf4ea1517e257 100644 (file)
@@ -48,6 +48,8 @@ public:
                
        int isTransparent() { return m_vis & wVisTransparent; }
        
+       ePoint getAbsolutePosition();
+       
        eWidgetAnimation m_animation;
 private:
        eWidgetDesktop *m_desktop;