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


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

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


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

示例1: clicked

void TabBarButton::clicked (const ModifierKeys& mods)
{
    if (mods.isPopupMenu())
        owner.popupMenuClickOnTab (getIndex(), getButtonText());
    else
        owner.setCurrentTabIndex (getIndex());
}
开发者ID:sonic59,项目名称:JuceS1Text,代码行数:7,代码来源:juce_TabbedButtonBar.cpp

示例2: buttonClicked

void BigClockEditor::buttonClicked (Button* buttonThatWasClicked) {
    ModifierKeys mousebutton = ModifierKeys::getCurrentModifiers();
    if (!mousebutton.isPopupMenu()) {
		if (buttonThatWasClicked==runButton)
		{
			getFilter()->setParameter(kRunWatch,1.f-getFilter()->getParameter(kRunWatch));
		}
		else if (buttonThatWasClicked==resetButton)
		{
			getFilter()->setParameter(kClearWatch,1.f);
		}
		else if (buttonThatWasClicked==infoLabel)
		{
			bool samplemode = getFilter()->getParameter(kSamples)>=0.5f;
			if (barsbeats && !samplemode) {
				barsbeats=false;
				getFilter()->setParameter(kBarsBeats, 0.0);
				getFilter()->setParameter(kSamples, 0.0);
			}
			else if (!barsbeats && !samplemode) {
				getFilter()->setParameter(kSamples, 1.0);
			}
			else if (samplemode) {
				barsbeats=true;
				getFilter()->setParameter(kBarsBeats, 1.0);
				getFilter()->setParameter(kSamples, 0.0);
			}
			updateParametersFromFilter();
		}
    }
}
开发者ID:Amcut,项目名称:pizmidi,代码行数:31,代码来源:BigClockEditor.cpp

示例3: mouseDown

void ChannelStripComponent::mouseDown(const MouseEvent &) {

	ModifierKeys modifiers = ModifierKeys::getCurrentModifiersRealtime();

	// check the mod keys ..
	if (modifiers.isPopupMenu() || modifiers.isCtrlDown())
	{
		ScopedPointer<PopupMenu> arrangeMenu_ = new PopupMenu();
		arrangeMenu_->clear();
		arrangeMenu_->addCommandItem(&_commands, MainWindow::showArrangement);
		arrangeMenu_->show();
	}
}
开发者ID:dmtaudio,项目名称:mordaw,代码行数:13,代码来源:ChannelStripComponent.cpp

示例4: 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

示例5: buttonStateChanged

void TrackMixerComponent::buttonStateChanged(Button* button)
{
    // if button is clicked mute or solo track
    if(button == _muteButton)
        _engine.getMixer();
    else if(button == _soloButton)
        _engine.getMixer()->soloTrack(_trackID);
	ModifierKeys modifiers = ModifierKeys::getCurrentModifiersRealtime();

	// menu for adding tracks
	if (modifiers.isPopupMenu() || modifiers.isCtrlDown())
	{
		ScopedPointer<PopupMenu> arrangeMenu_ = new PopupMenu();
		arrangeMenu_->clear();
		arrangeMenu_->addCommandItem(&_commands, ProjectManager::addTrack);
		arrangeMenu_->show();
	}
}
开发者ID:dmtaudio,项目名称:mordaw,代码行数:18,代码来源:TrackComponent.cpp

示例6: mouseDown

