More OS/2 Updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -143,6 +143,7 @@ public:
|
|||||||
void SetClient(WXHWND c_Hwnd);
|
void SetClient(WXHWND c_Hwnd);
|
||||||
void SetClient(wxWindow* c_Window);
|
void SetClient(wxWindow* c_Window);
|
||||||
wxWindow *GetClient();
|
wxWindow *GetClient();
|
||||||
|
HWND GetFrame(void) const { return m_hFrame; }
|
||||||
|
|
||||||
friend MRESULT EXPENTRY wxFrameWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
|
friend MRESULT EXPENTRY wxFrameWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
|
||||||
friend MRESULT EXPENTRY wxFrameMainWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
|
friend MRESULT EXPENTRY wxFrameMainWndProc(HWND hWnd,ULONG ulMsg, MPARAM wParam, MPARAM lParam);
|
||||||
|
@@ -55,7 +55,9 @@ extern wxList WXDLLEXPORT wxPendingDelete;
|
|||||||
extern wxChar wxFrameClassName[];
|
extern wxChar wxFrameClassName[];
|
||||||
extern wxMenu *wxCurrentPopupMenu;
|
extern wxMenu *wxCurrentPopupMenu;
|
||||||
|
|
||||||
extern void wxAssociateWinWithHandle( HWND hWnd,wxWindow* pWin);
|
extern void wxAssociateWinWithHandle( HWND hWnd
|
||||||
|
,wxWindow* pWin
|
||||||
|
);
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// event tables
|
// event tables
|
||||||
@@ -630,7 +632,7 @@ void wxFrame::InternalSetMenuBar()
|
|||||||
sError = wxPMErrorToStr(vError);
|
sError = wxPMErrorToStr(vError);
|
||||||
wxLogError("Error setting parent for submenu. Error: %s\n", sError);
|
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
|
} // end of wxFrame::InternalSetMenuBar
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -706,9 +708,9 @@ bool wxFrame::ShowFullScreen(
|
|||||||
|
|
||||||
if (lStyle & wxFULLSCREEN_NOMENUBAR)
|
if (lStyle & wxFULLSCREEN_NOMENUBAR)
|
||||||
{
|
{
|
||||||
::WinSetParent(m_hMenu, GetHWND(), FALSE);
|
::WinSetParent(m_hMenu, m_hFrame, FALSE);
|
||||||
::WinSetOwner(m_hMenu, GetHWND());
|
::WinSetOwner(m_hMenu, m_hFrame);
|
||||||
::WinSendMsg((HWND)GetHWND(), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
|
::WinSendMsg((HWND)m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
@@ -732,16 +734,16 @@ bool wxFrame::ShowFullScreen(
|
|||||||
//
|
//
|
||||||
// Save the 'normal' window style
|
// 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_vFsOldSize = GetRect();
|
||||||
m_bFsIsMaximized = IsMaximized();
|
m_bFsIsMaximized = IsMaximized();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Decide which window style flags to turn off
|
// Decide which window style flags to turn off
|
||||||
//
|
//
|
||||||
LONG lNewStyle = m_lFsOldWindowStyle;
|
LONG lNewStyle = m_lFsOldWindowStyle;
|
||||||
LONG lOffFlags = 0;
|
LONG lOffFlags = 0;
|
||||||
@@ -756,7 +758,7 @@ bool wxFrame::ShowFullScreen(
|
|||||||
//
|
//
|
||||||
// Change our window style to be compatible with full-screen mode
|
// 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
|
// Resize to the size of the desktop
|
||||||
@@ -827,13 +829,13 @@ bool wxFrame::ShowFullScreen(
|
|||||||
|
|
||||||
if ((m_lFsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0))
|
if ((m_lFsStyle & wxFULLSCREEN_NOMENUBAR) && (m_hMenu != 0))
|
||||||
{
|
{
|
||||||
::WinSetParent(m_hMenu, GetHWND(), FALSE);
|
::WinSetParent(m_hMenu, m_hFrame, FALSE);
|
||||||
::WinSetOwner(m_hMenu, GetHWND());
|
::WinSetOwner(m_hMenu, m_hFrame);
|
||||||
::WinSendMsg((HWND)GetHWND(), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
|
::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
|
||||||
}
|
}
|
||||||
Maximize(m_bFsIsMaximized);
|
Maximize(m_bFsIsMaximized);
|
||||||
|
|
||||||
::WinSetWindowULong( (HWND)GetHWND()
|
::WinSetWindowULong( m_hFrame
|
||||||
,QWL_STYLE
|
,QWL_STYLE
|
||||||
,(ULONG)m_lFsOldWindowStyle
|
,(ULONG)m_lFsOldWindowStyle
|
||||||
);
|
);
|
||||||
@@ -1253,7 +1255,7 @@ bool wxFrame::HandlePaint()
|
|||||||
HPOINTER hIcon;
|
HPOINTER hIcon;
|
||||||
|
|
||||||
if (m_icon.Ok())
|
if (m_icon.Ok())
|
||||||
hIcon = (HPOINTER)::WinSendMsg(GetHWND(), WM_QUERYICON, 0L, 0L);
|
hIcon = (HPOINTER)::WinSendMsg(m_hFrame, WM_QUERYICON, 0L, 0L);
|
||||||
else
|
else
|
||||||
hIcon = (HPOINTER)m_hDefaultIcon;
|
hIcon = (HPOINTER)m_hDefaultIcon;
|
||||||
|
|
||||||
@@ -1721,7 +1723,7 @@ void wxFrame::SetClient(
|
|||||||
pOldClient->Show( FALSE );
|
pOldClient->Show( FALSE );
|
||||||
::WinSetWindowUShort(pOldClient->GetHWND(), QWS_ID, (USHORT)pOldClient->GetId());
|
::WinSetWindowUShort(pOldClient->GetHWND(), QWS_ID, (USHORT)pOldClient->GetId());
|
||||||
// to avoid OS/2 bug need to update frame
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1746,11 +1748,11 @@ void wxFrame::SetClient(
|
|||||||
if( this->IsShown() )
|
if( this->IsShown() )
|
||||||
{
|
{
|
||||||
this->Show();
|
this->Show();
|
||||||
::WinSendMsg(GetHWND(), WM_UPDATEFRAME, (MPARAM)~0, 0);
|
::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)~0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindow* wxFrame::GetClient()
|
wxWindow* wxFrame::GetClient()
|
||||||
{
|
{
|
||||||
return wxFindWinFromHandle((WXHWND)::WinWindowFromID(GetHWND(), FID_CLIENT));
|
return wxFindWinFromHandle((WXHWND)::WinWindowFromID(m_hFrame, FID_CLIENT));
|
||||||
}
|
}
|
||||||
|
@@ -37,11 +37,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEBUG_PRINTF(NAME) { static int raz=0; \
|
|
||||||
printf( #NAME " %i\n",raz); fflush(stdout); \
|
|
||||||
raz++; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#if wxUSE_OWNER_DRAWN
|
#if wxUSE_OWNER_DRAWN
|
||||||
#include "wx/ownerdrw.h"
|
#include "wx/ownerdrw.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -250,9 +245,6 @@ bool wxWindow::OS2Command(
|
|||||||
, WXWORD WXUNUSED(uId)
|
, WXWORD WXUNUSED(uId)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
DEBUG_PRINTF(wxWindow::OS2Command);
|
|
||||||
|
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,9 +294,6 @@ void wxWindow::Init()
|
|||||||
m_lLastMouseY = -1;
|
m_lLastMouseY = -1;
|
||||||
m_nLastMouseEvent = -1;
|
m_nLastMouseEvent = -1;
|
||||||
#endif // wxUSE_MOUSEEVENT_HACK
|
#endif // wxUSE_MOUSEEVENT_HACK
|
||||||
|
|
||||||
DEBUG_PRINTF(wxWindow::Init-End);
|
|
||||||
|
|
||||||
} // wxWindow::Init
|
} // wxWindow::Init
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -312,7 +301,6 @@ DEBUG_PRINTF(wxWindow::Init-End);
|
|||||||
//
|
//
|
||||||
wxWindow::~wxWindow()
|
wxWindow::~wxWindow()
|
||||||
{
|
{
|
||||||
DEBUG_PRINTF(wxWindow::~wxWindow-Start);
|
|
||||||
m_isBeingDeleted = TRUE;
|
m_isBeingDeleted = TRUE;
|
||||||
|
|
||||||
OS2DetachWindowMenu();
|
OS2DetachWindowMenu();
|
||||||
@@ -329,7 +317,6 @@ DEBUG_PRINTF(wxWindow::~wxWindow-Start);
|
|||||||
//
|
//
|
||||||
wxRemoveHandleAssociation(this);
|
wxRemoveHandleAssociation(this);
|
||||||
}
|
}
|
||||||
DEBUG_PRINTF(wxWindow::~wxWindow-End);
|
|
||||||
} // end of wxWindow::~wxWindow
|
} // end of wxWindow::~wxWindow
|
||||||
|
|
||||||
bool wxWindow::Create(
|
bool wxWindow::Create(
|
||||||
@@ -518,7 +505,6 @@ bool wxWindow::SetFont(
|
|||||||
const wxFont& rFont
|
const wxFont& rFont
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DEBUG_PRINTF(wxWindow::SetFont);
|
|
||||||
if (!wxWindowBase::SetFont(rFont))
|
if (!wxWindowBase::SetFont(rFont))
|
||||||
{
|
{
|
||||||
// nothing to do
|
// nothing to do
|
||||||
@@ -1338,10 +1324,12 @@ int wxWindow::GetCharHeight() const
|
|||||||
hPs = ::WinGetPS(GetHwnd());
|
hPs = ::WinGetPS(GetHwnd());
|
||||||
|
|
||||||
if(!GpiQueryFontMetrics(hPs, sizeof(FONTMETRICS), &vFontMetrics))
|
if(!GpiQueryFontMetrics(hPs, sizeof(FONTMETRICS), &vFontMetrics))
|
||||||
|
{
|
||||||
|
::WinReleasePS(hPs);
|
||||||
return (0);
|
return (0);
|
||||||
else
|
}
|
||||||
return(vFontMetrics.lMaxAscender + vFontMetrics.lMaxDescender);
|
|
||||||
::WinReleasePS(hPs);
|
::WinReleasePS(hPs);
|
||||||
|
return(vFontMetrics.lMaxAscender + vFontMetrics.lMaxDescender);
|
||||||
} // end of wxWindow::GetCharHeight
|
} // end of wxWindow::GetCharHeight
|
||||||
|
|
||||||
int wxWindow::GetCharWidth() const
|
int wxWindow::GetCharWidth() const
|
||||||
@@ -1352,10 +1340,12 @@ int wxWindow::GetCharWidth() const
|
|||||||
hPs = ::WinGetPS(GetHwnd());
|
hPs = ::WinGetPS(GetHwnd());
|
||||||
|
|
||||||
if(!GpiQueryFontMetrics(hPs, sizeof(FONTMETRICS), &vFontMetrics))
|
if(!GpiQueryFontMetrics(hPs, sizeof(FONTMETRICS), &vFontMetrics))
|
||||||
|
{
|
||||||
|
::WinReleasePS(hPs);
|
||||||
return (0);
|
return (0);
|
||||||
else
|
}
|
||||||
return(vFontMetrics.lAveCharWidth);
|
|
||||||
::WinReleasePS(hPs);
|
::WinReleasePS(hPs);
|
||||||
|
return(vFontMetrics.lAveCharWidth);
|
||||||
} // end of wxWindow::GetCharWidth
|
} // end of wxWindow::GetCharWidth
|
||||||
|
|
||||||
void wxWindow::GetTextExtent(
|
void wxWindow::GetTextExtent(
|
||||||
@@ -1519,8 +1509,6 @@ MRESULT wxWindow::OS2DefWindowProc(
|
|||||||
, WXLPARAM lParam
|
, WXLPARAM lParam
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DEBUG_PRINTF(wxWindow::OS2DefWindowProc);
|
|
||||||
|
|
||||||
if (m_fnOldWndProc)
|
if (m_fnOldWndProc)
|
||||||
return (MRESULT)m_fnOldWndProc(GetHWND(), (ULONG)uMsg, (MPARAM)wParam, (MPARAM)lParam);
|
return (MRESULT)m_fnOldWndProc(GetHWND(), (ULONG)uMsg, (MPARAM)wParam, (MPARAM)lParam);
|
||||||
else
|
else
|
||||||
@@ -1804,7 +1792,6 @@ MRESULT EXPENTRY wxWndProc(
|
|||||||
// Trace all ulMsgs - useful for the debugging
|
// Trace all ulMsgs - useful for the debugging
|
||||||
//
|
//
|
||||||
#ifdef __WXDEBUG__
|
#ifdef __WXDEBUG__
|
||||||
DEBUG_PRINTF(__WXDEBUG__wxWndProc);
|
|
||||||
wxLogTrace(wxTraceMessages, wxT("Processing %s(wParam=%8lx, lParam=%8lx)"),
|
wxLogTrace(wxTraceMessages, wxT("Processing %s(wParam=%8lx, lParam=%8lx)"),
|
||||||
wxGetMessageName(ulMsg), wParam, lParam);
|
wxGetMessageName(ulMsg), wParam, lParam);
|
||||||
#endif // __WXDEBUG__
|
#endif // __WXDEBUG__
|
||||||
@@ -1933,7 +1920,6 @@ MRESULT wxWindow::OS2WindowProc(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
DEBUG_PRINTF(WM_PAINT)
|
|
||||||
bProcessed = HandlePaint();
|
bProcessed = HandlePaint();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1944,11 +1930,9 @@ DEBUG_PRINTF(WM_PAINT)
|
|||||||
//
|
//
|
||||||
bProcessed = TRUE;
|
bProcessed = TRUE;
|
||||||
mResult = (MRESULT)TRUE;
|
mResult = (MRESULT)TRUE;
|
||||||
DEBUG_PRINTF(WM_CLOSE)
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SHOW:
|
case WM_SHOW:
|
||||||
DEBUG_PRINTF(WM_SHOW)
|
|
||||||
bProcessed = HandleShow(wParam != 0, (int)lParam);
|
bProcessed = HandleShow(wParam != 0, (int)lParam);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1987,11 +1971,9 @@ DEBUG_PRINTF(WM_SHOW)
|
|||||||
{
|
{
|
||||||
WORD id, cmd;
|
WORD id, cmd;
|
||||||
WXHWND hwnd;
|
WXHWND hwnd;
|
||||||
DEBUG_PRINTF(WM_COMMAND-in)
|
|
||||||
UnpackCommand(wParam, lParam, &id, &hwnd, &cmd);
|
UnpackCommand(wParam, lParam, &id, &hwnd, &cmd);
|
||||||
|
|
||||||
bProcessed = HandleCommand(id, cmd, hwnd);
|
bProcessed = HandleCommand(id, cmd, hwnd);
|
||||||
DEBUG_PRINTF(WM_COMMAND-out)
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user