[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:
Mart Raudsepp 2005-11-07 20:00:50 +00:00
parent 56aed4aace
commit 015dca24ca
8 changed files with 58 additions and 2 deletions

View File

@ -58,6 +58,8 @@ public:
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
virtual void SetWindowStyleFlag( long style );
virtual bool Show(bool show = true);
virtual void Raise();

View File

@ -59,6 +59,8 @@ public:
virtual bool Show( bool show = true );
virtual bool Enable( bool enable = true );
virtual void SetWindowStyleFlag( long style );
virtual bool IsRetained() const;
virtual void SetFocus();

View File

@ -58,6 +58,8 @@ public:
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
virtual void SetWindowStyleFlag( long style );
virtual bool Show(bool show = true);
virtual void Raise();

View File

@ -59,6 +59,8 @@ public:
virtual bool Show( bool show = true );
virtual bool Enable( bool enable = true );
virtual void SetWindowStyleFlag( long style );
virtual bool IsRetained() const;
virtual void SetFocus();

View File

@ -572,7 +572,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
}
#endif
#if GTK_CHECK_VERSION(2,4,0)
#ifdef __WXGTK24__
if (!gtk_check_version(2,4,0))
{
if (style & wxSTAY_ON_TOP)
@ -1361,3 +1361,22 @@ void wxTopLevelWindowGTK::RequestUserAttention(int flags)
#endif
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
}

View File

@ -4814,6 +4814,11 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
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
// position.

View File

@ -572,7 +572,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
}
#endif
#if GTK_CHECK_VERSION(2,4,0)
#ifdef __WXGTK24__
if (!gtk_check_version(2,4,0))
{
if (style & wxSTAY_ON_TOP)
@ -1361,3 +1361,22 @@ void wxTopLevelWindowGTK::RequestUserAttention(int flags)
#endif
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
}

View File

@ -4814,6 +4814,11 @@ void wxWindowGTK::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
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
// position.