예제 #1
0
void
KnobGuiGroup::setCheckedInternal(bool checked,
                                 bool userRequested)
{
    if (checked == _checked) {
        return;
    }
    _checked = checked;

    if (userRequested) {
        KnobGroupPtr knob = _knob.lock();
        if (knob) {
            knob->setValue(checked);
        }
    }

    //getGui()->getPropertiesBin()->setUpdatesEnabled(false);
    for (std::list<KnobGuiWPtr>::iterator it = _children.begin(); it != _children.end(); ++it) {
        KnobGuiPtr knob = it->lock();
        if (!knob) {
            continue;
        }
        if (!checked) {
            knob->hide();
        } else if ( !knob->getKnob()->getIsSecret() ) {
            knob->show();
        }
    }
    //getGui()->getPropertiesBin()->setUpdatesEnabled(true);
}
예제 #2
0
void
KnobGuiGroup::setWidgetsVisible(bool visible)
{
    if (_button) {
        _button->setVisible(visible);
    }
    for (std::list<KnobGuiWPtr>::iterator it = _children.begin(); it != _children.end(); ++it) {
        KnobGuiPtr k = it->lock();
        if (!k) {
            continue;
        }
        if (visible) {
            k->show();
        } else {
            k->hide();
        }
    }

}
예제 #3
0
void
KnobGuiGroup::_show()
{
//    if ( _knob->getIsSecret() ) {
//        return;
//    }
    if (_button) {
        _button->show();
    }

    if (_checked) {
        for (std::list<KnobGuiWPtr>::iterator it = _children.begin(); it != _children.end(); ++it) {
            KnobGuiPtr k = it->lock();
            if (!k) {
                continue;
            }
            k->show();
        }
    }
}
예제 #4
0
void
KnobGuiGroup::setCheckedInternal(bool checked, bool userRequested)
{
    if (checked == _checked) {
        return;
    }
    _checked = checked;
    
    if (userRequested) {
        boost::shared_ptr<KnobGroup> knob = _knob.lock();
        if (knob) {
            knob->setValue(checked, ViewSpec::all(), 0, eValueChangedReasonUserEdited, 0);
        }
    }
    
    ///get the current index of the group knob in the layout, and reinsert
    ///the children back with an offset relative to the group.
    int realIndexInLayout = getActualIndexInLayout();
    int startChildIndex = realIndexInLayout + 1;
    //getGui()->getPropertiesBin()->setUpdatesEnabled(false);
    for (std::list<KnobGuiWPtr>::iterator it = _children.begin(); it != _children.end(); ++it) {
        KnobGuiPtr knob = it->lock();
        if (!knob) {
            continue;
        }
        if (!checked) {
            knob->hide();
        } else if ( !knob->getKnob()->getIsSecret() ) {
            knob->show(startChildIndex);
            if ( knob->getKnob()->isNewLineActivated() ) {
                ++startChildIndex;
            }
        }
    }
    //getGui()->getPropertiesBin()->setUpdatesEnabled(true);
}