void CUndoBar::DoUndo() { CUndoButton* pUndoButton = GetParentButton(); ASSERT_VALID(pUndoButton); pUndoButton->m_nSelNum = m_wndList.GetSelCount() + 1; CMDIChildWnd* pChildFrame = ((CMDIFrameWndEx*)GetTopLevelFrame())->MDIGetActive(); if (pChildFrame) { CEditView* pView = DYNAMIC_DOWNCAST(CEditView, pChildFrame->GetActiveView()); if (pView != NULL) { //pView->OnEditUndo(); TODO } else { ASSERT(FALSE); } } else { ASSERT(FALSE); } GetParent()->PostMessage(WM_CLOSE); }
int CUndoMenu::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CMiniFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; DWORD toolbarStyle = AFX_DEFAULT_TOOLBAR_STYLE; if (m_AnimationType != NO_ANIMATION && !CMFCToolBar::IsCustomizeMode()) { toolbarStyle &= ~WS_VISIBLE; } if (!m_wndUndoBar.Create(this, toolbarStyle | CBRS_TOOLTIPS | CBRS_FLYBY, 1)) { TRACE(_T("Can't create popup menu bar\n")); return -1; } CWnd* pWndParent = GetParent(); ASSERT_VALID(pWndParent); m_wndUndoBar.SetOwner(pWndParent); m_wndUndoBar.SetPaneStyle(m_wndUndoBar.GetPaneStyle() | CBRS_TOOLTIPS); ActivatePopupMenu(GetTopLevelFrame(), this); RecalcLayout(); return 0; }
void CMSOffice2007DemoView::OnFontsize() { CMFCRibbonBar* pRibbon = ((CMainFrame*) GetTopLevelFrame())->GetRibbonBar(); ASSERT_VALID(pRibbon); CMFCRibbonComboBox* pSizeCombo = DYNAMIC_DOWNCAST(CMFCRibbonComboBox, pRibbon->FindByID(ID_FONT_FONTSIZE)); if (pSizeCombo == NULL) { return; } int nSize = GetTwipSize(pSizeCombo->GetEditText()); if (nSize == -2 || (nSize >= 0 && nSize < 20) || nSize > 32760) { // Restore current size: pSizeCombo->SetEditText (TwipsToPointString (GetCharFormatSelection ().yHeight)); MessageBox (_T("The number must be between 1 and 1638.")); return; } if (nSize > 0) { CCharFormat cf; cf.dwMask = CFM_SIZE; cf.yHeight = nSize; SetCharFormat(cf); } }
void CMSOffice2007DemoView::OnSelChange(NMHDR* pNMHDR, LRESULT* pResult) { CRichEditView::OnSelChange(pNMHDR, pResult); if (GetFocus ()->GetSafeHwnd () != GetSafeHwnd()) { return; } CMainFrame* pMainFrame = ((CMainFrame*) GetTopLevelFrame()); ASSERT_VALID(pMainFrame); UINT uiCategoryID = 0; CMSOffice2007DemoCntrItem* pItem = (CMSOffice2007DemoCntrItem*) GetSelectedItem(); if (pItem != NULL) { uiCategoryID = pItem->m_uiCategoryID; } pMainFrame->SetRibbonContextCategory(uiCategoryID); SyncFont(); }
BOOL CControlBar::PreTranslateMessage(MSG* pMsg) { ASSERT_VALID(this); ASSERT(m_hWnd != NULL); // handle mouse messages for tooltip support if (m_dwStyle & (CBRS_FLYBY|CBRS_TOOLTIPS)) FilterToolTipMsg(pMsg->message, pMsg->pt); // 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 CWnd* pOwner = GetOwner(); // always use owner first while (pOwner != NULL) { // allow owner & frames to translate before IsDialogMessage does if (pOwner->PreTranslateMessage(pMsg)) return TRUE; // try parent frames until there are no parent frames pOwner = pOwner->GetParentFrame(); } // filter both messages to dialog and from children return PreTranslateInput(pMsg); }
// Ends-in Contrast Stretching의 최저값 설정 void CBMPFrame::OnIpEcsLowEnd() { // TODO: 여기에 명령 처리기 코드를 추가합니다. CMFCRibbonEdit *pSpin = DYNAMIC_DOWNCAST(CMFCRibbonEdit, ((CMainFrame*)GetTopLevelFrame())->GetRibbonBar()->FindByID(ID_IP_ECSLOW)); m_bEcsLowEnd = (BYTE)_wtof(pSpin->GetEditText()); }
void CBCGPMSOffice2007DemoView::OnFontname() { USES_CONVERSION; CBCGPRibbonBar* pRibbon = ((CMainFrame*) GetTopLevelFrame ())->GetRibbonBar (); ASSERT_VALID (pRibbon); CBCGPRibbonFontComboBox* pFontCombo = DYNAMIC_DOWNCAST ( CBCGPRibbonFontComboBox, pRibbon->FindByID (ID_FONT_FONT)); if (pFontCombo == NULL) { return; } CCharFormat cf; cf.szFaceName[0] = NULL; cf.dwMask = CFM_FACE | CFM_CHARSET; const CBCGPFontDesc* pDesc = pFontCombo->GetFontDesc (); ASSERT_VALID (pDesc); ASSERT(pDesc->m_strName.GetLength() < LF_FACESIZE); #if _MSC_VER >= 1300 lstrcpyn(cf.szFaceName, pDesc->m_strName, LF_FACESIZE); #else lstrcpynA(cf.szFaceName, T2A((LPTSTR) (LPCTSTR) pDesc->m_strName), LF_FACESIZE); #endif cf.bCharSet = pDesc->m_nCharSet; cf.bPitchAndFamily = pDesc->m_nPitchAndFamily; SetCharFormat (cf); }
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); }
void CStagePrefsLighting::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { CFrameWnd *pMainFrame = GetTopLevelFrame(); CStageView *pView = (CStageView *)pMainFrame->GetActiveView(); CStageDoc *pDoc = pView->GetDocument(); if ((CSliderCtrl *)pScrollBar == &m_lightingSunSliderIntensity) { m_lightingSunIntensity = (float)m_lightingSunSliderIntensity.GetPos() / 100.0f; pDoc->m_sunIntensity = m_lightingSunIntensity; } else { CPropertyPage::OnHScroll(nSBCode, nPos, pScrollBar); } UpdateData(FALSE); if (nSBCode == SB_ENDSCROLL) { pView->YoRender(YO_RENDER_LIGHT); pView->YoRender(YO_RENDER_FULL); } else { pView->YoRender(YO_RENDER_QUICK); } return; }
void CEditFrameView::OnFontSize () { CBCGPRibbonBar* pRibbon = ((CEditFrameDialog*) GetTopLevelFrame ())->GetRibbonBar (); ASSERT_VALID (pRibbon); CBCGPRibbonComboBox* pSizeCombo = DYNAMIC_DOWNCAST ( CBCGPRibbonComboBox, pRibbon->FindByID (ID_FONT_SIZE)); if (pSizeCombo == NULL) { return; } int nSize = GetTwipSize (pSizeCombo->GetItem (-1)); if (nSize == -2) { return; } if ((nSize >= 0 && nSize < 20) || nSize > 32760) { return; } if (nSize > 0) { CCharFormat cf; cf.dwMask = CFM_SIZE; cf.yHeight = nSize; SetCharFormat (cf); } }
void CFrameWnd::OnMenuSelect( UINT nItemID, UINT nFlags, HMENU hSysMenu ) /***********************************************************************/ { CWnd::OnMenuSelect( nItemID, nFlags, hSysMenu ); if( nFlags == 0xFFFF && hSysMenu == NULL ) { CFrameWnd *pFrame = GetTopLevelFrame(); ASSERT( pFrame != NULL ); if( pFrame->m_bHelpMode ) { SetMessageText( AFX_IDS_HELPMODEMESSAGE ); } else { SetMessageText( AFX_IDS_IDLEMESSAGE ); } } else { if( nFlags & MF_POPUP ) { SetMessageText( _T("") ); } else if( nItemID >= AFX_IDM_FIRST_MDICHILD ) { SetMessageText( AFX_IDS_MDICHILD ); } else if( nItemID >= 0xF000 && nItemID < 0xF1F0) { SetMessageText( ID_COMMAND_FROM_SC( nItemID ) ); } else { SetMessageText( nItemID ); } } }
BOOL CDlgResLib::PreTranslateMessage(MSG* pMsg) { ASSERT_VALID(this); ASSERT(m_hWnd != NULL); CWnd* pOwner = GetOwner(); // 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 while (pOwner != NULL) { // allow owner & frames to translate before IsDialogMessage does if (pOwner->PreTranslateMessage(pMsg)) return TRUE; // try parent frames until there are no parent frames if (IsWindow (pOwner->GetSafeHwnd ())) { pOwner = pOwner->GetParentFrame(); } else { break; } } return CDialogEx::PreTranslateMessage(pMsg); }
void CUndoBar::DoUndo () { CUndoButton* pUndoButton = GetParentButton (); ASSERT_VALID (pUndoButton); pUndoButton->m_nSelNum = m_wndList.GetSelCount () + 1; CMDIChildWnd* pChildFrame = ((CMDIFrameWnd*)GetTopLevelFrame())->MDIGetActive(); if (pChildFrame) { CView* pView = pChildFrame->GetActiveView(); if (pView && pView->IsKindOf(RUNTIME_CLASS(CBCGPVisualStudioGUIDemoView))) { ((CBCGPVisualStudioGUIDemoView*)pView)->DoUndo(pUndoButton); } else { ASSERT(FALSE); } } else { ASSERT(FALSE); } GetParent ()->PostMessage (WM_CLOSE); }
void CBCGPMSOffice2007DemoView::OnInitialUpdate () { CRichEditView::OnInitialUpdate(); SendMessage (EM_SHOWSCROLLBAR, SB_HORZ, FALSE); SendMessage (EM_SHOWSCROLLBAR, SB_VERT, FALSE); GetRichEditCtrl ().SetEventMask (GetRichEditCtrl ().GetEventMask() | (ENM_REQUESTRESIZE | ENM_SCROLL)); CScrollBar* pScrollBar = ((CMainFrame*) GetTopLevelFrame ())->GetScrollBar (); if (pScrollBar->GetSafeHwnd () != NULL && GetRichEditCtrl().GetTextLength () == 0) { ASSERT_VALID (pScrollBar); pScrollBar->EnableScrollBar (ESB_DISABLE_BOTH); } // Set the printing margins (720 twips = 1/2 inch). SetMargins(CRect(720, 720, 720, 720)); CCharFormat cf; GetDefaultFont (cf); SetCharFormat (cf); SyncFont (); }
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); }
BOOL CSAPrefsDialog::PreTranslateMessage(MSG* pMsg) { 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); }
BOOL CDialog::PreTranslateMessage(MSG* pMsg) { // for modeless processing (or modal) ASSERT(m_hWnd != NULL); // allow tooltip messages to be filtered if (CWnd::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; // fix around for VK_ESCAPE in a multiline Edit that is on a Dialog // that doesn't have a cancel or the cancel is disabled. if (pMsg->message == WM_KEYDOWN && (pMsg->wParam == VK_ESCAPE || pMsg->wParam == VK_CANCEL) && (::GetWindowLong(pMsg->hwnd, GWL_STYLE) & ES_MULTILINE) && _AfxCompareClassName(pMsg->hwnd, _T("Edit"))) { HWND hItem = ::GetDlgItem(m_hWnd, IDCANCEL); if (hItem == NULL || ::IsWindowEnabled(hItem)) { SendMessage(WM_COMMAND, IDCANCEL, 0); return TRUE; } } // filter both messages to dialog and from children return PreTranslateInput(pMsg); }
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); }
void CStageGripperDlg::OnGripperOpen() { CFrameWnd *pMainFrame = GetTopLevelFrame(); CView *pView = pMainFrame->GetActiveView(); CStageDoc *pDoc = ((CStageView *)pView)->GetDocument(); ((CStageGripper *)pDoc->m_currentDevice)->YoOpenGripper(); return; }
void CSetPaneSizeView::OnButtonSetContainerSize() { UpdateData (); CMainFrame* pMainFrame = DYNAMIC_DOWNCAST (CMainFrame, GetTopLevelFrame()); if (pMainFrame != NULL) { pMainFrame->SetContainerSize (m_nContainerSize); } }
void CStageGripperDlg::OnGripperTypeTranslating() { CFrameWnd *pMainFrame = GetTopLevelFrame(); CView *pView = pMainFrame->GetActiveView(); CStageDoc *pDoc = ((CStageView *)pView)->GetDocument(); ((CStageGripper *)pDoc->m_currentDevice)->m_typeTranslating = TRUE; return; }
void CSetPaneSizeView::OnBtnSetWidthInPixels() { UpdateData (); CMainFrame* pMainFrame = DYNAMIC_DOWNCAST (CMainFrame, GetTopLevelFrame()); if (pMainFrame != NULL) { pMainFrame->SetDlgBarWidthInPixels (m_nWidthInPixels); } }
void CStagePartMotion::OnPartRemove() { // TODO: Add your control notification handler code here CFrameWnd *pMainFrame = GetTopLevelFrame(); CView *pView = pMainFrame->GetActiveView(); CStageDoc *pDoc = ((CStageView *)pView)->GetDocument(); CStageMotion *ptrMotion; int i = 0; int j = m_partMotionList.GetCount(); GLint min; GLint sec; GLint frm; GLint t; char s[128]; char *p; while (i < j) { if (m_partMotionList.GetSel(i)) { m_partMotionList.GetText(i, s); sscanf(s, "%d", &min); p = &s[3]; sscanf(p, "%d", &sec); p = &s[6]; sscanf(p, "%d", &frm); //sscanf(s, "%d *%s %d *%s %d", &min, &sec, &frm); t = (min * 60 * pDoc->m_framesPerSecond) + (sec * pDoc->m_framesPerSecond) + frm; ptrMotion = pDoc->m_currentPart->m_motion; while (ptrMotion != NULL && t != 0) { if (t == ptrMotion->m_time) { // flag motion for removal ptrMotion->m_time = -ptrMotion->m_time; ptrMotion = NULL; } else { ptrMotion = ptrMotion->m_next; } } m_partMotionList.DeleteString(i); j--; } else { i++; } } return; }
BOOL CFrameWndBase::OnNcActivate( BOOL bActive ) { CFrameWnd* pFrame = GetTopLevelFrame(); ASSERT_VALID( pFrame ); m_wndMenuBar.FrameOnNcActivate( ( bActive || ( pFrame->m_nFlags & WF_STAYACTIVE ) ) && pFrame->IsWindowEnabled() ); return CFrameWnd::OnNcActivate( bActive ); }
void CStagePartMotion::OnPartClearAll() { // TODO: Add your control notification handler code here CFrameWnd *pMainFrame = GetTopLevelFrame(); CView *pView = pMainFrame->GetActiveView(); CStageDoc *pDoc = ((CStageView *)pView)->GetDocument(); pDoc->m_currentPart->m_motion->m_time = INT_MAX; m_partMotionList.ResetContent(); return; }
CSize CRibbonTooltipCtrl::GetIconSize() { CMFCToolBarImages* pBmp = ((CMainFrame*) GetTopLevelFrame())->GetTooltipImage(m_nID); if (pBmp != NULL) { ASSERT_VALID(pBmp); return pBmp->GetImageSize(); } return CMFCToolTipCtrl::GetIconSize(); }
void COutputList::OnViewOutput() { CDockablePane* pParentBar = DYNAMIC_DOWNCAST(CDockablePane, GetOwner()); CMDIFrameWndEx* pMainFrame = DYNAMIC_DOWNCAST(CMDIFrameWndEx, GetTopLevelFrame()); if (pMainFrame != NULL && pParentBar != NULL) { pMainFrame->SetFocus(); pMainFrame->ShowPane(pParentBar, FALSE, FALSE, FALSE); pMainFrame->RecalcLayout(); } }
BOOL CFrameWnd::OnSetCursor( CWnd *pWnd, UINT nHitTest, UINT message ) /********************************************************************/ { CFrameWnd *pTopLevel = GetTopLevelFrame(); ASSERT( pTopLevel != NULL ); if( pTopLevel->m_bHelpMode ) { ::SetCursor( _HelpCursor ); return( TRUE ); } else { return( CWnd::OnSetCursor( pWnd, nHitTest, message ) ); } }
void CSynBCGPEditView::ReSetEncodingLabel() { CBCGPRibbonStatusBar *pRibbonBar = ((CMainFrame*)GetTopLevelFrame())->GetRibbonStatusBar(); ASSERT_VALID(pRibbonBar); CMyBCGPRibbonStatusBarPane *pRibbonLabel = DYNAMIC_DOWNCAST(CMyBCGPRibbonStatusBarPane, pRibbonBar->FindByID(ID_NOW_ENCODING)); if (pRibbonLabel) { CString strLabelText(m_pEdit->GetSelectEncodingString()); pRibbonLabel->SetText(strLabelText); pRibbonLabel->Redraw(); } }
void CStageGripperDlg::OnKillfocusGripperDisplacementOpen() { CFrameWnd *pMainFrame = GetTopLevelFrame(); CView *pView = pMainFrame->GetActiveView(); CStageDoc *pDoc = ((CStageView *)pView)->GetDocument(); CWnd *pCBox; char s[32]; pCBox = (CComboBox*)GetDlgItem(IDC_GRIPPER_DISPLACEMENT_OPEN); pCBox->GetWindowText(s, 32); sscanf(s, "%lf", &((CStageGripper *)pDoc->m_currentDevice)->m_displacementOpen); return; }