Small update of DynamicLabel for Isis.

This commit is contained in:
Jean-Paul Chaput 2012-12-31 11:52:42 +00:00
parent 3daf4d6ac2
commit ceda10e523
7 changed files with 47 additions and 110 deletions

View File

@ -2,14 +2,9 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved
//
// ===================================================================
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | V L S I B a c k e n d D a t a - B a s e |
// | |
@ -17,10 +12,7 @@
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== |
// | C++ Module : "./ControllerWidget.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
// +-----------------------------------------------------------------+
#include <QAction>

View File

@ -2,14 +2,9 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
// Copyright (c) UPMC/LIP6 2008-2012, 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 |
// | |
@ -17,10 +12,7 @@
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== |
// | C++ Module : "./DynamicLabel.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
// +-----------------------------------------------------------------+
# include <QFontMetrics>
@ -47,18 +39,16 @@ namespace Hurricane {
//_staticLabel->setFrameStyle (QFrame::Panel | QFrame::Raised );
QFont font = Graphics::getFixedFont(QFont::Bold);
int cwidth = QFontMetrics(font).width('X');
_dynamicLabel = new QLabel ();
_dynamicLabel->setText ( "vvv.vu" );
_dynamicLabel->setIndent ( cwidth/2 );
_dynamicLabel->setMinimumSize ( QSize(cwidth*10,QFontMetrics(font).height()) );
_dynamicLabel->setAlignment ( Qt::AlignRight );
_dynamicLabel->setFont ( font );
setDynamicWidth ( 10 );
QHBoxLayout* layout = new QHBoxLayout ();
layout->addWidget ( _staticLabel );
layout->addWidget ( _dynamicLabel );
layout->addWidget ( _staticLabel );
layout->addWidget ( _dynamicLabel );
layout->setSpacing ( 0 );
layout->setContentsMargins ( 0, 0, 0, 0 );
setLayout ( layout );
@ -77,6 +67,17 @@ namespace Hurricane {
}
void DynamicLabel::setDynamicWidth ( int chars, int flags )
{
QFont font = Graphics::getFixedFont(QFont::Bold);
int cwidth = QFontMetrics(font).width('X');
if ( flags|NoIndent ) _dynamicLabel->setIndent( 0 );
if ( flags|HalfIndent ) _dynamicLabel->setIndent( cwidth/2 );
_dynamicLabel->setMinimumSize( QSize(cwidth*chars,QFontMetrics(font).height()) );
}
void DynamicLabel::setStaticText ( const QString& text )
{
_staticLabel->setText ( text );

View File

@ -2,14 +2,9 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
// Copyright (c) UPMC/LIP6 2008-2012, 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 |
// | |
@ -17,10 +12,7 @@
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== |
// | C++ Module : "./GraphicsWidget.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
// +-----------------------------------------------------------------+
#include <QLabel>

View File

@ -67,7 +67,7 @@ namespace Hurricane {
inline void setEnableRedrawInterrupt ( bool );
inline void setApplicationName ( const QString& );
Cell* getCell () const;
void setCell ( Cell* );
virtual void setCell ( Cell* );
void renameCell ( const char* );
virtual Cell* getCellFromDb ( const char* );
inline CellWidget* getCellWidget ();

View File

@ -2,25 +2,17 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved
//
// ===================================================================
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// +-----------------------------------------------------------------+
// | C O R I O L I S |
// | 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++ Header : "./ControllerWidget.h" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
// | C++ Header : "./hurricane/viewer/ControllerWidget.h" |
// +-----------------------------------------------------------------+
#ifndef __HURRICANE_CONTROLLER_WIDGET__

View File

@ -1,53 +1,18 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Project.
// Copyright (C) Laboratoire LIP6 - Departement ASIM
// Universite Pierre et Marie Curie
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved
//
// Main contributors :
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
// Hugo Clément <Hugo.Clement@lip6.fr>
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
// Damien Dupuis <Damien.Dupuis@lip6.fr>
// Christian Masson <Christian.Masson@lip6.fr>
// Marek Sroka <Marek.Sroka@lip6.fr>
//
// The Coriolis Project is free software; you can redistribute it
// and/or modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2 of
// the License, or (at your option) any later version.
//
// The Coriolis Project is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with the Coriolis Project; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
//
// License-Tag
// Authors-Tag
// ===================================================================
//
// $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++ Header : "./DynamicLabel.h" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
// | C++ Header : "./hurricane/viewer/DynamicLabel.h" |
// +-----------------------------------------------------------------+
# ifndef __DYNAMIC_LABEL_H__
@ -68,15 +33,18 @@ namespace Hurricane {
class DynamicLabel : public QWidget {
Q_OBJECT;
public:
enum Indent { NoIndent=1, HalfIndent=2 };
public:
// Constructor.
DynamicLabel ( QWidget* parent=NULL );
// Methods.
QString getStaticText () const;
QString getDynamicText () const;
void setStaticText ( const QString& text );
void setDynamicText ( const QString& text );
void setDynamicText ( DbU::Unit u );
DynamicLabel ( QWidget* parent=NULL );
// Methods.
QString getStaticText () const;
QString getDynamicText () const;
void setDynamicWidth ( int chars, int flags=HalfIndent );
void setStaticText ( const QString& text );
void setDynamicText ( const QString& text );
void setDynamicText ( DbU::Unit u );
protected:
// Internal - Attributes.

View File

@ -2,14 +2,9 @@
// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
// Copyright (c) UPMC/LIP6 2008-2012, 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 |
// | |
@ -17,10 +12,7 @@
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== |
// | C++ Header : "./GraphicsWidget.h" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
// +-----------------------------------------------------------------+
#ifndef __HURRICANE_GRAPHICS_WIDGET__