本文整理汇总了C++中GetMDIParent函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMDIParent函数的具体用法?C++ GetMDIParent怎么用?C++ GetMDIParent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMDIParent函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetMDIParent
void wxMDIChildFrame::InternalSetMenuBar()
{
wxMDIParentFrame * const parent = GetMDIParent();
MDIInsertWindowMenu(parent->GetClientWindow(),
m_hMenu, GetMDIWindowMenu(parent));
}
示例2: GetMDIParent
void wxMDIChildFrame::Maximize(bool maximize)
{
wxMDIParentFrame * const parent = GetMDIParent();
if ( parent && parent->GetClientWindow() )
{
if ( !IsShown() )
{
// Turn off redrawing in the MDI client window because otherwise
// maximizing it would also show it and we don't want this for
// hidden windows.
::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_SETREDRAW,
FALSE, 0L);
}
::SendMessage(GetWinHwnd(parent->GetClientWindow()),
maximize ? WM_MDIMAXIMIZE : WM_MDIRESTORE,
(WPARAM)GetHwnd(), 0);
if ( !IsShown() )
{
// Hide back the child window shown by maximizing it.
::ShowWindow(GetHwnd(), SW_HIDE);
// Turn redrawing in the MDI client back on.
::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_SETREDRAW,
TRUE, 0L);
}
}
}
示例3: WXUNUSED
bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate),
WXHWND hwndAct,
WXHWND hwndDeact)
{
wxMDIParentFrame * const parent = GetMDIParent();
WXHMENU hMenuToSet = 0;
bool activated;
if ( m_hWnd == hwndAct )
{
activated = true;
parent->SetActiveChild(this);
WXHMENU hMenuChild = m_hMenu;
if ( hMenuChild )
hMenuToSet = hMenuChild;
}
else if ( m_hWnd == hwndDeact )
{
wxASSERT_MSG( parent->GetActiveChild() == this,
wxT("can't deactivate MDI child which wasn't active!") );
activated = false;
parent->SetActiveChild(NULL);
WXHMENU hMenuParent = parent->m_hMenu;
// activate the the parent menu only when there is no other child
// that has been activated
if ( hMenuParent && !hwndAct )
hMenuToSet = hMenuParent;
}
else
{
// we have nothing to do with it
return false;
}
if ( hMenuToSet )
{
MDISetMenu(parent->GetClientWindow(),
(HMENU)hMenuToSet, GetMDIWindowMenu(parent));
}
wxActivateEvent event(wxEVT_ACTIVATE, activated, m_windowId);
event.SetEventObject( this );
ResetWindowStyle(NULL);
return HandleWindowEvent(event);
}
示例4: GetWindowRect
void wxMDIChildFrame::DoGetPosition(int *x, int *y) const
{
RECT rect;
GetWindowRect(GetHwnd(), &rect);
POINT point;
point.x = rect.left;
point.y = rect.top;
// Since we now have the absolute screen coords,
// if there's a parent we must subtract its top left corner
wxMDIParentFrame * const mdiParent = GetMDIParent();
::ScreenToClient(GetHwndOf(mdiParent->GetClientWindow()), &point);
if (x)
*x = point.x;
if (y)
*y = point.y;
}
示例5: GetHwnd
// Set the client size (i.e. leave the calculation of borders etc.
// to wxWidgets)
void wxMDIChildFrame::DoSetClientSize(int width, int height)
{
HWND hWnd = GetHwnd();
RECT rect;
::GetClientRect(hWnd, &rect);
RECT rect2;
GetWindowRect(hWnd, &rect2);
// Find the difference between the entire window (title bar and all)
// and the client area; add this to the new client size to move the
// window
int actual_width = rect2.right - rect2.left - rect.right + width;
int actual_height = rect2.bottom - rect2.top - rect.bottom + height;
#if wxUSE_STATUSBAR
if (GetStatusBar() && GetStatusBar()->IsShown())
{
int sx, sy;
GetStatusBar()->GetSize(&sx, &sy);
actual_height += sy;
}
#endif // wxUSE_STATUSBAR
POINT point;
point.x = rect2.left;
point.y = rect2.top;
// If there's an MDI parent, must subtract the parent's top left corner
// since MoveWindow moves relative to the parent
wxMDIParentFrame * const mdiParent = GetMDIParent();
::ScreenToClient(GetHwndOf(mdiParent->GetClientWindow()), &point);
MoveWindow(hWnd, point.x, point.y, actual_width, actual_height, (BOOL)true);
wxSize size(width, height);
wxSizeEvent event(size, m_windowId);
event.SetEventObject( this );
HandleWindowEvent(event);
}
示例6: MSWDoTranslateMessage
bool wxMDIChildFrame::MSWTranslateMessage(WXMSG* msg)
{
// we must pass the parent frame to ::TranslateAccelerator(), otherwise it
// doesn't do its job correctly for MDI child menus
return MSWDoTranslateMessage(GetMDIParent(), msg);
}