CSolarSystemView* CSolarSystemDoc::GetMainView(void)
{
	POSITION pos = GetFirstViewPosition();
	while (pos)
	{
		CView* pView = GetNextView(pos);
		if (pView->IsKindOf(RUNTIME_CLASS(CSolarSystemView)))
			return dynamic_cast<CSolarSystemView*>(pView);
	}

	return NULL;
}
Beispiel #2
0
BOOL CMainFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
{
#if 1
	CGumpEditorDoc* pDoc = GetGumpDocument();
	if (pDoc) {
		CView* pView = pDoc->FindView(RUNTIME_CLASS(CGumpEditorView));
		if (pView && pView->OnCmdMsg(nID,nCode,pExtra,pHandlerInfo)) return TRUE;
	}
#endif

	return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
}
Beispiel #3
0
void CSideBar::SwitchFocusBack()
{
   CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;

   // Get the active MDI child window.
   CMDIChildWnd *pChild = (CMDIChildWnd *) pFrame->GetActiveFrame();

   // Get the active view attached to the active MDI child
   // window.
   CView *pView = pChild->GetActiveView();

   pView->SetFocus();
}
Beispiel #4
0
void COleDropTarget::OnDragLeave(CWnd* pWnd)
{
	ASSERT_VALID(this);

	if (!pWnd->IsKindOf(RUNTIME_CLASS(CView)))
		return;

	// default delegates to view
	CView* pView = (CView*)pWnd;
	ASSERT_VALID(pView);
	pView->OnDragLeave();
	return;
}
Beispiel #5
0
DROPEFFECT COleDropTarget::OnDropEx(CWnd* pWnd, COleDataObject* pDataObject,
	DROPEFFECT dropEffect, DROPEFFECT dropEffectList, CPoint point)
{
	ASSERT_VALID(this);

	if (!pWnd->IsKindOf(RUNTIME_CLASS(CView)))
		return (DROPEFFECT)-1;  // not implemented

	// default delegates to view
	CView* pView = (CView*)pWnd;
	ASSERT_VALID(pView);
	return pView->OnDropEx(pDataObject, dropEffect, dropEffectList, point);
}
Beispiel #6
0
BOOL COleDropTarget::OnDrop(CWnd* pWnd, COleDataObject* pDataObject,
	DROPEFFECT dropEffect, CPoint point)
{
	ASSERT_VALID(this);

	if (!pWnd->IsKindOf(RUNTIME_CLASS(CView)))
		return DROPEFFECT_NONE;

	// default delegates to view
	CView* pView = (CView*)pWnd;
	ASSERT_VALID(pView);
	return pView->OnDrop(pDataObject, dropEffect, point);
}
Beispiel #7
0
DROPEFFECT COleDropTarget::OnDragOver(CWnd* pWnd, COleDataObject* pDataObject,
	DWORD dwKeyState, CPoint point)
{
	ASSERT_VALID(this);

	if (!pWnd->IsKindOf(RUNTIME_CLASS(CView)))
		return DROPEFFECT_NONE;

	// default delegates to view
	CView* pView = (CView*)pWnd;
	ASSERT_VALID(pView);
	return pView->OnDragOver(pDataObject, dwKeyState, point);
}
void CMultiSheetDoc::SelectSheetView( int i )
{
	POSITION pos = GetFirstViewPosition();
    while (pos != NULL)
    {
		CView* pView = GetNextView(pos);
		if (pView->IsKindOf( RUNTIME_CLASS( CTinyCadView )))
		{
			static_cast<CTinyCadView*>(pView)->SelectSheet( i );
			pView->RedrawWindow();
		}
    }
}
Beispiel #9
0
CMDIChildWnd *CMDIChildIter::GetNextChild()
{
	CDocument	*pDoc = m_DocIter.GetNextDoc();
	if (pDoc != NULL) {
		POSITION	pos = pDoc->GetFirstViewPosition();
		if (pos != NULL) {
			CView	*pView = pDoc->GetNextView(pos);
			if (pView != NULL)
				return(DYNAMIC_DOWNCAST(CMDIChildWnd, pView->GetParentFrame()));
		}
	}
	return(NULL);
}
Beispiel #10
0
void CAutoClickDoc::ShowWindow()
{
	POSITION pos = GetFirstViewPosition();
	CView* pView = GetNextView(pos);
	if (pView != NULL)
	{
		CFrameWnd* pFrameWnd = pView->GetParentFrame();
		pFrameWnd->ActivateFrame(SW_SHOW);
		pFrameWnd = pFrameWnd->GetParentFrame();
		if (pFrameWnd != NULL)
			pFrameWnd->ActivateFrame(SW_SHOW);
	}
}
Beispiel #11
0
void CTagVwSplit::OnSetFocus(CWnd* pOldWnd) 
  {
  if (gs_pCmd->BusyDocument())
    {
    POSITION pos = gs_pCmd->BusyDocument()->GetFirstViewPosition();
    ASSERT(pos);
    CView* pView = gs_pCmd->BusyDocument()->GetNextView(pos);
    if (GetActiveView()!=pView)
      pView->PostMessage(WMU_DOSETFOCUS, 0 , (LPARAM)pView);
    }
  else
    CMDIChildWnd::OnSetFocus(pOldWnd);
  }
