Added knowledge of virtual size to wx(Scrolled)Windows, they can now
manage their own scrollbars with the help of a sizer or other user clues (SetVirtualSizeHints) without the need for an ancillary container. Added SetSizerAndFit convenience method. SetSizer now enables/disables AutoLayout automagically. Logic bugfix for scrollsub sample. Syntax bugfix in parser.y. Compiler warning fix in textctrl.cpp. Modified Files: docs/latex/wx/scrolwin.tex docs/latex/wx/sizer.tex docs/latex/wx/window.tex include/wx/scrolwin.h include/wx/sizer.h include/wx/window.h include/wx/generic/scrolwin.h include/wx/gtk/scrolwin.h samples/scrollsub/scrollsub.cpp src/common/parser.y src/common/sizer.cpp src/common/wincmn.cpp src/generic/scrlwing.cpp src/gtk/scrolwin.cpp src/msw/textctrl.cpp git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -210,7 +210,18 @@ MyTopLabels::MyTopLabels( wxScrolledWindow *parent, wxWindowID id, const wxPoint
|
||||
void MyTopLabels::OnPaint( wxPaintEvent &event )
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
m_owner->PrepareDC( dc );
|
||||
|
||||
// This is wrong.. it will translate both x and y if the
|
||||
// window is scrolled, the label windows are active in one
|
||||
// direction only. Do the action below instead -- RL.
|
||||
//m_owner->PrepareDC( dc );
|
||||
|
||||
int xScrollUnits, xOrigin;
|
||||
|
||||
m_owner->GetViewStart( &xOrigin, 0 );
|
||||
m_owner->GetScrollPixelsPerUnit( &xScrollUnits, 0 );
|
||||
dc.SetDeviceOrigin( -xOrigin * xScrollUnits, 0 );
|
||||
|
||||
dc.DrawText( "Column 1", 5, 5 );
|
||||
dc.DrawText( "Column 2", 105, 5 );
|
||||
dc.DrawText( "Column 3", 205, 5 );
|
||||
@@ -233,7 +244,18 @@ MyRightLabels::MyRightLabels( wxScrolledWindow *parent, wxWindowID id, const wxP
|
||||
void MyRightLabels::OnPaint( wxPaintEvent &event )
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
m_owner->PrepareDC( dc );
|
||||
|
||||
// This is wrong.. it will translate both x and y if the
|
||||
// window is scrolled, the label windows are active in one
|
||||
// direction only. Do the action below instead -- RL.
|
||||
//m_owner->PrepareDC( dc );
|
||||
|
||||
int yScrollUnits, yOrigin;
|
||||
|
||||
m_owner->GetViewStart( 0, &yOrigin );
|
||||
m_owner->GetScrollPixelsPerUnit( 0, &yScrollUnits );
|
||||
dc.SetDeviceOrigin( 0, -yOrigin * yScrollUnits );
|
||||
|
||||
dc.DrawText( "Row 1", 5, 5 );
|
||||
dc.DrawText( "Row 2", 5, 30 );
|
||||
dc.DrawText( "Row 3", 5, 55 );
|
||||
|
Reference in New Issue
Block a user