~s-cecilio/lenmus/v5.1.x

« back to all changes in this revision

Viewing changes to src/score/Score.cpp

  • Committer: cecilios
  • Date: 2008-09-23 17:49:53 UTC
  • Revision ID: svn-v4:2587a929-2f0e-0410-ae78-fe6f687d5efe:trunk:390

Show diffs side-by-side

added added

removed removed

Lines of Context:
761
761
}
762
762
 
763
763
lmInstrument* lmScore::AddInstrument(int nMIDIChannel, int nMIDIInstr,
764
 
                                                                         lmTextItem* pName, lmTextItem* pAbbrev,
 
764
                                                                         lmInstrNameAbbrev* pName, lmInstrNameAbbrev* pAbbrev,
765
765
                                     lmInstrGroup* pGroup)
766
766
{
767
767
    //add an lmInstrument.
1622
1622
        pCanvas->ShowContextualMenu(this, pGMO, pMenu, vPos.x, vPos.y);
1623
1623
}
1624
1624
 
1625
 
void lmScore::OnInstrProperties(int nInstr)
 
1625
bool lmScore::OnInstrProperties(int nInstr, lmController* pController)
1626
1626
{
1627
1627
        //Shows the Instruments properties dialog for the selected instrumnet (0..n).
1628
1628
        //If nInst == -1 shows a selction dialog first
 
1629
    //Returns true if dialog end by clicking on 'Accept' button
1629
1630
 
1630
1631
        if (nInstr == -1)
1631
1632
        {
1647
1648
                                                                                          _("Instrument selection"), aChoices);
1648
1649
        }
1649
1650
 
1650
 
        if (nInstr == -1) return;               //cancel button
 
1651
        if (nInstr == -1) return false;         //cancel button
1651
1652
 
1652
1653
        //Instrument selected. Show properties dialog
1653
 
        lmDlgProperties dlg((lmController*)NULL);
1654
 
        GetInstrument(nInstr+1)->OnEditProperties(&dlg);                //add specific panels
 
1654
        lmDlgProperties dlg(pController);
 
1655
        lmInstrument* pInstr = GetInstrument(nInstr+1);
 
1656
    pInstr->OnEditProperties(&dlg);             //add specific panels
1655
1657
        dlg.Layout();
1656
 
        dlg.ShowModal();
 
1658
        if (dlg.ShowModal() != wxID_OK)
 
1659
        return false;
 
1660
 
 
1661
    pInstr->OnPropertiesChanged();
 
1662
    return true;
1657
1663
}       
1658
1664
 
1659
1665
//-------------------------------------------------------------------------------------