case evtChangedPosition:
case evtChangedSize:
case evtParentChangedPosition:
- eDebug("position is now ...");
- updatePosition();
+ case evtParentVisibilityChanged:
+ updatePosition(!isVisible());
+ break;
}
return eWidget::event(event, data, data2);
}
if (!disable)
pos = eRect(getAbsolutePosition(), size());
+ if (m_cur_pos == pos)
+ return;
+
+ m_cur_pos = pos;
+
eDebug("position is %d %d -> %d %d", pos.left(), pos.top(), pos.width(), pos.height());
for (int i=0; i<4; ++i)
return;
m_vis |= wVisShow;
+ eDebug("show widget %p", this);
+ notifyShowHide();
+
/* TODO: optimize here to only recalc what's required. possibly merge with hide. */
eWidget *root = this;
ePoint abspos = position();
if (!(m_vis & wVisShow))
return;
m_vis &= ~wVisShow;
+
/* this is a workaround to the above problem. when we are in the delete phase,
don't hide childs. */
if (!(m_parent || m_desktop))
return;
+ notifyShowHide();
/* TODO: optimize here to only recalc what's required. possibly merge with show. */
eWidget *root = this;
m_current_focus->event(evtFocusGot, this);
}
+void eWidget::notifyShowHide()
+{
+ event(evtParentVisibilityChanged);
+ for (ePtrList<eWidget>::iterator i(m_childs.begin()); i != m_childs.end(); ++i)
+ i->notifyShowHide();
+}
evtParentChangedPosition,
- evtWillShow,
- evtWillHide,
+ evtParentVisibilityChanged,
evtWillChangePosition, /* new size is eRect *data */
evtWillChangeSize,
/* enable this if you need the absolute position of the widget */
void setPositionNotifyChild(int n) { m_notify_child_on_position_change = 1; }
+
+ void notifyShowHide();
};
extern eWidgetDesktop *getDesktop(int which);