Back to index

salome-gui  6.5.0
OCCViewer_FontWidget.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #include "OCCViewer_FontWidget.h"
00024 
00025 #include <QComboBox>
00026 
00027 //#include <vtkTextProperty.h>
00028 
00037 OCCViewer_FontWidget::OCCViewer_FontWidget( QWidget* theParent )
00038 : ViewerTools_FontWidgetBase( theParent )
00039 {
00040 }
00041 
00045 OCCViewer_FontWidget::~OCCViewer_FontWidget()
00046 {
00047 }
00048 
00049 void OCCViewer_FontWidget::InitializeFamilies()
00050 {
00051   //myFamily->insertItem( myFamily->count(), tr( "ARIAL" ) );
00052   //myFamily->insertItem( myFamily->count(), tr( "COURIER" ) );
00053   //myFamily->insertItem( myFamily->count(), tr( "TIMES" ) );
00054 }
00055 
00056 void OCCViewer_FontWidget::SetData( const QColor& theColor,
00057                                     const int theFamily,
00058                                     const bool theBold,
00059                                     const bool theItalic,
00060                                     const bool theShadow )
00061 {
00062   ViewerTools_FontWidgetBase::SetData( theColor,
00063                                        theFamily,
00064                                        theBold,
00065                                        theItalic,
00066                                        theShadow );
00067 
00068   /*
00069   if ( theFamily == VTK_ARIAL )
00070     myFamily->setCurrentIndex( 0 );
00071   else if ( theFamily == VTK_COURIER )
00072     myFamily->setCurrentIndex( 1 );
00073   else
00074     myFamily->setCurrentIndex( 2 );
00075   */
00076 }
00077 
00078 void OCCViewer_FontWidget::GetData( QColor& theColor,
00079                                     int& theFamily,
00080                                     bool& theBold,
00081                                     bool& theItalic,
00082                                     bool& theShadow ) const
00083 {
00084   ViewerTools_FontWidgetBase::GetData( theColor,
00085                                        theFamily,
00086                                        theBold,
00087                                        theItalic,
00088                                        theShadow );
00089 
00090   /*
00091   int anItem = myFamily->currentIndex();
00092   if ( anItem == 0 )
00093     theFamily = VTK_ARIAL;
00094   else if ( anItem == 1 )
00095     theFamily = VTK_COURIER;
00096   else
00097     theFamily = VTK_TIMES;
00098   */
00099 }