本文整理汇总了C++中CFrameWnd类的典型用法代码示例。如果您正苦于以下问题:C++ CFrameWnd类的具体用法?C++ CFrameWnd怎么用?C++ CFrameWnd使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CFrameWnd类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetStyle
LRESULT CControlBar::OnIdleUpdateCmdUI(WPARAM wParam, LPARAM)
{
// handle delay hide/show
BOOL bVis = GetStyle() & WS_VISIBLE;
UINT swpFlags = 0;
if ((m_nStateFlags & delayHide) && bVis)
swpFlags = SWP_HIDEWINDOW;
else if ((m_nStateFlags & delayShow) && !bVis)
swpFlags = SWP_SHOWWINDOW;
m_nStateFlags &= ~(delayShow|delayHide);
if (swpFlags != 0)
{
SetWindowPos(NULL, 0, 0, 0, 0, swpFlags|
SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
}
// the style must be visible and if it is docked
// the dockbar style must also be visible
if ((GetStyle() & WS_VISIBLE) &&
(m_pDockBar == NULL || (m_pDockBar->GetStyle() & WS_VISIBLE)))
{
CFrameWnd* pTarget = (CFrameWnd*)GetOwner();
if (pTarget == NULL || !pTarget->IsFrameWnd())
pTarget = GetParentFrame();
if (pTarget != NULL)
OnUpdateCmdUI(pTarget, (BOOL)wParam);
}
return 0L;
}
示例2: ASSERT_VALID
void COleClientItem::OnSetMenu(CMenu* pMenuShared, HOLEMENU holemenu,
HWND hwndActiveObject)
{
ASSERT_VALID(this);
ASSERT(m_pInPlaceFrame != NULL);
ASSERT(m_pInPlaceFrame->m_pFrameWnd != NULL);
// don't set the doc is active
CFrameWnd* pFrameWnd = m_pInPlaceFrame->m_pFrameWnd;
ASSERT_VALID(pFrameWnd);
if (m_pInPlaceDoc != NULL &&
m_pInPlaceDoc->m_pFrameWnd != pFrameWnd->GetActiveFrame())
{
return;
}
// update the menu
pFrameWnd->DelayUpdateFrameMenu(pMenuShared->GetSafeHmenu());
// enable/disable the OLE command routing hook
::OleSetMenuDescriptor(holemenu, pFrameWnd->m_hWnd,
hwndActiveObject, NULL, NULL);
if (m_pInPlaceDoc != NULL)
{
pFrameWnd = m_pInPlaceDoc->m_pFrameWnd;
ASSERT_VALID(pFrameWnd);
::OleSetMenuDescriptor(holemenu, pFrameWnd->m_hWnd,
hwndActiveObject, NULL, NULL);
}
}
示例3:
void CLayerChooseDlg::OnSelchangeCombo1()
{
// TODO: Add your control notification handler code here
m_CurSelect=m_Combo_Show.GetCurSel();
CFrameWnd *pFrame = (CFrameWnd*)AfxGetApp()->m_pMainWnd;
CMapManagerView *pView = (CMapManagerView *) pFrame->GetActiveView();
m_LayerType=pView->GetDocument()->map1->m_parLayers.GetAt(m_CurSelect)->GetLayerType();
switch (m_LayerType)
{
case 1:
m_Edit.SetWindowText("你选择的为点状目标图层");
break;
case 3:
m_Edit.SetWindowText("你选择的为线状目标图层");
break;
case 5:
m_Edit.SetWindowText("你选择的为面状目标图层");
break;
case 7:
m_Edit.SetWindowText("你选择的为注记图层");
break;
default :
break;
}
}
示例4: GetParentFrame
int CView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
int nResult = CWnd::OnMouseActivate(pDesktopWnd, nHitTest, message);
if (nResult == MA_NOACTIVATE || nResult == MA_NOACTIVATEANDEAT)
return nResult; // frame does not want to activate
CFrameWnd* pParentFrame = GetParentFrame();
if (pParentFrame != NULL)
{
// eat it if this will cause activation
ASSERT(pParentFrame == pDesktopWnd || pDesktopWnd->IsChild(pParentFrame));
// either re-activate the current view, or set this view to be active
CView* pView = pParentFrame->GetActiveView();
HWND hWndFocus = ::GetFocus();
if (pView == this &&
m_hWnd != hWndFocus && !::IsChild(m_hWnd, hWndFocus))
{
// re-activate this view
OnActivateView(TRUE, this, this);
}
else
{
// activate this view
pParentFrame->SetActiveView(this);
}
}
return nResult;
}
示例5: main
//------------------------------------------------------------------
// main
//------------------------------------------------------------------
void main()
{
CWinApp* pApp = AfxGetApp();
pApp->InitApplication();
pApp->InitInstance();
pApp->Run();
CMyDoc* pMyDoc = new CMyDoc;
CMyView* pMyView = new CMyView;
CFrameWnd* pMyFrame = (CFrameWnd*)pApp->m_pMainWnd;
// output Message Map construction
AFX_MSGMAP* pMessageMap = pMyView->GetMessageMap();
cout << endl << "CMyView Message Map : " << endl;
MsgMapPrinting(pMessageMap);
pMessageMap = pMyDoc->GetMessageMap();
cout << endl << "CMyDoc Message Map : " << endl;
MsgMapPrinting(pMessageMap);
pMessageMap = pMyFrame->GetMessageMap();
cout << endl << "CMyFrameWnd Message Map : " << endl;
MsgMapPrinting(pMessageMap);
pMessageMap = pApp->GetMessageMap();
cout << endl << "CMyWinApp Message Map : " << endl;
MsgMapPrinting(pMessageMap);
}
示例6: UNUSED_ALWAYS
void CFrameWnd::ShowControlBar( CControlBar *pBar, BOOL bShow, BOOL bDelay )
/**************************************************************************/
{
UNUSED_ALWAYS( bDelay );
ASSERT( pBar != NULL );
if( bShow ) {
pBar->ShowWindow( SW_SHOW );
} else {
pBar->ShowWindow( SW_HIDE );
}
if( pBar->IsFloating() ) {
CDockBar *pDockBar = pBar->m_pDockBar;
ASSERT( pDockBar != NULL );
CFrameWnd *pFrame = pDockBar->GetParentFrame();
ASSERT( pFrame != NULL );
if( !bShow && pDockBar->GetDockedVisibleCount() == 0 ) {
pFrame->ShowWindow( SW_HIDE );
} else if( bShow && pDockBar->GetDockedVisibleCount() == 1 ) {
pFrame->ShowWindow( SW_SHOW );
pFrame->UpdateWindow();
}
}
RecalcLayout();
}
示例7: GetParentFrame
void CPrime95View::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CFrameWnd *parent;
CSize sz;
CPoint pos;
int new_scroll_height, new_scroll_width;
parent = GetParentFrame();
if (parent != NULL) {
if (charHeight == 0) getCharSize ();
sz = GetTotalSize ();
new_scroll_height = NumLines * charHeight;
new_scroll_width = MaxLineSize * charWidth;
pos = GetScrollPosition ();
pos.y += (new_scroll_height - sz.cy);
if (pos.y < 0) pos.y = 0;
sz.cx = new_scroll_width;
sz.cy = new_scroll_height;
SetScrollSizes (MM_TEXT, sz);
ScrollToPosition (pos);
parent->RecalcLayout ();
}
CScrollView::OnUpdate (pSender, lHint, pHint);
}
示例8: GetTopLevelFrame
void CStagePrefsLighting::OnLightingDefaults()
{
CFrameWnd *pMainFrame = GetTopLevelFrame();
CStageView *pView = (CStageView *)pMainFrame->GetActiveView();
CStageDoc *pDoc = pView->GetDocument();
pDoc->m_lighting[1] = YO_DEFAULT_LIGHTING_TWO_SIDED;
m_twoSide = YO_DEFAULT_LIGHTING_TWO_SIDED;
::glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, YO_DEFAULT_LIGHTING_TWO_SIDED);
pDoc->m_sunIntensity = YO_DEFAULT_SUN_INTENSITY;
m_lightingSunIntensity = YO_DEFAULT_SUN_INTENSITY;
m_lightingSunSliderIntensity.SetPos((int)(m_lightingSunIntensity * 100.0));
pDoc->m_sunAzimuth = YO_DEFAULT_SUN_AZIMUTH;
m_lightingSunAzimuth = YO_DEFAULT_SUN_AZIMUTH;
pDoc->m_sunAltitude = YO_DEFAULT_SUN_ALTITUDE;
m_lightingSunAltitude = YO_DEFAULT_SUN_ALTITUDE;
UpdateData(FALSE);
pView->YoRender(YO_RENDER_LIGHT);
pView->YoRender(YO_RENDER_FULL);
}
示例9: switch
void CHiddenFrame::HandleEditorNotification(LONG lMessage)
{
switch (lMessage)
{
case WM_LBUTTONUP:
{
// Find last active editor/browser and find or launch new editor from there
// 2/17/96 - fixed bug 45611. Was creating disabled editor window when invoked from a
// Mail window. We need to look for any active frame, not just Browser frame.
// We send a message instead of assuming that it's a generic frame because the
// the inplace frame could be the last active frame.
CFrameWnd * pFrame = FEU_GetLastActiveFrame(MWContextAny, TRUE);
if (pFrame) {
pFrame->SendMessage(WM_COMMAND, WPARAM(ID_TOOLS_EDITOR), 0);
} else {
// there should always be an active frame.
ASSERT(FALSE); // FE_CreateNewEditWindow(NULL, NULL);
}
}
break;
case WM_RBUTTONUP:
case WM_MOUSEMOVE:
break;
}
} // END OF FUNCTION CHiddenFrame::HandleWebNotification()
示例10: GetActiveFrame
//****************************************************************************
COleClientItem* CBCGPFrameWnd::GetInPlaceActiveItem ()
{
CFrameWnd* pActiveFrame = GetActiveFrame ();
if (pActiveFrame == NULL)
{
return NULL;
}
ASSERT_VALID (pActiveFrame);
CView* pView = pActiveFrame->GetActiveView ();
if (pView == NULL || pView->IsKindOf (RUNTIME_CLASS (CBCGPPrintPreviewView)))
{
return NULL;
}
ASSERT_VALID (pView);
COleDocument* pDoc = DYNAMIC_DOWNCAST (COleDocument, pView->GetDocument ());
if (pDoc == NULL)
{
return NULL;
}
ASSERT_VALID (pDoc);
return pDoc->GetInPlaceActiveItem (pView);
}
示例11: OnEditRecord
* End of Class Event CEsmFindDlg::OnEditPaste()
*=========================================================================*/
/*===========================================================================
*
* Class CEsmFindDlg Event - LRESULT OnEditRecord (lParam, wParam);
*
*=========================================================================*/
LRESULT CEsmFindDlg::OnEditRecord (LPARAM lParam, LPARAM wParam) {
POSITION ListPos;
int ListIndex;
esmrecinfo_t* pRecInfo;
/* Get the first selected item */
ListPos = m_RecordList.GetFirstSelectedItemPosition();
if (ListPos == NULL) return (0);
ListIndex = m_RecordList.GetNextSelectedItem(ListPos);
pRecInfo = m_RecordList.GetRecInfo(ListIndex);
if (m_pDlgHandler == NULL || pRecInfo == NULL) return (0);
/* Check for special case of INFO record type */
if (pRecInfo->pRecord->IsType(MWESM_REC_INFO)) {
CEsmInfo* pInfo = (CEsmInfo *) pRecInfo->pRecord;
esmrecinfo_t* pNewRecInfo = m_pDlgHandler->GetDocument()->FindRecInfo(pInfo->GetDialParent());
if (pNewRecInfo != NULL) {
m_pDlgHandler->EditRecord(pNewRecInfo);
CFrameWnd* pWnd = m_pDlgHandler->FindDialog(pNewRecInfo);
if (pWnd != NULL) {
pWnd->SendMessageToDescendants(ESMDLG_MSG_ONINFOEDIT, (LPARAM) pRecInfo, -1, FALSE);
}
}
}
else {
m_pDlgHandler->EditRecord(pRecInfo);
}
return (0);
}
示例12: ASSERT
BOOL CSettingsDialog::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
ASSERT(pMsg != NULL);
ASSERT_VALID(this);
ASSERT(m_hWnd != NULL);
// Don't let CDialog process the Escape key.
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_ESCAPE))
return TRUE;
if (CWnd::PreTranslateMessage(pMsg)) return TRUE;
// Don't translate dialog messages when
// application is in help mode
CFrameWnd* pFrameWnd = GetTopLevelFrame();
if (pFrameWnd != NULL && pFrameWnd->m_bHelpMode) return FALSE;
// Ensure the dialog messages will not
// eat frame accelerators
pFrameWnd = GetParentFrame();
while (pFrameWnd != NULL)
{
if (pFrameWnd->PreTranslateMessage(pMsg)) return TRUE;
pFrameWnd = pFrameWnd->GetParentFrame();
}
return PreTranslateInput(pMsg);
// return CDialog::PreTranslateMessage(pMsg);
}
示例13: ASSERT
LRESULT CMainFrame::OnGetTabToolTip(WPARAM /*wp*/, LPARAM lp)
{
CMFCTabToolTipInfo* pInfo = (CMFCTabToolTipInfo*) lp;
ASSERT(pInfo != NULL);
if (!pInfo)
{
return 0;
}
ASSERT_VALID(pInfo->m_pTabWnd);
if (!pInfo->m_pTabWnd->IsMDITab())
{
return 0;
}
CFrameWnd* pFrame = DYNAMIC_DOWNCAST(CFrameWnd, pInfo->m_pTabWnd->GetTabWnd(pInfo->m_nTabIndex));
if (pFrame == NULL)
{
return 0;
}
CDocument* pDoc = pFrame->GetActiveDocument();
if (pDoc == NULL)
{
return 0;
}
pInfo->m_strText = pDoc->GetPathName();
if(pInfo->m_strText.IsEmpty())
pInfo->m_strText=pDoc->GetTitle();
return 0;
}
示例14: getFrame
void CLangModelsDoc::showWindow()
{
CFrameWnd* pF = getFrame();
ASSERTX(pF);
pF->ShowWindow(SW_SHOWNORMAL);
getFrame()->GetMDIFrame()->MDIActivate(pF);
}
示例15: ASSERT
BOOL CFormView::PreTranslateMessage(MSG* pMsg)
{
ASSERT(pMsg != NULL);
ASSERT_VALID(this);
ASSERT(m_hWnd != NULL);
// allow tooltip messages to be filtered
if (CView::PreTranslateMessage(pMsg))
return TRUE;
// don't translate dialog messages when in Shift+F1 help mode
CFrameWnd* pFrameWnd = GetTopLevelFrame();
if (pFrameWnd != NULL && pFrameWnd->m_bHelpMode)
return FALSE;
// since 'IsDialogMessage' will eat frame window accelerators,
// we call all frame windows' PreTranslateMessage first
pFrameWnd = GetParentFrame(); // start with first parent frame
while (pFrameWnd != NULL)
{
// allow owner & frames to translate before IsDialogMessage does
if (pFrameWnd->PreTranslateMessage(pMsg))
return TRUE;
// try parent frames until there are no parent frames
pFrameWnd = pFrameWnd->GetParentFrame();
}
// don't call IsDialogMessage if form is empty
if (::GetWindow(m_hWnd, GW_CHILD) == NULL)
return FALSE;
// filter both messages to dialog and from children
return PreTranslateInput(pMsg);
}