Logo Search packages:      
Sourcecode: canorus version File versions  Download package

void CAMainWin::updateRepeatMarkToolBar (  )  [private]

Shows/Hides the repeat mark properties tool bar according to the current state.

Definition at line 4405 of file mainwin.cpp.

References CAToolButton::currentId(), CARepeatMark::repeatMarkType(), CAMusElementFactory::repeatMarkType(), CAScoreViewPort::selection(), CAMenuToolButton::setCurrentId(), and CARepeatMark::voltaNumber().

Referenced by updateToolBars().

                                        {
      if ( uiMarkType->isChecked() && uiMarkType->currentId()==CAMark::RepeatMark && mode()==InsertMode) {
            if ( musElementFactory()->repeatMarkType()==CARepeatMark::Volta )
                  uiRepeatMarkType->setCurrentId( musElementFactory()->repeatMarkVoltaNumber()*(-1)-1 );
            else
                  uiRepeatMarkType->setCurrentId( musElementFactory()->repeatMarkType() );
            uiRepeatMarkToolBar->show();
      } else if ( mode()==EditMode && currentScoreViewPort() &&
                  currentScoreViewPort()->selection().size() &&
                  dynamic_cast<CARepeatMark*>(currentScoreViewPort()->selection().at(0)->musElement()) ) {
            CAScoreViewPort *v = currentScoreViewPort();
            if (v && v->selection().size()) {
                  CARepeatMark *r = dynamic_cast<CARepeatMark*>(v->selection().at(0)->musElement());
                  if (r) {
                        if ( r->repeatMarkType()==CARepeatMark::Volta )
                              uiRepeatMarkType->setCurrentId( r->voltaNumber()*(-1)-1 );
                        else
                              uiRepeatMarkType->setCurrentId( r->repeatMarkType() );
                        uiRepeatMarkToolBar->show();
                  } else
                        uiRepeatMarkToolBar->hide();
            }
      } else
            uiRepeatMarkToolBar->hide();
}


Generated by  Doxygen 1.6.0   Back to index