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

void CAMainWin::updateInsertToolBar (  )  [private]

Shows/Hides music elements which cannot be placed in the selected context.

Definition at line 4095 of file mainwin.cpp.

References CAContext::contextType(), and currentContext().

Referenced by updateToolBars().

                                    {
      if ( currentSheet() ) {
            uiNewContext->setVisible(true);
            if (mode()==EditMode) {
                  uiInsertToolBar->show();
            } else {
                  uiInsertToolBar->show();
                  CAContext *context = currentContext();
                  if (context) {
                        switch (context->contextType()) {
                              case CAContext::Staff:
                                    // staff selected
                                    uiInsertPlayable->setVisible(true);
                                    uiSlurType->defaultAction()->setVisible(true); uiSlurType->defaultAction()->setEnabled(true);
                                    //uiSlurType->setVisible(true); // \todo This is needed in order for actions to hide?! -Matevz
                                    uiInsertClef->setVisible(true); // menu
                                    uiInsertBarline->setVisible(true); // menu
                                    uiClefType->defaultAction()->setVisible(true); uiClefType->defaultAction()->setEnabled(true);
                                    uiTimeSigType->defaultAction()->setVisible(true); uiTimeSigType->defaultAction()->setEnabled(true);
                                    uiInsertKeySig->setVisible(true);
                                    uiMarkType->defaultAction()->setVisible(true); uiMarkType->defaultAction()->setEnabled(true);
                                    uiArticulationType->defaultAction()->setVisible(true); uiArticulationType->defaultAction()->setEnabled(true);
                                    uiInsertTimeSig->setVisible(true);
                                    uiBarlineType->defaultAction()->setVisible(true); uiBarlineType->defaultAction()->setEnabled(true);
                                    uiInsertFM->setVisible(false);
                                    uiInsertSyllable->setVisible(false);
                                    break;
                              case CAContext::FunctionMarkContext:
                                    // function mark context selected
                                    uiInsertPlayable->setVisible(false);
                                    uiSlurType->defaultAction()->setVisible(false);
                                    uiInsertClef->setVisible(false); // menu
                                    uiInsertBarline->setVisible(false); // menu
                                    uiClefType->defaultAction()->setVisible(false);
                                    uiTimeSigType->defaultAction()->setVisible(false);
                                    uiInsertKeySig->setVisible(false);
                                    uiMarkType->defaultAction()->setVisible(false);
                                    uiArticulationType->defaultAction()->setVisible(false);
                                    uiInsertTimeSig->setVisible(false);
                                    uiBarlineType->defaultAction()->setVisible(false);
                                    uiInsertFM->setVisible(true);
                                    uiInsertSyllable->setVisible(false);
                                    break;
                              case CAContext::LyricsContext:
                                    // lyrics context selected
                                    uiInsertPlayable->setVisible(false);
                                    uiSlurType->defaultAction()->setVisible(false);
                                    uiInsertClef->setVisible(false); // menu
                                    uiInsertBarline->setVisible(false); // menu
                                    uiClefType->defaultAction()->setVisible(false);
                                    uiTimeSigType->defaultAction()->setVisible(false);
                                    uiInsertKeySig->setVisible(false);
                                    uiMarkType->defaultAction()->setVisible(false);
                                    uiArticulationType->defaultAction()->setVisible(false);
                                    uiInsertTimeSig->setVisible(false);
                                    uiBarlineType->defaultAction()->setVisible(false);
                                    uiInsertFM->setVisible(false);
                                    uiInsertSyllable->setVisible(true);
                                    break;
                        }
                  } else {
                        // no contexts selected
                        uiInsertPlayable->setVisible(false);
                        uiSlurType->defaultAction()->setVisible(false);
                        uiInsertClef->setVisible(false); // menu
                        uiInsertBarline->setVisible(false); // menu
                        uiClefType->defaultAction()->setVisible(false);
                        uiTimeSigType->defaultAction()->setVisible(false);
                        uiInsertKeySig->setVisible(false);
                        uiMarkType->defaultAction()->setVisible(false);
                        uiArticulationType->defaultAction()->setVisible(false);
                        uiInsertTimeSig->setVisible(false);
                        uiBarlineType->defaultAction()->setVisible(false);
                        uiInsertFM->setVisible(false);
                        uiInsertSyllable->setVisible(false);
                  }
            }

      } else {
            uiInsertToolBar->hide();
            uiNewContext->setVisible(false);
            uiInsertPlayable->setVisible(false);
            uiSlurType->defaultAction()->setVisible(false);
            //uiSlurType->setVisible(false); // \todo This is needed in order for actions to hide?! -Matevz
            uiInsertClef->setVisible(false); // menu
            uiInsertBarline->setVisible(false); // menu
            uiClefType->defaultAction()->setVisible(false);
            uiTimeSigType->defaultAction()->setVisible(false);
            uiInsertKeySig->setVisible(false);
            uiMarkType->defaultAction()->setVisible(false);
            uiArticulationType->defaultAction()->setVisible(false);
            uiInsertTimeSig->setVisible(false);
            uiBarlineType->defaultAction()->setVisible(false);
            uiInsertFM->setVisible(false);
            uiInsertSyllable->setVisible(false);
      }
}


Generated by  Doxygen 1.6.0   Back to index