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

void CAMainWin::on_uiNoteStemDirection_toggled ( bool  checked,
int  id 
) [private, slot]

Sets the currently selected note stem direction if in insert/edit mode or the music elements factory note stem direction if in insert mode.

Definition at line 3950 of file mainwin.cpp.

References CAScoreViewPort::selection(), CAMusElementFactory::setNoteStemDirection(), and CANote::setStemDirection().

                                                                   {
      CANote::CAStemDirection direction = static_cast<CANote::CAStemDirection>(id);
      if (mode()==InsertMode)
            musElementFactory()->setNoteStemDirection( direction );
      else if (mode()==SelectMode || mode()==EditMode) {
            CACanorus::undo()->createUndoCommand( document(), tr("change note stem direction", "undo") );
            CAScoreViewPort *v = currentScoreViewPort();
            bool changed=false;
            for (int i=0; v && i<v->selection().size(); i++) {
                  CANote *note = dynamic_cast<CANote*>(v->selection().at(i)->musElement());
                  if ( note ) {
                        note->setStemDirection( direction );
                        changed=true;
                  }
            }
            if (changed) {
                  CACanorus::undo()->pushUndoCommand();
                  CACanorus::rebuildUI(document(), currentSheet());
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index