comparison Framework/Widgets/EmptyWidget.h @ 373:d6136a7e914d

making branch am-2 the new mainline
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 05 Nov 2018 10:06:18 +0100
parents 7a364e44fbb4
children 6cc3ce74dc05
comparison
equal deleted inserted replaced
371:fe4befe03935 373:d6136a7e914d
11 * 11 *
12 * This program is distributed in the hope that it will be useful, but 12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Affero General Public License for more details. 15 * Affero General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Affero General Public License 17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/ 19 **/
20 20
21 21
23 23
24 #include "IWidget.h" 24 #include "IWidget.h"
25 25
26 namespace OrthancStone 26 namespace OrthancStone
27 { 27 {
28 namespace Samples 28 /**
29 {
30 /**
31 * This is a test widget that simply fills its surface with an 29 * This is a test widget that simply fills its surface with an
32 * uniform color. 30 * uniform color.
33 **/ 31 **/
34 class EmptyWidget : public IWidget 32 class EmptyWidget : public IWidget
33 {
34 private:
35 uint8_t red_;
36 uint8_t green_;
37 uint8_t blue_;
38
39 public:
40 EmptyWidget(uint8_t red,
41 uint8_t green,
42 uint8_t blue) :
43 red_(red),
44 green_(green),
45 blue_(blue)
35 { 46 {
36 private: 47 }
37 uint8_t red_;
38 uint8_t green_;
39 uint8_t blue_;
40 48
41 public: 49 virtual void FitContent()
42 EmptyWidget(uint8_t red, 50 {
43 uint8_t green, 51 }
44 uint8_t blue) :
45 red_(red),
46 green_(green),
47 blue_(blue)
48 {
49 }
50 52
51 virtual void SetDefaultView() 53 virtual void SetParent(IWidget& widget)
52 { 54 {
53 } 55 }
54
55 virtual void SetParent(OrthancStone::IWidget& widget)
56 {
57 }
58
59 virtual void SetViewport(IViewport& viewport)
60 {
61 }
62 56
63 virtual void NotifyChange() 57 virtual void SetViewport(IViewport& viewport)
64 { 58 {
65 } 59 }
66 60
67 virtual void SetStatusBar(IStatusBar& statusBar) 61 virtual void NotifyContentChanged()
68 { 62 {
69 } 63 }
70 64
71 virtual void SetSize(unsigned int width, 65 virtual void SetStatusBar(IStatusBar& statusBar)
72 unsigned int height) 66 {
73 { 67 }
74 }
75
76 virtual bool Render(Orthanc::ImageAccessor& surface);
77 68
78 virtual IMouseTracker* CreateMouseTracker(MouseButton button, 69 virtual void SetSize(unsigned int width,
79 int x, 70 unsigned int height)
80 int y, 71 {
81 KeyboardModifiers modifiers) 72 }
82 {
83 return NULL;
84 }
85 73
86 virtual void RenderMouseOver(Orthanc::ImageAccessor& target, 74 virtual bool Render(Orthanc::ImageAccessor& surface);
87 int x,
88 int y)
89 {
90 }
91 75
92 virtual void MouseWheel(MouseWheelDirection direction, 76 virtual IMouseTracker* CreateMouseTracker(MouseButton button,
93 int x, 77 int x,
94 int y, 78 int y,
95 KeyboardModifiers modifiers) 79 KeyboardModifiers modifiers)
96 { 80 {
97 } 81 return NULL;
82 }
98 83
99 virtual void KeyPressed(char key, 84 virtual void RenderMouseOver(Orthanc::ImageAccessor& target,
100 KeyboardModifiers modifiers) 85 int x,
101 { 86 int y)
102 } 87 {
88 }
103 89
104 virtual bool HasUpdateContent() const 90 virtual void MouseWheel(MouseWheelDirection direction,
105 { 91 int x,
106 return false; 92 int y,
107 } 93 KeyboardModifiers modifiers)
94 {
95 }
108 96
109 virtual void UpdateContent(); 97 virtual void KeyPressed(KeyboardKeys key,
98 char keyChar,
99 KeyboardModifiers modifiers)
100 {
101 }
110 102
111 virtual bool HasRenderMouseOver() 103 virtual bool HasUpdateContent() const
112 { 104 {
113 return false; 105 return false;
114 } 106 }
115 }; 107
116 } 108 virtual void UpdateContent();
109
110 virtual bool HasRenderMouseOver()
111 {
112 return false;
113 }
114 };
117 } 115 }