notewidgetcontroller.cpp
00001 /*************************************************************************** 00002 * * 00003 * This program is free software; you can redistribute it and/or modify * 00004 * it under the terms of the GNU General Public License as published by * 00005 * the Free Software Foundation; either version 2 of the License, or * 00006 * (at your option) any later version. * 00007 * * 00008 * copyright (C) 2006 * 00009 * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> * 00010 ***************************************************************************/ 00011 00012 // app includes 00013 #include "notewidgetcontroller.h" 00014 #include "notewidget.h" 00015 #include "uml.h" 00016 #include "umldoc.h" 00017 #include "listpopupmenu.h" 00018 00019 NoteWidgetController::NoteWidgetController(NoteWidget *noteWidget): 00020 UMLWidgetController(noteWidget) { 00021 m_noteWidget = noteWidget; 00022 } 00023 00024 NoteWidgetController::~NoteWidgetController() { 00025 } 00026 00027 void NoteWidgetController::mouseMoveEvent(QMouseEvent *me) { 00028 UMLWidgetController::mouseMoveEvent(me); 00029 m_noteWidget->setEditorGeometry(); 00030 } 00031 00032 void NoteWidgetController::mouseReleaseEvent(QMouseEvent *me) { 00033 UMLWidgetController::mouseReleaseEvent(me); 00034 //TODO why is it needed? drawText is already called in draw, 00035 //and draw is (well, I think that is) called when the canvas rectangle is resized 00036 if (m_resized) { 00037 m_noteWidget->drawText(); 00038 } 00039 } 00040 00041 void NoteWidgetController::doMouseDoubleClick(QMouseEvent *me) { 00042 //TODO Copied from old code. What it does? 00043 if (m_noteWidget->m_DiagramLink == Uml::id_None) { 00044 m_noteWidget->slotMenuSelection(ListPopupMenu::mt_Rename); 00045 } else { 00046 UMLDoc *umldoc = UMLApp::app()->getDocument(); 00047 umldoc->changeCurrentView(m_noteWidget->m_DiagramLink); 00048 } 00049 }