void TrackComponent::mouseDown(const MouseEvent &e) {

	ModifierKeys modifiers = ModifierKeys::getCurrentModifiersRealtime();

    int posX;
	// check the mod keys ..
	if (modifiers.isPopupMenu() || modifiers.isCtrlDown())
	{
		ScopedPointer<PopupMenu> trackMenu_ = new PopupMenu();
		trackMenu_->clear();
		trackMenu_->addCommandItem(&_commands, MainWindow::showMixer);
		trackMenu_->addItem(1, "Add Region", true);
        MouseEvent ev = e.getEventRelativeTo(this);
        for(auto region : _regionComponents)
        {
            posX = ev.x;
            region->setBroughtToFrontOnMouseClick(true);
            if(region->getPositionX() < posX && posX < (region->getPositionX() + region->getRegionWidth()))
            {
                trackMenu_->addItem(2, "Remove Region", true);
            }
        }
        switch (trackMenu_->show())
        {
            case 1:
            {
                FileChooser chooser("Select an audio file to add...",
                                    File::nonexistent,
                                    "*.wav; *aif; *.flac");
                if (chooser.browseForFileToOpen()) {
                    File audioFile(chooser.getResult());
                    const String fileString = audioFile.getFullPathName();
                    String format;
                    if (fileString.contains(".wav"))
                        format = "WAV";
                    else if (fileString.contains(".aif") || fileString.contains(".aiff"))
                        format = "AIFF";
                    else if (fileString.contains(".flac"))
                        format = "FLAC";
                    AudioFormatManager formatManager;
                    formatManager.registerBasicFormats();
                    
                    AudioFormatReader* reader = formatManager.createReaderFor(audioFile);
                    Audio::Region* region = new Audio::SampleRegion(reader, 1, &audioFile);
                    Point<int> position = e.getPosition();
                    int x = position.getX();
                    
                    if (x > _mixerOffset)
                    {
                        int64 samplesRange = secondsToSamples(100, _sampleRate);
                        int64 positionSamples = pixelsToSamples(x - _mixerOffset, 100 * _pixelsPerClip, samplesRange);
                        
                        _track->add(positionSamples, region);
                        createRegionGUI(x, region, formatManager, audioFile);
                        getParentComponent()->resized();
                    }
                    else if (x < _mixerOffset)
                    {
                        _track->add(0, region);
                        createRegionGUI(_mixerOffset, region, formatManager, audioFile);
                        getParentComponent()->resized();
                    }
                }
            }
                break;
            case 2:
            {
                CriticalSection critical;
                critical.enter();
                for(size_t i = 0; i < _regionComponents.size(); ++i)
                {
                    
                    Rectangle<int> bounds_ = _regionComponents.at(i)->getBounds();
					posX = ev.x;
                    if((int)_regionComponents.at(i)->getPositionX() < posX && posX < ((int)_regionComponents.at(i)->getPositionX() + (int)_regionComponents.at(i)->getRegionWidth()))
                    {
                        _track->remove(_regionComponents.at(i)->getRegion(), _posX.at(i));
                        std::vector<RegionComponent*>::iterator regit = _regionComponents.begin() + i;
                        RegionComponent* component = _regionComponents.at(i);
                        removeChildComponent(_regionComponents.at(i));
                        _regionComponents.erase(regit);
                        delete component;
                        _regions.erase(_posX.at(i));
                        std::vector<int64>::iterator posit = _posX.begin() + i;;
                        _posX.erase(posit);
                        std::vector<int64>::iterator sampsit = _sizeSamps.begin() + i;;
                        _sizeSamps.erase(sampsit);
                    }
                }
                critical.exit();
            }
            default:
                break;
        }
    }
}
开发者ID:dmtaudio,项目名称:mordaw,代码行数:96,代码来源:TrackComponent.cpp

示例7: buttonStateChanged

