本文整理汇总了C++中TextButton::setClickingTogglesState方法的典型用法代码示例。如果您正苦于以下问题:C++ TextButton::setClickingTogglesState方法的具体用法?C++ TextButton::setClickingTogglesState怎么用?C++ TextButton::setClickingTogglesState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextButton
的用法示例。
在下文中一共展示了TextButton::setClickingTogglesState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LookAndFeelDemoComponent
LookAndFeelDemoComponent()
{
addAndMakeVisible (rotarySlider);
rotarySlider.setSliderStyle (Slider::RotaryHorizontalVerticalDrag);
rotarySlider.setTextBoxStyle (Slider::NoTextBox, false, 0, 0);
rotarySlider.setValue (2.5);
addAndMakeVisible (verticalSlider);
verticalSlider.setSliderStyle (Slider::LinearVertical);
verticalSlider.setTextBoxStyle (Slider::NoTextBox, false, 90, 20);
verticalSlider.setValue (6.2);
addAndMakeVisible (barSlider);
barSlider.setSliderStyle (Slider::LinearBar);
barSlider.setValue (4.5);
addAndMakeVisible (incDecSlider);
incDecSlider.setSliderStyle (Slider::IncDecButtons);
incDecSlider.setRange (0.0, 10.0, 1.0);
incDecSlider.setIncDecButtonsMode (Slider::incDecButtonsDraggable_Horizontal);
incDecSlider.setTextBoxStyle (Slider::TextBoxBelow, false, 90, 20);
addAndMakeVisible (button1);
button1.setButtonText ("Hello World!");
addAndMakeVisible (button2);
button2.setButtonText ("Hello World!");
button2.setClickingTogglesState (true);
button2.setToggleState (true, dontSendNotification);
addAndMakeVisible (button3);
button3.setButtonText ("Hello World!");
addAndMakeVisible (button4);
button4.setButtonText ("Toggle Me");
button4.setToggleState (true, dontSendNotification);
for (int i = 0; i < 3; ++i)
{
TextButton* b = radioButtons.add (new TextButton());
addAndMakeVisible (b);
b->setRadioGroupId (42);
b->setClickingTogglesState (true);
b->setButtonText ("Button " + String (i + 1));
switch (i)
{
case 0: b->setConnectedEdges (Button::ConnectedOnRight); break;
case 1: b->setConnectedEdges (Button::ConnectedOnRight + Button::ConnectedOnLeft); break;
case 2: b->setConnectedEdges (Button::ConnectedOnLeft); break;
default: break;
}
}
radioButtons.getUnchecked (2)->setToggleState (true, dontSendNotification);
}