Display child panels, and make unneeded scrollbars disappear and reappear when needed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14148 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2002-02-12 06:00:27 +00:00
parent ccd970b13b
commit 524d72c4cb

View File

@@ -849,6 +849,8 @@ void wxWindowOS2::SetScrollbar(
// owner in terms of the parent frame. // owner in terms of the parent frame.
// The horz bar is the same width as the owner and 20 pels high. // The horz bar is the same width as the owner and 20 pels high.
// //
if (nRange1 >= nThumbVisible)
{
::WinSetWindowPos( m_hWndScrollBarHorz ::WinSetWindowPos( m_hWndScrollBarHorz
,HWND_TOP ,HWND_TOP
,vSwp.x + vSwpOwner.x ,vSwp.x + vSwpOwner.x
@@ -870,6 +872,9 @@ void wxWindowOS2::SetScrollbar(
,(MPARAM)0 ,(MPARAM)0
); );
} }
else
::WinShowWindow(m_hWndScrollBarHorz, FALSE);
}
} }
else else
{ {
@@ -920,6 +925,8 @@ void wxWindowOS2::SetScrollbar(
// owner window). // owner window).
// It is 20 pels wide and the same height as the owner. // It is 20 pels wide and the same height as the owner.
// //
if (nRange1 >= nThumbVisible)
{
::WinSetWindowPos( m_hWndScrollBarVert ::WinSetWindowPos( m_hWndScrollBarVert
,HWND_TOP ,HWND_TOP
,vSwp.x + vSwpOwner.x + vSwpOwner.cx ,vSwp.x + vSwpOwner.x + vSwpOwner.cx
@@ -941,6 +948,9 @@ void wxWindowOS2::SetScrollbar(
,(MPARAM)0 ,(MPARAM)0
); );
} }
else
::WinShowWindow(m_hWndScrollBarVert, FALSE);
}
m_nYThumbSize = nThumbVisible; m_nYThumbSize = nThumbVisible;
} }
} // end of wxWindowOS2::SetScrollbar } // end of wxWindowOS2::SetScrollbar
@@ -1609,9 +1619,15 @@ void wxWindowOS2::DoMoveWindow(
int nAdjustHeight = 0; int nAdjustHeight = 0;
SWP vSwpScroll; SWP vSwpScroll;
if (GetScrollBarHorz() != NULLHANDLE) if (GetScrollBarHorz() == NULLHANDLE ||
!WinIsWindowShowing(GetScrollBarHorz()))
nAdjustHeight = 0L;
else
nAdjustHeight = 20L; nAdjustHeight = 20L;
if (GetScrollBarVert() != NULLHANDLE) if (GetScrollBarVert() == NULLHANDLE ||
!WinIsWindowShowing(GetScrollBarVert()))
nAdjustWidth = 0L;
else
nAdjustWidth = 20L; nAdjustWidth = 20L;
::WinQueryWindowPos(GetHWND(), &vSwpScroll); ::WinQueryWindowPos(GetHWND(), &vSwpScroll);
::WinSetWindowPos( GetHWND() ::WinSetWindowPos( GetHWND()
@@ -1622,7 +1638,7 @@ void wxWindowOS2::DoMoveWindow(
,vSwpScroll.cy - nAdjustHeight ,vSwpScroll.cy - nAdjustHeight
,SWP_MOVE | SWP_SIZE ,SWP_MOVE | SWP_SIZE
); );
nYDiff += 20; nYDiff += nAdjustHeight;
} }
MoveChildren(nYDiff); MoveChildren(nYDiff);
::WinQueryWindowPos(GetHwnd(), &m_vWinSwp); ::WinQueryWindowPos(GetHwnd(), &m_vWinSwp);
@@ -3574,7 +3590,71 @@ bool wxWindowOS2::HandlePaint()
vEvent.SetEventObject(this); vEvent.SetEventObject(this);
bProcessed = GetEventHandler()->ProcessEvent(vEvent); bProcessed = GetEventHandler()->ProcessEvent(vEvent);
return GetEventHandler()->ProcessEvent(vEvent); //bProcessed; if (!bProcessed &&
IsKindOf(CLASSINFO(wxPanel)) &&
GetChildren().GetCount() == 0
)
{
//
// OS/2 needs to process this right here, not by the default proc
// Window's default proc correctly paints everything, OS/2 does not!
//
HPS hPS;
RECTL vRect;
wxFrame* pFrame;
wxWindow* pParent;
hPS = ::WinBeginPaint( GetHwnd()
,NULLHANDLE
,&vRect
);
if(hPS)
{
::GpiCreateLogColorTable( hPS
,0L
,LCOLF_CONSECRGB
,0L
,(LONG)wxTheColourDatabase->m_nSize
,(PLONG)wxTheColourDatabase->m_palTable
);
::GpiCreateLogColorTable( hPS
,0L
,LCOLF_RGB
,0L
,0L
,NULL
);
::WinFillRect(hPS, &vRect, GetBackgroundColour().GetPixel());
if (m_dwExStyle)
{
LINEBUNDLE vLineBundle;
vLineBundle.lColor = 0x00000000; // Black
vLineBundle.usMixMode = FM_OVERPAINT;
vLineBundle.fxWidth = 1;
vLineBundle.lGeomWidth = 1;
vLineBundle.usType = LINETYPE_SOLID;
vLineBundle.usEnd = 0;
vLineBundle.usJoin = 0;
::GpiSetAttrs( hPS
,PRIM_LINE
,LBB_COLOR | LBB_MIX_MODE | LBB_WIDTH | LBB_GEOM_WIDTH | LBB_TYPE
,0L
,&vLineBundle
);
::WinQueryWindowRect(GetHwnd(), &vRect);
wxDrawBorder( hPS
,vRect
,m_dwExStyle
);
}
::WinEndPaint(hPS);
}
bProcessed = TRUE;
}
return bProcessed;
} // end of wxWindowOS2::HandlePaint } // end of wxWindowOS2::HandlePaint
bool wxWindowOS2::HandleEraseBkgnd( bool wxWindowOS2::HandleEraseBkgnd(