Lots of fixes for scrolling

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster 2002-01-31 22:48:09 +00:00
parent ffd0623c11
commit b3260bce47
19 changed files with 206 additions and 160 deletions

View File

@ -901,7 +901,8 @@ bool wxApp::ProcessMessage(
if (pMsg->msg == WM_TIMER &&
(SHORT1FROMMP(pMsg->mp1) != TID_CURSOR &&
SHORT1FROMMP(pMsg->mp1) != TID_FLASHWINDOW &&
SHORT1FROMMP(pMsg->mp1) != TID_SCROLL
SHORT1FROMMP(pMsg->mp1) != TID_SCROLL &&
SHORT1FROMMP(pMsg->mp1) != 0x0000
))
wxTimerProc(NULL, 0, (int)pMsg->mp1, 0);

View File

@ -71,14 +71,6 @@ bool wxButton::Create(
//
if (m_windowStyle & wxCLIP_SIBLINGS )
lStyle |= WS_CLIPSIBLINGS;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lStyle |= WS_CLIPSIBLINGS;
m_hWnd = (WXHWND)::WinCreateWindow( GetHwndOf(pParent) // Parent handle
,WC_BUTTON // A Button class window
@ -113,6 +105,7 @@ bool wxButton::Create(
,rSize.x
,rSize.y
);
delete pButtonFont;
return TRUE;
} // end of wxButton::Create

View File

@ -97,15 +97,6 @@ bool wxCheckBox::Create(
if (lStyle & wxCLIP_SIBLINGS )
lSstyle |= WS_CLIPSIBLINGS;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lSstyle |= WS_CLIPSIBLINGS;
m_hWnd = (WXHWND)::WinCreateWindow ( GetHwndOf(pParent)
,WC_BUTTON
,rsLabel.c_str()
@ -131,13 +122,18 @@ bool wxCheckBox::Create(
,(PVOID)&lColor
);
SetFont(*wxSMALL_FONT);
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
SetFont(*pTextFont);
SetSize( nX
,nY
,nWidth
,nHeight
);
delete pTextFont;
return TRUE;
} // end of wxCheckBox::Create

View File

@ -77,12 +77,18 @@ bool wxChoice::Create(
{
Append(asChoices[i]);
}
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
SetFont(*pTextFont);
SetSize( rPos.x
,rPos.y
,rSize.x
,rSize.y
);
delete pTextFont;
return TRUE;
} // end of wxChoice::Create

View File

@ -143,10 +143,14 @@ bool wxComboBox::Create(
//
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
SetFont(*wxSMALL_FONT);
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
SetFont(*pTextFont);
int i;
for (i = 0; i < n; i++)
{
Append(asChoices[i]);
@ -165,6 +169,7 @@ bool wxComboBox::Create(
,(PFNWP)wxComboEditWndProc
);
::WinSetWindowULong(GetHwnd(), QWL_USER, (ULONG)this);
delete pTextFont;
return TRUE;
} // end of wxComboBox::Create

View File

@ -140,15 +140,6 @@ bool wxControl::OS2CreateControl(
zClass = WC_BUTTON;
dwStyle |= WS_VISIBLE;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
dwStyle |= WS_CLIPSIBLINGS;
m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
,(PSZ)zClass // Window class
,(PSZ)rsLabel.c_str() // Initial Text

View File

@ -156,15 +156,6 @@ bool wxGauge::Create(
if (m_windowStyle & wxCLIP_SIBLINGS)
lMsStyle |= WS_CLIPSIBLINGS;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lMsStyle |= WS_CLIPSIBLINGS;
m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
,WC_ENTRYFIELD // Window class
,(PSZ)NULL // Initial Text
@ -185,7 +176,12 @@ bool wxGauge::Create(
::WinQueryWindowPos(m_hWnd, &vSwp);
SetXComp(vSwp.x);
SetYComp(vSwp.y);
SetFont(pParent->GetFont());
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
SetFont(*pTextFont);
if (nWidth == -1L)
nWidth = 50L;
if (nHeight == -1L)
@ -196,6 +192,7 @@ bool wxGauge::Create(
,nHeight
);
::WinShowWindow((HWND)GetHWND(), TRUE);
delete pTextFont;
return TRUE;
} // end of wxGauge::Create

View File

@ -143,15 +143,6 @@ bool wxListBox::Create(
//
lStyle |= LS_NOADJUSTPOS;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lStyle |= WS_CLIPSIBLINGS;
m_hWnd = (WXHWND)::WinCreateWindow( GetWinHwnd(pParent) // Parent
,WC_LISTBOX // Default Listbox class
,"LISTBOX" // Control's name
@ -179,7 +170,12 @@ bool wxListBox::Create(
{
Append(asChoices[lUi]);
}
SetFont(*wxSMALL_FONT);
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
SetFont(*pTextFont);
//
// Set standard wxWindows colors for Listbox items and highlighting
@ -208,6 +204,7 @@ bool wxListBox::Create(
,nWidth
,nHeight
);
delete pTextFont;
return TRUE;
} // end of wxListBox::Create

View File

@ -399,7 +399,6 @@ bool wxOwnerDrawn::OnDrawItem(
,&vLine
);
::GpiMove(hPS, &vPnt1);
char zMsg[128];
::GpiBox( hPS
,DRO_OUTLINE
,&vPnt2

View File

@ -264,7 +264,11 @@ bool wxRadioBox::Create(
// System fonts are too big in OS/2 and they are blue
// We want smaller fonts and black by default.
//
wxFont& rFont = *wxSMALL_FONT;
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
wxColour vColour;
LONG lColor;
@ -319,9 +323,9 @@ bool wxRadioBox::Create(
m_pnRadioWidth = new int[nNum];
m_pnRadioHeight = new int[nNum];
if (rFont.Ok())
if (pTextFont->Ok())
{
hFont = rFont.GetResourceHandle();
hFont = pTextFont->GetResourceHandle();
}
for (int i = 0; i < nNum; i++)
@ -365,7 +369,7 @@ bool wxRadioBox::Create(
m_ahRadioButtons[i] = (WXHWND)hWndBtn;
SubclassRadioButton((WXHWND)hWndBtn);
wxOS2SetFont( hWndBtn
,rFont
,*pTextFont
);
::WinSetWindowULong(hWndBtn, QWL_USER, (ULONG)this);
m_aSubControls.Add(nNewId);
@ -385,7 +389,7 @@ bool wxRadioBox::Create(
,NULL
,NULL
);
SetFont(*wxSMALL_FONT);
SetFont(*pTextFont);
lColor = (LONG)vColour.GetPixel();
::WinSetPresParam( m_hWnd
,PP_FOREGROUNDCOLOR
@ -405,6 +409,7 @@ bool wxRadioBox::Create(
,rSize.x
,rSize.y
);
delete pTextFont;
return TRUE;
} // end of wxRadioBox::Create

View File

@ -85,12 +85,18 @@ bool wxRadioButton::Create(
if (HasFlag(wxRB_GROUP))
SetValue(TRUE);
SetFont(*wxSMALL_FONT);
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
SetFont(*pTextFont);
SetSize( rPos.x
,rPos.y
,rSize.x
,rSize.y
);
delete pTextFont;
return TRUE;
} // end of wxRadioButton::Create

View File

@ -96,7 +96,7 @@ void wxSlider::AdjustSubControls(
,(LONG)nYOffset
,(LONG)nNewWidth
,(LONG)nValueHeight
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
,SWP_SIZE | SWP_MOVE
);
}
::WinSetWindowPos( (HWND)m_hStaticMin
@ -105,7 +105,7 @@ void wxSlider::AdjustSubControls(
,(LONG)nYOffset
,(LONG)nMinLen
,(LONG)nCy
,SWP_ZORDER | SWP_SIZE | SWP_MOVE | SWP_SHOW
,SWP_SIZE | SWP_MOVE
);
nXOffset += nWidth + nCx;
@ -201,15 +201,6 @@ bool wxSlider::Create(
{
lMsStyle |= WS_VISIBLE | SS_TEXT | DT_VCENTER;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lMsStyle |= WS_CLIPSIBLINGS;
m_hStaticValue = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
,WC_STATIC // Window class
,(PSZ)NULL // Initial Text
@ -229,14 +220,6 @@ bool wxSlider::Create(
lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
if (m_windowStyle & wxCLIP_SIBLINGS)
lWstyle |= WS_CLIPSIBLINGS;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lWstyle |= WS_CLIPSIBLINGS;
m_hStaticMin = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
,WC_STATIC // Window class
@ -282,15 +265,6 @@ bool wxSlider::Create(
else
lMsStyle |= SLS_PRIMARYSCALE2;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lMsStyle |= WS_CLIPSIBLINGS;
m_nPageSize = ((nMaxValue - nMinValue)/10);
vSlData.usScale1Increments = m_nPageSize;
vSlData.usScale2Increments = m_nPageSize;
@ -329,7 +303,13 @@ bool wxSlider::Create(
m_hWnd = (WXHWND)hScrollBar;
SubclassWin(GetHWND());
::WinSetWindowText((HWND)m_hWnd, "");
SetFont(*wxSMALL_FONT);
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
SetFont(*pTextFont);
if (m_windowStyle & wxSL_LABELS)
{
//
@ -339,14 +319,6 @@ bool wxSlider::Create(
lWstyle = SS_TEXT|DT_LEFT|WS_VISIBLE;
if (m_windowStyle & wxCLIP_SIBLINGS)
lMsStyle |= WS_CLIPSIBLINGS;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lWstyle |= WS_CLIPSIBLINGS;
m_hStaticMax = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
,WC_STATIC // Window class
@ -441,6 +413,7 @@ bool wxSlider::Create(
,(PVOID)&lColor
);
SetValue(nValue);
delete pTextFont;
return TRUE;
} // end of wxSlider::Create

View File

@ -102,15 +102,6 @@ bool wxSpinButton::Create(
if (m_windowStyle & wxCLIP_SIBLINGS )
lSstyle |= WS_CLIPSIBLINGS;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lSstyle |= WS_CLIPSIBLINGS;
SPBCDATA vCtrlData;
vCtrlData.cbSize = sizeof(SPBCDATA);
@ -141,7 +132,12 @@ bool wxSpinButton::Create(
::WinQueryWindowPos(m_hWnd, &vSwp);
SetXComp(vSwp.x);
SetYComp(vSwp.y);
SetFont(*wxSMALL_FONT);
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
SetFont(*pTextFont);
//
// 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
@ -156,6 +152,7 @@ bool wxSpinButton::Create(
);
::WinSetWindowULong(GetHwnd(), QWL_USER, (LONG)this);
fnWndProcSpinCtrl = (WXFARPROC)::WinSubclassWindow(m_hWnd, (PFNWP)wxSpinCtrlWndProc);
delete pTextFont;
return TRUE;
} // end of wxSpinButton::Create

View File

@ -151,15 +151,6 @@ bool wxSpinCtrl::Create(
if (m_windowStyle & wxCLIP_SIBLINGS )
lSstyle |= WS_CLIPSIBLINGS;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lSstyle |= WS_CLIPSIBLINGS;
SPBCDATA vCtrlData;
vCtrlData.cbSize = sizeof(SPBCDATA);
@ -187,7 +178,12 @@ bool wxSpinCtrl::Create(
m_hWndBuddy = m_hWnd; // One in the same for OS/2
if(pParent)
pParent->AddChild((wxSpinButton *)this);
SetFont(*wxSMALL_FONT);
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
SetFont(*pTextFont);
::WinQueryWindowPos(m_hWnd, &vSwp);
SetXComp(vSwp.x);
SetYComp(vSwp.y);
@ -209,6 +205,7 @@ bool wxSpinCtrl::Create(
::WinSetWindowULong(GetHwnd(), QWL_USER, (LONG)this);
fnWndProcSpinCtrl = (WXFARPROC)::WinSubclassWindow(m_hWnd, (PFNWP)wxSpinCtrlWndProc);
m_svAllSpins.Add(this);
delete pTextFont;
return TRUE;
} // end of wxSpinCtrl::Create

View File

@ -79,12 +79,18 @@ bool wxStaticBox::Create(
,sizeof(LONG)
,(PVOID)&lColor
);
SetFont(*wxSMALL_FONT);
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
SetFont(*pTextFont);
SetSize( rPos.x
,rPos.y
,rSize.x
,rSize.y
);
delete pTextFont;
return TRUE;
} // end of wxStaticBox::Create

View File

@ -67,15 +67,6 @@ bool wxStaticText::Create(
lSstyle |= DT_RIGHT;
else
lSstyle |= DT_LEFT;
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lSstyle |= WS_CLIPSIBLINGS;
m_hWnd = (WXHWND)::WinCreateWindow( (HWND)GetHwndOf(pParent) // Parent window handle
,WC_STATIC // Window class
,(PSZ)rsLabel.c_str() // Initial Text
@ -110,12 +101,18 @@ bool wxStaticText::Create(
);
SubclassWin(m_hWnd);
wxControl::SetFont(*wxSMALL_FONT);
wxFont* pTextFont = new wxFont( 10
,wxMODERN
,wxNORMAL
,wxNORMAL
);
wxControl::SetFont(*pTextFont);
SetSize( nX
,nY
,nWidth
,nHeight
);
delete pTextFont;
return TRUE;
} // end of wxStaticText::Create

View File

@ -154,14 +154,6 @@ bool wxTextCtrl::Create(
if (m_windowStyle & wxTE_PASSWORD) // hidden input
lSstyle |= ES_UNREADABLE;
}
//
// If the parent is a scrolled window the controls must
// have this style or they will overlap the scrollbars
//
if (pParent)
if (pParent->IsKindOf(CLASSINFO(wxScrolledWindow)) ||
pParent->IsKindOf(CLASSINFO(wxGenericScrolledWindow)))
lSstyle |= WS_CLIPSIBLINGS;
if (m_bIsMLE)
{
@ -231,6 +223,7 @@ bool wxTextCtrl::Create(
,rSize.x
,rSize.y
);
delete pTextFont;
return TRUE;
} // end of wxTextCtrl::Create
@ -320,7 +313,10 @@ void wxTextCtrl::WriteText(
const wxString& rsValue
)
{
::WinSendMsg(GetHwnd(), MLM_INSERT, MPARAM((PCHAR)rsValue.c_str()), MPARAM(0));
if (m_bIsMLE)
::WinSendMsg(GetHwnd(), MLM_INSERT, MPARAM((PCHAR)rsValue.c_str()), MPARAM(0));
else
::WinSetWindowText(GetHwnd(), rsValue.c_str());
AdjustSpaceLimit();
} // end of wxTextCtrl::WriteText

View File

@ -281,6 +281,7 @@ bool wxTopLevelWindowOS2::CreateDialog(
{
return FALSE;
}
::WinSetWindowPos( GetHwnd()
,HWND_TOP
,nX
@ -289,9 +290,6 @@ bool wxTopLevelWindowOS2::CreateDialog(
,nHeight
,SWP_MOVE | SWP_SIZE | SWP_ZORDER | SWP_SHOW
);
//
// Set the m_hFrame to m_hWnd for Dialogs
//
m_hFrame = m_hWnd;
SubclassWin(m_hWnd);
return TRUE;

View File

@ -766,6 +766,7 @@ void wxWindowOS2::SetScrollbar(
HWND hWnd = GetHwnd();
ULONG ulStyle = WS_VISIBLE;
RECTL vRect;
SWP vSwp;
::WinQueryWindowRect(hWnd, &vRect);
if (nPageSize > 1 && nRange > 0)
@ -783,18 +784,13 @@ void wxWindowOS2::SetScrollbar(
ulStyle |= SBS_HORZ;
if (m_hWndScrollBarHorz == 0L)
{
//
// We create the scrollbars with the desktop so that they are not
// registered as child windows of the window in order that child
// windows may be scrolled without scrolling the scrollbars themselves!
//
m_hWndScrollBarHorz = ::WinCreateWindow( hWnd
,WC_SCROLLBAR
,(PSZ)NULL
,ulStyle
,vRect.xLeft
,vRect.yBottom
,vRect.xRight - vRect.xLeft
,vRect.xRight - vRect.xLeft - 20
,20
,hWnd
,HWND_TOP
@ -824,7 +820,7 @@ void wxWindowOS2::SetScrollbar(
,HWND_TOP
,vRect.xLeft
,vRect.yBottom
,vRect.xRight - vRect.xLeft
,vRect.xRight - vRect.xLeft - 20
,20
,SWP_ACTIVATE | SWP_MOVE | SWP_SIZE | SWP_SHOW
);
@ -894,25 +890,24 @@ void wxWindowOS2::ScrollWindow(
{
nDy *= -1; // flip the sign of Dy as OS/2 is opposite Windows.
RECTL vRect;
RECTL vRect2;
RECTL vRectHorz;
RECTL vRectVert;
RECTL vRectChild;
if (pRect)
{
vRect2.xLeft = pRect->x;
vRect2.yTop = pRect->y + pRect->height;
vRect2.xRight = pRect->x + pRect->width;
vRect2.yBottom = pRect->y;
vRect.xLeft = pRect->x;
vRect.yTop = pRect->y + pRect->height;
vRect.xRight = pRect->x + pRect->width;
vRect.yBottom = pRect->y;
}
else
{
::WinQueryWindowRect(GetHwnd(), &vRect);
::WinQueryWindowRect(m_hWndScrollBarHorz, &vRectHorz);
vRect2.yBottom += vRect.yTop - vRect.yBottom;
vRect.yBottom += vRectHorz.yTop - vRectHorz.yBottom;
::WinQueryWindowRect(m_hWndScrollBarVert, &vRectVert);
vRect2.xRight -= vRect.xRight - vRect.xLeft;
vRect.xRight -= vRectVert.xRight - vRectVert.xLeft;
}
::WinScrollWindow( GetHwnd()
@ -924,9 +919,6 @@ void wxWindowOS2::ScrollWindow(
,NULL
,SW_INVALIDATERGN
);
::WinInvalidateRect(m_hWndScrollBarHorz, &vRectHorz, FALSE);
::WinInvalidateRect(m_hWndScrollBarVert, &vRectVert, FALSE);
//
// Move the children
//
@ -940,7 +932,7 @@ void wxWindowOS2::ScrollWindow(
if (pChildWin->GetHWND() != NULLHANDLE)
{
::WinQueryWindowPos(pChildWin->GetHWND(), &vSwp);
::WinQueryWindowRect(pChildWin->GetHWND(), &vRectChild);
::WinQueryWindowRect(pChildWin->GetHWND(), &vRect);
if (pChildWin->IsKindOf(CLASSINFO(wxControl)))
{
wxControl* pCtrl;
@ -960,7 +952,7 @@ void wxWindowOS2::ScrollWindow(
,vSwp.y + nDy
,0
,0
,SWP_MOVE | SWP_ZORDER
,SWP_MOVE
);
if (pChildWin->IsKindOf(CLASSINFO(wxRadioBox)))
{
@ -990,6 +982,38 @@ void wxWindowOS2::ScrollWindow(
}
pCurrent = pCurrent->GetNext();
}
if (GetChildren().GetCount() > 0)
{
//
// Clean up child window slop
//
::WinQueryWindowRect(GetHwnd(), &vRect);
vRect.xRight -= 20;
vRect.yBottom += 20;
::WinInvalidateRect(GetHwnd(), &vRect, TRUE);
}
//
// Takes a lot to keep the scrollbars on top of everything
//
::WinSetWindowPos( m_hWndScrollBarHorz
,HWND_TOP
,0
,0
,0
,0
,SWP_ZORDER
);
::WinSetWindowPos( m_hWndScrollBarVert
,HWND_TOP
,0
,0
,0
,0
,SWP_ZORDER
);
::WinInvalidateRect(m_hWndScrollBarHorz, &vRectHorz, FALSE);
::WinInvalidateRect(m_hWndScrollBarVert, &vRectVert, FALSE);
} // end of wxWindowOS2::ScrollWindow
// ---------------------------------------------------------------------------
@ -4063,12 +4087,12 @@ void wxWindowOS2::MoveChildren(
vSwp.x -= pCtrl->GetXComp();
}
::WinSetWindowPos( GetHwndOf(pWin)
,HWND_TOP
,HWND_BOTTOM
,vSwp.x
,vSwp.y - nDiff
,vSwp.cx
,vSwp.cy
,SWP_MOVE
,SWP_MOVE | SWP_ZORDER
);
if (pWin->IsKindOf(CLASSINFO(wxRadioBox)))
{
@ -4094,6 +4118,68 @@ void wxWindowOS2::MoveChildren(
,(int)pSlider->GetSizeFlags()
);
}
//
// Originally created before Panel was properly sized, most likely.
// So now the the panel is sized correctly, resize the scrollbars
// and bring them to the top of all the other panel children
//
if (m_hWndScrollBarVert != NULLHANDLE ||
m_hWndScrollBarHorz != NULLHANDLE)
{
RECTL vRect;
::WinQueryWindowRect(GetHwnd(), &vRect);
::WinQueryWindowPos(m_hWndScrollBarHorz, &vSwp);
if ( (vRect.xRight - vRect.xLeft) - vSwp.cx != 20)
{
::WinSetWindowPos( m_hWndScrollBarHorz
,HWND_TOP
,0
,0
,(vRect.xRight - vRect.xLeft) - 20
,vSwp.cy
,SWP_ZORDER | SWP_SIZE
);
}
else
{
::WinSetWindowPos( m_hWndScrollBarHorz
,HWND_TOP
,0
,0
,0
,0
,SWP_ZORDER
);
}
::WinQueryWindowPos(m_hWndScrollBarVert, &vSwp);
if ( (vRect.yTop - vRect.yBottom) - vSwp.cy != 20)
{
::WinSetWindowPos( m_hWndScrollBarVert
,HWND_TOP
,vSwp.x
,vSwp.y + 20
,vSwp.cx
,(vRect.yTop - vRect.yBottom) - 20
,SWP_ZORDER | SWP_SIZE | SWP_MOVE
);
}
else
{
::WinSetWindowPos( m_hWndScrollBarVert
,HWND_TOP
,0
,0
,0
,0
,SWP_ZORDER
);
}
::WinQueryWindowRect(m_hWndScrollBarHorz, &vRect);
::WinInvalidateRect(m_hWndScrollBarHorz, &vRect, FALSE);
::WinQueryWindowRect(m_hWndScrollBarVert, &vRect);
::WinInvalidateRect(m_hWndScrollBarVert, &vRect, FALSE);
}
}
} // end of wxWindowOS2::MoveChildren