Beispiel #12
0
CLuaView* CMainFrame::GetActiveView()
{
	CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
	CMDIChildWnd *pChild = (CMDIChildWnd *)pFrame->GetActiveFrame();
	if ( !pChild )
		return NULL;

	CView *pView = pChild->GetActiveView();
	if ( pView && pView->IsKindOf(RUNTIME_CLASS(CLuaView)) )
		return (CLuaView*)pView;

	return NULL;
}
BOOL CMainFrame::OnQueryNewPalette()
{
	// always realize the palette for the active view
	CMDIChildWnd* pMDIChildWnd = MDIGetActive();
	if (pMDIChildWnd == NULL)
		return FALSE; // no active MDI child frame (no new palette)
	CView* pView = pMDIChildWnd->GetActiveView();
	ASSERT(pView != NULL);

	// just notify the target view
	pView->SendMessage(WM_DOREALIZE, (WPARAM)pView->m_hWnd);
	return TRUE;
}
Beispiel #14
0
CfSqlQueryFrame* CdSqlQuery::GetFrameWindow()
{
	POSITION pos = GetFirstViewPosition();
	CView* pView = GetNextView(pos);
	ASSERT (pView);
	if (pView)
	{
		CfSqlQueryFrame* pFrame = (CfSqlQueryFrame*)pView->GetParentFrame();
		ASSERT (pFrame);
		return pFrame;
	}
	return NULL;
}
Beispiel #15
0
void CMainFrame::OnPaletteChanged(CWnd* pFocusWnd) 
{
//CFrameWnd::OnPaletteChanged(pFocusWnd);
// HG 10.08.95 from easygl MSDN 07/95	
    CView* pView = GetActiveView();
    if (pView) {
        // OnPaletteChanged is not public, so send a message.
        pView->SendMessage(WM_PALETTECHANGED,
                           (WPARAM)(pFocusWnd->GetSafeHwnd()),
                           (LPARAM)0);
    }

}
Beispiel #16
0
CView * CStaticDoc::GetViewIfExist( CRuntimeClass *pViewClass )
{
	POSITION pos = GetFirstViewPosition( );
	CView * pView = NULL;
	while( pView = GetNextView(pos) )
	{
		if( pView && pView->IsKindOf( pViewClass ) )
		{
			return pView;
		}
	}
	return NULL;
}
Beispiel #17
0
void CMainFrame::OnStopsnap() 
{
	// TODO: Add your command handler code here
	OnSnapexStop();
	OnSnapexClose();

    CView *pView		= GetActiveView();		//获取当前VIEW视图
	CDC *pDC			= pView->GetDC();		//得到VIEW的DC
	RECT rect;       
	GetClientRect(&rect);
    pDC->FillSolidRect(&rect, RGB(255, 255, 255));
	pView->ReleaseDC(pDC);
}
Beispiel #18
0
void CmdwEditorDoc::Serialize(CArchive& ar)
{
	POSITION pos = this->GetFirstViewPosition();
	CView* cv = NULL;
	CEditView* pEv = NULL;
	
	do {
		cv = this->GetNextView(pos);
		if( cv != NULL && cv->IsKindOf(RUNTIME_CLASS(CEditView))) {
			pEv = (CEditView*)cv;  
			break;
		}
	} while(cv != NULL);

	if(pEv == NULL) return;

	//CString htmlpath;
	CFile *pCF = ar.GetFile();
	//if(pCF != NULL)
	//	htmlpath = pCF->GetFilePath() + _T(".html");

	if (ar.IsStoring())
	{
		// TODO: add storing code here
		/**
			unicode data 修改後儲存時轉換回 utf-8
			再由sundown 轉換成 html,通知 HtmlView 顯示
		*/
		LPCTSTR lpszText = pEv->LockBuffer();
		ASSERT(lpszText != NULL);
		UINT nLen = pEv->GetBufferLength();
		TRY
		{
			//ar.Write(lpszText, nLen*sizeof(TCHAR));
			getEditText(lpszText, nLen);

			pCF->SeekToBegin();
			pCF->Write(mib_utf8->data, mib_utf8->size);

			m_bHtmlExisted = convMd2Html((LPCTSTR)m_htmlPath, m_cssPath);
			this->UpdateAllViews(NULL, (LPARAM)(LPCTSTR)m_htmlPath, NULL);
		}
		CATCH_ALL(e)
		{
			pEv->UnlockBuffer();
			THROW_LAST();
		}
		END_CATCH_ALL

		pEv->UnlockBuffer();
	}
Beispiel #19
0
void CFrameWnd::SetActiveView( CView *pViewNew, BOOL bNotify )
/************************************************************/
{
    if( m_pViewActive != pViewNew ) {
        CView *pViewOld = m_pViewActive;
        if( pViewOld != NULL ) {
            pViewOld->OnActivateView( FALSE, pViewNew, pViewOld );
        }
        m_pViewActive = pViewNew;
        if( bNotify && pViewNew != NULL ) {
            pViewNew->OnActivateView( TRUE, pViewNew, pViewOld );
        }
    }
}
Beispiel #20
0
void CHLRDoc::FitAll2DViews(Standard_Boolean UpdateViewer)
{
  if (UpdateViewer)   my2DViewer->Update();
  POSITION position = GetFirstViewPosition();
  while (position != (POSITION)NULL)
  {
    CView* pCurrentView = (CView*)GetNextView(position);
    if(pCurrentView->IsKindOf(RUNTIME_CLASS(OCC_2dView)) )
     {
      ASSERT_VALID(pCurrentView);
      ((OCC_2dView*)pCurrentView)->GetV2dView()->Fitall();
    }
  }
}
Beispiel #21
0
/////////////////////////////////////////////////////////////////////////////
// CdSqlQuery commands
CuSqlQueryControl* CdSqlQuery::GetSqlQueryCtrl()
{
	POSITION pos = GetFirstViewPosition();
	while (pos != NULL)
	{
		CView* pView = GetNextView(pos);
		if (pView->IsKindOf(RUNTIME_CLASS(CvSqlQuery)))
		{
			CvSqlQuery* pSqlView = (CvSqlQuery* )pView;
			return &pSqlView->m_SqlQuery;
		}
	}
	return NULL;
}
Beispiel #22
0
//--------------------------------------------------------------------------------
void CRowColumnView::getMaxChildViewSize (CPoint& maxSize)
{
	ViewIterator it (this);
	while (*it)
	{
		CView* view = *it;
		CRect viewSize = view->getViewSize ();
		if (viewSize.getWidth () > maxSize.x)
			maxSize.x = viewSize.getWidth ();
		if (viewSize.getHeight () > maxSize.y)
			maxSize.y = viewSize.getHeight ();
		it++;
	}
}
Beispiel #23
0
BOOL CMainFrame::OnQueryNewPalette() 
{
// HG 10.08.95 from easygl MSDN 07/95	
    CView* pView = GetActiveView();
    if (pView) {
        // OnQueryNewPalette is not public, so send a message.
        return pView->SendMessage(WM_QUERYNEWPALETTE,
                                  (WPARAM)0,
                                  (LPARAM)0);
    }
    return FALSE; 
	
//	return CFrameWnd::OnQueryNewPalette();
}
Beispiel #24
0
	// Fonction permettant d'obtenir la classe de l'interface à partir de partout...
//------------------------------------------
//	Fonction permettant d'obtenir la classe de l'interface à partir de partout...
//	Entrées: vide
//	Retourne: l'instance de la "view"
//	Auteur: Maxime Lussier
//------------------------------------------
	CP10View * CP10View::GetView()
	{
		CFrameWnd * pFrame = (CFrameWnd *)(AfxGetApp()->m_pMainWnd);

		CView * pView = pFrame->GetActiveView();

		if ( !pView )
			return NULL;

		if ( ! pView->IsKindOf( RUNTIME_CLASS(CP10View) ) )
			return NULL;

		return (CP10View *) pView;
	}
Beispiel #25
0
//----------------------------------------------------------------------------------------------------
void MultipleAttributeChangeAction::setAttributeValue (UTF8StringPtr value)
{
	const IViewFactory* viewFactory = description->getViewFactory ();
	const_iterator it = begin ();
	while (it != end ())
	{
		CView* view = (*it).first;
		UIAttributes newAttr;
		newAttr.setAttribute ((*it).second, value);
		viewFactory->applyAttributeValues (view, newAttr, description);
		view->invalid ();
		it++;
	}
}
Beispiel #26
0
LONG CuDlgDBEventPane02::OnDbeventTraceIncoming (WPARAM wParam, LPARAM lParam)
{
    LPRAISEDDBE lpStruct = (LPRAISEDDBE)lParam;
    CView*  pView = (CView*)GetParent();
    ASSERT  (pView);
    CDbeventDoc* pDoc = (CDbeventDoc*)pView->GetDocument();
    ASSERT  (pDoc);
    CSplitterWnd* pSplitter = (CSplitterWnd*)pView->GetParent();
    ASSERT (pSplitter);
    CDbeventFrame*  pFrame = (CDbeventFrame*)pSplitter->GetParent();
    ASSERT  (pFrame);
    if (!pFrame->GetPaneRegisteredDBEvent()->Find ((LPCTSTR)lpStruct->DBEventName, (LPCTSTR)lpStruct->DBEventOwner))
    {
        IncomingDBEvent (
            pDoc, 
            "r",
            (LPCTSTR)lpStruct->StrTimeStamp, 
            (LPCTSTR)lpStruct->DBEventName, 
            (LPCTSTR)lpStruct->DBEventOwner, 
            (LPCTSTR)lpStruct->DBEventText,
            "*");
    }
    else
    {
        IncomingDBEvent (
            pDoc, 
            "r",
            (LPCTSTR)lpStruct->StrTimeStamp, 
            (LPCTSTR)lpStruct->DBEventName, 
            (LPCTSTR)lpStruct->DBEventOwner, 
            (LPCTSTR)lpStruct->DBEventText);
    }
    if (pDoc->m_bPopupOnRaise)
    {
        CString strMsg;
        strMsg.GetBuffer (520);
        TCHAR tchszAll [80];

        StringWithOwner ((LPUCHAR)lpStruct->DBEventName, (LPUCHAR)lpStruct->DBEventOwner, (LPUCHAR)tchszAll);
        //"%s: Database Event %s '%s' was raised on node %s."
            strMsg.Format (IDS_I_DB_EVENT_RAISED,
            (LPCTSTR)lpStruct->StrTimeStamp,
            (LPCTSTR)tchszAll,
            (LPCTSTR)lpStruct->DBEventText,
            (LPCTSTR)GetVirtNodeName (pDoc->m_hNode));
        BfxMessageBox (strMsg);
    }
    return RES_SUCCESS;
}
Beispiel #27
0
bool CToolTip::HandleMessage(CMessage* pMessage)
{
	bool bHandled = false;

	if (pMessage)
	{
		switch(pMessage->MessageType())
		{
			case CMessage::CTRL_TIMER:
			{
				wGui::TIntMessage* pTimerMessage = dynamic_cast<wGui::TIntMessage*>(pMessage);
				if (pTimerMessage && pMessage->Destination() == this)
				{
					// Timer has expired, so it's time to show the tooltip
					ShowTip(m_LastMousePosition + CPoint(-6, 18));
					bHandled = true;
				}
				break;
			}
		case CMessage::MOUSE_MOVE:
		{
			// We don't want to mess with the underlying control, so don't trap any MOUSE_MOVE messages
			CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage);
			if (pMouseMessage)
			{
				m_LastMousePosition = pMouseMessage->Point;
				m_pTimer->StopTimer();
				if (IsVisible())
				{
					HideTip();
				}
				CView* pView = GetView();
				bool bHitFloating = pView && pView->GetFloatingWindow() && pView->GetFloatingWindow()->HitTest(pMouseMessage->Point) &&
					pView->GetFloatingWindow() != m_pParentWindow;
				if (m_pParentWindow->GetWindowRect().SizeRect().HitTest(
					m_pParentWindow->ViewToWindow(m_LastMousePosition)) == CRect::RELPOS_INSIDE && !bHitFloating)
				{
					m_pTimer->StartTimer(1000);
				}
			}
		}
		default :
			bHandled = CWindow::HandleMessage(pMessage);
			break;
		}
	}

	return bHandled;
}
Beispiel #28
0
// set pause to true or false for all views
void CMUSHclientDoc::Pause(BOOL Flag) 
{
  for(POSITION pos = GetFirstViewPosition(); pos != NULL; )
	  {
	  CView* pView = GetNextView(pos);
	  
	  if (pView->IsKindOf(RUNTIME_CLASS(CMUSHView)))
  	  {
		  CMUSHView* pmyView = (CMUSHView*)pView;
      pmyView->m_freeze = Flag != 0;
	    }	  // end of being a CMUSHView
    }   // end of loop through views


}   // end of CMUSHclientDoc::Pause
Beispiel #29
0
CMineView* CMainFrame::GetMineView() {
	CView* view = NULL;
	CDocument* doc = GetActiveDocument();
	if (doc)
	{
		POSITION pos = doc->GetFirstViewPosition();
		while (pos != NULL)
		{
			view = (CMineView *)doc->GetNextView(pos);
			if (view->IsKindOf(RUNTIME_CLASS(CMineView))) break;
		}
		ASSERT(view->IsKindOf(RUNTIME_CLASS(CMineView)));
	}
	return (CMineView *)view;
}
Beispiel #30
0
void CGuiApp:: raisekids(CMultiDocTemplate *doc_temp)
{
  POSITION pos_doc_temp = doc_temp->GetFirstDocPosition();
  while (pos_doc_temp) {
    CDocument *doc = doc_temp->GetNextDoc(pos_doc_temp);
    POSITION p =  doc->GetFirstViewPosition();
    while (p)
      {
	CView *view = doc->GetNextView (p);
	//      view->GetParentFrame()->SetParent(crap);
	CFrameWnd *f = (CFrameWnd *)(view->GetParentFrame());
	f->ActivateFrame(SW_SHOWNORMAL);
      } 
  }
}