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

void CAMainWin::updateFMToolBar (  )  [private]

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

Definition at line 4325 of file mainwin.cpp.

References CAFunctionMark::chordArea(), CAFunctionMark::function(), CAFunctionMark::isChordAreaMinor(), CAFunctionMark::isMinor(), CAFunctionMark::isPartOfEllipse(), CAFunctionMark::isTonicDegreeMinor(), CAFunctionMark::key(), CAScoreViewPort::selection(), CAMenuToolButton::setCurrentId(), and CAFunctionMark::tonicDegree().

Referenced by updateToolBars().

                                {
      if (uiInsertFM->isChecked() && mode()==InsertMode) {
            uiFMFunction->setCurrentId( musElementFactory()->fmFunction()*(musElementFactory()->isFMFunctionMinor()?-1:1) );
            uiFMChordArea->setCurrentId( musElementFactory()->fmChordArea()*(musElementFactory()->isFMChordAreaMinor()?-1:1) );
            uiFMTonicDegree->setCurrentId( musElementFactory()->fmTonicDegree()*(musElementFactory()->isFMTonicDegreeMinor()?-1:1) );
            uiFMEllipse->setChecked( musElementFactory()->isFMEllipse() );

            uiFMKeySig->setCurrentIndex((musElementFactory()->diatonicKeyNumberOfAccs()+7)*2 + ((musElementFactory()->diatonicKeyGender()==CADiatonicKey::Minor)?1:0) );

            uiFMToolBar->show();
      } else if ( mode()==EditMode && currentScoreViewPort() &&
                  currentScoreViewPort()->selection().size() &&
                  dynamic_cast<CAFunctionMark*>(currentScoreViewPort()->selection().at(0)->musElement()) ) {
            CAFunctionMark *fm = dynamic_cast<CAFunctionMark*>(currentScoreViewPort()->selection().at(0)->musElement());
            uiFMFunction->setCurrentId( fm->function()*(fm->isMinor()?-1:1) );
            uiFMChordArea->setCurrentId( fm->chordArea()*(fm->isChordAreaMinor()?-1:1) );
            uiFMTonicDegree->setCurrentId( fm->tonicDegree()*(fm->isTonicDegreeMinor()?-1:1) );
            uiFMEllipse->setChecked( fm->isPartOfEllipse() );

            uiFMKeySig->setCurrentIndex( CADrawableKeySignature::diatonicKeyToRow(fm->key()) );

            uiFMToolBar->show();
      } else {
            uiFMToolBar->hide();
      }
}


Generated by  Doxygen 1.6.0   Back to index