Add the new showOnIdle code to various other
widget which override OnInternalIdle(). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -182,6 +182,9 @@ public:
|
|||||||
// until idle time. This partly mimmicks defered
|
// until idle time. This partly mimmicks defered
|
||||||
// sizing under MSW.
|
// sizing under MSW.
|
||||||
void GtkShowOnIdle() { m_showOnIdle = true; }
|
void GtkShowOnIdle() { m_showOnIdle = true; }
|
||||||
|
|
||||||
|
// This is called from the various OnInternalIdle methods
|
||||||
|
bool GtkShowFromOnIdle();
|
||||||
|
|
||||||
// fix up the mouse event coords, used by wxListBox only so far
|
// fix up the mouse event coords, used by wxListBox only so far
|
||||||
virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget),
|
virtual void FixUpMouseEvent(GtkWidget * WXUNUSED(widget),
|
||||||
|
@@ -232,6 +232,9 @@ bool wxCheckBox::IsOwnGtkWindow( GdkWindow *window )
|
|||||||
|
|
||||||
void wxCheckBox::OnInternalIdle()
|
void wxCheckBox::OnInternalIdle()
|
||||||
{
|
{
|
||||||
|
// Check if we have to show window now
|
||||||
|
if (GtkShowFromOnIdle()) return;
|
||||||
|
|
||||||
wxCursor cursor = m_cursor;
|
wxCursor cursor = m_cursor;
|
||||||
if (g_globalCursor.Ok()) cursor = g_globalCursor;
|
if (g_globalCursor.Ok()) cursor = g_globalCursor;
|
||||||
|
|
||||||
|
@@ -1100,7 +1100,9 @@ void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style)
|
|||||||
|
|
||||||
void wxListBox::OnInternalIdle()
|
void wxListBox::OnInternalIdle()
|
||||||
{
|
{
|
||||||
//RN: Is this needed anymore?
|
// Check if we have to show window now
|
||||||
|
if (GtkShowFromOnIdle()) return;
|
||||||
|
|
||||||
wxCursor cursor = m_cursor;
|
wxCursor cursor = m_cursor;
|
||||||
if (g_globalCursor.Ok()) cursor = g_globalCursor;
|
if (g_globalCursor.Ok()) cursor = g_globalCursor;
|
||||||
|
|
||||||
|
@@ -659,6 +659,9 @@ bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )
|
|||||||
|
|
||||||
void wxRadioBox::OnInternalIdle()
|
void wxRadioBox::OnInternalIdle()
|
||||||
{
|
{
|
||||||
|
// Check if we have to show window now
|
||||||
|
if (GtkShowFromOnIdle()) return;
|
||||||
|
|
||||||
if ( m_lostFocus )
|
if ( m_lostFocus )
|
||||||
{
|
{
|
||||||
m_hasFocus = false;
|
m_hasFocus = false;
|
||||||
@@ -678,6 +681,9 @@ void wxRadioBox::OnInternalIdle()
|
|||||||
SetFocus();
|
SetFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wxUpdateUIEvent::CanUpdate(this))
|
||||||
|
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
@@ -1678,6 +1678,9 @@ void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event)
|
|||||||
|
|
||||||
void wxTextCtrl::OnInternalIdle()
|
void wxTextCtrl::OnInternalIdle()
|
||||||
{
|
{
|
||||||
|
// Check if we have to show window now
|
||||||
|
if (GtkShowFromOnIdle()) return;
|
||||||
|
|
||||||
if (g_delayedFocus == this)
|
if (g_delayedFocus == this)
|
||||||
{
|
{
|
||||||
if (GTK_WIDGET_REALIZED(m_widget))
|
if (GTK_WIDGET_REALIZED(m_widget))
|
||||||
@@ -1686,7 +1689,7 @@ void wxTextCtrl::OnInternalIdle()
|
|||||||
g_delayedFocus = NULL;
|
g_delayedFocus = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wxUpdateUIEvent::CanUpdate(this))
|
if (wxUpdateUIEvent::CanUpdate(this))
|
||||||
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
|
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
|
||||||
}
|
}
|
||||||
|
@@ -181,6 +181,9 @@ bool wxToggleBitmapButton::IsOwnGtkWindow(GdkWindow *window)
|
|||||||
|
|
||||||
void wxToggleBitmapButton::OnInternalIdle()
|
void wxToggleBitmapButton::OnInternalIdle()
|
||||||
{
|
{
|
||||||
|
// Check if we have to show window now
|
||||||
|
if (GtkShowFromOnIdle()) return;
|
||||||
|
|
||||||
wxCursor cursor = m_cursor;
|
wxCursor cursor = m_cursor;
|
||||||
|
|
||||||
if (g_globalCursor.Ok())
|
if (g_globalCursor.Ok())
|
||||||
|
@@ -2959,22 +2959,8 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
|
|||||||
m_resizing = false;
|
m_resizing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowGTK::OnInternalIdle()
|
bool wxWindowGTK::GtkShowFromOnIdle()
|
||||||
{
|
{
|
||||||
if ( m_dirtyTabOrder )
|
|
||||||
{
|
|
||||||
m_dirtyTabOrder = false;
|
|
||||||
RealizeTabOrder();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update style if the window was not yet realized
|
|
||||||
// and SetBackgroundStyle(wxBG_STYLE_CUSTOM) was called
|
|
||||||
if (m_needsStyleChange)
|
|
||||||
{
|
|
||||||
SetBackgroundStyle(GetBackgroundStyle());
|
|
||||||
m_needsStyleChange = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsShown() && m_showOnIdle && !GTK_WIDGET_VISIBLE (m_widget))
|
if (IsShown() && m_showOnIdle && !GTK_WIDGET_VISIBLE (m_widget))
|
||||||
{
|
{
|
||||||
GtkAllocation alloc;
|
GtkAllocation alloc;
|
||||||
@@ -2988,8 +2974,31 @@ void wxWindowGTK::OnInternalIdle()
|
|||||||
eventShow.SetEventObject(this);
|
eventShow.SetEventObject(this);
|
||||||
GetEventHandler()->ProcessEvent(eventShow);
|
GetEventHandler()->ProcessEvent(eventShow);
|
||||||
m_showOnIdle = false;
|
m_showOnIdle = false;
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxWindowGTK::OnInternalIdle()
|
||||||
|
{
|
||||||
|
// Check if we have to show window now
|
||||||
|
if (GtkShowFromOnIdle()) return;
|
||||||
|
|
||||||
|
if ( m_dirtyTabOrder )
|
||||||
|
{
|
||||||
|
m_dirtyTabOrder = false;
|
||||||
|
RealizeTabOrder();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update style if the window was not yet realized
|
||||||
|
// and SetBackgroundStyle(wxBG_STYLE_CUSTOM) was called
|
||||||
|
if (m_needsStyleChange)
|
||||||
|
{
|
||||||
|
SetBackgroundStyle(GetBackgroundStyle());
|
||||||
|
m_needsStyleChange = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Update invalidated regions.
|
// Update invalidated regions.
|
||||||
GtkUpdate();
|
GtkUpdate();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user