coriolis/hurricane/src/viewer/MousePositionWidget.cpp

63 lines
2.0 KiB
C++
Raw Normal View History

2008-07-07 09:53:12 -05:00
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
//
// ===================================================================
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e |
// | |
// | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== |
// | C++ Module : "./MousePositionWidget.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
#include <QHBoxLayout>
2008-07-07 09:53:12 -05:00
#include "hurricane/viewer/DynamicLabel.h"
#include "hurricane/viewer/MousePositionWidget.h"
2008-07-07 09:53:12 -05:00
namespace Hurricane {
MousePositionWidget::MousePositionWidget ( QWidget* parent )
2008-07-07 09:53:12 -05:00
: QWidget(parent)
, _xPosition(new DynamicLabel())
, _yPosition(new DynamicLabel())
2008-07-07 09:53:12 -05:00
{
_xPosition->setStaticText ( "X:" );
_xPosition->setDynamicText ( "N/A" );
_yPosition->setStaticText ( "Y:" );
_yPosition->setDynamicText ( "N/A" );
QHBoxLayout* layout = new QHBoxLayout ();
layout->addWidget ( _xPosition );
layout->addWidget ( _yPosition );
layout->setContentsMargins ( 0, 0, 0, 0 );
setLayout ( layout );
}
void MousePositionWidget::setPosition ( const Point& position )
2008-07-07 09:53:12 -05:00
{
_xPosition->setDynamicText ( position.getX() );
_yPosition->setDynamicText ( position.getY() );
}
} // End of Hurricane namespace.