本文整理汇总了C++中ToggleButton::setComponentID方法的典型用法代码示例。如果您正苦于以下问题:C++ ToggleButton::setComponentID方法的具体用法?C++ ToggleButton::setComponentID怎么用?C++ ToggleButton::setComponentID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToggleButton
的用法示例。
在下文中一共展示了ToggleButton::setComponentID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
//.........这里部分代码省略.........