本文整理汇总了C++中Label::addListener方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::addListener方法的具体用法?C++ Label::addListener怎么用?C++ Label::addListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label::addListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Label
Label *CtrlrSysExEditor::addByte(const String &byteAsString)
{
Label *byteLabel = new Label ("byteLabel", byteAsString);
addAndMakeVisible (byteLabel);
byteLabel->setFont (Font (Font::getDefaultMonospacedFontName(), 15.0000f, Font::plain));
byteLabel->setJustificationType (Justification::centredLeft);
byteLabel->setEditable (true, true, false);
byteLabel->setColour (Label::outlineColourId, Colour (0x9e000000));
byteLabel->setColour (TextEditor::textColourId, Colours::black);
byteLabel->setColour (TextEditor::backgroundColourId, Colour (0x0));
byteLabel->addListener (this);
byteLabel->addMouseListener (this, false);
return (byteLabel);
}
示例2: indexString
//==============================================================================
MainContentComponent::MainContentComponent()
{
for (int i=0; i<10; ++i)
{
String indexString (i);
String sliderName ("Slider " + indexString);
Slider* slider = new Slider(sliderName);
slider->setTextBoxStyle(Slider::NoTextBox, false, 0, 0);
slider->addListener(this);
sliders.add(slider);
addAndMakeVisible(slider);
String labelName("label " + indexString);
Label* label = new Label(labelName, String (slider->getValue()));
label->setEditable(true);
label->addListener(this);
labels.add(label);
addAndMakeVisible(label);
}
setSize (500, 400);
}
示例3: Component
EngineParameterComponent::EngineParameterComponent(EngineParameter ¶m)
: Component(param.name), type(param.type), parameter(param)
{
if (param.type == EngineParameter::BOOL)
{
ToggleButton* but = new ToggleButton();
but->setToggleState(param.boolParam.value,dontSendNotification);
but->setBounds(120,0,20,20);
addAndMakeVisible(but);
control = but;
}
else
{
Label* lab = new Label();
lab->setFont(Font("Small Text",10,Font::plain));
switch (param.type)
{
case EngineParameter::INT:
lab->setText(String(param.intParam.value),dontSendNotification);
lab->setBounds(120,0,50,20);
break;
case EngineParameter::FLOAT:
lab->setText(String(param.floatParam.value),dontSendNotification);
lab->setBounds(120,0,50,20);
break;
case EngineParameter::STR:
lab->setText(String(param.strParam.value),dontSendNotification);
lab->setBounds(120,0,150,20);
}
lab->setEditable(true);
lab->setColour(Label::ColourIds::backgroundColourId,Colours::lightgrey);
lab->setColour(Label::ColourIds::outlineColourId,Colours::black);
lab->addListener(this);
addAndMakeVisible(lab);
control = lab;
}
}