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


C++ ToggleButton::setRadioGroupId方法代码示例

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


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

示例1: InstrumentComponent

InstrumentListComponent::InstrumentListComponent (Sequencer* sequencer_) :
Component ("InstrumentListComponent"),
sequencer (sequencer_),
lastPattern (nullptr),
lastActiveInstrument (nullptr)
{
    Pattern* pattern = sequencer->getPattern();
    lastPattern = pattern;
    int numInstruments = pattern->getNumInstruments();    
    for (int i = 0; i < numInstruments; i++) {
        Instrument* instrument = pattern->getInstrumentAt (i);
        InstrumentComponent* instrumentComponent = new InstrumentComponent (instrument);
        addAndMakeVisible (instrumentComponent);
        instrumentComponents.add (instrumentComponent);
    }   
    
    for (int i = 0; i < numInstruments; i++) {
        ToggleButton* btn = new ToggleButton ((String)i);
        btn->setRadioGroupId (kRadioGroupId);
        btn->setColour (ToggleButton::textColourId, Colours::white);
        addAndMakeVisible (btn);
        btn->addListener (this);
        activeButtons.add (btn);
    }   
    
    startTimer (100);
}
开发者ID:mattsonic,项目名称:GateTrigger,代码行数:27,代码来源:InstrumentListComponent.cpp

示例2: TextValidator

void
SettingsWindow::setUpStandardFields(int & widthSoFar,
                                    int & heightSoFar)
{
    ODL_OBJENTER(); //####
    ODL_P2("widthSoFar = ", &widthSoFar, "heightSoFar = ", &heightSoFar); //####
    Component * content = getContentComponent();
    int         buttonHeight = GetButtonHeight();
    Point<int>  dimensions;
    size_t      numDescriptors = _descriptors.size();

    widthSoFar = heightSoFar = 0;
    _topText.setFont(_regularFont);
    if ((0 < numDescriptors) || _canSetEndpoint || _canSetPort || _canSetTag || _canUseModifier)
    {
        _topText.setText(String("The ") + _execType + " has one or more arguments, that need to be "
                         "provided before it can be launched.", dontSendNotification);
    }
    else
    {
        _topText.setText(String("The ") + _execType + " has no arguments or options, so it can be "
                         "launched right now.", dontSendNotification);
    }
    CommonVisuals::CalculateTextArea(dimensions, _regularFont, _topText.getText());
    _topText.setBounds(FormField::kButtonGap, FormField::kButtonGap + getTitleBarHeight(),
                       dimensions.getX() + FormField::kButtonGap, dimensions.getY());
    content->addAndMakeVisible(&_topText, 0);
    heightSoFar = _topText.getY() + _topText.getHeight() + FormField::kButtonGap;
    widthSoFar = jmax(widthSoFar, _topText.getX() + _topText.getWidth());
    if (_canSetEndpoint)
    {
        _endpointField = new CaptionedTextField(*this, _regularFont, _errorFont, 0,
                                                "(Optional) Endpoint to use", heightSoFar, false,
                                                false, NULL,
                                                new TextValidator(*_endpointDescriptor),
                                                kEndpointFieldName);

        _endpointField->addToComponent(content);
        widthSoFar = jmax(widthSoFar, _endpointField->getMinimumWidth());
        heightSoFar = (_endpointField->getY() + _endpointField->getHeight() +
                       (FormField::kButtonGap / 2));
    }
    if (_canSetPort)
    {
        _portField = new CaptionedTextField(*this, _regularFont, _errorFont, 0,
                                            "(Optional) Network port to use", heightSoFar, false,
                                            false, NULL, new TextValidator(*_portDescriptor),
                                            kPortFieldName);

        _portField->addToComponent(content);
        widthSoFar = jmax(widthSoFar, _portField->getMinimumWidth());
        heightSoFar = _portField->getY() + _portField->getHeight() + (FormField::kButtonGap / 2);
    }
    if (_canSetTag)
    {
        _tagField = new CaptionedTextField(*this, _regularFont, _errorFont, 0,
                                           String("(Optional) Tag for the ") + _execType,
                                           heightSoFar, false, false, NULL, NULL, kTagFieldName);

        _tagField->addToComponent(content);
        widthSoFar = jmax(widthSoFar, _tagField->getMinimumWidth());
        heightSoFar = _tagField->getY() + _tagField->getHeight() + (FormField::kButtonGap / 2);
    }
    if (_canUseModifier)
    {
        _tagModifierGroup = new GroupComponent("", "(Optional) Tag modifier");
        _tagModifierGroup->setBounds(FormField::kFieldInset, heightSoFar,
                                        widthSoFar - (FormField::kButtonGap +
                                                      FormField::kFieldInset),
                                        static_cast<int>(2 * _regularFont.getHeight()) +
                                        FormField::kButtonGap);
        for (int ii = 0; 4 >= ii; ++ii)
        {
            ToggleButton * tb = new ToggleButton(String(ii) + ((1 == ii) ? " byte" : " bytes"));

            _tagModifierGroup->addAndMakeVisible(tb);
            _tagModifierButtons.add(tb);
            tb->setComponentID(String(ii));
            tb->setRadioGroupId(kTagModifierGroupId);
            tb->setBounds(FormField::kFieldInset + (kTagModifierButtonWidth * ii),
                          FormField::kButtonGap + static_cast<int>(_regularFont.getHeight() / 2),
                          kTagModifierButtonWidth, static_cast<int>(_regularFont.getHeight()));
            tb->setTooltip("Modify tag with " + String(ii) + ((1 == ii) ?
                                                              " byte of the IP address" :
                                                              " bytes of the IP address"));
            if (0 == ii)
            {
                tb->setToggleState(true, dontSendNotification);
            }
        }
        content->addAndMakeVisible(_tagModifierGroup);
        heightSoFar = (_tagModifierGroup->getY() + _tagModifierGroup->getHeight() +
                       (FormField::kButtonGap / 2));
        widthSoFar = jmax(widthSoFar, _tagModifierGroup->getX() +
                          _tagModifierGroup->getWidth());
    }
    // Check for one or more file descriptors.
    for (size_t ii = 0; numDescriptors > ii; ++ii)
    {
        bool                                forOutput;
//.........这里部分代码省略.........
开发者ID:MovementAndMeaning,项目名称:Core_MPlusM,代码行数:101,代码来源:m+mSettingsWindow.cpp


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