]> Creatis software - bbtk.git/blobdiff - kernel/src/ThirdParty/wx/treemultictrl/TreeMultiItemWindow.cpp
Feature #1774
[bbtk.git] / kernel / src / ThirdParty / wx / treemultictrl / TreeMultiItemWindow.cpp
index dfa9b0dbe80be28e86321d210cf866a265417aaa..2ac88a8c58f1f939c4d1253ede70d5b2fac4480a 100644 (file)
-//---------------------------------------------------------------------------\r
-// $RCSfile: TreeMultiItemWindow.cpp,v $\r
-// $Source: /cvs/creatis/bbtk/kernel/src/ThirdParty/wx/treemultictrl/TreeMultiItemWindow.cpp,v $\r
-// $Revision: 1.1 $\r
-// $Date: 2008/03/28 13:42:18 $\r
-//---------------------------------------------------------------------------\r
-// Author:      Jorgen Bodde\r
-// Copyright:   (c) Jorgen Bodde\r
-// License:     wxWidgets License\r
-//---------------------------------------------------------------------------\r
-\r
-#ifdef __GNUG__\r
-    #pragma implementation "TreeMultiItemWindow.cpp"\r
-#endif\r
-\r
-/* for compilers that support precompilation\r
-   includes "wx/wx.h" */\r
-\r
-#include "wx/wxprec.h"\r
-\r
-#ifdef __BORLANDC__\r
-    #pragma hdrstop\r
-#endif\r
-\r
-#include "wx/treemultictrl/TreeMultiItemWindow.h"\r
-\r
-/** TreeMultiItemWindow\r
-  *    This class is a possible end node for the tree. If you want multiple\r
-  *    types of end-nodes you should copy this file and adjust it with a \r
-  *    different class name.\r
-  */\r
-\r
-TreeMultiItemWindow::TreeMultiItemWindow(TreeMultiItemNode *parent, const wxString &name)\r
-       :  TreeMultiItemBase(parent)\r
-       , _window(0)\r
-       , _topSpacing(0)\r
-       , _frontSpacing(0)\r
-       , _span(false)\r
-{\r
-    _name = name;\r
-\r
-       // TODO: Enter your constructor code here\r
-}\r
-\r
-TreeMultiItemWindow::~TreeMultiItemWindow()\r
-{\r
-       if(_window)\r
-               _window->Destroy();\r
-}\r
-\r
-void TreeMultiItemWindow::AssignWindow(wxWindow *wnd)\r
-{\r
-       // delete previous, assign new (even if zero)\r
-       if(_window)\r
-               _window->Destroy();\r
-\r
-       _window = wnd;\r
-\r
-       // recalculate the size\r
-       if(wnd)\r
-       {\r
-               wxSize size; \r
-\r
-               // resize the sized control by sizer or \r
-               // by single window. For a sizer handled window\r
-               // GetBestSize returns the optimal size\r
-\r
-               /// \todo This might need rivision for retaining the sizer size\r
-               /// maybe we need to check whether size is <> 0,0 before get best size\r
-\r
-               if(wnd->GetSizer())\r
-                       size = wnd->GetBestSize();\r
-               else\r
-                       size = wnd->GetSize();\r
-\r
-               _height = size.GetHeight();\r
-               _width = size.GetWidth();\r
-\r
-       }\r
-       else\r
-       {\r
-               _height = 0;\r
-               _width = 0;\r
-       }\r
-}\r
-\r
-#if(CHECKBOXVIEW)\r
-\r
-void TreeMultiItemWindow::SetCheckboxState(int state) {\r
-       TreeMultiItemBase::SetCheckboxState(state);\r
-\r
-       // enable or disable the window\r
-       if(GetCheckbox() && GetWindow() && state != 2)\r
-               GetWindow()->Enable(state == 1);\r
-};\r
-\r
-#endif // #if(CHECKBOXVIEW)\r
+/*
+ # ---------------------------------------------------------------------
+ #
+ # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
+ #                        pour la SantÈ)
+ # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
+ # Previous Authors : Laurent Guigues, Jean-Pierre Roux
+ # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
+ #
+ #  This software is governed by the CeCILL-B license under French law and
+ #  abiding by the rules of distribution of free software. You can  use,
+ #  modify and/ or redistribute the software under the terms of the CeCILL-B
+ #  license as circulated by CEA, CNRS and INRIA at the following URL
+ #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ #  or in the file LICENSE.txt.
+ #
+ #  As a counterpart to the access to the source code and  rights to copy,
+ #  modify and redistribute granted by the license, users are provided only
+ #  with a limited warranty  and the software's author,  the holder of the
+ #  economic rights,  and the successive licensors  have only  limited
+ #  liability.
+ #
+ #  The fact that you are presently reading this means that you have had
+ #  knowledge of the CeCILL-B license and that you accept its terms.
+ # ------------------------------------------------------------------------ */
+
+
+//---------------------------------------------------------------------------
+// $RCSfile: TreeMultiItemWindow.cpp,v $
+// $Source: /cvs/creatis/bbtk/kernel/src/ThirdParty/wx/treemultictrl/TreeMultiItemWindow.cpp,v $
+// $Revision: 1.2 $
+// $Date: 2012/11/16 08:49:16 $
+//---------------------------------------------------------------------------
+// Author:      Jorgen Bodde
+// Copyright:   (c) Jorgen Bodde
+// License:     wxWidgets License
+//---------------------------------------------------------------------------
+
+#ifdef __GNUG__
+    #pragma implementation "TreeMultiItemWindow.cpp"
+#endif
+
+/* for compilers that support precompilation
+   includes "wx/wx.h" */
+
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/treemultictrl/TreeMultiItemWindow.h"
+
+/** TreeMultiItemWindow
+  *    This class is a possible end node for the tree. If you want multiple
+  *    types of end-nodes you should copy this file and adjust it with a 
+  *    different class name.
+  */
+
+TreeMultiItemWindow::TreeMultiItemWindow(TreeMultiItemNode *parent, const wxString &name)
+       :  TreeMultiItemBase(parent)
+       , _window(0)
+       , _topSpacing(0)
+       , _frontSpacing(0)
+       , _span(false)
+{
+    _name = name;
+
+       // TODO: Enter your constructor code here
+}
+
+TreeMultiItemWindow::~TreeMultiItemWindow()
+{
+       if(_window)
+               _window->Destroy();
+}
+
+void TreeMultiItemWindow::AssignWindow(wxWindow *wnd)
+{
+       // delete previous, assign new (even if zero)
+       if(_window)
+               _window->Destroy();
+
+       _window = wnd;
+
+       // recalculate the size
+       if(wnd)
+       {
+               wxSize size; 
+
+               // resize the sized control by sizer or 
+               // by single window. For a sizer handled window
+               // GetBestSize returns the optimal size
+
+               /// \todo This might need rivision for retaining the sizer size
+               /// maybe we need to check whether size is <> 0,0 before get best size
+
+               if(wnd->GetSizer())
+                       size = wnd->GetBestSize();
+               else
+                       size = wnd->GetSize();
+
+               _height = size.GetHeight();
+               _width = size.GetWidth();
+
+       }
+       else
+       {
+               _height = 0;
+               _width = 0;
+       }
+}
+
+#if(CHECKBOXVIEW)
+
+void TreeMultiItemWindow::SetCheckboxState(int state) {
+       TreeMultiItemBase::SetCheckboxState(state);
+
+       // enable or disable the window
+       if(GetCheckbox() && GetWindow() && state != 2)
+               GetWindow()->Enable(state == 1);
+};
+
+#endif // #if(CHECKBOXVIEW)