//---------------------------------------------------------------------------------------------------- void UIDialogController::run (UTF8StringPtr _templateName, UTF8StringPtr _dialogTitle, UTF8StringPtr _button1, UTF8StringPtr _button2, IController* _dialogController, UIDescription* _description) { collectOpenGLViews (frame); templateName = _templateName; dialogTitle = _dialogTitle; dialogButton1 = _button1; dialogButton2 = _button2 != 0 ? _button2 : ""; dialogController = dynamic_cast<CBaseObject*> (_dialogController); dialogDescription = _description; CView* view = UIEditController::getEditorDescription ().createView ("dialog", this); if (view) { CRect size = view->getViewSize (); size.right += sizeDiff.x; size.bottom += sizeDiff.y; CRect frameSize = frame->getViewSize (); size.centerInside (frameSize); size.makeIntegral (); view->setViewSize (size); view->setMouseableArea (size); frame->setModalView (view); frame->registerKeyboardHook (this); if (button1) frame->setFocusView (button1); setOpenGLViewsVisible (false); dialogController->notify (this, kMsgDialogShow); } else { forget (); } }
//---------------------------------------------------------------------------------------------------- void UIDialogController::run (UTF8StringPtr _templateName, UTF8StringPtr _dialogTitle, UTF8StringPtr _button1, UTF8StringPtr _button2, IController* _dialogController, UIDescription* _description) { collectOpenGLViews (frame); templateName = _templateName; dialogTitle = _dialogTitle; dialogButton1 = _button1; dialogButton2 = _button2 != 0 ? _button2 : ""; dialogController = dynamic_cast<CBaseObject*> (_dialogController); dialogDescription = _description; CView* view = UIEditController::getEditorDescription ().createView ("dialog", this); if (view) { CLayeredViewContainer* layeredView = dynamic_cast<CLayeredViewContainer*>(view); if (layeredView) layeredView->setZIndex (10); CRect size = view->getViewSize (); size.right += sizeDiff.x; size.bottom += sizeDiff.y; CRect frameSize = frame->getViewSize (); size.centerInside (frameSize); size.makeIntegral (); view->setViewSize (size); view->setMouseableArea (size); view->setAlphaValue (0.f); frame->setModalView (view); frame->registerKeyboardHook (this); frame->registerViewListener (this); view->registerViewListener (this); if (button1) frame->setFocusView (button1); setOpenGLViewsVisible (false); if (dialogController) dialogController->notify (this, kMsgDialogShow); view->addAnimation ("AlphaAnimation", new Animation::AlphaValueAnimation (1.f), new Animation::LinearTimingFunction (160)); } else { forget (); } }
//---------------------------------------------------------------------------------------------------- void UIDialogController::collectOpenGLViews (CViewContainer* container) { #if VSTGUI_OPENGL_SUPPORT ViewIterator it (container); while (*it) { COpenGLView* openGLView = dynamic_cast<COpenGLView*>(*it); if (openGLView && openGLView->isVisible ()) openglViews.push_back (openGLView); else { CViewContainer* childContainer = dynamic_cast<CViewContainer*>(*it); if (childContainer) collectOpenGLViews (childContainer); } it++; } #endif }