本文整理汇总了C++中Fl_Check_Button::labelsize方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Check_Button::labelsize方法的具体用法?C++ Fl_Check_Button::labelsize怎么用?C++ Fl_Check_Button::labelsize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Check_Button
的用法示例。
在下文中一共展示了Fl_Check_Button::labelsize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddButton
//==== Create & Init Gui CheckButton ====//
void GroupLayout::AddButton( CheckButton& cbutton, const char* label )
{
assert( m_Group && m_Screen );
//==== Add Check Button ====//
int bw = FitWidth( 0, m_ButtonWidth );
Fl_Check_Button* flbutton = new Fl_Check_Button( m_X, m_Y, bw, m_StdHeight, label );
flbutton->box( FL_DOWN_BOX );
flbutton->down_box( FL_DOWN_BOX );
flbutton->labelfont( 1 );
flbutton->labelsize( 12 );
flbutton->labelcolor( FL_DARK_BLUE );
flbutton->copy_label( label );
m_Group->add( flbutton );
AddX( bw );
AddY( m_StdHeight );
NewLineX();
cbutton.Init( m_Screen, flbutton );
}
示例2: pickGroupProperty
void ModelerUserInterface::pickGroupProperty(GroupProperty* group) {
// Remove the event listeners for old controls
// TODO: we really need to have a PropertyEditor class that handles this
// automatically...
if (currentGroup) {
PropertyList* props = currentGroup->getProperties();
for (PropertyList::iterator iter = props->begin();
iter != props->end();
iter++)
{
if (RangeProperty* prop = dynamic_cast<RangeProperty*>(*iter)) {
prop->unlisten((SignalListener)updateRangeSlider);
} else if (RGBProperty* prop = dynamic_cast<RGBProperty*>(*iter)) {
prop->unlisten((SignalListener)updateColorChooser);
} else if (BooleanProperty* prop = dynamic_cast<BooleanProperty*>(*iter)) {
prop->unlisten((SignalListener)updateCheckbox);
} else if (ChoiceProperty* prop = dynamic_cast<ChoiceProperty*>(*iter)) {
prop->unlisten((SignalListener)updateChoice);
}
}
// Clear out the old controls
m_controlsPack->clear();
currentGroup = NULL;
}
// Reset the scrollbar
m_controlsScroll->position(0, 0);
// If there's no group, exit
if (!group) {
m_controlsScroll->redraw();
return;
}
// Constants for slider dimensions
const int packWidth = m_controlsPack->w();
const int textHeight = 20;
const int sliderHeight = 20;
const int chooserHeight = 100;
const int buttonHeight = 20;
// Show them
// For each control, add appropriate objects to the user interface
currentGroup = group;
PropertyList* props = group->getProperties();
for (PropertyList::iterator iter = props->begin();
iter != props->end();
iter++)
{
// Ignore it if it's a group property (those belong in the tree).
if (dynamic_cast<GroupProperty*>(*iter))
continue;
// And now we'll create a UI element for the property.
// The big if-statement below uses dynamic_cast<PropertyType*>(ptr),
// to see if a property has a given type. dynamic_cast will
// return 0 if ptr is not of type PropertyType.
// Add a slider if the property is a RangeProperty
if (RangeProperty* prop = dynamic_cast<RangeProperty*>(*iter)) {
// Add the label
Fl_Box *box = new Fl_Box(0, 0, packWidth, textHeight, (*iter)->getName());
box->labelsize(14);
box->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
m_controlsPack->add(box);
// Add the slider
Fl_Value_Slider *slider = new Fl_Value_Slider(0, 0, packWidth, sliderHeight);
slider->type(1);
slider->range(prop->getMin(), prop->getMax());
slider->step(prop->getStep());
slider->value(prop->getValue());
m_controlsPack->add(slider);
// Use the step size to determine the number of decimal places
// shown in the slider's label.
if (prop->getStep() > 0) {
slider->precision((int)-log(prop->getStep()));
}
// Have the slider notify the program when it changes
slider->callback((Fl_Callback*)SliderCallback, (void*) prop);
// Have the property notify the slider when it changes
prop->listen((SignalListener)updateRangeSlider, (void*) slider);
// Add a color picker if the property is an RGB property
} else if (RGBProperty* prop = dynamic_cast<RGBProperty*>(*iter)) {
// Add the label
Fl_Box *box = new Fl_Box(0, 0, packWidth, textHeight, (*iter)->getName());
box->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE);
box->labelsize(14);
box->box(FL_FLAT_BOX); // otherwise, Fl_Scroll messes up (ehsu)
m_controlsPack->add(box);
//.........这里部分代码省略.........
示例3: make_formant_window
Fl_Double_Window* FilterUI::make_formant_window() {
{ formantparswindow = new Fl_Double_Window(700, 205, "Formant Filter Parameters");
formantparswindow->user_data((void*)(this));
{ Fl_Group* o = new Fl_Group(485, 47, 105, 113);
o->box(FL_THIN_UP_BOX);
{ Fl_Counter* o = new Fl_Counter(545, 80, 40, 15, "Formant ");
o->type(1);
o->labelfont(1);
o->labelsize(10);
o->minimum(0);
o->maximum(127);
o->step(1);
o->textsize(10);
o->callback((Fl_Callback*)cb_Formant);
o->align(FL_ALIGN_LEFT);
o->bounds(0,FF_MAX_FORMANTS-1);
o->value(nformant);
} // Fl_Counter* o
{ Fl_Counter* o = new Fl_Counter(545, 55, 40, 20, "Vowel no.");
o->type(1);
o->labelfont(1);
o->labelsize(10);
o->minimum(0);
o->maximum(127);
o->step(1);
o->textfont(1);
o->textsize(11);
o->callback((Fl_Callback*)cb_Vowel);
o->align(FL_ALIGN_LEFT);
o->bounds(0,FF_MAX_VOWELS-1);
o->value(nvowel);
} // Fl_Counter* o
{ formantparsgroup = new Fl_Group(490, 105, 95, 50);
formantparsgroup->box(FL_ENGRAVED_FRAME);
{ formant_freq_dial = new WidgetPDial(495, 115, 25, 25, "freq");
formant_freq_dial->tooltip("Formant frequency");
formant_freq_dial->box(FL_ROUND_UP_BOX);
formant_freq_dial->color(FL_BACKGROUND_COLOR);
formant_freq_dial->selection_color(FL_INACTIVE_COLOR);
formant_freq_dial->labeltype(FL_NORMAL_LABEL);
formant_freq_dial->labelfont(0);
formant_freq_dial->labelsize(10);
formant_freq_dial->labelcolor(FL_FOREGROUND_COLOR);
formant_freq_dial->maximum(127);
formant_freq_dial->step(1);
formant_freq_dial->callback((Fl_Callback*)cb_formant_freq_dial);
formant_freq_dial->align(FL_ALIGN_BOTTOM);
formant_freq_dial->when(FL_WHEN_CHANGED);
} // WidgetPDial* formant_freq_dial
{ formant_q_dial = new WidgetPDial(525, 115, 24, 25, "Q");
formant_q_dial->tooltip("Formant\'s Q");
formant_q_dial->box(FL_ROUND_UP_BOX);
formant_q_dial->color(FL_BACKGROUND_COLOR);
formant_q_dial->selection_color(FL_INACTIVE_COLOR);
formant_q_dial->labeltype(FL_NORMAL_LABEL);
formant_q_dial->labelfont(0);
formant_q_dial->labelsize(10);
formant_q_dial->labelcolor(FL_FOREGROUND_COLOR);
formant_q_dial->maximum(127);
formant_q_dial->step(1);
formant_q_dial->callback((Fl_Callback*)cb_formant_q_dial);
formant_q_dial->align(FL_ALIGN_BOTTOM);
formant_q_dial->when(FL_WHEN_CHANGED);
} // WidgetPDial* formant_q_dial
{ formant_amp_dial = new WidgetPDial(555, 115, 24, 25, "amp");
formant_amp_dial->tooltip("Formant amplitude");
formant_amp_dial->box(FL_ROUND_UP_BOX);
formant_amp_dial->color(FL_BACKGROUND_COLOR);
formant_amp_dial->selection_color(FL_INACTIVE_COLOR);
formant_amp_dial->labeltype(FL_NORMAL_LABEL);
formant_amp_dial->labelfont(0);
formant_amp_dial->labelsize(10);
formant_amp_dial->labelcolor(FL_FOREGROUND_COLOR);
formant_amp_dial->maximum(127);
formant_amp_dial->step(1);
formant_amp_dial->callback((Fl_Callback*)cb_formant_amp_dial);
formant_amp_dial->align(FL_ALIGN_BOTTOM);
formant_amp_dial->when(FL_WHEN_CHANGED);
} // WidgetPDial* formant_amp_dial
formantparsgroup->end();
} // Fl_Group* formantparsgroup
o->end();
} // Fl_Group* o
{ Fl_Group* o = new Fl_Group(590, 47, 100, 113);
o->box(FL_THIN_UP_BOX);
{ Fl_Counter* o = new Fl_Counter(595, 62, 55, 20, "Seq.Size");
o->type(1);
o->labelfont(1);
o->labelsize(10);
o->minimum(0);
o->maximum(127);
o->step(1);
o->textfont(1);
o->textsize(11);
o->callback((Fl_Callback*)cb_Seq);
o->align(FL_ALIGN_TOP_LEFT);
o->bounds(1,FF_MAX_SEQUENCE-1);
o->value(pars->Psequencesize);
} // Fl_Counter* o
{ Fl_Counter* o = new Fl_Counter(595, 97, 40, 15, "S.Pos.");
//.........这里部分代码省略.........