Support for scrolling

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2001-05-07 04:17:46 +00:00
parent e7d5dd022c
commit 1c84ee88f6
4 changed files with 116 additions and 32 deletions

View File

@@ -552,6 +552,8 @@ private:
DECLARE_NO_COPY_CLASS(wxWindow); DECLARE_NO_COPY_CLASS(wxWindow);
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
private: private:
HWND m_hWndScrollBar;
// Virtual function hiding supression // Virtual function hiding supression
inline virtual bool Reparent(wxWindowBase* pNewParent) inline virtual bool Reparent(wxWindowBase* pNewParent)
{ return(wxWindowBase::Reparent(pNewParent));}; { return(wxWindowBase::Reparent(pNewParent));};

View File

@@ -1192,12 +1192,12 @@ void wxFrame::PositionToolBar()
} }
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR
if ( GetToolBar() ) if ( m_frameToolBar )
{ {
int nToolbarWidth; int nToolbarWidth;
int nToolbarHeight; int nToolbarHeight;
GetToolBar()->GetSize( &nToolbarWidth m_frameToolBar->GetSize( &nToolbarWidth
,&nToolbarHeight ,&nToolbarHeight
); );

View File

@@ -273,8 +273,9 @@ void wxWindow::Init()
// //
// wxWnd // wxWnd
// //
m_hMenu = 0; m_hMenu = 0L;
m_hWnd = 0; m_hWnd = 0L;
m_hWndScrollBar = 0L;
// //
// Pass WM_GETDLGCODE to DefWindowProc() // Pass WM_GETDLGCODE to DefWindowProc()
@@ -687,13 +688,74 @@ void wxWindow::SetScrollbar(
, bool bRefresh , bool bRefresh
) )
{ {
::WinSendMsg(GetHwnd(), SBM_SETSCROLLBAR, (MPARAM)nPos, MPFROM2SHORT(0, nRange)); int nOldRange = nRange - nThumbVisible;
int nRange1 = nOldRange;
int nPageSize = nThumbVisible;
SBCDATA vInfo;
HWND hWnd = GetHwnd();
ULONG ulStyle = WS_VISIBLE;
RECTL vRect;
::WinQueryWindowRect(hWnd, &vRect);
if (nPageSize > 1 && nRange > 0)
{
nRange1 += (nPageSize - 1);
}
vInfo.cb = sizeof(SBCDATA);
vInfo.posFirst = 0;
vInfo.posLast = (SHORT)nRange1;
vInfo.posThumb = nPos;
if (nOrient == wxHORIZONTAL ) if (nOrient == wxHORIZONTAL )
{ {
m_nXThumbSize = nThumbVisible; ulStyle |= SBS_HORZ;
if (m_hWndScrollBar == 0L)
{
m_hWndScrollBar = ::WinCreateWindow( hWnd
,WC_SCROLLBAR
,(PSZ)NULL
,ulStyle
,vRect.xLeft
,vRect.yBottom
,vRect.xRight - vRect.xLeft
,20
,hWnd
,HWND_TOP
,-1
,&vInfo
,NULL
);
} }
else else
{ {
::WinSendMsg(m_hWndScrollBar, SBM_SETSCROLLBAR, (MPARAM)nPos, MPFROM2SHORT(0, (SHORT)nRange1));
}
}
else
{
ulStyle |= SBS_VERT;
if (m_hWndScrollBar == 0L)
{
m_hWndScrollBar = ::WinCreateWindow( hWnd
,WC_SCROLLBAR
,(PSZ)NULL
,ulStyle
,vRect.xRight - 20
,vRect.yBottom
,20
,vRect.yTop - vRect.yBottom
,hWnd
,HWND_TOP
,-1
,&vInfo
,NULL
);
}
else
{
::WinSendMsg(m_hWndScrollBar, SBM_SETSCROLLBAR, (MPARAM)nPos, MPFROM2SHORT(0, (SHORT)nRange1));
}
m_nYThumbSize = nThumbVisible; m_nYThumbSize = nThumbVisible;
} }
} // end of wxWindow::SetScrollbar } // end of wxWindow::SetScrollbar

View File

@@ -4,7 +4,7 @@ DATA MULTIPLE NONSHARED READWRITE LOADONCALL
CODE LOADONCALL CODE LOADONCALL
EXPORTS EXPORTS
;From library: H:\Dev\Wx2\WxWindows\lib\wx.lib ;From library: F:\DEV\WX2\WXWINDOWS\LIB\WX.lib
;From object file: dummy.cpp ;From object file: dummy.cpp
;PUBDEFs (Symbols available from object file): ;PUBDEFs (Symbols available from object file):
wxDummyChar wxDummyChar
@@ -1361,6 +1361,7 @@ EXPORTS
Connect__12wxEvtHandlerFiN21M8wxObjectFR7wxEvent_vP8wxObject Connect__12wxEvtHandlerFiN21M8wxObjectFR7wxEvent_vP8wxObject
wxEVT_SOCKET wxEVT_SOCKET
wxEVT_SCROLLWIN_PAGEUP wxEVT_SCROLLWIN_PAGEUP
wxEVT_MOUSEWHEEL
wxEVT_MIDDLE_UP wxEVT_MIDDLE_UP
wxEVT_MENU_INIT wxEVT_MENU_INIT
wxEVT_HELP wxEVT_HELP
@@ -1651,7 +1652,7 @@ EXPORTS
wxEVT_NC_LEFT_DCLICK wxEVT_NC_LEFT_DCLICK
wxEVT_INIT_DIALOG wxEVT_INIT_DIALOG
wxEVT_COMMAND_SET_FOCUS wxEVT_COMMAND_SET_FOCUS
;From object file: H:\DEV\WX2\WXWINDOWS\src\common\extended.c ;From object file: F:\DEV\WX2\WXWINDOWS\src\common\extended.c
;PUBDEFs (Symbols available from object file): ;PUBDEFs (Symbols available from object file):
ConvertToIeeeExtended ConvertToIeeeExtended
ConvertFromIeeeExtended ConvertFromIeeeExtended
@@ -2296,6 +2297,8 @@ EXPORTS
wxConstructorForwxPenList__Fv wxConstructorForwxPenList__Fv
;wxGetDisplaySizeMM() ;wxGetDisplaySizeMM()
wxGetDisplaySizeMM__Fv wxGetDisplaySizeMM__Fv
;wxGetClientDisplayRect()
wxGetClientDisplayRect__Fv
;wxDeleteStockObjects() ;wxDeleteStockObjects()
wxDeleteStockObjects__Fv wxDeleteStockObjects__Fv
;wxConstructorForwxBitmapList() ;wxConstructorForwxBitmapList()
@@ -5260,7 +5263,7 @@ EXPORTS
Read32__17wxTextInputStreamFv Read32__17wxTextInputStreamFv
;wxTextInputStream::SkipIfEndOfLine(char) ;wxTextInputStream::SkipIfEndOfLine(char)
SkipIfEndOfLine__17wxTextInputStreamFc SkipIfEndOfLine__17wxTextInputStreamFc
;From object file: H:\DEV\WX2\WXWINDOWS\src\common\unzip.c ;From object file: F:\DEV\WX2\WXWINDOWS\src\common\unzip.c
;PUBDEFs (Symbols available from object file): ;PUBDEFs (Symbols available from object file):
unzReadCurrentFile unzReadCurrentFile
unzGetCurrentFileInfo unzGetCurrentFileInfo
@@ -6762,6 +6765,8 @@ EXPORTS
__vft16wxGenericDirCtrl8wxObject __vft16wxGenericDirCtrl8wxObject
;wxGenericDirDialog::OnTreeSelected(wxTreeEvent&) ;wxGenericDirDialog::OnTreeSelected(wxTreeEvent&)
OnTreeSelected__18wxGenericDirDialogFR11wxTreeEvent OnTreeSelected__18wxGenericDirDialogFR11wxTreeEvent
;setdrive(int)
setdrive__Fi
;wxDirFilterListCtrl::Init() ;wxDirFilterListCtrl::Init()
Init__19wxDirFilterListCtrlFv Init__19wxDirFilterListCtrlFv
;wxConstructorForwxGenericDirCtrl() ;wxConstructorForwxGenericDirCtrl()
@@ -8871,6 +8876,8 @@ EXPORTS
sm_classwxScrolledWindow__16wxScrolledWindow sm_classwxScrolledWindow__16wxScrolledWindow
;wxGenericScrolledWindow::OnPaint(wxPaintEvent&) ;wxGenericScrolledWindow::OnPaint(wxPaintEvent&)
OnPaint__23wxGenericScrolledWindowFR12wxPaintEvent OnPaint__23wxGenericScrolledWindowFR12wxPaintEvent
;wxGenericScrolledWindow::OnMouseWheel(wxMouseEvent&)
OnMouseWheel__23wxGenericScrolledWindowFR12wxMouseEvent
;wxGenericScrolledWindow::GetScrollPixelsPerUnit(int*,int*) const ;wxGenericScrolledWindow::GetScrollPixelsPerUnit(int*,int*) const
GetScrollPixelsPerUnit__23wxGenericScrolledWindowCFPiT1 GetScrollPixelsPerUnit__23wxGenericScrolledWindowCFPiT1
;wxGenericScrolledWindow::wxGenericScrolledWindow() ;wxGenericScrolledWindow::wxGenericScrolledWindow()
@@ -9831,38 +9838,45 @@ EXPORTS
sm_classwxHtmlTag__9wxHtmlTag sm_classwxHtmlTag__9wxHtmlTag
;From object file: ..\html\htmlwin.cpp ;From object file: ..\html\htmlwin.cpp
;PUBDEFs (Symbols available from object file): ;PUBDEFs (Symbols available from object file):
;wxHtmlWindow::SetFonts(wxString,wxString,const int*) ;wxHtmlHistoryArray::RemoveAt(unsigned int)
SetFonts__12wxHtmlWindowF8wxStringT1PCi RemoveAt__18wxHtmlHistoryArrayFUi
;wxHtmlWinModule::sm_classwxHtmlWinModule ;wxHtmlWinModule::sm_classwxHtmlWinModule
sm_classwxHtmlWinModule__15wxHtmlWinModule sm_classwxHtmlWinModule__15wxHtmlWinModule
;wxHtmlWindow::SetFonts(wxString,wxString,const int*)
SetFonts__12wxHtmlWindowF8wxStringT1PCi
;wxHtmlHistoryArray::DoCopy(const wxHtmlHistoryArray&)
DoCopy__18wxHtmlHistoryArrayFRC18wxHtmlHistoryArray
;wxHtmlHistoryArray::Add(const wxHtmlHistoryItem&)
Add__18wxHtmlHistoryArrayFRC17wxHtmlHistoryItem
;wxHtmlHistoryArray::~wxHtmlHistoryArray()
__dt__18wxHtmlHistoryArrayFv
;wxHtmlWindow::~wxHtmlWindow() ;wxHtmlWindow::~wxHtmlWindow()
__dt__12wxHtmlWindowFv __dt__12wxHtmlWindowFv
;wxHtmlWindow::HistoryCanForward() ;wxHtmlWindow::HistoryCanForward()
HistoryCanForward__12wxHtmlWindowFv HistoryCanForward__12wxHtmlWindowFv
;wxHtmlWindow::HistoryBack() ;wxHtmlWindow::HistoryBack()
HistoryBack__12wxHtmlWindowFv HistoryBack__12wxHtmlWindowFv
;wxwxHtmlProcessorListNode::DeleteData()
DeleteData__25wxwxHtmlProcessorListNodeFv
;wxHtmlWindow::AddGlobalProcessor(wxHtmlProcessor*)
AddGlobalProcessor__12wxHtmlWindowFP15wxHtmlProcessor
;wxHtmlWindow::AddFilter(wxHtmlFilter*) ;wxHtmlWindow::AddFilter(wxHtmlFilter*)
AddFilter__12wxHtmlWindowFP12wxHtmlFilter AddFilter__12wxHtmlWindowFP12wxHtmlFilter
;wxHtmlWindow::OnDraw(wxDC&) ;wxHtmlWindow::OnDraw(wxDC&)
OnDraw__12wxHtmlWindowFR4wxDC OnDraw__12wxHtmlWindowFR4wxDC
;wxHtmlWindow::m_Filters ;wxHtmlWindow::m_Filters
m_Filters__12wxHtmlWindow m_Filters__12wxHtmlWindow
;HtmlHistoryArray::Index(const HtmlHistoryItem&,unsigned long) const ;wxHtmlHistoryArray::Index(const wxHtmlHistoryItem&,unsigned long) const
Index__16HtmlHistoryArrayCFRC15HtmlHistoryItemUl Index__18wxHtmlHistoryArrayCFRC17wxHtmlHistoryItemUl
;HtmlHistoryArray::RemoveAt(unsigned int) ;wxHtmlHistoryArray::Insert(const wxHtmlHistoryItem&,unsigned int)
RemoveAt__16HtmlHistoryArrayFUi Insert__18wxHtmlHistoryArrayFRC17wxHtmlHistoryItemUi
;HtmlHistoryArray::operator=(const HtmlHistoryArray&) __vft25wxwxHtmlProcessorListNode10wxNodeBase
__as__16HtmlHistoryArrayFRC16HtmlHistoryArray ;wxHtmlHistoryArray::DoEmpty()
;HtmlHistoryArray::Insert(const HtmlHistoryItem&,unsigned int) DoEmpty__18wxHtmlHistoryArrayFv
Insert__16HtmlHistoryArrayFRC15HtmlHistoryItemUi
;HtmlHistoryArray::DoCopy(const HtmlHistoryArray&)
DoCopy__16HtmlHistoryArrayFRC16HtmlHistoryArray
;HtmlHistoryArray::Add(const HtmlHistoryItem&)
Add__16HtmlHistoryArrayFRC15HtmlHistoryItem
;HtmlHistoryArray::DoEmpty()
DoEmpty__16HtmlHistoryArrayFv
;wxConstructorForwxHtmlWinModule() ;wxConstructorForwxHtmlWinModule()
wxConstructorForwxHtmlWinModule__Fv wxConstructorForwxHtmlWinModule__Fv
;wxHtmlProcessor::sm_classwxHtmlProcessor
sm_classwxHtmlProcessor__15wxHtmlProcessor
;wxHtmlWindow::HistoryClear() ;wxHtmlWindow::HistoryClear()
HistoryClear__12wxHtmlWindowFv HistoryClear__12wxHtmlWindowFv
;wxHtmlWindow::GetEventTable() const ;wxHtmlWindow::GetEventTable() const
@@ -9883,6 +9897,10 @@ EXPORTS
OnSize__12wxHtmlWindowFR11wxSizeEvent OnSize__12wxHtmlWindowFR11wxSizeEvent
;wxHtmlWindow::OnMouseEvent(wxMouseEvent&) ;wxHtmlWindow::OnMouseEvent(wxMouseEvent&)
OnMouseEvent__12wxHtmlWindowFR12wxMouseEvent OnMouseEvent__12wxHtmlWindowFR12wxMouseEvent
;wxHtmlHistoryArray::operator=(const wxHtmlHistoryArray&)
__as__18wxHtmlHistoryArrayFRC18wxHtmlHistoryArray
;wxHtmlHistoryArray::wxHtmlHistoryArray(const wxHtmlHistoryArray&)
__ct__18wxHtmlHistoryArrayFRC18wxHtmlHistoryArray
;wxHtmlWindow::SetRelatedStatusBar(int) ;wxHtmlWindow::SetRelatedStatusBar(int)
SetRelatedStatusBar__12wxHtmlWindowFi SetRelatedStatusBar__12wxHtmlWindowFi
;wxHtmlWindow::CleanUpStatics() ;wxHtmlWindow::CleanUpStatics()
@@ -9897,21 +9915,21 @@ EXPORTS
ReadCustomization__12wxHtmlWindowFP12wxConfigBase8wxString ReadCustomization__12wxHtmlWindowFP12wxConfigBase8wxString
;wxHtmlWindow::OnIdle(wxIdleEvent&) ;wxHtmlWindow::OnIdle(wxIdleEvent&)
OnIdle__12wxHtmlWindowFR11wxIdleEvent OnIdle__12wxHtmlWindowFR11wxIdleEvent
;HtmlHistoryArray::~HtmlHistoryArray()
__dt__16HtmlHistoryArrayFv
;wxConstructorForwxHtmlWindow()
wxConstructorForwxHtmlWindow__Fv
;wxHtmlWindow::CreateLayout() ;wxHtmlWindow::CreateLayout()
CreateLayout__12wxHtmlWindowFv CreateLayout__12wxHtmlWindowFv
;wxConstructorForwxHtmlWindow()
wxConstructorForwxHtmlWindow__Fv
;wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo&) ;wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo&)
OnLinkClicked__12wxHtmlWindowFRC14wxHtmlLinkInfo OnLinkClicked__12wxHtmlWindowFRC14wxHtmlLinkInfo
;wxHtmlWindow::m_GlobalProcessors
m_GlobalProcessors__12wxHtmlWindow
__vft12wxHtmlWindow8wxObject __vft12wxHtmlWindow8wxObject
;HtmlHistoryArray::HtmlHistoryArray(const HtmlHistoryArray&)
__ct__16HtmlHistoryArrayFRC16HtmlHistoryArray
;wxHtmlWindow::HistoryCanBack() ;wxHtmlWindow::HistoryCanBack()
HistoryCanBack__12wxHtmlWindowFv HistoryCanBack__12wxHtmlWindowFv
;wxHtmlWindow::HistoryForward() ;wxHtmlWindow::HistoryForward()
HistoryForward__12wxHtmlWindowFv HistoryForward__12wxHtmlWindowFv
;wxHtmlWindow::AddProcessor(wxHtmlProcessor*)
AddProcessor__12wxHtmlWindowFP15wxHtmlProcessor
;wxHtmlWindow::wxHtmlWindow(wxWindow*,int,const wxPoint&,const wxSize&,long,const wxString&) ;wxHtmlWindow::wxHtmlWindow(wxWindow*,int,const wxPoint&,const wxSize&,long,const wxString&)
__ct__12wxHtmlWindowFP8wxWindowiRC7wxPointRC6wxSizelRC8wxString __ct__12wxHtmlWindowFP8wxWindowiRC7wxPointRC6wxSizelRC8wxString
;wxHtmlWindow::sm_eventTableEntries ;wxHtmlWindow::sm_eventTableEntries
@@ -13435,6 +13453,8 @@ EXPORTS
wxFatalError__FRC8wxStringT1 wxFatalError__FRC8wxStringT1
;wxDisplaySize(int*,int*) ;wxDisplaySize(int*,int*)
wxDisplaySize__FPiT1 wxDisplaySize__FPiT1
;wxClientDisplayRect(int*,int*,int*,int*)
wxClientDisplayRect__FPiN31
;wxDisplayDepth() ;wxDisplayDepth()
wxDisplayDepth__Fv wxDisplayDepth__Fv
gs_wxBusyCursor gs_wxBusyCursor