Delete new gallery control
[apps/osp/ImageViewer.git] / src / IvImageViewerForm.cpp
index 7298489..4eff1d8 100644 (file)
@@ -559,14 +559,12 @@ ImageViewerForm::CreateGallery(void)
        Rectangle clientRect = GetClientAreaBounds();
        Rectangle rect = GetBounds();
 
-       __pGallery = new (std::nothrow) Gallery();
-       __pGallery->Construct(Rectangle(0, clientRect.y, rect.width, rect.height));
-       __pGallery->SetName(L"GalleryControl");
+       __pGallery = static_cast<Gallery*>(GetControl(L"IDC_GALLERY"));
+       AppAssert(__pGallery);
+
        __pGallery->SetItemProvider(*this);
        __pGallery->AddGalleryEventListener(*this);
        __pGallery->SetBackgroundColor(COLOR_GALLERY_BG);
-       AddControl(*__pGallery);
-       __pGallery->SetTextOfEmptyGallery(ResourceManager::GetString(L"IDS_COM_BODY_LOADING"));
 
        SlideShowTransitionEffect effect = __pPresentationModel->GetTransitionEffectOfSlideShow();