本文整理汇总了C++中GetTopLevelFrame函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTopLevelFrame函数的具体用法?C++ GetTopLevelFrame怎么用?C++ GetTopLevelFrame使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetTopLevelFrame函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetParentButton
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);
}
示例2: TRACE
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;
}
示例3: GetTopLevelFrame
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);
}
}
示例4: ASSERT_VALID
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);
}
示例5: DYNAMIC_DOWNCAST
// 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());
}
示例6: GetTopLevelFrame
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);
}
示例7: 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);
}
示例8: GetTopLevelFrame
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);
}
}
示例9: GetTopLevelFrame
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 );
}
}
}
示例10: ASSERT_VALID
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);
}
示例11: GetParentButton
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);
}
示例12: SendMessage
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 ();
}
示例13: 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);
}
示例14: ASSERT
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);
}
示例15: ASSERT
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);
}