]> Creatis software - bbtk.git/blob - kernel/src/ThirdParty/wx/treemultictrl/TreeMultiItemWindow.h
Feature #1774
[bbtk.git] / kernel / src / ThirdParty / wx / treemultictrl / TreeMultiItemWindow.h
1 /*
2  # ---------------------------------------------------------------------
3  #
4  # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5  #                        pour la SantÈ)
6  # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
7  # Previous Authors : Laurent Guigues, Jean-Pierre Roux
8  # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9  #
10  #  This software is governed by the CeCILL-B license under French law and
11  #  abiding by the rules of distribution of free software. You can  use,
12  #  modify and/ or redistribute the software under the terms of the CeCILL-B
13  #  license as circulated by CEA, CNRS and INRIA at the following URL
14  #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
15  #  or in the file LICENSE.txt.
16  #
17  #  As a counterpart to the access to the source code and  rights to copy,
18  #  modify and redistribute granted by the license, users are provided only
19  #  with a limited warranty  and the software's author,  the holder of the
20  #  economic rights,  and the successive licensors  have only  limited
21  #  liability.
22  #
23  #  The fact that you are presently reading this means that you have had
24  #  knowledge of the CeCILL-B license and that you accept its terms.
25  # ------------------------------------------------------------------------ */
26
27
28 //---------------------------------------------------------------------------
29 // $RCSfile: TreeMultiItemWindow.h,v $
30 // $Source: /cvs/creatis/bbtk/kernel/src/ThirdParty/wx/treemultictrl/TreeMultiItemWindow.h,v $
31 // $Revision: 1.2 $
32 // $Date: 2012/11/16 08:49:16 $
33 //---------------------------------------------------------------------------
34 // Author:      Jorgen Bodde
35 // Copyright:   (c) Jorgen Bodde
36 // License:     wxWidgets License
37 //---------------------------------------------------------------------------
38
39 #ifndef __TREEMULTIITEMWINDOW_HPP_
40 #define __TREEMULTIITEMWINDOW_HPP_
41
42 #ifdef __GNUG__
43     #pragma interface "TreeMultiItemWindow.cpp"
44 #endif
45
46 #ifndef WX_PRECOMP
47     #include "wx/wx.h"
48 #endif
49
50 #include <wx/dynarray.h>
51
52 #include "TreeMultiItemBase.h"
53
54 class TreeMultiItemWindow : public TreeMultiItemBase
55 {
56 private:
57         /** The simple control, or complex sizer that represents this window
58                 in the TreeMultiCtrl */
59         wxWindow *_window;
60
61         /** Top and front extra spacings, added to X, Y */
62         int _topSpacing, _frontSpacing;
63
64         /** Spanning flag */
65         bool _span;
66
67 public:
68         TreeMultiItemWindow(TreeMultiItemNode *parent, const wxString &name = wxEmptyString);
69         virtual ~TreeMultiItemWindow();
70
71         // IsClass method
72         virtual TreeMultiItemWindow *IsTreeMultiItemWindow() const {
73                 return (TreeMultiItemWindow *)this;
74         };
75         
76         /** Assigns the given window to this TreeMultiItemWindow, and also destroys the 
77                 present window. If the assigned window is 0, this item is not drawn
78                 and removed from the tree visually */
79         void AssignWindow(wxWindow *wnd);
80
81         /** Get window method */
82         wxWindow *GetWindow() {
83                 return _window;
84         };
85
86         /* Sets front spacing */
87         void SetFrontSpacing(int frontSpacing) {
88                 _frontSpacing = frontSpacing;
89         };
90         /* Gets front spacing */
91         int GetFrontSpacing() const {
92                 return _frontSpacing;
93         };
94         /* Sets top spacing */
95         void SetTopSpacing(int topSpacing) {
96                 _topSpacing = topSpacing;
97         };
98         /* Gets top spacing */
99         int GetTopSpacing() const {
100                 return _topSpacing;
101         };
102         
103         /* Sets horizontal span, meaning when this is set the window
104            attached may be resized horizontally when the window is resized */
105         void SetHorizontalSpan(bool span) {
106                 _span = span;
107         };
108
109         /* Sets horizontal span, meaning when this is set the window
110            attached may be resized horizontally when the window is resized */
111         bool GetHorizontalSpan() const {
112                 return _span;
113         };
114
115 #if(CHECKBOXVIEW)
116         /** Inherited from base, to enable or disable window */
117         virtual void SetCheckboxState(int state);
118 #endif
119 };
120
121 #endif
122