本文整理汇总了C++中CDocument::UpdateAllViews方法的典型用法代码示例。如果您正苦于以下问题:C++ CDocument::UpdateAllViews方法的具体用法?C++ CDocument::UpdateAllViews怎么用?C++ CDocument::UpdateAllViews使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDocument
的用法示例。
在下文中一共展示了CDocument::UpdateAllViews方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSize
void CActivityView::OnSize(UINT nType, int cx, int cy)
{
CScrollView::OnSize(nType, cx, cy);
CDocument *pDoc = GetDocument();
ASSERT(pDoc);
pDoc->UpdateAllViews(NULL);
}
示例2: OnCopyData
BOOL CPlayerFrame::OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct)
{
CDocTemplate* pTemplate = NULL;
POSITION pos;
CDocument* pDocument = NULL;
pos = AfxGetApp()->GetFirstDocTemplatePosition();
pTemplate = AfxGetApp()->GetNextDocTemplate( pos );
if ( pCopyDataStruct->dwData == 0 && pCopyDataStruct->lpData )
{
if ( pTemplate )
{
POSITION docpos = pTemplate->GetFirstDocPosition( );
// Loop through documents in this template
while ( docpos )
{
VERIFY( pDocument = pTemplate->GetNextDoc(docpos) );
// update all view attached to this document
pDocument->UpdateAllViews( NULL, WM_PLAYER_ADD_FILE, (CObject*)pCopyDataStruct->lpData );
}
}
}
return CMainFrame::OnCopyData(pWnd, pCopyDataStruct);
}
示例3: UpdateViews
void SECEditView::UpdateViews(CWnd* pSender, LPARAM lHint, CObject* pHint)
{
// This is declared in SECEditCore.h because many OE functions
// Update the view. The default implementation does nothing
// and is called for SECEditCtrl derivatives. This is called
// for SECEditView derivatives
CDocument* pDoc = GetDocument();
if (pDoc)
pDoc->UpdateAllViews((CView*)pSender, lHint, pHint);
}
示例4: OnDblclk
void CXTPShellListView::OnDblclk(NMHDR* /*pNMHDR*/, LRESULT* pResult)
{
int iIndex = GetDoubleClickedItem();
if (iIndex >= 0)
{
CDocument* pDoc = GetDocument();
pDoc->UpdateAllViews(this, SHN_XTP_SELECTCHILD,
(CObject*)GetListCtrl().GetItemData(iIndex));
}
*pResult = 0;
}
示例5: SelectionChanged
void CXTPShellTreeView::SelectionChanged(HTREEITEM hItem, CString strFolderPath)
{
if (hItem != NULL && !m_bTunneling)
{
CDocument* pDoc = GetDocument();
if (pDoc != NULL)
{
pDoc->UpdateAllViews(this, SHN_XTP_TREESELCHANGE,
(CObject*)GetTreeCtrl().GetItemData(hItem));
}
}
CXTPShellTreeBase::SelectionChanged(hItem, strFolderPath);
}
示例6: OnKeyDown
void CXTPShellListView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if (nChar == VK_RETURN)
{
int iIndex = GetListCtrl().GetNextItem(-1, LVNI_FOCUSED);
if (iIndex >= 0)
{
CDocument* pDoc = GetDocument();
pDoc->UpdateAllViews(this, SHN_XTP_SELECTCHILD,
(CObject*)GetListCtrl().GetItemData(iIndex));
}
}
CXTPShellListViewBase::OnKeyDown(nChar, nRepCnt, nFlags);
}
示例7: RealizeAppPalette
UINT CPaletteApp::RealizeAppPalette(CDC* pDC)
{
// PERFORMANCE
static CPalette* pLastApp = NULL;
ASSERT(pDC);
#ifdef _DEBUGRARE
// Note that this may be called often since every OnPaint()
// or other DC drawing done by the app should realize this palette
// into the DC before drawing.
//
TRACE("CPaletteApp::RealizeAppPalette() called\n");
#endif // _DEBUGRARE
CPalette* pAppPalette = GetAppPalette();
UINT uChanged = 0;
if (pAppPalette)
{
pDC->SelectPalette(pAppPalette, FALSE);
uChanged = pDC->RealizePalette();
if (uChanged || pAppPalette != pLastApp)
{
// Cause all windows to repaint with new palette.
// REVIEW: This only affects views of the current document.
//
if (m_pMainWnd && m_pMainWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd)))
{
CDocument* pDoc = ((CFrameWnd*)m_pMainWnd)->GetActiveDocument();
if (pDoc)
pDoc->UpdateAllViews(NULL);
}
pLastApp = pAppPalette;
uChanged = 256;
}
}
return uChanged;
}
示例8: OpenDocumentFile
CDocument* CWedApp::OpenDocumentFile(LPCTSTR lpszFileName)
{
CDocument* ret = NULL;
ret = CWinApp::OpenDocumentFile(lpszFileName);
if(!ret)
return ret;
// See if window creation failed
if( ((CWedDoc*)ret)->ssel.m_err)
{
//Close this one
pDocTemplate->RemoveDocument(ret);
//Close some more
POSITION pos = pDocTemplate->GetFirstDocPosition();
pDocTemplate->RemoveDocument(pDocTemplate->GetNextDoc(pos));
pDocTemplate->RemoveDocument(pDocTemplate->GetNextDoc(pos));
pDocTemplate->RemoveDocument(pDocTemplate->GetNextDoc(pos));
AfxMessageBox("Windows ran out of windows", MB_ICONSTOP);
ret = NULL;
}
// Maximize it
// Open up in demonstration/full screen mode:
POSITION pos = ret->GetFirstViewPosition();
CView *pView = ret->GetNextView(pos);
if (pView)
{
pView->GetParent()->ShowWindow(SW_SHOWMAXIMIZED);
ret->UpdateAllViews(NULL);
}
return ret;
}
示例9: OnUpdate
void CXTPShellTreeView::OnUpdate(CView* /*pSender*/, LPARAM lHint, CObject* pHint)
{
switch (lHint)
{
// Update selection of tree view to the
case SHN_XTP_SELECTCHILD:
{
XTP_LVITEMDATA* lplvid = (XTP_LVITEMDATA*)pHint;
ASSERT(lplvid != NULL);
if (!FindTreeItem(GetTreeCtrl().GetSelectedItem(), lplvid, FALSE))
{
// The folder was not found so we send back a message
// to the listview to execute the itemid
CDocument* pDoc = GetDocument();
pDoc->UpdateAllViews(this, SHN_XTP_NOFOLDER, (CObject*)lplvid);
}
}
break;
default:
break;
}
}
示例10:
// @pymethod |PyCDocument|UpdateAllViews|Informs each view when a document changes.
static PyObject *
ui_doc_update_all_views(PyObject *self, PyObject *args)
{
PyObject *obSender;
PyObject *obHint = Py_None;
CDocument *pDoc;
if (!(pDoc=PyCDocument::GetDoc(self)))
return NULL;
if (!PyArg_ParseTuple(args, "O|O:UpdateAllViews",
&obSender, // @pyparm <o PyCView>|sender||The view who initiated the update
&obHint)) // @pyparm object|hint|None|A hint for the update.
return NULL;
CView *pView = NULL;
if (obSender!=Py_None) {
if (!(pView=PyCView::GetViewPtr(obSender)))
return NULL;
}
if (obHint==Py_None)
obHint = NULL;
GUI_BGN_SAVE;
pDoc->UpdateAllViews(pView, (LPARAM)obHint);// @pyseemfc CDocument|UpdateAllViews
GUI_END_SAVE;
RETURN_NONE;
}
示例11: OnLanguageSelection
void CMainFrame::OnLanguageSelection( UINT nID )
{
CDocTemplate* pTemplate = NULL;
POSITION pos;
CDocument* pDocument = NULL;
int nLanguageSelection = nID - ID_LANGUAGE_START;
if ( 0 == nLanguageSelection )
{
WORD nLanguage;
CHyperLink myLink;
CUString strVersions;
// FIXME
strVersions.Format( _W("cdexversion=1.70&beta=8&cdexdir=%s" ), (LPCWSTR)g_config.GetAppPath() );
for ( nLanguage=0; nLanguage < g_language.GetNumLanguageStrings(); nLanguage++)
{
CUString strLangName( g_language.GetLanguageString( nLanguage ) );
CUString strLangVersion;
strLangVersion.Format( _W("%s=%s"), (LPCWSTR)strLangName, (LPCWSTR)g_language.GetRevisionLevel( strLangName ) );
strVersions += _W( "&" ) + strLangVersion;
}
// myLink.GotoURL( _T("www.cdex.n3.net/lang/langcheck.php?") + strVersions , SW_SHOW );
myLink.GotoURL( _T("cdexos.sourceforge.net/lang/cdex_v1.70"), SW_SHOW );
}
else
{
// nLanguageSelection--;
// Switch to selected language
CString strMenu;
m_pPopupMenu->GetMenuString( nLanguageSelection, strMenu, MF_BYPOSITION );
g_language.SetLanguage( CUString( strMenu ) );
// get document template
pos = AfxGetApp()->GetFirstDocTemplatePosition();
pTemplate = AfxGetApp()->GetNextDocTemplate( pos );
POSITION docpos = pTemplate->GetFirstDocPosition( );
// Loop through documents in this template
while ( docpos )
{
VERIFY( pDocument = pTemplate->GetNextDoc(docpos) );
// update all view attached to this document
pDocument->UpdateAllViews( NULL,WM_CDEX_INITIAL_UPDATE, NULL );
}
g_config.SetLanguage( g_language.GetLanguage() );
g_config.Save();
SetLanguageMenu( );
}
}