Commit 84cc8b47 authored by Alexandre De Fonvillars's avatar Alexandre De Fonvillars
Browse files

modif graphique

parent a2e6fe4e
......@@ -29,27 +29,7 @@ void CreerInterface()
gInterface.ZoneDessin->mouse_callback( ZoneDessinSourisCB, NULL ) ;
gInterface.ZoneDessin->keyboard_callback( ZoneDessinClavierCB, NULL ) ;
// Creation du bouton Quitter
gInterface.BoutonQuitter = new Fl_Button(680, 510, 100, 20, "Quit") ;
gInterface.BoutonQuitter->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonQuitter->callback( BoutonQuitterCB, NULL ) ;
// Creation du bouton Run
gInterface.BoutonRun = new Fl_Button(575, 485, 100, 20, "Run") ;
gInterface.BoutonRun->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonRun->callback( BoutonRunCB, NULL ) ;
// Creation du bouton Stop
gInterface.BoutonStop = new Fl_Button(680, 485, 100, 20, "Stop") ;
gInterface.BoutonStop->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonStop->callback( BoutonStopCB, NULL ) ;
// Creation du bouton Reset
gInterface.BoutonReset = new Fl_Button(575, 510, 100, 20, "Reset") ;
gInterface.BoutonReset->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonReset->callback( BoutonResetCB, NULL ) ;
// Creation du bouton Polarisation X (check button)
gInterface.BoutonPolarisationX = new Fl_Check_Button(575, 460, 100, 20, "Pola/X") ;
gInterface.BoutonPolarisationX->selection_color(FL_RED);
gInterface.BoutonPolarisationX->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonPolarisationX->callback( BoutonPolarisationXCB, NULL) ;
//Création sliders1
gInterface.Slider1 = new Fl_Value_Slider( 680, 300, 100, 20, "k" ) ;
gInterface.Slider1->type( FL_HORIZONTAL ) ;
......@@ -65,70 +45,128 @@ void CreerInterface()
gInterface.Slider2->callback( SliderCallback2, NULL ) ;
gInterface.Slider2->precision( 1 ) ;
gInterface.Slider2->bounds(1, 20 ) ;
//Création des tabulations
gInterface.Tab1 = new Fl_Tabs( L_ZONE + 5, 5, L_IHM - L_ZONE - 10, H_IHM*3/4, "");
gInterface.Tab1 = new Fl_Tabs( L_ZONE + 5, 5, L_IHM - L_ZONE - 10, H_IHM*7/8, "");
{
int xTab = L_ZONE + 5, yTab = 5, lTab = L_IHM - L_ZONE - 10, hTab = H_IHM*3/4;
int xGroup = xTab, yGroup = yTab + 20, lGroup = lTab, hGroup = hTab -20;
int lGap = lGroup/10, hGap= hGroup/15;
int lWidget = lGroup/2 - lGap, hWidget = hGroup/20;
int xTab = L_ZONE + 5, yTab = 5, lTab = L_IHM - L_ZONE - 10, hTab = H_IHM*7/8;
int xGroup = xTab, yGroup = yTab + 20, lGroup = lTab, hGroup = hTab -20;
int lGap = lGroup/10, hGap= hGroup/20;
int lWidget = lGroup/2 - lGap, hWidget = hGroup/25;
int xR = xGroup+lGroup/2-lWidget-lGap/4, xL = xGroup+lGroup/2+lGap/4; //Position en x right, x left des widgets
Fl_Group *grp0 = new Fl_Group( xGroup, yGroup, lGroup, hGroup ,"General");
{
// Creation du bouton Quitter
gInterface.BoutonQuitter = new Fl_Button(xL, hGroup - 5, lWidget, hWidget, "Quit") ;
gInterface.BoutonQuitter->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonQuitter->callback( BoutonQuitterCB, NULL ) ;
gInterface.BoutonQuitter->label("@-11+");
// Creation du bouton Run
gInterface.BoutonRun = new Fl_Button(xR, hGroup - 10 - hWidget, lWidget, hWidget, "Run") ;
gInterface.BoutonRun->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonRun->callback( BoutonRunCB, NULL ) ;
gInterface.BoutonRun->label("@-1>");
// Creation du bouton Stop
gInterface.BoutonStop = new Fl_Button(xL, hGroup - 10 - hWidget, lWidget, hWidget, "Stop") ;
gInterface.BoutonStop->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonStop->callback( BoutonStopCB, NULL ) ;
gInterface.BoutonStop->label("@-1||");
// Creation du bouton Reset
gInterface.BoutonReset = new Fl_Button(xR, hGroup - 5, lWidget, hWidget, "Reset") ;
gInterface.BoutonReset->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonReset->callback( BoutonResetCB, NULL ) ;
gInterface.BoutonReset->label("@-3square");
}
grp0->end();
Fl_Group *grp1 = new Fl_Group( xGroup, yGroup, lGroup, hGroup ,"Valeurs");
{
int xR = xGroup+lGroup/2-lWidget-lGap/4, xL = xGroup+lGroup/2+lGap/4; //Position successive des widgets
int y = yGroup + hGap*2;
int y = yGroup + hGap*2; //y : compteur qui permet de placer les positions successives des widgets
//Valeurs pour les k de la corde
gInterface.SliderK = new Fl_Value_Slider(xR , y, lWidget, hWidget, "k");
gInterface.SliderK->type( FL_HORIZONTAL ) ;
gInterface.SliderK->align( FL_ALIGN_TOP ) ;
gInterface.SliderK->bounds(1, 20 ) ;
gInterface.SliderK->bounds(1, 50 ) ;
gInterface.SliderK->precision( 1 ) ;
gInterface.SliderK->callback( SliderKCallback, NULL ) ;
gInterface.SliderKc = new Fl_Value_Slider( xL , y, lWidget, hWidget, "kc");
gInterface.SliderKc->type( FL_HORIZONTAL ) ;
gInterface.SliderKc->align( FL_ALIGN_TOP ) ;
gInterface.SliderKc->bounds(1, 20 ) ;
gInterface.SliderKc->bounds(1, 50 ) ;
gInterface.SliderKc->precision( 1 ) ;
gInterface.SliderKc->callback( SliderKcCallback, NULL ) ;
//Valeurs pour les x de la corde
y += hWidget + hGap*2;
gInterface.SliderX3 = new Fl_Value_Slider(xR , y, lWidget*2+lGap/2, hWidget, "x4 (x10e4)");
gInterface.SliderX3->type( FL_HORIZONTAL ) ;
gInterface.SliderX3->align( FL_ALIGN_TOP ) ;
gInterface.SliderX3->bounds(1, 500 ) ;
gInterface.SliderX3->precision( 1 ) ;
gInterface.SliderX3->callback( SliderX3Callback, NULL ) ;
/* y += hWidget + hGap*3/4;
gInterface.SliderX0 = new Fl_Value_Slider(xR , y, lWidget*2+lGap/2, hWidget, "x1");
gInterface.SliderX0->type( FL_HORIZONTAL ) ;
gInterface.SliderX0->align( FL_ALIGN_TOP ) ;
gInterface.SliderX0->bounds(1, 20 ) ;
gInterface.SliderX0->precision( 1 ) ;
gInterface.SliderX0->callback( SliderX0Callback, NULL ) ;
*/
y += hWidget + hGap*3/4;
gInterface.SliderX1 = new Fl_Value_Slider(xR , y, lWidget*2+lGap/2, hWidget, "x2");
gInterface.SliderX2 = new Fl_Value_Slider(xR , y, lWidget*2+lGap/2, hWidget, "x3 (x10e4)");
gInterface.SliderX2->type( FL_HORIZONTAL ) ;
gInterface.SliderX2->align( FL_ALIGN_TOP ) ;
gInterface.SliderX2->bounds(1, 500 ) ;
gInterface.SliderX2->precision( 1 ) ;
gInterface.SliderX2->callback( SliderX2Callback, NULL ) ;
y += hWidget + hGap*3/4;
gInterface.SliderX1 = new Fl_Value_Slider(xR , y, lWidget*2+lGap/2, hWidget, "x2 (x10e4)");
gInterface.SliderX1->type( FL_HORIZONTAL ) ;
gInterface.SliderX1->align( FL_ALIGN_TOP ) ;
gInterface.SliderX1->bounds(1, 20 ) ;
gInterface.SliderX1->bounds(1, 500 ) ;
gInterface.SliderX1->precision( 1 ) ;
gInterface.SliderX1->callback( SliderX1Callback, NULL ) ;
//Valeurs pour le h de la corde :
y += hWidget + hGap*2;
gInterface.SliderH0 = new Fl_Value_Slider(xR , y, lWidget*2+lGap/2, hWidget, "h1 h4");
gInterface.SliderH0->type( FL_HORIZONTAL ) ;
gInterface.SliderH0->align( FL_ALIGN_TOP ) ;
gInterface.SliderH0->bounds(1, 50 ) ;
gInterface.SliderH0->precision( 1 ) ;
gInterface.SliderH0->callback( SliderH0Callback, NULL ) ;
y += hWidget + hGap*3/4;
gInterface.SliderX2 = new Fl_Value_Slider(xR , y, lWidget*2+lGap/2, hWidget, "x3");
gInterface.SliderX2->type( FL_HORIZONTAL ) ;
gInterface.SliderX2->align( FL_ALIGN_TOP ) ;
gInterface.SliderX2->bounds(1, 20 ) ;
gInterface.SliderX2->precision( 1 ) ;
gInterface.SliderX2->callback( SliderX2Callback, NULL ) ;
gInterface.SliderH1 = new Fl_Value_Slider(xR , y, lWidget*2+lGap/2, hWidget, "h2");
gInterface.SliderH1->type( FL_HORIZONTAL ) ;
gInterface.SliderH1->align( FL_ALIGN_TOP ) ;
gInterface.SliderH1->bounds(0.01, 10 ) ;
gInterface.SliderH1->precision( 2 ) ;
gInterface.SliderH1->callback( SliderH1Callback, NULL ) ;
y += hWidget + hGap*3/4;
gInterface.SliderX3 = new Fl_Value_Slider(xR , y, lWidget*2+lGap/2, hWidget, "x4");
gInterface.SliderX3->type( FL_HORIZONTAL ) ;
gInterface.SliderX3->align( FL_ALIGN_TOP ) ;
gInterface.SliderX3->bounds(1, 20 ) ;
gInterface.SliderX3->precision( 1 ) ;
gInterface.SliderX3->callback( SliderX3Callback, NULL ) ;
gInterface.SliderH2 = new Fl_Value_Slider(xR , y, lWidget*2+lGap/2, hWidget, "h3");
gInterface.SliderH2->type( FL_HORIZONTAL ) ;
gInterface.SliderH2->align( FL_ALIGN_TOP ) ;
gInterface.SliderH2->bounds(1, 50 ) ;
gInterface.SliderH2->precision( 1 ) ;
gInterface.SliderH2->callback( SliderH1Callback, NULL ) ;
//Valeurs pour m de la corde
y += hWidget + hGap*2;
gInterface.SliderM = new Fl_Value_Slider(xR , y, lWidget, hWidget, "m");
gInterface.SliderM = new Fl_Value_Slider(xR , y, lWidget, hWidget, "m (x10000)");
gInterface.SliderM->type( FL_HORIZONTAL ) ;
gInterface.SliderM->align( FL_ALIGN_TOP ) ;
gInterface.SliderM->bounds(1, 20 ) ;
gInterface.SliderM->bounds(0.1, 10 ) ;
gInterface.SliderM->precision( 1 ) ;
gInterface.SliderM->callback( SliderMCallback, NULL ) ;
......@@ -139,14 +177,24 @@ void CreerInterface()
gInterface.SliderR->bounds(1, 20 ) ;
gInterface.SliderR->precision( 1 ) ;
gInterface.SliderR->callback( SliderRCallback, NULL ) ;
gInterface.BoutonReset = new Fl_Button(xR, hGroup - 5, lWidget, hWidget, "Reset") ;
gInterface.BoutonReset->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonReset->callback( BoutonResetCB, NULL ) ;
}
grp1->end();
grp1->end();
Fl_Group *grp2 = new Fl_Group( xGroup, yGroup, lGroup, hGroup ,"Affichage");
{
//..widgets that go in tab#2..
}
grp2->end();
Fl_Group *grp2 = new Fl_Group( xGroup, yGroup, lGroup, hGroup ,"Affichage");
{
// Creation du bouton Polarisation X (check button)
gInterface.BoutonPolarisationX = new Fl_Check_Button(575, 300, 100, 20, "Pola/X") ;
gInterface.BoutonPolarisationX->selection_color(FL_RED);
gInterface.BoutonPolarisationX->box(FL_PLASTIC_UP_BOX);
gInterface.BoutonPolarisationX->callback( BoutonPolarisationXCB, NULL) ;
}
grp2->end();
}
gInterface.Tab1->end();
......@@ -154,8 +202,8 @@ void CreerInterface()
// Affichage de la fenetre
gInterface.Fenetre->end();
gInterface.Fenetre->show();
gInterface.Fenetre->end();
gInterface.Fenetre->show();
}
void ActualiserInterface()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment