Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9438 in orxonox.OLD


Ignore:
Timestamp:
Jul 24, 2006, 5:07:55 PM (18 years ago)
Author:
bensch
Message:

more gui

Location:
branches/proxy/src/lib/network/monitor
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/monitor/network_monitor.cc

    r9431 r9438  
    3131
    3232
    33 SHELL_COMMAND(showGUI, NetworkMonitor, showGUI);
    34 SHELL_COMMAND(hideGUI, NetworkMonitor, hideGUI);
     33#include "network_stats_widget.h"
     34
     35SHELL_COMMAND(gui, NetworkMonitor, toggleGUI);
    3536SHELL_COMMAND(debug, NetworkMonitor, debug);
    3637
     
    7273    }
    7374  }
     75  this->box = NULL;
    7476}
    7577
     
    196198 * this displays the network monitor gui
    197199 */
    198 void NetworkMonitor::showGUI()
     200void NetworkMonitor::toggleGUI()
    199201{
    200202  if (this->box == NULL)
     
    202204    this->box = new OrxGui::GLGuiBox(OrxGui::Vertical);
    203205    {
    204       OrxGui::GLGuiBox* waterColorBox = new OrxGui::GLGuiBox(OrxGui::Horizontal);
    205       {
    206         OrxGui::GLGuiText* waterColorText = new OrxGui::GLGuiText();
    207         waterColorText->setText("NetworkMonitor");
    208         waterColorBox->pack(waterColorText);
    209       }
    210       this->box->pack(waterColorBox);
     206      NetworkStatsWidget* netStats = new NetworkStatsWidget();
     207      this->box->pack(netStats);
     208
    211209    }
    212210
    213211    this->box->showAll();
    214212    this->box->setAbsCoor2D(300, 40);
    215     OrxGui::GLGuiHandler::getInstance()->activate();
    216 //     OrxGui::GLGuiHandler::getInstance()->activateCursor();
    217   }
    218 }
    219 
    220 
    221 /**
    222  * hides the network monitor gui again
    223  */
    224 void NetworkMonitor::hideGUI()
    225 {
    226   if( this->box == NULL)
    227     return;
    228 
    229   OrxGui::GLGuiHandler::getInstance()->deactivate();
    230 //   OrxGui::GLGuiHandler::getInstance()->deactivateCursor();
    231 
    232   delete this->box;
    233   this->box = NULL;
    234 }
    235 
     213  }
     214  else
     215  {
     216    delete this->box;
     217    this->box = NULL;
     218  }
     219}
    236220
    237221/**
  • branches/proxy/src/lib/network/monitor/network_monitor.h

    r9431 r9438  
    7474
    7575
    76     void showGUI();
    77     void hideGUI();
     76    void toggleGUI();
    7877
    7978    void process();
  • branches/proxy/src/lib/network/monitor/network_stats_widget.cc

    r9437 r9438  
    1919
    2020#include "multi_type.h"
    21 
    22 #include "shell_command.h"
    23 //#include "network_monitor.h"
    24 
    25 SHELL_COMMAND(gui, NetworkStatsWidget, gui);
    26 
    2721
    2822HostWidget::HostWidget(const std::string& name, const IP& ip)
     
    142136//======================================================//
    143137
    144 
    145 void NetworkStatsWidget::gui()
    146 {
    147   printf("YEAH\n");
    148 }
    149 
    150 
    151138/**
    152139 * @brief standard constructor
     
    157144  //   this->setClassID(CL_PROTO_ID, "NetworkStatsWidget");
    158145
     146  /*
    159147  this->_bar.setSize2D(100, 30);
    160148  this->pack(&this->_valueText);
     
    173161  this->_bar.setForegroundColor(Color(.5, .5, .5, 1));
    174162  this->_bar.setChangedValueColor(Color::black);
     163  */
     164  this->pack(&this->_thisHost);
     165
     166  this->pack(&this->_upstreamText);
     167  this->pack(&this->_downstreamText);
     168
     169  this->pack(&this->_serverIP);
    175170}
    176171
     
    185180void NetworkStatsWidget::setMaximum(float max)
    186181{
    187   this->_bar.setMaximum(max);
     182 // this->_bar.setMaximum(max);
    188183}
    189184
     
    192187  MultiType val(value);
    193188  val.setType(MT_INT);
    194 
     189  /*
    195190
    196191  this->_bar.setValue(value);
     
    198193  this->_bar.setFrontColor(Color(1,1,1,1), true);
    199194  this->_valueText.setText(val.getString());
     195  */
    200196}
    201197
     
    208204void NetworkStatsWidget::showing()
    209205{
    210   this->_valueText.show();
    211   this->_bar.show();
    212206}
    213207
    214208void NetworkStatsWidget::hiding()
    215209{
    216   this->_valueText.hide();
    217   this->_bar.hide();
    218 }
     210}
  • branches/proxy/src/lib/network/monitor/network_stats_widget.h

    r9437 r9438  
    7373{
    7474  public:
    75     void gui();
    76 
    77   public:
    7875    NetworkStatsWidget();
    7976    virtual ~NetworkStatsWidget();
     
    109106
    110107
    111     OrxGui::GLGuiText       _valueText;
    112     OrxGui::GLGuiBar        _bar;
     108    //OrxGui::GLGuiText       _valueText;
     109    //OrxGui::GLGuiBar        _bar;
    113110};
    114111
Note: See TracChangeset for help on using the changeset viewer.