Mercurial > hg > orthanc-stone
diff Applications/Samples/SimpleViewerApplication.h @ 267:89d02de83c03 am-2
added declaretion of messages handled/emitted
author | am@osimis.io |
---|---|
date | Wed, 22 Aug 2018 14:59:20 +0200 |
parents | c9cf95b49a86 |
children | 5bd4161bf11b |
line wrap: on
line diff
--- a/Applications/Samples/SimpleViewerApplication.h Tue Aug 21 18:14:22 2018 +0200 +++ b/Applications/Samples/SimpleViewerApplication.h Wed Aug 22 14:59:20 2018 +0200 @@ -177,8 +177,8 @@ virtual void HandleMessage(const IObservable& from, const IMessage& message) { switch (message.GetType()) { - case MessageType_GeometryReady: - mainLayout_->SetDefaultView(); + case MessageType_Widget_GeometryChanged: + //TODO remove constness !! dynamic_cast<const LayerWidget&>(from).SetDefaultView(); break; default: VLOG("unhandled message type" << message.GetType()); @@ -208,6 +208,8 @@ wasmViewport2_(NULL), slice_(0) { + DeclareIgnoredMessage(MessageType_Widget_ContentChanged); + DeclareHandledMessage(MessageType_Widget_GeometryChanged); } virtual void Finalize() {} @@ -267,6 +269,9 @@ mainViewport_ = new LayerWidget(broker_); thumbnails_.push_back(new LayerWidget(broker_)); thumbnails_.push_back(new LayerWidget(broker_)); + mainViewport_->RegisterObserver(*this); + thumbnails_[0]->RegisterObserver(*this); + thumbnails_[1]->RegisterObserver(*this); // hierarchy mainLayout_->AddWidget(thumbnailsLayout_); @@ -277,7 +282,6 @@ // sources smartLoader_.reset(new SmartLoader(broker_, context_->GetWebService())); smartLoader_->SetImageQuality(SliceImageQuality_FullPam); - smartLoader_->RegisterObserver(*this); mainViewport_->AddLayer(smartLoader_->GetFrame(instances_[currentInstanceIndex_], 0)); thumbnails_[0]->AddLayer(smartLoader_->GetFrame(instances_[0], 0));