void BigClockEditor::buttonStateChanged (Button* buttonThatWasClicked) {
    if (buttonThatWasClicked->isDown()) {
        ModifierKeys mousebutton = ModifierKeys::getCurrentModifiers();
        if (mousebutton.isPopupMenu()) {
            bool samplemode = getFilter()->getParameter(kSamples)>=0.5f;
            PopupMenu m, sub1,sub2,sub3,sub4,clockmode;
            sub1.addCustomItem (-1, colourSelector, 300, 300, false);
            m.addSubMenu (L"Color", sub1);
            m.addSeparator();
			clockmode.addItem(100,"Host Timeline",true,getFilter()->mode == HostTimeMode);
			clockmode.addItem(101,"Recording Time",true,getFilter()->mode == RecTimeMode);
			clockmode.addItem(102,"Stopwatch",true,getFilter()->mode == StopwatchMode);
			clockmode.addItem(103,"Plugin Time",true,getFilter()->mode == PluginTimeMode);
			clockmode.addItem(104,"Actual Time",true,getFilter()->mode == ActualTimeMode);
			m.addSubMenu("Clock Mode",clockmode);
			m.addItem(120,"Reset",getFilter()->mode != HostTimeMode && getFilter()->mode != ActualTimeMode);
            m.addSeparator();
            sub4.addItem(998,L"Show Cues",true,showtextbox);
            sub4.addItem(996,L"Import...");
            sub4.addItem(997,L"Export...",getFilter()->cues.size()>0);
            sub4.addItem(999,L"Clear",getFilter()->cues.size()>0);
            for (int i=0;i<getFilter()->cues.size();i++) {
                sub4.addItem(1000+i,
                    getFilter()->ppqToString(getFilter()->cues[i]->ppq,
                                             getFilter()->lastPosInfo.timeSigNumerator,
                                             getFilter()->lastPosInfo.timeSigDenominator,
                                             getFilter()->lastPosInfo.bpm,barsbeats) 
                    + " - " + getFilter()->cues[i]->text,true,getFilter()->cues[i]->enabled);
            }
            m.addSubMenu (L"Cues", sub4, getFilter()->mode==HostTimeMode);
            m.addSeparator();
            m.addItem (3, L"Bars|Beats|Ticks", true, barsbeats && !samplemode);
            float ppqn = getFilter()->getParameter(kTicks);
            sub2.addItem(30,L"hide ticks",true,ppqn==1.0);
            sub2.addItem(31,L"4",true,ppqn<1.0 && ppqn>=0.9);
            sub2.addItem(32,L"16",true,ppqn<0.9 && ppqn>=0.8);
            sub2.addItem(33,L"48",true,ppqn<0.8 && ppqn>=0.7);
            sub2.addItem(34,L"96",true,ppqn<0.7 && ppqn>=0.65);
            sub2.addItem(35,L"100",true,ppqn<0.65 && ppqn>=0.6);
            sub2.addItem(36,L"120",true,ppqn<0.6 && ppqn>=0.5);
            sub2.addItem(37,L"192",true,ppqn<0.5 && ppqn>=0.4);
            sub2.addItem(38,L"240",true,ppqn<0.4 && ppqn>=0.3);
            sub2.addItem(39,L"384",true,ppqn<0.3 && ppqn>=0.2);
            sub2.addItem(40,L"480",true,ppqn<0.2 && ppqn>=0.1);
            sub2.addItem(41,L"768",true,ppqn<0.1 && ppqn>0.0);
            sub2.addItem(42,L"960",true,ppqn==0.0);
            m.addSubMenu (L"Ticks per beat", sub2,barsbeats && !samplemode);
            m.addSeparator();
            m.addItem (4, L"Hour:Min:Sec", true, !barsbeats && !samplemode);
            float fps = getFilter()->getParameter(kFrames);
            sub3.addItem(50,L"ms (1000)",true,fps==0.0);
            sub3.addItem(51,L"120",true,fps==1.0);
            sub3.addItem(52,L"100",true,fps<1.0 && fps>=0.9);
            sub3.addItem(53,L"75",true,fps<0.9 && fps>=0.8);
            sub3.addItem(54,L"60",true,fps<0.8 && fps>=0.7);
            sub3.addItem(55,L"50",true,fps<0.7 && fps>=0.6);
            sub3.addItem(56,L"30",true,fps<0.6 && fps>=0.5);
            sub3.addItem(61,L"29.97 drop",true,fps<0.5 && fps>=0.4);
            sub3.addItem(57,L"25",true,fps<0.4 && fps>=0.3);
            sub3.addItem(58,L"24",true,fps<0.3 && fps>=0.2);
            sub3.addItem(59,L"15",true,fps<0.2 && fps>=0.1);
            sub3.addItem(60,L"10",true,fps<0.1 && fps>0.0);
            m.addSubMenu (L"Frames per second", sub3, !barsbeats && !samplemode);
            m.addItem (1, L"Show ms/frames", !barsbeats && !samplemode, getFilter()->getParameter(kShowms)>=0.5);
            m.addItem (6, L"Show subframes", !barsbeats && !samplemode && getFilter()->getParameter(kShowms)>=0.5, getFilter()->getParameter(kShowsubfr)>=0.5);
            m.addItem (2, L"Show hours", !barsbeats && !samplemode, getFilter()->getParameter(kShowhrs)>=0.5);
            m.addSeparator();
            m.addItem (5, L"Samples", true, samplemode);
            int result = m.show();
            if (result > 0)
            {
                if (result==1) {
                    if (getFilter()->getParameter(kShowms)>=0.5) getFilter()->setParameter(kShowms,0.0);
                    else getFilter()->setParameter(kShowms,1.0);
                }
                else if (result==2) {
                    if (getFilter()->getParameter(kShowhrs)>=0.5f) getFilter()->setParameter(kShowhrs,0.0f);
                    else getFilter()->setParameter(kShowhrs,1.0f);
                }
                else if (result==3) {
                    if (barsbeats && !samplemode) { }
                    else {
                        getFilter()->setParameter(kBarsBeats,1.0f);
                        getFilter()->setParameter(kSamples,0.0f);
                    }
                }
                else if (result>=30 && result<50) {
                    if (result==30) getFilter()->setParameter(kTicks,1.0f);
                    else if (result==31) getFilter()->setParameter(kTicks,0.91f);
                    else if (result==32) getFilter()->setParameter(kTicks,0.81f);
                    else if (result==33) getFilter()->setParameter(kTicks,0.71f);
                    else if (result==34) getFilter()->setParameter(kTicks,0.65f);
                    else if (result==35) getFilter()->setParameter(kTicks,0.61f);
                    else if (result==36) getFilter()->setParameter(kTicks,0.51f);
                    else if (result==37) getFilter()->setParameter(kTicks,0.41f);
                    else if (result==38) getFilter()->setParameter(kTicks,0.31f);
                    else if (result==39) getFilter()->setParameter(kTicks,0.21f);
                    else if (result==40) getFilter()->setParameter(kTicks,0.11f);
                    else if (result==41) getFilter()->setParameter(kTicks,0.051f);
                    else if (result==42) getFilter()->setParameter(kTicks,0.0f);
//.........这里部分代码省略.........
开发者ID:Amcut,项目名称:pizmidi,代码行数:101,代码来源:BigClockEditor.cpp


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