void CFolderListPopupWnd::CloseMe(BOOL bKeep) { CMainFrame* pMainFrame = DYNAMIC_DOWNCAST(CMainFrame, GetParentFrame()); if (pMainFrame != NULL) { pMainFrame->OnCloseFoldersPopup(bKeep); } PostMessage(WM_CLOSE); }
void CMainTestView::OnInitialUpdate() { CFormView::OnInitialUpdate(); GetParentFrame()->RecalcLayout(); ResizeParentToFit(); Sleep(1000); OnFullScreenMode(); }
void CDynamoRIOView::OnInitialUpdate() { CFormView::OnInitialUpdate(); GetParentFrame()->RecalcLayout(); ResizeParentToFit(); OnDropdownList(); // 100 flashes too much with long stats list // ::SetTimer(NULL, NULL, 100, TimerProc); ::SetTimer(NULL, NULL, 200, TimerProc); }
CFrameWnd* CControlBar::GetDockingFrame() const { CFrameWnd* pFrameWnd = GetParentFrame(); if (pFrameWnd == NULL) pFrameWnd = m_pDockSite; ASSERT(pFrameWnd != NULL); ASSERT(pFrameWnd->IsKindOf(RUNTIME_CLASS(CFrameWnd))); return pFrameWnd; }
void CEsmUsesDlg::UpdateTitle (void) { CString Buffer; if (m_pRecInfo != NULL) Buffer.Format(_T("%s -- Uses -- %s"), m_pDlgHandler->GetDocument()->GetTitle(), m_pRecInfo->pRecord->GetID()); else Buffer.Format(_T("%s -- Uses --"), m_pDlgHandler->GetDocument()->GetTitle()); GetParentFrame()->SetWindowText(Buffer); }
void CIETabBar::OnCLoseTab(int nIndex) { PAGEID nPageIDRemoved = (PAGEID)IndexToPageID(nIndex); CFrameWnd *pParentFrame = GetParentFrame(); if (pParentFrame) { pParentFrame->PostMessage( WM_TAB_CLOSE,nPageIDRemoved,0); } }
void CIETabBar::OnTcnSelchange(NMHDR *pNMHDR, LRESULT *pResult) { int nIndex = GetCurSel(); int nCount = GetItemCount(); if (nIndex >= 0 && nIndex < nCount) { GetParentFrame()->PostMessage(WM_TAB_SEL_CHANGE,(PAGEID)IndexToPageID(nIndex),0); } *pResult = 0; }
BOOL CChildView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) { if(((CMainFrame*)GetParentFrame())->m_fHideCursor) { SetCursor(NULL); return TRUE; } return CWnd::OnSetCursor(pWnd, nHitTest, message); }
BOOL CChildView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) { if (((CMainFrame*)GetParentFrame())->m_fHideCursor) { SetCursor(NULL); return TRUE; } if (((CMainFrame*)GetParentFrame())->IsSomethingLoaded() && (nHitTest == HTCLIENT)) { if (((CMainFrame*)GetParentFrame())->GetPlaybackMode() == PM_DVD) { return FALSE; } ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); return TRUE; } return CWnd::OnSetCursor(pWnd, nHitTest, message); }
void CPPagePlayback::OnBalanceTextDblClk() { // double click on text "Balance" resets the balance to zero m_nBalance = 0; m_balancectrl.SetPos(m_nBalance); ((CMainFrame*)GetParentFrame())->SetBalance(m_nBalance); SetModified(); }
BOOL CSnapView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { ENSURE(pParentWnd != NULL); ASSERT_KINDOF(CFrameWnd, pParentWnd); if (!CWnd::Create(lpszClassName, lpszWindowName, dwStyle | WS_CLIPCHILDREN, rect, pParentWnd, nID, pContext)) { return FALSE; } // add your pages here! m_pPageBkfst = new CBkfstPage; m_pPageLunch = new CLunchPage; m_pPageDinner = new CDinnerPage; // create the window object m_pPropSheet = new CSnapPropertySheet; m_pPropSheet->AddPage(m_pPageBkfst); m_pPropSheet->AddPage(m_pPageLunch); m_pPropSheet->AddPage(m_pPageDinner); // create a modeless property page if (!m_pPropSheet->Create(this, DS_CONTEXTHELP | DS_SETFONT | WS_CHILD | WS_VISIBLE)) { DestroyWindow(); return FALSE; } m_pPropSheet->SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE); // we use the style from the template - but make sure that // the WS_BORDER bit is correct. // the WS_BORDER bit will be whatever is in dwRequestedStyle m_pPropSheet->ModifyStyle(WS_BORDER|WS_CAPTION, dwStyle & (WS_BORDER|WS_CAPTION)); // Force the size requested. // Fake a call to OnSize()--it would have been called automatically // if this were using the base class implementation of Create(). CFrameWnd* pParentFrame = GetParentFrame(); CRect rectSize; m_pPropSheet->GetWindowRect(rectSize); pParentFrame->CalcWindowRect(rectSize); OnSize(SIZE_RESTORED, rectSize.Width(), rectSize.Height()); return TRUE; }
void CTestSetBatchView::Test20M() { CAdcTestPlatDoc* pDoc = (CAdcTestPlatDoc*)GetDocument(); if ( pDoc != NULL ) { DWORD dwCmd = (CMD_RESET << 16); pDoc->SendCommand( dwCmd ); dwCmd = (CMD_MODE << 16) + (0 << 8) //m_nStart + (0 << 6) //m_nM0 + (1 << 5) //m_nChanConfigCtrl + (0 << 4) //m_nDataOutModelSel lvds + (1 << 3) //m_nParaSerSel + (1 << 1) //m_nLvdsAck + 0; //m_nTest pDoc->SendCommand( dwCmd ); // 自动载入配置文件param_20m.dat, ????? LoadParamFile( m_str20MFileName ); dwCmd = (CMD_MODE << 16) + (1 << 8) //m_nStart + (1 << 6) //m_nM0 + (1 << 5) //m_nChanConfigCtrl + (0 << 4) //m_nDataOutModelSel lvds + (1 << 3) //m_nParaSerSel + (1 << 1) //m_nLvdsAck + 0; //m_nTest pDoc->SendCommand( dwCmd ); // r值的作用80/20/2 SetR( 2 ); // 设置alg显示 CMainFrame* pFrame = (CMainFrame*)GetParentFrame(); if ( pFrame != NULL ) { pFrame->m_bTestADCBatch = TRUE; pFrame->m_bTestADC = FALSE; pFrame->m_bTestAlg = TRUE; } // 选择alg模式 pDoc->m_nTestModeSel = 6; // 上次的采集完成后,可以建立新线程,采集和计算 if ( pDoc->m_bTestComp ) { // 第二个参数不能像doc里面直接使用this, 切记 AfxBeginThread( pDoc->TestAndCalc, pDoc ); } // 打开定时器1, 每隔2s采集一次 SetTimer( 1, 2000, NULL ); } }
void Cp02resourceView::OnInitialUpdate() { CFormView::OnInitialUpdate(); GetParentFrame()->RecalcLayout(); ResizeParentToFit(); ////초기값 설정 check.SetCheck(1); state3.SetCheck(2); //xxx.SetCheck(1); }
void CNuGenDimensionView::OnLButtonDown(UINT nFlags, CPoint point) { CChildFrame* pFrame = static_cast<CChildFrame*>(GetParentFrame()); // Save the mouse left button down screen position m_ScreenLeftButtonDownPoint = point; SetCapture(); COpenGLView::OnLButtonDown(nFlags, point); }
void CChildView::OnNcPaint() { if(!((CMainFrame*)GetParentFrame())->IsFrameLessWindow()) { CRect r; GetWindowRect(r); r.OffsetRect(-r.left, -r.top); CWindowDC(this).Draw3dRect(&r, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT)); } }
void CRimshotView::OnViewUniform() { CMenu *pMenu = GetParentFrame()->GetMenu(); m_Draw.bDrawUniform = !m_Draw.bDrawUniform; if (pMenu) pMenu->CheckMenuItem(ID_VIEW_UNIFORM, MF_BYCOMMAND | m_Draw.bDrawUniform ? MF_CHECKED : MF_UNCHECKED); StopDrawing(); StartDrawing(); }
LRESULT CControlBar::OnIdleUpdateCmdUI( WPARAM wParam, LPARAM lParam ) /********************************************************************/ { UNUSED_ALWAYS( lParam ); CFrameWnd *pFrame = GetParentFrame(); if( pFrame != NULL ) { OnUpdateCmdUI( pFrame, (BOOL)wParam ); } return( 0L ); }
void CChildFrame::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu) { CMDIChildWnd::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu); // CG: The following block was inserted by 'Status Bar' component. { GetParentFrame()->PostMessage(WM_INITMENUPOPUP, (WPARAM)pPopupMenu->GetSafeHmenu(), MAKELONG(nIndex, bSysMenu)); } }
void CTestSetBatchView::AutoSaveFile() { ((CMainFrame*)GetParentFrame())->FileSave( m_strCurFileName ); // 保存为文本文件 SaveTxtFile(); // 文件名在原来电路ID基础上增加1 UpdateData( TRUE ); m_strID.Format( "%08d", atoi(m_strID) + 1 ); m_strCurFileName = m_strID + ".atp"; UpdateData( FALSE ); }
void SkeinWindow::OnLButtonDblClk(UINT nFlags, CPoint point) { Skein::Node* node = NodeAtPoint(point); if (node != NULL) { // Start the skein playing to this node GetParentFrame()->SendMessage(WM_PLAYSKEIN,(WPARAM)node); } CScrollView::OnLButtonDblClk(nFlags,point); }
void CSiriusView::OnCommandStop() { EndCapture(); g_bStarted = FALSE; KillTimer(TIMER_ID); // kill statistics timer CloseHandle(m_hAdapterMutex); // update application title CString sTitle; sTitle.LoadString(AFX_IDS_APP_TITLE); GetParentFrame()->SetWindowText(sTitle); }
/////////////////////// Drag & Drop support ////////////////// void CFPAnalysisView::OnDropFiles(HDROP hDropInfo) { CFPAnalysisDoc* pDoc = GetDocument(); WORD dwFiles; char lpszFile[80]; //Drop only one file at a time, so if more than one file has been dropped, the //action is disallowed. dwFiles = ::DragQueryFile(hDropInfo,0xFFFFFFFF,(LPTSTR)NULL,0); if (dwFiles > 1) return; //Handle one file at a time // Get the name of the file dropped... ::DragQueryFile(hDropInfo,0,lpszFile,sizeof(lpszFile)); //DEBUG AfxMessageBox(lpszFile); //Be sure that file is BMP file if (strstr(lpszFile,".BMP")) { currentimage.SetFilename(lpszFile); currentimage.LoadBMP(); Invalidate(FALSE); pDoc->SetTitle(lpszFile); } else AfxMessageBox("Incorrect File Type.", MB_ICONSTOP); //set the size of view to image-size... CChildFrame* pParent =(CChildFrame*)GetParentFrame(); CRect rcParent; rcParent.left = 0; rcParent.top =0; rcParent.right = (int)currentimage.GetWidth(); rcParent.bottom = (int)currentimage.GetHeight(); pParent->MoveWindow(&rcParent); //initialize zoom-specific members m_nNum = m_nDen = 1; SetFPScrollInfo(); // Refresh the entire view... Invalidate(TRUE); //Call base class's implementation CScrollView::OnDropFiles(hDropInfo); }
void CvSqlQueryRichEditView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { if (nChar == VK_F5) { CfSqlQueryFrame* pFrame = (CfSqlQueryFrame*)GetParentFrame(); if (pFrame && pFrame->IsRunEnable()) pFrame->Execute(); } CRichEditView::OnKeyDown(nChar, nRepCnt, nFlags); }
// Toggle the zoom (either menu or toolbar) void CRDVView::OnViewZoom() { // Toggle the zoom m_bViewZoom = !m_bViewZoom; // Handle the changed condition if (m_bViewZoom) { // Provide a full view of the server with scroll bars SetScrollSizes(MM_TEXT,m_ViewSize); GetParentFrame()->RecalcLayout(); ResizeParentToFit(); } else { // Shrink to fit the server in the client window SetScaleToFitSize(m_ViewSize); GetParentFrame()->RecalcLayout(); } }
void CMsgTreeView::OnUpdateExportContact(CCmdUI* pCmdUI) { if (GetParentFrame()->GetActiveView() == this) { CTreeCtrl &tree = GetTreeCtrl(); HTREEITEM item = tree.GetSelectedItem(); if (item) { uint32 uin = tree.GetItemData(item); pCmdUI->Enable(uin != 0); } } }
void CEditFrameView::OnEndPrintPreview(CDC* pDC, CPrintInfo* pInfo, POINT point, CPreviewView* pPreviewView) { CRichEditView::OnEndPrintPreview(pDC, pInfo, point, pPreviewView); CEditFrameDialog* pFrame = DYNAMIC_DOWNCAST (CEditFrameDialog, GetParentFrame ()); if (pFrame != NULL) { pFrame->ClosePrintPreview (); } }
BOOL CTabProfsDlg::PreTranslateMessage(MSG* pMsg) { // This was the only way I could get the accelerators to work while the // focus is on the modeless dialog. CFrameWnd *pWnd = GetParentFrame(); if (pWnd && ::TranslateAccelerator(pWnd->GetSafeHwnd(),m_hAccel,pMsg)) return(TRUE); return(CDialog::PreTranslateMessage(pMsg)); }
void CHashMD5Form::OnInitialUpdate() { CForm::OnInitialUpdate(); GetParentFrame()->RecalcLayout(); m_btln1.EnableWindow(FALSE); m_btln2.EnableWindow(FALSE); // 初始化完成标志位 m_bInitControl= TRUE; }
void CViewPrintPreview::OnEndPrintPreview(CDC* pDC, CPrintInfo* pInfo, POINT point, CPreviewView* pView) { CView::OnEndPrintPreview(pDC, pInfo, point, pView); // Show the original frame m_pOldFrame->ShowWindow(SW_SHOW); // Restore main frame pointer AfxGetApp()->m_pMainWnd=m_pOldFrame; m_pCtrl->m_bPrintPreview=FALSE; // Kill parent frame and itself GetParentFrame()->DestroyWindow(); }
void CG2XPrintDummyView::OnEndPrintPreview(CDC* pDC, CPrintInfo* pInfo, POINT point, CPreviewView* pView) { CView::OnEndPrintPreview(pDC, pInfo, point, pView); // show the original frame m_pOldFrame->ShowWindow(SW_SHOW); // restore main frame pointer AfxGetApp()->m_pMainWnd = m_pOldFrame; //m_pDialog->EndPreviewMode(); ::SetFocus(m_pPrintInterface->GetOwnerHandle()); GetParentFrame()->DestroyWindow(); }