uiBasis:: uiBasis( Fl_Group &tabs, const BasisInfo &bi ) : name( bi.name ), group( new Fl_Group( tabs.x(), tabs.y()+24, tabs.w(), tabs.h()-24, bi.name.c_str() ) ), input() { //-------------------------------------------------------------------------- // record the new tab //-------------------------------------------------------------------------- tabs.add(group); group->labelfont( FL_COURIER ); group->labelsize( 14 ); static const int bh = 23; //-------------------------------------------------------------------------- // create the parameters //-------------------------------------------------------------------------- const int h = group->h(); const size_t nb = bi.param.size(); const int hfree = h - nb * bh; const int hskip = hfree/(nb+1); int y = group->y(); const int x = group->x() + 8; for( size_t i=1; i <= nb; ++i ) { y += hskip; const string ¶m = bi.param[i]; Fl_Input *box = new Fl_Input(x,y,100,bh,param.c_str()); box->input_type(FL_FLOAT_INPUT); box->labeltype( FL_NORMAL_LABEL ); box->align(FL_ALIGN_RIGHT); box->labelfont(FL_HELVETICA); box->labelsize(12); box->textsize(12); box->textfont(FL_HELVETICA); group->add(box); box->value("0.0"); y += bh; input.push_back(box); box->callback(ChangeCB); box->when(FL_WHEN_RELEASE); } }
//==== 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 ); }
//==== Create & Init Float Input ====// void GroupLayout::AddInput( Input& input, const char* label, const char* format ) { assert( m_Group && m_Screen ); //==== Parm Button ====// VspButton* button = AddParmButton( label ); //==== Add Text Input ====// int iw = FitWidth( m_ButtonWidth, m_InputWidth ); Fl_Input* flinput = new Fl_Input( m_X, m_Y, iw, m_StdHeight ); flinput->type( 1 ); flinput->box( FL_THIN_DOWN_BOX ); flinput->textsize( 12 ); flinput->when( FL_WHEN_ENTER_KEY | FL_WHEN_RELEASE ); m_Group->add( flinput ); AddX( iw ); AddY( m_StdHeight ); NewLineX(); input.Init( m_Screen, flinput, format, button ); }