Added MacInternalOnSize() to allow windows to resize themselves independently of size events
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70765 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -59,7 +59,6 @@ public:
|
||||
// event handlers
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
// Toolbar
|
||||
#if wxUSE_TOOLBAR
|
||||
@@ -84,6 +83,8 @@ public:
|
||||
|
||||
void PositionBars();
|
||||
|
||||
// internal response to size events
|
||||
virtual void MacOnInternalSize() { PositionBars(); }
|
||||
|
||||
protected:
|
||||
// common part of all ctors
|
||||
|
@@ -288,6 +288,9 @@ public:
|
||||
|
||||
float GetContentScaleFactor() const ;
|
||||
|
||||
// internal response to size events
|
||||
virtual void MacOnInternalSize() {}
|
||||
|
||||
protected:
|
||||
// For controls like radio buttons which are genuinely composite
|
||||
wxList m_subControls;
|
||||
|
@@ -29,7 +29,6 @@
|
||||
BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
|
||||
EVT_ACTIVATE(wxFrame::OnActivate)
|
||||
EVT_SYS_COLOUR_CHANGED(wxFrame::OnSysColourChanged)
|
||||
EVT_SIZE(wxFrame::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#define WX_MAC_STATUSBAR_HEIGHT 18
|
||||
@@ -216,14 +215,6 @@ void wxFrame::OnActivate(wxActivateEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void wxFrame::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
PositionBars();
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
#if wxUSE_MENUS
|
||||
void wxFrame::DetachMenuBar()
|
||||
{
|
||||
|
@@ -1193,6 +1193,9 @@ bool wxToolBar::Realize()
|
||||
SetInitialSize( wxSize(m_minWidth, m_minHeight));
|
||||
|
||||
SendSizeEventToParent();
|
||||
wxWindow * const parent = GetParent();
|
||||
if ( parent && !parent->IsBeingDeleted() )
|
||||
parent->MacOnInternalSize();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@@ -1615,6 +1615,7 @@ void wxWidgetCocoaImpl::SetVisibility( bool visible )
|
||||
wxUnusedVar(progress);
|
||||
|
||||
m_win->SendSizeEvent();
|
||||
m_win->MacOnInternalSize();
|
||||
}
|
||||
|
||||
- (void)animationDidEnd:(NSAnimation*)animation
|
||||
@@ -1791,6 +1792,7 @@ wxWidgetCocoaImpl::ShowViewOrWindowWithEffect(wxWindow *win,
|
||||
// refresh it once again after the end to ensure that everything is in
|
||||
// place
|
||||
win->SendSizeEvent();
|
||||
win->MacOnInternalSize();
|
||||
}
|
||||
|
||||
[anim setDelegate:nil];
|
||||
|
@@ -249,6 +249,7 @@ bool wxNonOwnedWindow::OSXShowWithEffect(bool show,
|
||||
{
|
||||
// as apps expect a size event to occur when the window is shown,
|
||||
// generate one when it is shown with effect too
|
||||
MacOnInternalSize();
|
||||
wxSizeEvent event(GetSize(), m_windowId);
|
||||
event.SetEventObject(this);
|
||||
HandleWindowEvent(event);
|
||||
@@ -311,6 +312,7 @@ void wxNonOwnedWindow::HandleActivated( double timestampsec, bool didActivate )
|
||||
|
||||
void wxNonOwnedWindow::HandleResized( double timestampsec )
|
||||
{
|
||||
MacOnInternalSize();
|
||||
wxSizeEvent wxevent( GetSize() , GetId());
|
||||
wxevent.SetTimestamp( (int) (timestampsec * 1000) );
|
||||
wxevent.SetEventObject( this );
|
||||
@@ -385,6 +387,7 @@ bool wxNonOwnedWindow::Show(bool show)
|
||||
if ( show )
|
||||
{
|
||||
// because apps expect a size event to occur at this moment
|
||||
MacOnInternalSize();
|
||||
wxSizeEvent event(GetSize() , m_windowId);
|
||||
event.SetEventObject(this);
|
||||
HandleWindowEvent(event);
|
||||
|
@@ -1065,6 +1065,7 @@ void wxWindowMac::DoMoveWindow(int x, int y, int width, int height)
|
||||
if ( doResize )
|
||||
{
|
||||
MacRepositionScrollBars() ;
|
||||
MacOnInternalSize();
|
||||
wxSize size(actualWidth, actualHeight);
|
||||
wxSizeEvent event(size, m_windowId);
|
||||
event.SetEventObject(this);
|
||||
@@ -1148,6 +1149,7 @@ void wxWindowMac::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
|
||||
if (sizeFlags & wxSIZE_FORCE_EVENT)
|
||||
{
|
||||
MacOnInternalSize();
|
||||
wxSizeEvent event( wxSize(width,height), GetId() );
|
||||
event.SetEventObject( this );
|
||||
HandleWindowEvent( event );
|
||||
@@ -1686,6 +1688,7 @@ void wxWindowMac::DoUpdateScrollbarVisibility()
|
||||
MacRepositionScrollBars() ;
|
||||
if ( triggerSizeEvent )
|
||||
{
|
||||
MacOnInternalSize();
|
||||
wxSizeEvent event(GetSize(), m_windowId);
|
||||
event.SetEventObject(this);
|
||||
HandleWindowEvent(event);
|
||||
|
Reference in New Issue
Block a user