#include "wx/stockitem.h"
#include "wx/msw/private.h"
-#if wxUSE_STATUSBAR && wxUSE_NATIVE_STATUSBAR
- #include "wx/msw/statbr95.h"
-#endif
-
#include <string.h>
// ---------------------------------------------------------------------------
{
event.Skip();
- if ( !event.Iconized() )
- {
+ if ( !event.IsIconized() )
UpdateClientSize();
- }
}
// Returns the active MDI child window
return processed;
}
-bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
+bool wxMDIParentFrame::HandleCommand(WXWORD id_, WXWORD cmd, WXHWND hwnd)
{
+ // sign extend to int from short before comparing with the other int ids
+ int id = (signed short)id_;
+
// In case it's e.g. a toolbar.
if ( hwnd )
{
wxWindowCreationHook hook(this);
m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
- WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
+ WM_MDICREATE, 0, (LPARAM)&mcs);
if ( !m_hWnd )
{
// we need to refresh the MDI frame window menu to include (or exclude if
// we've been hidden) this frame
- wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
+ wxMDIParentFrame *parent = GetMDIParent();
MDISetMenu(parent->GetClientWindow(), NULL, NULL);
return true;
// If there's an MDI parent, must subtract the parent's top left corner
// since MoveWindow moves relative to the parent
- wxMDIParentFrame *mdiParent = (wxMDIParentFrame *)GetParent();
+ wxMDIParentFrame *mdiParent = GetMDIParent();
::ScreenToClient((HWND) mdiParent->GetClientWindow()->GetHWND(), &point);
MoveWindow(hWnd, point.x, point.y, actual_width, actual_height, (BOOL)true);
// Since we now have the absolute screen coords,
// if there's a parent we must subtract its top left corner
- wxMDIParentFrame *mdiParent = (wxMDIParentFrame *)GetParent();
+ wxMDIParentFrame *mdiParent = GetMDIParent();
::ScreenToClient((HWND) mdiParent->GetClientWindow()->GetHWND(), &point);
if (x)
void wxMDIChildFrame::InternalSetMenuBar()
{
- wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
+ wxMDIParentFrame *parent = GetMDIParent();
InsertWindowMenu(parent->GetClientWindow(),
m_hMenu, GetMDIWindowMenu(parent));
void wxMDIChildFrame::Maximize(bool maximize)
{
- wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
+ wxMDIParentFrame *parent = GetMDIParent();
if ( parent && parent->GetClientWindow() )
{
::SendMessage(GetWinHwnd(parent->GetClientWindow()),
void wxMDIChildFrame::Restore()
{
- wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
+ wxMDIParentFrame *parent = GetMDIParent();
if ( parent && parent->GetClientWindow() )
{
::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIRESTORE,
void wxMDIChildFrame::Activate()
{
- wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
+ wxMDIParentFrame *parent = GetMDIParent();
if ( parent && parent->GetClientWindow() )
{
::SendMessage(GetWinHwnd(parent->GetClientWindow()), WM_MDIACTIVATE,
return rc;
}
-bool wxMDIChildFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd)
+bool wxMDIChildFrame::HandleCommand(WXWORD id_, WXWORD cmd, WXHWND hwnd)
{
+ // sign extend to int from short before comparing with the other int ids
+ int id = (signed short)id_;
+
// In case it's e.g. a toolbar.
if ( hwnd )
{
WXHWND hwndAct,
WXHWND hwndDeact)
{
- wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
+ wxMDIParentFrame *parent = GetMDIParent();
HMENU menuToSet = 0;
{
// we must pass the parent frame to ::TranslateAccelerator(), otherwise it
// doesn't do its job correctly for MDI child menus
- return MSWDoTranslateMessage((wxMDIChildFrame *)GetParent(), msg);
+ return MSWDoTranslateMessage(GetMDIParent(), msg);
}
// ---------------------------------------------------------------------------
void wxMDIChildFrame::MSWDestroyWindow()
{
- wxMDIParentFrame *parent = (wxMDIParentFrame *)GetParent();
+ wxMDIParentFrame *parent = GetMDIParent();
// Must make sure this handle is invalidated (set to NULL) since all sorts
// of things could happen after the child client is destroyed, but before
bool wxMDIChildFrame::ResetWindowStyle(void *vrect)
{
RECT *rect = (RECT *)vrect;
- wxMDIParentFrame* pFrameWnd = (wxMDIParentFrame *)GetParent();
+ wxMDIParentFrame* pFrameWnd = GetMDIParent();
wxMDIChildFrame* pChild = pFrameWnd->GetActiveChild();
if (!pChild || (pChild == this))
{
success = true;
::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING,
- (UINT)subMenu, _("&Window").wx_str());
+ (UINT_PTR)subMenu, _("&Window").wx_str());
break;
}
}
if ( !success )
{
- ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _("&Window").wx_str());
+ ::AppendMenu(hmenu, MF_POPUP,
+ (UINT_PTR)subMenu, _("&Window").wx_str());
}
}