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