当前位置: 首页>>代码示例>>C++>>正文


C++ ModifierKeys::isCommandDown方法代码示例

本文整理汇总了C++中ModifierKeys::isCommandDown方法的典型用法代码示例。如果您正苦于以下问题:C++ ModifierKeys::isCommandDown方法的具体用法?C++ ModifierKeys::isCommandDown怎么用?C++ ModifierKeys::isCommandDown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModifierKeys的用法示例。


在下文中一共展示了ModifierKeys::isCommandDown方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: selectBasedOnModifiers

    void selectBasedOnModifiers (TreeViewItem* const item, const ModifierKeys& modifiers)
    {
        TreeViewItem* firstSelected = 0;

        if (modifiers.isShiftDown() && ((firstSelected = owner.getSelectedItem (0)) != 0))
        {
            TreeViewItem* const lastSelected = owner.getSelectedItem (owner.getNumSelectedItems() - 1);
            jassert (lastSelected != 0);

            int rowStart = firstSelected->getRowNumberInTree();
            int rowEnd = lastSelected->getRowNumberInTree();
            if (rowStart > rowEnd)
                swapVariables (rowStart, rowEnd);

            int ourRow = item->getRowNumberInTree();
            int otherEnd = ourRow < rowEnd ? rowStart : rowEnd;

            if (ourRow > otherEnd)
                swapVariables (ourRow, otherEnd);

            for (int i = ourRow; i <= otherEnd; ++i)
                owner.getItemOnRow (i)->setSelected (true, false);
        }
        else
        {
            const bool cmd = modifiers.isCommandDown();
            item->setSelected ((! cmd) || ! item->isSelected(), ! cmd);
        }
    }
开发者ID:Labmind,项目名称:GUI,代码行数:29,代码来源:juce_TreeView.cpp

示例2: selectRowsBasedOnModifierKeys

void ListBox::selectRowsBasedOnModifierKeys (const int row,
                                             const ModifierKeys& mods,
                                             const bool isMouseUpEvent)
{
    if (multipleSelection && mods.isCommandDown())
    {
        flipRowSelection (row);
    }
    else if (multipleSelection && mods.isShiftDown() && lastRowSelected >= 0)
    {
        selectRangeOfRows (lastRowSelected, row);
    }
    else if ((! mods.isPopupMenu()) || ! isRowSelected (row))
    {
        selectRowInternal (row, false, ! (multipleSelection && (! isMouseUpEvent) && isRowSelected (row)), true);
    }
}
开发者ID:sonic59,项目名称:JuceEditor,代码行数:17,代码来源:juce_ListBox.cpp

示例3: buttonClicked


//.........这里部分代码省略.........
                                        noteNumber = i;
                                }
                                
                            }
                        }
                        else
                        {
                            //redraw and re-set what was previously there
                            //bit convoluted to clear everything above
                            //just to redraw it in a certain situation.
                            //Is there a better way to code it?
                            for (int row = 0; row < 12; row++)
                            {
                                if (padIndex == 0)
                                {
                                    setKeyDisplay (PAD_SETTINGS->getSequencerMidiNote(row), true);
                                    selectedKeys.addIfNotAlreadyThere(PAD_SETTINGS->getSequencerMidiNote(row));
                                }
                            }
                            
                        }
                        
                        recentlyUpdated = true;
                         
                    }
                }
            
                
            }
            
            //=========================================================================
            //=========================================================================
            //cmd-click to select mutiple notes for midi pads or custom scale for sequencer pads
            else if (modifier.isCommandDown() == true)
            {
                //don't intially clear the keys
                
                //=========================================================================
                //MIDI MODE CMD-CLICK
                
                //if the number of selected keys is less than the number of selected pads
                if (selectedKeys.size() < selectedPads.size())
                {
                    //cycle through the SELECTED KEYS in the order they were selected,
                    //applying them to the selected pads in the order they were selected.
                    for (int padIndex = 0; padIndex < selectedKeys.size(); padIndex++)
                    {
                        int padNum = selectedPads[padIndex];
                        
                        if (PAD_SETTINGS->getMode() == 1) //Midi Mode
                        {
                            
                            PAD_SETTINGS->setMidiNote(selectedKeys[padIndex]);
                            
                            //update the GUI
                            if (padIndex == 0)
                            {
                                //add the key
                                setKeyDisplay (i, true);
                                selectedKeys.addIfNotAlreadyThere(i); 
                                noteNumber = selectedKeys[0];
                            }
                            
                        }
                        
                    }
开发者ID:ankit--sethi,项目名称:AlphaLive,代码行数:67,代码来源:GuiPiano.cpp


注:本文中的ModifierKeys::isCommandDown方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。