comparison Framework/Widgets/LayoutWidget.cpp @ 726:4f2416d519b4

moving layers, widgets and loaders to Deprecated namespace
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 May 2019 11:43:25 +0200
parents b1377625e4ba
children
comparison
equal deleted inserted replaced
714:d2c0e347ddc2 726:4f2416d519b4
24 #include <Core/Logging.h> 24 #include <Core/Logging.h>
25 #include <Core/OrthancException.h> 25 #include <Core/OrthancException.h>
26 26
27 #include <boost/math/special_functions/round.hpp> 27 #include <boost/math/special_functions/round.hpp>
28 28
29 namespace OrthancStone 29 namespace Deprecated
30 { 30 {
31 class LayoutWidget::LayoutMouseTracker : public IMouseTracker 31 class LayoutWidget::LayoutMouseTracker : public IMouseTracker
32 { 32 {
33 private: 33 private:
34 std::auto_ptr<IMouseTracker> tracker_; 34 std::auto_ptr<IMouseTracker> tracker_;
152 target.GetRegion(accessor, left_, top_, width_, height_); 152 target.GetRegion(accessor, left_, top_, width_, height_);
153 return widget_->Render(accessor); 153 return widget_->Render(accessor);
154 } 154 }
155 } 155 }
156 156
157 IMouseTracker* CreateMouseTracker(MouseButton button, 157 IMouseTracker* CreateMouseTracker(OrthancStone::MouseButton button,
158 int x, 158 int x,
159 int y, 159 int y,
160 KeyboardModifiers modifiers, 160 OrthancStone::KeyboardModifiers modifiers,
161 const std::vector<Touch>& touches) 161 const std::vector<Touch>& touches)
162 { 162 {
163 if (Contains(x, y)) 163 if (Contains(x, y))
164 { 164 {
165 IMouseTracker* tracker = widget_->CreateMouseTracker(button, 165 IMouseTracker* tracker = widget_->CreateMouseTracker(button,
187 187
188 widget_->RenderMouseOver(accessor, x - left_, y - top_); 188 widget_->RenderMouseOver(accessor, x - left_, y - top_);
189 } 189 }
190 } 190 }
191 191
192 void MouseWheel(MouseWheelDirection direction, 192 void MouseWheel(OrthancStone::MouseWheelDirection direction,
193 int x, 193 int x,
194 int y, 194 int y,
195 KeyboardModifiers modifiers) 195 OrthancStone::KeyboardModifiers modifiers)
196 { 196 {
197 if (Contains(x, y)) 197 if (Contains(x, y))
198 { 198 {
199 widget_->MouseWheel(direction, x - left_, y - top_, modifiers); 199 widget_->MouseWheel(direction, x - left_, y - top_, modifiers);
200 } 200 }
417 417
418 return true; 418 return true;
419 } 419 }
420 420
421 421
422 IMouseTracker* LayoutWidget::CreateMouseTracker(MouseButton button, 422 IMouseTracker* LayoutWidget::CreateMouseTracker(OrthancStone::MouseButton button,
423 int x, 423 int x,
424 int y, 424 int y,
425 KeyboardModifiers modifiers, 425 OrthancStone::KeyboardModifiers modifiers,
426 const std::vector<Touch>& touches) 426 const std::vector<Touch>& touches)
427 { 427 {
428 for (size_t i = 0; i < children_.size(); i++) 428 for (size_t i = 0; i < children_.size(); i++)
429 { 429 {
430 IMouseTracker* tracker = children_[i]->CreateMouseTracker(button, x, y, modifiers, touches); 430 IMouseTracker* tracker = children_[i]->CreateMouseTracker(button, x, y, modifiers, touches);
447 children_[i]->RenderMouseOver(target, x, y); 447 children_[i]->RenderMouseOver(target, x, y);
448 } 448 }
449 } 449 }
450 450
451 451
452 void LayoutWidget::MouseWheel(MouseWheelDirection direction, 452 void LayoutWidget::MouseWheel(OrthancStone::MouseWheelDirection direction,
453 int x, 453 int x,
454 int y, 454 int y,
455 KeyboardModifiers modifiers) 455 OrthancStone::KeyboardModifiers modifiers)
456 { 456 {
457 for (size_t i = 0; i < children_.size(); i++) 457 for (size_t i = 0; i < children_.size(); i++)
458 { 458 {
459 children_[i]->MouseWheel(direction, x, y, modifiers); 459 children_[i]->MouseWheel(direction, x, y, modifiers);
460 } 460 }
461 } 461 }
462 462
463 463
464 void LayoutWidget::KeyPressed(KeyboardKeys key, 464 void LayoutWidget::KeyPressed(OrthancStone::KeyboardKeys key,
465 char keyChar, 465 char keyChar,
466 KeyboardModifiers modifiers) 466 OrthancStone::KeyboardModifiers modifiers)
467 { 467 {
468 for (size_t i = 0; i < children_.size(); i++) 468 for (size_t i = 0; i < children_.size(); i++)
469 { 469 {
470 children_[i]->GetWidget().KeyPressed(key, keyChar, modifiers); 470 children_[i]->GetWidget().KeyPressed(key, keyChar, modifiers);
471 } 471 }