[wxGTK] Support changing the wxSTAY_ON_TOP style value run-time through wxWindow::SetWindowStyleFlag, support for
more styles to follow git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36116 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -58,6 +58,8 @@ public:
|
|||||||
|
|
||||||
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
||||||
|
|
||||||
|
virtual void SetWindowStyleFlag( long style );
|
||||||
|
|
||||||
virtual bool Show(bool show = true);
|
virtual bool Show(bool show = true);
|
||||||
|
|
||||||
virtual void Raise();
|
virtual void Raise();
|
||||||
|
@@ -59,6 +59,8 @@ public:
|
|||||||
virtual bool Show( bool show = true );
|
virtual bool Show( bool show = true );
|
||||||
virtual bool Enable( bool enable = true );
|
virtual bool Enable( bool enable = true );
|
||||||
|
|
||||||
|
virtual void SetWindowStyleFlag( long style );
|
||||||
|
|
||||||
virtual bool IsRetained() const;
|
virtual bool IsRetained() const;
|
||||||
|
|
||||||
virtual void SetFocus();
|
virtual void SetFocus();
|
||||||
|
@@ -58,6 +58,8 @@ public:
|
|||||||
|
|
||||||
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
||||||
|
|
||||||
|
virtual void SetWindowStyleFlag( long style );
|
||||||
|
|
||||||
virtual bool Show(bool show = true);
|
virtual bool Show(bool show = true);
|
||||||
|
|
||||||
virtual void Raise();
|
virtual void Raise();
|
||||||
|
@@ -59,6 +59,8 @@ public:
|
|||||||
virtual bool Show( bool show = true );
|
virtual bool Show( bool show = true );
|
||||||
virtual bool Enable( bool enable = true );
|
virtual bool Enable( bool enable = true );
|
||||||
|
|
||||||
|
virtual void SetWindowStyleFlag( long style );
|
||||||
|
|
||||||
virtual bool IsRetained() const;
|
virtual bool IsRetained() const;
|
||||||
|
|
||||||
virtual void SetFocus();
|
virtual void SetFocus();
|
||||||
|
@@ -572,7 +572,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GTK_CHECK_VERSION(2,4,0)
|
#ifdef __WXGTK24__
|
||||||
if (!gtk_check_version(2,4,0))
|
if (!gtk_check_version(2,4,0))
|
||||||
{
|
{
|
||||||
if (style & wxSTAY_ON_TOP)
|
if (style & wxSTAY_ON_TOP)
|
||||||
@@ -1361,3 +1361,22 @@ void wxTopLevelWindowGTK::RequestUserAttention(int flags)
|
|||||||
#endif
|
#endif
|
||||||
wxgtk_window_set_urgency_hint(GTK_WINDOW( m_widget ), new_hint_value);
|
wxgtk_window_set_urgency_hint(GTK_WINDOW( m_widget ), new_hint_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxTopLevelWindowGTK::SetWindowStyleFlag( long style )
|
||||||
|
{
|
||||||
|
// Store which styles were changed
|
||||||
|
long styleChanges = style ^ m_windowStyle;
|
||||||
|
|
||||||
|
// Process wxWindow styles. This also updates the internal variable
|
||||||
|
// Therefore m_windowStyle bits carry now the _new_ style values
|
||||||
|
wxWindow::SetWindowStyleFlag(style);
|
||||||
|
|
||||||
|
// just return for now if widget does not exist yet
|
||||||
|
if (!m_widget)
|
||||||
|
return;
|
||||||
|
|
||||||
|
#ifdef __WXGTK24__
|
||||||
|
if ( (styleChanges & wxSTAY_ON_TOP) && !gtk_check_version(2,4,0) )
|
||||||
|
gtk_window_set_keep_above(GTK_WINDOW(m_widget), m_windowStyle & wxSTAY_ON_TOP);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@@ -4814,6 +4814,11 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
|||||||
m_clipPaintRegion = false;
|
m_clipPaintRegion = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindowGTK::SetWindowStyleFlag( long style )
|
||||||
|
{
|
||||||
|
// Updates the internal variable. NB: Now m_windowStyle bits carry the _new_ style values already
|
||||||
|
wxWindowBase::SetWindowStyleFlag(style);
|
||||||
|
}
|
||||||
|
|
||||||
// Find the wxWindow at the current mouse position, also returning the mouse
|
// Find the wxWindow at the current mouse position, also returning the mouse
|
||||||
// position.
|
// position.
|
||||||
|
@@ -572,7 +572,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GTK_CHECK_VERSION(2,4,0)
|
#ifdef __WXGTK24__
|
||||||
if (!gtk_check_version(2,4,0))
|
if (!gtk_check_version(2,4,0))
|
||||||
{
|
{
|
||||||
if (style & wxSTAY_ON_TOP)
|
if (style & wxSTAY_ON_TOP)
|
||||||
@@ -1361,3 +1361,22 @@ void wxTopLevelWindowGTK::RequestUserAttention(int flags)
|
|||||||
#endif
|
#endif
|
||||||
wxgtk_window_set_urgency_hint(GTK_WINDOW( m_widget ), new_hint_value);
|
wxgtk_window_set_urgency_hint(GTK_WINDOW( m_widget ), new_hint_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxTopLevelWindowGTK::SetWindowStyleFlag( long style )
|
||||||
|
{
|
||||||
|
// Store which styles were changed
|
||||||
|
long styleChanges = style ^ m_windowStyle;
|
||||||
|
|
||||||
|
// Process wxWindow styles. This also updates the internal variable
|
||||||
|
// Therefore m_windowStyle bits carry now the _new_ style values
|
||||||
|
wxWindow::SetWindowStyleFlag(style);
|
||||||
|
|
||||||
|
// just return for now if widget does not exist yet
|
||||||
|
if (!m_widget)
|
||||||
|
return;
|
||||||
|
|
||||||
|
#ifdef __WXGTK24__
|
||||||
|
if ( (styleChanges & wxSTAY_ON_TOP) && !gtk_check_version(2,4,0) )
|
||||||
|
gtk_window_set_keep_above(GTK_WINDOW(m_widget), m_windowStyle & wxSTAY_ON_TOP);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@@ -4814,6 +4814,11 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
|
|||||||
m_clipPaintRegion = false;
|
m_clipPaintRegion = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindowGTK::SetWindowStyleFlag( long style )
|
||||||
|
{
|
||||||
|
// Updates the internal variable. NB: Now m_windowStyle bits carry the _new_ style values already
|
||||||
|
wxWindowBase::SetWindowStyleFlag(style);
|
||||||
|
}
|
||||||
|
|
||||||
// Find the wxWindow at the current mouse position, also returning the mouse
|
// Find the wxWindow at the current mouse position, also returning the mouse
|
||||||
// position.
|
// position.
|
||||||
|
Reference in New Issue
Block a user