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

void org::kbinani::cadencii::FormMain::applySelectedTool (  ) [inline]

現在選択されている編集ツールに応じて、メニューのチェック状態を更新します

Definition at line 6265 of file FormMain.cs.

References org::kbinani::cadencii::AppManager::getSelectedTool(), org::kbinani::cadencii::AppManager::isCurveMode(), and org::kbinani::cadencii::AppManager::mSelectedPaletteTool.

        {
            EditTool tool = AppManager.getSelectedTool();

#if JAVA
            int count = toolStripTool.getComponentCount();
#else
            int count = toolBarTool.Buttons.Count;
#endif
            for ( int i = 0; i < count; i++ ) {
#if JAVA
                Object tsi = toolStripTool.getComponentAtIndex( i );
#else
                Object tsi = toolBarTool.Buttons[i];
#endif
#if JAVA
                if( tsi instanceof PaletteToolButton ){
                    BToggleButton tsb = (PaletteToolButton)tsi;
                    boolean sel = false;
#if ENABLE_SCRIPT
                    String id = tsb.getPaletteToolID();
                    if( id != null ){
                        if( tool == EditTool.PALETTE_TOOL ){
                            sel = str.compare( AppManager.mSelectedPaletteTool, id );
                        }
                    }
#endif // ENABLE_SCRIPT
                    tsb.setSelected( sel );
                }
#else // JAVA
                if ( tsi is System.Windows.Forms.ToolBarButton ) {
                    System.Windows.Forms.ToolBarButton tsb = (System.Windows.Forms.ToolBarButton)tsi;
                    Object tag = tsb.Tag;
                    if ( tsb.Style == System.Windows.Forms.ToolBarButtonStyle.ToggleButton && tag != null && tag is String ) {
#if ENABLE_SCRIPT
                        if ( tool == EditTool.PALETTE_TOOL ) {
                            String id = (String)tag;
                            tsb.Pushed = str.compare( AppManager.mSelectedPaletteTool, id );
                        } else
#endif // ENABLE_SCRIPT
 {
                            tsb.Pushed = false;
                        }
                    }
                }
#endif // JAVA
            }
            MenuElement[] items = cMenuTrackSelectorPaletteTool.getSubElements();
            foreach ( MenuElement tsi in items ) {
                if ( tsi is PaletteToolMenuItem ) {
                    PaletteToolMenuItem tsmi = (PaletteToolMenuItem)tsi;
                    String id = tsmi.getPaletteToolID();
                    boolean sel = false;
#if ENABLE_SCRIPT
                    if ( tool == EditTool.PALETTE_TOOL ) {
                        sel = str.compare( AppManager.mSelectedPaletteTool, id );
                    }
#endif
                    tsmi.setSelected( sel );
                }
            }

            items = cMenuPianoPaletteTool.getSubElements();
            foreach ( MenuElement tsi in items ) {
                if ( tsi is PaletteToolMenuItem ) {
                    PaletteToolMenuItem tsmi = (PaletteToolMenuItem)tsi;
                    String id = tsmi.getPaletteToolID();
                    boolean sel = false;
#if ENABLE_SCRIPT
                    if ( tool == EditTool.PALETTE_TOOL ) {
                        sel = str.compare( AppManager.mSelectedPaletteTool, id );
                    }
#endif
                    tsmi.setSelected( sel );
                }
            }

            EditTool selected_tool = AppManager.getSelectedTool();
            cMenuPianoPointer.setSelected( (selected_tool == EditTool.ARROW) );
            cMenuPianoPencil.setSelected( (selected_tool == EditTool.PENCIL) );
            cMenuPianoEraser.setSelected( (selected_tool == EditTool.ERASER) );

            cMenuTrackSelectorPointer.setSelected( (selected_tool == EditTool.ARROW) );
            cMenuTrackSelectorPencil.setSelected( (selected_tool == EditTool.PENCIL) );
            cMenuTrackSelectorLine.setSelected( (selected_tool == EditTool.LINE) );
            cMenuTrackSelectorEraser.setSelected( (selected_tool == EditTool.ERASER) );

#if JAVA
            stripBtnPointer.setSelected( (selected_tool == EditTool.ARROW) );
            stripBtnPencil.setSelected( (selected_tool == EditTool.PENCIL) );
            stripBtnLine.setSelected( (selected_tool == EditTool.LINE) );
            stripBtnEraser.setSelected( (selected_tool == EditTool.ERASER) );
#else
            stripBtnPointer.Pushed = (selected_tool == EditTool.ARROW);
            stripBtnPencil.Pushed = (selected_tool == EditTool.PENCIL);
            stripBtnLine.Pushed = (selected_tool == EditTool.LINE);
            stripBtnEraser.Pushed = (selected_tool == EditTool.ERASER);
#endif


            cMenuPianoCurve.setSelected( AppManager.isCurveMode() );
            cMenuTrackSelectorCurve.setSelected( AppManager.isCurveMode() );
#if JAVA
            stripBtnCurve.setSelected( AppManager.isCurveMode() );
#else
            stripBtnCurve.Pushed = AppManager.isCurveMode();
#endif
        }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index