本文整理汇总了C++中Fl_Input::box方法的典型用法代码示例。如果您正苦于以下问题:C++ Fl_Input::box方法的具体用法?C++ Fl_Input::box怎么用?C++ Fl_Input::box使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fl_Input
的用法示例。
在下文中一共展示了Fl_Input::box方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddInput
//==== Create & Init Text Input ====//
void GroupLayout::AddInput( StringInput& text_input, const char* label )
{
assert( m_Group && m_Screen );
//==== Button ====//
AddParmButton( label );
//==== Add Text Input ====//
int iw = FitWidth( m_ButtonWidth, m_InputWidth );
Fl_Input* input = new Fl_Input( m_X, m_Y, iw, m_StdHeight );
input->box( FL_THIN_DOWN_BOX );
input->textsize( 12 );
input->when( FL_WHEN_ENTER_KEY | FL_WHEN_RELEASE );
m_Group->add( input );
AddX( iw );
AddY( m_StdHeight );
NewLineX();
text_input.Init( m_Screen, input );
}
示例2: edit_formula_cb
void edit_formula_cb( Fl_Widget* w, void* ) {
const int heightInput = 28;
const int heightText = 18;
const int wideLabel = 50;
const int wideInput = 450;
const int Ybetween = 3;
const int YbetweenMore = 6;
const int alignStyle = FL_ALIGN_INSIDE | FL_ALIGN_RIGHT;
const int textStyle = FL_ALIGN_INSIDE | FL_ALIGN_LEFT;
const Fl_Boxtype inputStyle = FL_PLASTIC_DOWN_BOX;
int x = 10;
int y = 10;
const int wide = x+wideLabel+wideInput+x;
const int height = y + 3*heightText + Ybetween + 3*(heightInput+Ybetween)
- Ybetween + YbetweenMore + y;
Fl_Window* win = new Fl_Window( wide, height, _("Formulas editor") );
Fl_Group* win2 = new Fl_Group( 0, 0, wide, height );
win->resizable(win2);
{
Fl_Box* o =
new Fl_Box( x, y, wideLabel+wideInput, heightText,
_("Enter the formulas of x(n+1) and y(n+1) using prefix notation.") );
o->align( textStyle );
}
y += heightText;
{
Fl_Box* o = new Fl_Box( x, y, wideLabel+wideInput, heightText,
_("Variables: x y x1 x2 y1 y2 xc yc rand, and any number.") );
o->align( textStyle );
}
y += heightText;
{
Fl_Box* o = new Fl_Box( x, y, wideLabel+wideInput, heightText, _("Functions: ") );
o->align( textStyle );
}
{
Fl_Box* o = new Fl_Box( x + (int)( fl_width(_("Functions: ")) ), y,
wideLabel+wideInput, heightText,
"+ - * / < pow abs atan2 sin cos tan atan ln sign square sqrt." );
o->align( textStyle );
}
y += heightText + Ybetween;
{
Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, "x <- " );
o->align( alignStyle );
}
{
Fl_Input* o = new Fl_Input( x+wideLabel, y, wideInput, heightInput );
o->box(inputStyle);
o->value( Function::formulaPoint.getStringX().c_str() );
}
y += heightInput + Ybetween;
{
Fl_Box* o = new Fl_Box( x, y, wideLabel, heightInput, "y <- " );
o->align( alignStyle );
}
{
Fl_Input* o = new Fl_Input( x+wideLabel, y, wideInput, heightInput );
o->box(inputStyle);
o->value( Function::formulaPoint.getStringY().c_str() );
}
y += heightInput + Ybetween + YbetweenMore;
{
Fl_Return_Button* o = new Fl_Return_Button( wide - x - 150, y, 150, heightInput,
_("Set formulas") );
o->box(FL_PLASTIC_UP_BOX);
o->callback( (Fl_Callback*)set_formula, glito );
}
win2->end();
win->end();
win->show();
}