next up previous contents
Next: The simulationclock widget Up: Graphical widgets Previous: The screen widget

The control widget

The control widget provides the means to adjust the behavior of the simulation. It provides means to adjust the speed, to stop and restart and to quit the simulation. Its interface :

 
   interface control : public screen
   {
     control(char* p,char* options = "");
     control(widget* w,char* p,char* options = "");
     virtual ~control();
     void factor(double fct);        // adjust speed factor
     void reset();                   // to initial state
   };

The following options can be handled :

When created and packed a screen appears with a button to start and stop the simulation, a button to quit the simulation and a scale widget to adjust the speed. The color of these widgets can be adjusted by chancing the widgets option. The -factor option is the delay factor. The execution of an event is delayed by factor times the inter-activation time (in seconds) times (100-x)/100, where x is the current speed. Again, when adjusting the width and height you should take into account that width/180 should be equal to height/120.



A Eliens
Tue Oct 31 09:27:21 MET 1995