예제 #1
0
//==== Create & Init Gui Slider Adjustable Range  ====//
void GroupLayout::AddSlider( SliderAdjRangeInput& slid_adj_input,
                             const char* label, double range, const char* format )
{
    assert( m_Group && m_Screen );

    int init_used_w = m_X - m_Group->x();

    //==== Parm Button ====//
    VspButton* button = AddParmButton( label );

    //==== Range Button ====//
    Fl_Repeat_Button* lbutton = new Fl_Repeat_Button( m_X, m_Y, m_RangeButtonWidth, m_StdHeight, "<" );
    lbutton->box( FL_THIN_UP_BOX );
    lbutton->labelcolor( ( Fl_Color )4 );
    m_Group->add( lbutton );
    AddX( m_RangeButtonWidth );

    //==== Slider ====//
    int sw = FitWidth( m_ButtonWidth + 2 * m_RangeButtonWidth + m_InputWidth + init_used_w, m_SliderWidth );
    Fl_Slider* slider = new Fl_Slider( m_X, m_Y, sw, m_StdHeight );
    slider->type( 5 );
    slider->box( FL_THIN_DOWN_BOX );
    slider->color( FL_BACKGROUND2_COLOR );
    slider->selection_color( FL_SELECTION_COLOR );
    m_Group->add( slider );
    AddX( sw );

    //==== Range Button ====//
    Fl_Repeat_Button* rbutton = new Fl_Repeat_Button( m_X, m_Y,  m_RangeButtonWidth, m_StdHeight, "<" );
    rbutton->box( FL_THIN_UP_BOX );
    rbutton->labelcolor( ( Fl_Color )4 );
    m_Group->add( rbutton );
    AddX( m_RangeButtonWidth );

    //==== Input ====//
    Fl_Float_Input* input = new Fl_Float_Input( m_X, m_Y, m_InputWidth, m_StdHeight );
    input->type( 1 );
    input->box( FL_THIN_DOWN_BOX );
    input->textsize( 12 );
    input->when( FL_WHEN_ENTER_KEY | FL_WHEN_RELEASE );
    m_Group->add( input );
    AddX( m_InputWidth );

    AddY( m_StdHeight );
    NewLineX();

    slid_adj_input.Init( m_Screen, slider, lbutton, rbutton, input, range, format, button );

    if( strcmp( label, "AUTO_UPDATE" ) == 0 || strcmp( label, "" ) == 0 )
    {
        slid_adj_input.SetButtonNameUpdate( true );
    }
}
예제 #2
0
//==== Add Fuselage Skin Control Group ====//
void GroupLayout::AddSkinControl( SkinControl & skin_control, const char* label, double range, const char* format )
{
    assert( m_Group && m_Screen );

    int sw = FitWidth( 3 * m_StdHeight + m_ButtonWidth + 2 * m_InputWidth + 4 * m_RangeButtonWidth, 2 * m_SliderWidth )/2;

    //==== Left Min Range Button ====//
    Fl_Repeat_Button* minbuttonL = new Fl_Repeat_Button( m_X, m_Y, m_RangeButtonWidth, m_StdHeight, "<" );
    minbuttonL->box( FL_THIN_UP_BOX );
    minbuttonL->labelcolor( ( Fl_Color )4 );
    m_Group->add( minbuttonL );
    AddX( m_RangeButtonWidth );

    //==== Left Slider ====//
    Fl_Slider* sliderL = new Fl_Slider( m_X, m_Y, sw, m_StdHeight );
    sliderL->type( 5 );
    sliderL->box( FL_THIN_DOWN_BOX );
    sliderL->color( FL_BACKGROUND2_COLOR );
    sliderL->selection_color( FL_SELECTION_COLOR );
    m_Group->add( sliderL );
    AddX( sw );

    //==== Left Max Range Button ====//
    Fl_Repeat_Button* maxbuttonL = new Fl_Repeat_Button( m_X, m_Y, m_RangeButtonWidth, m_StdHeight, ">" );
    maxbuttonL->box( FL_THIN_UP_BOX );
    maxbuttonL->labelcolor( ( Fl_Color )4 );
    m_Group->add( maxbuttonL );
    AddX( m_RangeButtonWidth );

    //==== Left Input ====//
    Fl_Float_Input* inputL = new Fl_Float_Input( m_X, m_Y,  m_InputWidth, m_StdHeight );
    inputL->type( 1 );
    inputL->box( FL_THIN_DOWN_BOX );
    inputL->textsize( 12 );
    inputL->when( FL_WHEN_ENTER_KEY | FL_WHEN_RELEASE );
    m_Group->add( inputL );
    AddX( m_InputWidth );

    //==== Left Set Check Button ====//
    Fl_Check_Button* setButtonL = new Fl_Check_Button( m_X, m_Y, m_StdHeight, m_StdHeight );
    m_Group->add( setButtonL );
    AddX( m_StdHeight );

    //==== Parm Button ====//
    VspButton* parm_button = AddParmButton( label );

    //==== Set Equality Check Button ====//
    Fl_Check_Button* setButtonEqual = new Fl_Check_Button( m_X, m_Y, m_StdHeight, m_StdHeight );
    m_Group->add( setButtonEqual );
    AddX( m_StdHeight );

    //==== Right Set Check Button ====//
    Fl_Check_Button* setButtonR = new Fl_Check_Button( m_X, m_Y, m_StdHeight, m_StdHeight );
    m_Group->add( setButtonR );
    AddX( m_StdHeight );

    //==== Right Min Range Button ====//
    Fl_Repeat_Button* minbuttonR = new Fl_Repeat_Button( m_X, m_Y, m_RangeButtonWidth, m_StdHeight, "<" );
    minbuttonR->box( FL_THIN_UP_BOX );
    minbuttonR->labelcolor( ( Fl_Color )4 );
    m_Group->add( minbuttonR );
    AddX( m_RangeButtonWidth );

    //==== Right Slider ====//
    Fl_Slider* sliderR = new Fl_Slider( m_X, m_Y, sw, m_StdHeight );
    sliderR->type( 5 );
    sliderR->box( FL_THIN_DOWN_BOX );
    sliderR->color( FL_BACKGROUND2_COLOR );
    sliderR->selection_color( FL_SELECTION_COLOR );
    m_Group->add( sliderR );
    AddX( sw );

    //==== Right Max Range Button ====//
    Fl_Repeat_Button* maxbuttonR = new Fl_Repeat_Button( m_X, m_Y, m_RangeButtonWidth, m_StdHeight, ">" );
    maxbuttonR->box( FL_THIN_UP_BOX );
    maxbuttonR->labelcolor( ( Fl_Color )4 );
    m_Group->add( maxbuttonR );
    AddX( m_RangeButtonWidth );

    //==== Right Input ====//
    Fl_Float_Input* inputR = new Fl_Float_Input( m_X, m_Y,  m_InputWidth, m_StdHeight );
    inputR->type( 1 );
    inputR->box( FL_THIN_DOWN_BOX );
    inputR->textsize( 12 );
    inputR->when( FL_WHEN_ENTER_KEY | FL_WHEN_RELEASE );
    m_Group->add( inputR );
    AddX( m_InputWidth );

    AddY( m_StdHeight );
    NewLineX();

    skin_control.Init( m_Screen,
        setButtonL,
        setButtonEqual,
        setButtonR,
        sliderL,
        minbuttonL,
        maxbuttonL,
        sliderR,
        minbuttonR,
        maxbuttonR,
        inputL,
        inputR,
        parm_button,
        range, format);
}