extern wxChar wxFrameClassName[];
extern wxMenu *wxCurrentPopupMenu;
-extern void wxAssociateWinWithHandle( HWND hWnd,wxWindow* pWin);
+extern void wxAssociateWinWithHandle( HWND hWnd
+ ,wxWindow* pWin
+ );
// ----------------------------------------------------------------------------
// event tables
sError = wxPMErrorToStr(vError);
wxLogError("Error setting parent for submenu. Error: %s\n", sError);
}
- WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
+ ::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
} // end of wxFrame::InternalSetMenuBar
//
if (lStyle & wxFULLSCREEN_NOMENUBAR)
{
- ::WinSetParent(m_hMenu, GetHWND(), FALSE);
- ::WinSetOwner(m_hMenu, GetHWND());
- ::WinSendMsg((HWND)GetHWND(), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
+ ::WinSetParent(m_hMenu, m_hFrame, FALSE);
+ ::WinSetOwner(m_hMenu, m_hFrame);
+ ::WinSendMsg((HWND)m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
}
#if wxUSE_STATUSBAR
//
// Save the 'normal' window style
//
- m_lFsOldWindowStyle = ::WinQueryWindowULong((HWND)GetHWND(), QWL_STYLE);
+ m_lFsOldWindowStyle = ::WinQueryWindowULong(m_hFrame, QWL_STYLE);
//
- // Save the old position, width & height, maximize state
+ // Save the old position, width & height, maximize state
//
m_vFsOldSize = GetRect();
m_bFsIsMaximized = IsMaximized();
//
- // Decide which window style flags to turn off
+ // Decide which window style flags to turn off
//
LONG lNewStyle = m_lFsOldWindowStyle;
LONG lOffFlags = 0;
//
// Change our window style to be compatible with full-screen mode
//
- ::WinSetWindowULong((HWND)GetHWND(), QWL_STYLE, (ULONG)lNewStyle);
+ ::WinSetWindowULong((HWND)m_hFrame, QWL_STYLE, (ULONG)lNewStyle);
//
// Resize to the size of the desktop
if ((m_lFsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0))
{
- ::WinSetParent(m_hMenu, GetHWND(), FALSE);
- ::WinSetOwner(m_hMenu, GetHWND());
- ::WinSendMsg((HWND)GetHWND(), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
+ ::WinSetParent(m_hMenu, m_hFrame, FALSE);
+ ::WinSetOwner(m_hMenu, m_hFrame);
+ ::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
}
Maximize(m_bFsIsMaximized);
- ::WinSetWindowULong( (HWND)GetHWND()
+ ::WinSetWindowULong( m_hFrame
,QWL_STYLE
,(ULONG)m_lFsOldWindowStyle
);
HPOINTER hIcon;
if (m_icon.Ok())
- hIcon = (HPOINTER)::WinSendMsg(GetHWND(), WM_QUERYICON, 0L, 0L);
+ hIcon = (HPOINTER)::WinSendMsg(m_hFrame, WM_QUERYICON, 0L, 0L);
else
hIcon = (HPOINTER)m_hDefaultIcon;
pOldClient->Show( FALSE );
::WinSetWindowUShort(pOldClient->GetHWND(), QWS_ID, (USHORT)pOldClient->GetId());
// to avoid OS/2 bug need to update frame
- ::WinSendMsg((HWND)this->GetHWND(), WM_UPDATEFRAME, (MPARAM)~0, 0);
+ ::WinSendMsg((HWND)this->GetFrame(), WM_UPDATEFRAME, (MPARAM)~0, 0);
return;
}
if( this->IsShown() )
{
this->Show();
- ::WinSendMsg(GetHWND(), WM_UPDATEFRAME, (MPARAM)~0, 0);
+ ::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)~0, 0);
}
}
wxWindow* wxFrame::GetClient()
{
- return wxFindWinFromHandle((WXHWND)::WinWindowFromID(GetHWND(), FID_CLIENT));
+ return wxFindWinFromHandle((WXHWND)::WinWindowFromID(m_hFrame, FID_CLIENT));
}
#include <stdio.h>
#endif
-#define DEBUG_PRINTF(NAME) { static int raz=0; \
- printf( #NAME " %i\n",raz); fflush(stdout); \
- raz++; \
- }
-
#if wxUSE_OWNER_DRAWN
#include "wx/ownerdrw.h"
#endif
, WXWORD WXUNUSED(uId)
)
{
-
-DEBUG_PRINTF(wxWindow::OS2Command);
-
return(FALSE);
}
m_lLastMouseY = -1;
m_nLastMouseEvent = -1;
#endif // wxUSE_MOUSEEVENT_HACK
-
-DEBUG_PRINTF(wxWindow::Init-End);
-
} // wxWindow::Init
//
//
wxWindow::~wxWindow()
{
-DEBUG_PRINTF(wxWindow::~wxWindow-Start);
m_isBeingDeleted = TRUE;
OS2DetachWindowMenu();
//
wxRemoveHandleAssociation(this);
}
-DEBUG_PRINTF(wxWindow::~wxWindow-End);
} // end of wxWindow::~wxWindow
bool wxWindow::Create(
const wxFont& rFont
)
{
-DEBUG_PRINTF(wxWindow::SetFont);
if (!wxWindowBase::SetFont(rFont))
{
// nothing to do
hPs = ::WinGetPS(GetHwnd());
if(!GpiQueryFontMetrics(hPs, sizeof(FONTMETRICS), &vFontMetrics))
+ {
+ ::WinReleasePS(hPs);
return (0);
- else
- return(vFontMetrics.lMaxAscender + vFontMetrics.lMaxDescender);
+ }
::WinReleasePS(hPs);
+ return(vFontMetrics.lMaxAscender + vFontMetrics.lMaxDescender);
} // end of wxWindow::GetCharHeight
int wxWindow::GetCharWidth() const
hPs = ::WinGetPS(GetHwnd());
if(!GpiQueryFontMetrics(hPs, sizeof(FONTMETRICS), &vFontMetrics))
+ {
+ ::WinReleasePS(hPs);
return (0);
- else
- return(vFontMetrics.lAveCharWidth);
+ }
::WinReleasePS(hPs);
+ return(vFontMetrics.lAveCharWidth);
} // end of wxWindow::GetCharWidth
void wxWindow::GetTextExtent(
, WXLPARAM lParam
)
{
-DEBUG_PRINTF(wxWindow::OS2DefWindowProc);
-
if (m_fnOldWndProc)
return (MRESULT)m_fnOldWndProc(GetHWND(), (ULONG)uMsg, (MPARAM)wParam, (MPARAM)lParam);
else
// Trace all ulMsgs - useful for the debugging
//
#ifdef __WXDEBUG__
-DEBUG_PRINTF(__WXDEBUG__wxWndProc);
wxLogTrace(wxTraceMessages, wxT("Processing %s(wParam=%8lx, lParam=%8lx)"),
wxGetMessageName(ulMsg), wParam, lParam);
#endif // __WXDEBUG__
break;
case WM_PAINT:
-DEBUG_PRINTF(WM_PAINT)
bProcessed = HandlePaint();
break;
//
bProcessed = TRUE;
mResult = (MRESULT)TRUE;
-DEBUG_PRINTF(WM_CLOSE)
break;
case WM_SHOW:
-DEBUG_PRINTF(WM_SHOW)
bProcessed = HandleShow(wParam != 0, (int)lParam);
break;
{
WORD id, cmd;
WXHWND hwnd;
-DEBUG_PRINTF(WM_COMMAND-in)
UnpackCommand(wParam, lParam, &id, &hwnd, &cmd);
bProcessed = HandleCommand(id, cmd, hwnd);
-DEBUG_PRINTF(WM_COMMAND-out)
}
break;