Mercurial > hg > orthanc-stone
comparison Framework/Deprecated/Widgets/LayoutWidget.cpp @ 1070:d7887f88710f broker
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 15 Oct 2019 21:28:46 +0200 |
parents | c35e98d22764 |
children | 0ca50d275b9a |
comparison
equal
deleted
inserted
replaced
1069:5d1b0d2f4b15 | 1070:d7887f88710f |
---|---|
83 | 83 |
84 | 84 |
85 class LayoutWidget::ChildWidget : public boost::noncopyable | 85 class LayoutWidget::ChildWidget : public boost::noncopyable |
86 { | 86 { |
87 private: | 87 private: |
88 std::auto_ptr<IWidget> widget_; | 88 boost::shared_ptr<IWidget> widget_; |
89 int left_; | 89 int left_; |
90 int top_; | 90 int top_; |
91 unsigned int width_; | 91 unsigned int width_; |
92 unsigned int height_; | 92 unsigned int height_; |
93 | 93 |
94 public: | 94 public: |
95 ChildWidget(IWidget* widget) : | 95 ChildWidget(boost::shared_ptr<IWidget> widget) : |
96 widget_(widget) | 96 widget_(widget) |
97 { | 97 { |
98 assert(widget != NULL); | 98 assert(widget != NULL); |
99 SetEmpty(); | 99 SetEmpty(); |
100 } | 100 } |
352 paddingBottom_ = padding; | 352 paddingBottom_ = padding; |
353 paddingInternal_ = padding; | 353 paddingInternal_ = padding; |
354 } | 354 } |
355 | 355 |
356 | 356 |
357 IWidget& LayoutWidget::AddWidget(IWidget* widget) // Takes ownership | 357 void LayoutWidget::AddWidget(boost::shared_ptr<IWidget> widget) // Takes ownership |
358 { | 358 { |
359 if (widget == NULL) | 359 if (widget == NULL) |
360 { | 360 { |
361 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | 361 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
362 } | 362 } |
373 | 373 |
374 if (widget->HasAnimation()) | 374 if (widget->HasAnimation()) |
375 { | 375 { |
376 hasAnimation_ = true; | 376 hasAnimation_ = true; |
377 } | 377 } |
378 | |
379 return *widget; | |
380 } | 378 } |
381 | 379 |
382 | 380 |
383 void LayoutWidget::SetStatusBar(IStatusBar& statusBar) | 381 void LayoutWidget::SetStatusBar(IStatusBar& statusBar) |
384 { | 382 { |