Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4325 in orxonox.OLD


Ignore:
Timestamp:
May 27, 2005, 2:18:49 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/particles: new Sliders

Location:
orxonox/branches/physics/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/lib/gui/gui/gui_gtk.cc

    r4319 r4325  
    10781078#ifdef HAVE_GTK2
    10791079/**
    1080     \brief Signal OptionChange writes the Value from the Slider to its Object-Database.
    1081     \param widget The widget(Slider) that has a changed Value
    1082     \param slider the Slider-Object that should receive the change.
     1080    \brief Signal OptionChange writes the Value from the Option to its Object-Database.
     1081    \param widget The widget(Option) that has a changed Value
     1082    \param option the Option-Object that should receive the change.
    10831083*/
    10841084gint Option::OptionChange(GtkWidget *widget, Widget* option)
     
    12721272{
    12731273  PRINTF(5)("deleting the Slider: %s\n", this->title);
     1274}
     1275
     1276/**
     1277   \brief sets the exactness of the widget
     1278   \param exactness count of digits after the dot
     1279*/
     1280void Slider::setExactness(int exactness)
     1281{
     1282#ifdef HAVE_GTK2
     1283 gtk_scale_set_digits(GTK_SCALE(this->widget), exactness);
     1284#endif /* HAVE_GTK2 */
    12741285}
    12751286
  • orxonox/branches/physics/src/lib/gui/gui/gui_gtk.h

    r4323 r4325  
    304304  virtual ~Slider(void);
    305305
     306  void setExactness(int exactness);
    306307  void setValue(float value);
    307308  virtual void redraw(void);
  • orxonox/branches/physics/src/subprojects/particles/framework.cc

    r4323 r4325  
    366366  delete valueC;
    367367
    368   printf("%s, %f\n", name, value);
    369 
    370368  ParticleEmitter* tmpEmit = ParticleEngine::getInstance()->getEmitterByNumber(1);
    371369  if (tmpEmit)
     
    374372      {
    375373        tmpEmit->setEmissionRate(value);
    376         PRINT(3)("emissionRate set to %f\n", tmpEmit->getEmissionRate());
     374        PRINT(3)("EmissionRate set to %f\n", value);
     375      }
     376      else if (!strcmp(name, "Velocity"))
     377      {
     378        tmpEmit->setEmissionVelocity(value);
     379        PRINT(3)("Velocity set to %f\n", value);
    377380      }
    378381    }
     
    392395    Box* windowBox = new Box('v');
    393396    {
    394       Slider* emissionRate = new Slider("EmissionRate", 0, 1000);
    395       emissionRate->connectSignal("value_changed", (void*)emissionRate, changeOption );
    396       windowBox->fill(emissionRate);
     397      Slider* EmissionRate = new Slider("EmissionRate", 0, 1000);
     398      EmissionRate->connectSignal("value_changed", (void*)EmissionRate, changeOption );
     399      windowBox->fill(EmissionRate);
     400
     401      Slider* velocity = new Slider("Velocity", 0, 2);
     402      velocity->setExactness(3);
     403      velocity->connectSignal("value_changed", (void*)velocity, changeOption );
     404      windowBox->fill(velocity);
     405
     406      Slider* SpreadAngle = new Slider("SpreadAngle", 0, 1000);
     407      SpreadAngle->connectSignal("value_changed", (void*)SpreadAngle, changeOption );
     408      windowBox->fill(SpreadAngle);
     409
     410     
    397411
    398412      Button* quitButton = new Button("quit");
Note: See TracChangeset for help on using the changeset viewer.