Lots of fixes for OS/2
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -288,8 +288,6 @@ protected:
|
||||
wxAcceleratorTable m_vAccelTable;
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
wxFrame* m_pMenuBarFrame;
|
||||
|
||||
private:
|
||||
//
|
||||
// Virtual function hiding suppression
|
||||
|
@@ -896,9 +896,13 @@ bool wxApp::ProcessMessage(
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
//
|
||||
// We must relay Timer events to wxTimer's processing function
|
||||
// Pass non-system timer messages to the wxTimerProc
|
||||
//
|
||||
if (pMsg->msg == WM_TIMER)
|
||||
if (pMsg->msg == WM_TIMER &&
|
||||
(SHORT1FROMMP(pMsg->mp1) != TID_CURSOR &&
|
||||
SHORT1FROMMP(pMsg->mp1) != TID_FLASHWINDOW &&
|
||||
SHORT1FROMMP(pMsg->mp1) != TID_SCROLL
|
||||
))
|
||||
wxTimerProc(NULL, 0, (int)pMsg->mp1, 0);
|
||||
|
||||
//
|
||||
|
@@ -100,7 +100,7 @@ bool wxButton::Create(
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
//
|
||||
SubclassWin(m_hWnd);
|
||||
SetFont(pParent->GetFont());
|
||||
SetFont(*wxSMALL_FONT);
|
||||
SetSize( rPos.x
|
||||
,rPos.y
|
||||
,rSize.x
|
||||
|
@@ -131,7 +131,7 @@ bool wxCheckBox::Create(
|
||||
,(PVOID)&lColor
|
||||
);
|
||||
|
||||
SetFont(pParent->GetFont());
|
||||
SetFont(*wxSMALL_FONT);
|
||||
|
||||
SetSize( nX
|
||||
,nY
|
||||
|
@@ -143,7 +143,7 @@ bool wxComboBox::Create(
|
||||
//
|
||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
||||
|
||||
SetFont(pParent->GetFont());
|
||||
SetFont(*wxSMALL_FONT);
|
||||
|
||||
int i;
|
||||
|
||||
|
@@ -144,7 +144,6 @@ bool wxFrame::Create(
|
||||
,rsName
|
||||
))
|
||||
return FALSE;
|
||||
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
|
||||
wxModelessWindows.Append(this);
|
||||
return TRUE;
|
||||
} // end of wxFrame::Create
|
||||
|
@@ -179,7 +179,7 @@ bool wxListBox::Create(
|
||||
{
|
||||
Append(asChoices[lUi]);
|
||||
}
|
||||
SetFont(pParent->GetFont());
|
||||
SetFont(*wxSMALL_FONT);
|
||||
|
||||
//
|
||||
// Set standard wxWindows colors for Listbox items and highlighting
|
||||
|
@@ -628,7 +628,7 @@ wxMenuItem* wxMenu::FindItem(
|
||||
void wxMenuBar::Init()
|
||||
{
|
||||
m_eventHandler = this;
|
||||
m_pMenuBarFrame = NULL;
|
||||
m_menuBarFrame = NULL;
|
||||
m_hMenu = 0;
|
||||
} // end of wxMenuBar::Init
|
||||
|
||||
@@ -673,7 +673,7 @@ void wxMenuBar::Refresh()
|
||||
{
|
||||
wxCHECK_RET( IsAttached(), wxT("can't refresh unatteched menubar") );
|
||||
|
||||
WinSendMsg(GetWinHwnd(m_pMenuBarFrame), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
|
||||
WinSendMsg(GetWinHwnd(m_menuBarFrame), WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0);
|
||||
} // end of wxMenuBar::Refresh
|
||||
|
||||
WXHMENU wxMenuBar::Create()
|
||||
@@ -689,8 +689,8 @@ WXHMENU wxMenuBar::Create()
|
||||
//
|
||||
// Menubars should be associated with a frame otherwise they are popups
|
||||
//
|
||||
if (m_pMenuBarFrame != NULL)
|
||||
hFrame = GetWinHwnd(m_pMenuBarFrame);
|
||||
if (m_menuBarFrame != NULL)
|
||||
hFrame = GetWinHwnd(m_menuBarFrame);
|
||||
else
|
||||
hFrame = HWND_DESKTOP;
|
||||
//
|
||||
@@ -900,8 +900,6 @@ bool wxMenuBar::Insert(
|
||||
,nPos
|
||||
);
|
||||
|
||||
pMenu->Attach(this);
|
||||
|
||||
if (IsAttached())
|
||||
{
|
||||
::WinSendMsg((HWND)m_hMenu, MM_INSERTITEM, (MPARAM)&pMenu->m_vMenuData, (MPARAM)Title.c_str());
|
||||
@@ -1024,7 +1022,7 @@ void wxMenuBar::Attach(
|
||||
)
|
||||
{
|
||||
wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
|
||||
m_pMenuBarFrame = pFrame;
|
||||
m_menuBarFrame = pFrame;
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
RebuildAccelTable();
|
||||
@@ -1043,7 +1041,7 @@ void wxMenuBar::Detach()
|
||||
{
|
||||
::WinDestroyWindow((HWND)m_hMenu);
|
||||
m_hMenu = (WXHMENU)NULL;
|
||||
m_pMenuBarFrame = NULL;
|
||||
m_menuBarFrame = NULL;
|
||||
} // end of wxMenuBar::Detach
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@@ -329,7 +329,7 @@ bool wxSlider::Create(
|
||||
m_hWnd = (WXHWND)hScrollBar;
|
||||
SubclassWin(GetHWND());
|
||||
::WinSetWindowText((HWND)m_hWnd, "");
|
||||
SetFont(pParent->GetFont());
|
||||
SetFont(*wxSMALL_FONT);
|
||||
if (m_windowStyle & wxSL_LABELS)
|
||||
{
|
||||
//
|
||||
|
@@ -141,7 +141,7 @@ bool wxSpinButton::Create(
|
||||
::WinQueryWindowPos(m_hWnd, &vSwp);
|
||||
SetXComp(vSwp.x);
|
||||
SetYComp(vSwp.y);
|
||||
SetFont(pParent->GetFont());
|
||||
SetFont(*wxSMALL_FONT);
|
||||
//
|
||||
// For OS/2 we want to hide the text portion so we can substitute an
|
||||
// independent text ctrl in its place. 10 device units does this
|
||||
|
@@ -187,7 +187,7 @@ bool wxSpinCtrl::Create(
|
||||
m_hWndBuddy = m_hWnd; // One in the same for OS/2
|
||||
if(pParent)
|
||||
pParent->AddChild((wxSpinButton *)this);
|
||||
SetFont(pParent->GetFont());
|
||||
SetFont(*wxSMALL_FONT);
|
||||
::WinQueryWindowPos(m_hWnd, &vSwp);
|
||||
SetXComp(vSwp.x);
|
||||
SetYComp(vSwp.y);
|
||||
|
@@ -93,7 +93,7 @@ bool wxStaticBitmap::Create(
|
||||
|
||||
// Subclass again for purposes of dialog editing mode
|
||||
SubclassWin(m_hWnd);
|
||||
SetFont(GetParent()->GetFont());
|
||||
SetFont(*wxSMALL_FONT);
|
||||
SetSize(nX, nY, nWidth, nHeight);
|
||||
return(FALSE);
|
||||
}
|
||||
|
@@ -79,7 +79,7 @@ bool wxStaticBox::Create(
|
||||
,sizeof(LONG)
|
||||
,(PVOID)&lColor
|
||||
);
|
||||
SetFont(pParent->GetFont());
|
||||
SetFont(*wxSMALL_FONT);
|
||||
SetSize( rPos.x
|
||||
,rPos.y
|
||||
,rSize.x
|
||||
|
@@ -110,7 +110,7 @@ bool wxStaticText::Create(
|
||||
);
|
||||
|
||||
SubclassWin(m_hWnd);
|
||||
wxControl::SetFont(pParent->GetFont());
|
||||
wxControl::SetFont(*wxSMALL_FONT);
|
||||
SetSize( nX
|
||||
,nY
|
||||
,nWidth
|
||||
|
@@ -208,16 +208,7 @@ bool wxTextCtrl::Create(
|
||||
//
|
||||
// Set font, position, size and initial value
|
||||
//
|
||||
wxFont& vFontParent = pParent->GetFont();
|
||||
|
||||
if (vFontParent.Ok())
|
||||
{
|
||||
SetFont(vFontParent);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetFont(wxSystemSettings::GetFont(wxSYS_SYSTEM_FONT));
|
||||
}
|
||||
SetFont(*wxSMALL_FONT);
|
||||
if (!rsValue.IsEmpty())
|
||||
{
|
||||
SetValue(rsValue);
|
||||
|
@@ -351,7 +351,7 @@ bool wxTopLevelWindowOS2::CreateFrame(
|
||||
wxAssociateWinWithHandle(m_hWnd, this);
|
||||
wxAssociateWinWithHandle(m_hFrame, this);
|
||||
|
||||
m_backgroundColour.Set(wxString("DARK GREY"));
|
||||
m_backgroundColour.Set(wxString("MEDIUM GREY"));
|
||||
|
||||
LONG lColor = (LONG)m_backgroundColour.GetPixel();
|
||||
|
||||
|
@@ -1051,9 +1051,20 @@ void wxWindowOS2::SubclassWin(
|
||||
{
|
||||
HWND hwnd = (HWND)hWnd;
|
||||
|
||||
wxASSERT_MSG( !m_fnOldWndProc, wxT("subclassing window twice?") );
|
||||
wxCHECK_RET(::WinIsWindow(vHabmain, hwnd), wxT("invalid HWND in SubclassWin") );
|
||||
wxAssociateWinWithHandle( hWnd
|
||||
,(wxWindow*)this
|
||||
);
|
||||
if (!wxCheckWindowWndProc( hWnd
|
||||
,(WXFARPROC)wxWndProc
|
||||
))
|
||||
{
|
||||
m_fnOldWndProc = (WXFARPROC) ::WinSubclassWindow(hwnd, (PFNWP)wxWndProc);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fnOldWndProc = (WXFARPROC)NULL;
|
||||
}
|
||||
} // end of wxWindowOS2::SubclassWin
|
||||
|
||||
void wxWindowOS2::UnsubclassWin()
|
||||
@@ -3025,6 +3036,10 @@ bool wxWindowOS2::OS2Create(
|
||||
// the actual Frame's size, not its client
|
||||
//
|
||||
if (pParent)
|
||||
{
|
||||
if ( pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)) ||
|
||||
pParent->IsKindOf(CLASSINFO(wxScrolledWindow))
|
||||
)
|
||||
{
|
||||
if (IsKindOf(CLASSINFO(wxStatusBar)) &&
|
||||
pParent->IsKindOf(CLASSINFO(wxFrame)))
|
||||
@@ -3038,6 +3053,7 @@ bool wxWindowOS2::OS2Create(
|
||||
else
|
||||
nY = pParent->GetSize().y - (nY + nHeight);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RECTL vRect;
|
||||
|
Reference in New Issue
Block a user