Пример #1
0
void widget::visible(bool visible)
{
    if (impl_->visible_ == visible)
        return;

    if (visible)
    {
        if (!onShowing())
            return;
        if (impl_->father_ && !impl_->father_->onChildShowing(this))
            return;

        impl_->visible_ = true;

        onShown();
        if (father())
            father()->onChildShown(this);
    }
    else
    {
        if (!onHiding())
            return;
        if (impl_->father_ && !impl_->father_->onChildHiding(this))
            return;

        impl_->visible_ = false;

        onHidden();
        if (father())
            father()->onChildHidden(this);
    }

    window().visible(visible);
    repaint();
}
Пример #2
0
void DialogLayer::setVisible(bool visible)
{
	if (visible == isVisible()) return;

	LayerColor::setVisible(visible);

	if (visible && onShowed) {
		onShowed();
	}

	if (!visible && onHidden) {
		onHidden();
	}
}