implement GetSizeAvailableForScrollTarget() in MyScrolledWindow
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -36,11 +36,15 @@ class MyApp;
|
|||||||
class MyScrolledWindow: public wxScrolledWindow
|
class MyScrolledWindow: public wxScrolledWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyScrolledWindow(){};
|
MyScrolledWindow() {}
|
||||||
MyScrolledWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size );
|
MyScrolledWindow( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size );
|
||||||
~MyScrolledWindow(){};
|
|
||||||
void OnPaint( wxPaintEvent &event );
|
void OnPaint( wxPaintEvent &event );
|
||||||
void OnSize( wxSizeEvent &event );
|
void OnSize( wxSizeEvent &event );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MyCanvas *m_canvas;
|
MyCanvas *m_canvas;
|
||||||
|
|
||||||
@@ -177,6 +181,16 @@ MyScrolledWindow::MyScrolledWindow( wxWindow *parent, wxWindowID id,
|
|||||||
SetSizer( mainsizer );
|
SetSizer( mainsizer );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxSize MyScrolledWindow::GetSizeAvailableForScrollTarget(const wxSize& size)
|
||||||
|
{
|
||||||
|
// decrease the total size by the size of the non-scrollable parts above/to
|
||||||
|
// the left of the canvas
|
||||||
|
wxSize sizeCanvas(size);
|
||||||
|
sizeCanvas.x -= 60;
|
||||||
|
sizeCanvas.y -= 25;
|
||||||
|
return sizeCanvas;
|
||||||
|
}
|
||||||
|
|
||||||
void MyScrolledWindow::OnSize( wxSizeEvent &WXUNUSED(event) )
|
void MyScrolledWindow::OnSize( wxSizeEvent &WXUNUSED(event) )
|
||||||
{
|
{
|
||||||
// We need to override OnSize so that our scrolled
|
// We need to override OnSize so that our scrolled
|
||||||
|
Reference in New Issue
Block a user