Set correct toolbar width in wxMSW wxFrame.
The hack introduced in r22410 artificially set wrong size for toolbar under MSW. This completely breaks any calculations that can be done using it (e.g. to find the space available for the stretchable part of the toolbar) and is completely and utterly unexpected. Revert it, toolbar flicker must be dealt in another way if it is still a problem. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
a7daf7ea0e
commit
563f85a956
@ -697,49 +697,23 @@ void wxFrame::PositionToolBar()
|
||||
tx = 0;
|
||||
}
|
||||
|
||||
int desiredW = tw;
|
||||
int desiredH = th;
|
||||
int desiredW,
|
||||
desiredH;
|
||||
|
||||
if ( toolbar->IsVertical() )
|
||||
{
|
||||
desiredW = tw;
|
||||
desiredH = height;
|
||||
}
|
||||
else
|
||||
{
|
||||
desiredW = width;
|
||||
desiredH = th;
|
||||
}
|
||||
|
||||
// use the 'real' MSW position here, don't offset relativly to the
|
||||
// use the 'real' MSW position here, don't offset relatively to the
|
||||
// client area origin
|
||||
|
||||
// Optimise such that we don't have to always resize the toolbar
|
||||
// when the frame changes, otherwise we'll get a lot of flicker.
|
||||
bool heightChanging wxDUMMY_INITIALIZE(true);
|
||||
bool widthChanging wxDUMMY_INITIALIZE(true);
|
||||
|
||||
if ( toolbar->IsVertical() )
|
||||
{
|
||||
// It's OK if the current height is greater than what can be shown.
|
||||
heightChanging = (desiredH > th) ;
|
||||
widthChanging = (desiredW != tw) ;
|
||||
|
||||
// The next time around, we may not have to set the size
|
||||
if (heightChanging)
|
||||
desiredH = desiredH + 200;
|
||||
}
|
||||
else
|
||||
{
|
||||
// It's OK if the current width is greater than what can be shown.
|
||||
widthChanging = (desiredW > tw) ;
|
||||
heightChanging = (desiredH != th) ;
|
||||
|
||||
// The next time around, we may not have to set the size
|
||||
if (widthChanging)
|
||||
desiredW = desiredW + 200;
|
||||
}
|
||||
|
||||
if (tx != 0 || ty != 0 || widthChanging || heightChanging)
|
||||
toolbar->SetSize(x, y, desiredW, desiredH, wxSIZE_NO_ADJUSTMENTS);
|
||||
toolbar->SetSize(x, y, desiredW, desiredH, wxSIZE_NO_ADJUSTMENTS);
|
||||
|
||||
}
|
||||
#endif // !WINCE_WITH_COMMANDBAR
|
||||
|
Loading…
Reference in New Issue
Block a user