Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 26, 2004, 5:56:18 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/updater: walkThrough is better now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc

    r3291 r3292  
    155155   \param function must be of type void and takes a Widget* as an Input.
    156156*/
    157 void Widget::walkThrough (void (*function)(Widget*))
     157void Widget::walkThrough (void (*function)(Widget*), unsigned int depth)
    158158{
    159159  function(this);
    160160  if (this->isOption < 0)
    161161    {
    162       static_cast<Packer*>(this)->down->walkThrough (function);
     162      static_cast<Packer*>(this)->down->walkThrough (function, depth+1);
    163163    }
    164164
    165   if (this->next != NULL)
    166     this->next->walkThrough(function);
     165  if (this->next && depth != 0)
     166    this->next->walkThrough(function, depth);
     167}
     168
     169/**
     170   \brief Moves through all the Widgets downwards from this and executes the function on them.
     171   \param function must be of type void and takes a Widget* as an Input.
     172   \param data Additional Data you want to pass to the function.
     173*/
     174void Widget::walkThrough (void (*function)(Widget*, void*), void* data, unsigned int depth)
     175{
     176  function(this, data);
     177  if (this->isOption < 0)
     178    {
     179      static_cast<Packer*>(this)->down->walkThrough(function, data, depth+1);
     180    }
     181  if (this->next && depth != 0)
     182    this->next->walkThrough(function, data, depth);
    167183}
    168184
     
    188204{
    189205  if (widget->isOption >= 1)
    190     static_cast<Option*>(widget)->redraw();// <<" is : " << static_cast<Option*>(this)->value <<endl;
     206    static_cast<Option*>(widget)->redraw();
    191207}
    192208
     
    635651
    636652/**
    637    \destructs an EventBox.
     653   \brief destructs an EventBox.
    638654*/
    639655EventBox::~EventBox(void)
     
    703719
    704720/**
    705    \destructs a Box.
     721   \brief destructs a Box.
    706722*/
    707723Box::~Box(void)
     
    890906
    891907/**
    892    \destructs a Button.
     908   \brief destructs a Button.
    893909*/
    894910Button::~Button(void)
     
    964980
    965981/**
    966    \destructs a CheckButton.
     982   \brief destructs a CheckButton.
    967983*/
    968984CheckButton::~CheckButton(void)
     
    10641080
    10651081/**
    1066    \destructs a Slider.
     1082   \brief destructs a Slider.
    10671083*/
    10681084Slider::~Slider(void)
     
    11781194
    11791195/**
    1180    \destructs a Menu.
     1196   \brief destructs a Menu.
    11811197*/
    11821198Menu::~Menu(void)
     
    12801296
    12811297/**
    1282    \destructs an OptionLabel.
     1298   \brief destructs an OptionLabel.
    12831299*/
    12841300OptionLabel::~OptionLabel(void)
     
    13751391
    13761392/**
    1377    \destructs a Label.
     1393   \brief destructs a Label.
    13781394*/
    13791395Label::~Label(void)
     
    15531569
    15541570/**
    1555    \destructs an Image.
     1571   \brief destructs an Image.
    15561572*/
    15571573Image::~Image(void)
Note: See TracChangeset for help on using the changeset viewer.