|
|
@ -645,12 +645,14 @@ void Window::ReInit()
|
|
|
|
|
|
|
|
|
|
|
|
/** Find the Window whose parent pointer points to this window
|
|
|
|
/** Find the Window whose parent pointer points to this window
|
|
|
|
* @param w parent Window to find child of
|
|
|
|
* @param w parent Window to find child of
|
|
|
|
* @return a Window pointer that is the child of w, or NULL otherwise */
|
|
|
|
* @param wc Window class of the window to remove; WC_INVALID if class does not matter
|
|
|
|
static Window *FindChildWindow(const Window *w)
|
|
|
|
* @return a Window pointer that is the child of w, or NULL otherwise
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
static Window *FindChildWindow(const Window *w, WindowClass wc)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Window *v;
|
|
|
|
Window *v;
|
|
|
|
FOR_ALL_WINDOWS_FROM_BACK(v) {
|
|
|
|
FOR_ALL_WINDOWS_FROM_BACK(v) {
|
|
|
|
if (v->parent == w) return v;
|
|
|
|
if ((wc == WC_INVALID || wc == v->window_class) && v->parent == w) return v;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
@ -658,13 +660,14 @@ static Window *FindChildWindow(const Window *w)
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Delete all children a window might have in a head-recursive manner
|
|
|
|
* Delete all children a window might have in a head-recursive manner
|
|
|
|
|
|
|
|
* @param wc Window class of the window to remove; WC_INVALID if class does not matter
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
void Window::DeleteChildWindows() const
|
|
|
|
void Window::DeleteChildWindows(WindowClass wc) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Window *child = FindChildWindow(this);
|
|
|
|
Window *child = FindChildWindow(this, wc);
|
|
|
|
while (child != NULL) {
|
|
|
|
while (child != NULL) {
|
|
|
|
delete child;
|
|
|
|
delete child;
|
|
|
|
child = FindChildWindow(this);
|
|
|
|
child = FindChildWindow(this, wc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|