00001 /* 00002 * Moka : Un modeleur de 3-G-cartes. 00003 * Copyright (C) 2004, Moka Team, Université de Poitiers, Laboratoire SIC 00004 * http://www.sic.sp2mi.univ-poitiers.fr/ 00005 * Copyright (C) 2009, Guillaume Damiand, CNRS, LIRIS, 00006 * guillaume.damiand@liris.cnrs.fr, http://liris.cnrs.fr/ 00007 * 00008 * This file is part of Moka 00009 * 00010 * This program is free software: you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation, either version 3 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00022 */ 00023 00024 #include "creation-objet.qt.hh" 00025 #include "window.qt.hh" 00026 #include "HtmlEntities.hh" 00027 00028 //********************************************** 00029 // Constructeur * 00030 //********************************************** 00031 CreationObjet :: CreationObjet(Window * parent , QString * nom, 00032 GMap3d :: CControlerGMap * controler) : 00033 QToolBar(*HTML::decode(*nom) , parent), 00034 FChoix(NULL), 00035 FControler(controler), 00036 FParent(parent), 00037 FPosit(NULL) 00038 { 00039 setVisible(false); 00040 parent -> addToolBar(Qt::BottomToolBarArea, this); 00041 setAllowedAreas(Qt::BottomToolBarArea | Qt::TopToolBarArea); 00042 } 00043 //********************************************** 00044 // Destructeur * 00045 //********************************************** 00046 CreationObjet :: ~CreationObjet() { } 00047 //********************************************** 00048 // Accesseurs * 00049 //********************************************** 00050 GMap3d :: CControlerGMap * CreationObjet :: getControler() const 00051 { 00052 return FControler ; 00053 } 00054 //********************************************** 00055 // Methode de rafraichissement * 00056 //********************************************** 00057 void CreationObjet :: repaint() 00058 { 00059 QToolBar :: repaint() ; 00060 FParent -> repaint() ; 00061 } 00062 //********************************************** 00063 // Mise a jour * 00064 //********************************************** 00065 void CreationObjet :: update() 00066 { 00067 if (FPosit != NULL) FPosit -> update() ; 00068 } 00069 //********************************************** 00070 // Creation * 00071 //********************************************** 00072 void CreationObjet :: create() 00073 { 00074 if (FChoix != NULL) FChoix -> create() ; 00075 } 00076 //********************************************** 00077 // Fermeture du dialogue * 00078 //********************************************** 00079 void CreationObjet :: cancel() 00080 { 00081 if (FPosit != NULL) 00082 FPosit -> close() ; 00083 00084 FControler -> setMode(MODE_SELECTION) ; 00085 setVisible(false) ; 00086 } 00087 //********************************************** 00088 // Ouverture de la boite d'options * 00089 //********************************************** 00090 void CreationObjet :: showOptions() 00091 { 00092 if (FPosit != NULL) 00093 { 00094 if (FPosit -> isVisible()) 00095 FPosit -> hide() ; 00096 else 00097 FPosit -> show() ; 00098 } 00099 }