New global cursor behaviour.
Test for tear-off menus in controls sample. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
56d7679d3e
commit
9146082cdf
@ -164,7 +164,7 @@ bool MyApp::OnInit()
|
||||
|
||||
frame->SetIcon( wxICON(mondrian) );
|
||||
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
wxMenu *file_menu = new wxMenu( wxMENU_TEAROFF );
|
||||
file_menu->Append(MINIMAL_ABOUT, "&About\tF1");
|
||||
file_menu->Append(MINIMAL_QUIT, "E&xit\tAlt-X", "Quit controls sample");
|
||||
|
||||
|
@ -2191,19 +2191,34 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
|
||||
|
||||
void wxWindow::OnInternalIdle()
|
||||
{
|
||||
GdkWindow *window = GetConnectWidget()->window;
|
||||
if (window)
|
||||
{
|
||||
wxCursor cursor = m_cursor;
|
||||
if (g_globalCursor.Ok()) cursor = g_globalCursor;
|
||||
wxCursor cursor = m_cursor;
|
||||
if (g_globalCursor.Ok()) cursor = g_globalCursor;
|
||||
|
||||
if (cursor.Ok() && m_currentGdkCursor != cursor)
|
||||
{
|
||||
if (cursor.Ok() && m_currentGdkCursor != cursor)
|
||||
{
|
||||
if (m_wxwindow)
|
||||
{
|
||||
GdkWindow *window = m_wxwindow->window;
|
||||
if (window)
|
||||
gdk_window_set_cursor( window, cursor.GetCursor() );
|
||||
m_currentGdkCursor = cursor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!g_globalCursor.Ok())
|
||||
cursor = *wxSTANDARD_CURSOR;
|
||||
|
||||
window = m_widget->window;
|
||||
if (window)
|
||||
gdk_window_set_cursor( window, cursor.GetCursor() );
|
||||
}
|
||||
else
|
||||
{
|
||||
GdkWindow *window = m_widget->window;
|
||||
if (window)
|
||||
gdk_window_set_cursor( window, cursor.GetCursor() );
|
||||
}
|
||||
|
||||
m_currentGdkCursor = cursor;
|
||||
}
|
||||
|
||||
UpdateWindowUI();
|
||||
}
|
||||
|
||||
|
@ -2191,19 +2191,34 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
|
||||
|
||||
void wxWindow::OnInternalIdle()
|
||||
{
|
||||
GdkWindow *window = GetConnectWidget()->window;
|
||||
if (window)
|
||||
{
|
||||
wxCursor cursor = m_cursor;
|
||||
if (g_globalCursor.Ok()) cursor = g_globalCursor;
|
||||
wxCursor cursor = m_cursor;
|
||||
if (g_globalCursor.Ok()) cursor = g_globalCursor;
|
||||
|
||||
if (cursor.Ok() && m_currentGdkCursor != cursor)
|
||||
{
|
||||
if (cursor.Ok() && m_currentGdkCursor != cursor)
|
||||
{
|
||||
if (m_wxwindow)
|
||||
{
|
||||
GdkWindow *window = m_wxwindow->window;
|
||||
if (window)
|
||||
gdk_window_set_cursor( window, cursor.GetCursor() );
|
||||
m_currentGdkCursor = cursor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!g_globalCursor.Ok())
|
||||
cursor = *wxSTANDARD_CURSOR;
|
||||
|
||||
window = m_widget->window;
|
||||
if (window)
|
||||
gdk_window_set_cursor( window, cursor.GetCursor() );
|
||||
}
|
||||
else
|
||||
{
|
||||
GdkWindow *window = m_widget->window;
|
||||
if (window)
|
||||
gdk_window_set_cursor( window, cursor.GetCursor() );
|
||||
}
|
||||
|
||||
m_currentGdkCursor = cursor;
|
||||
}
|
||||
|
||||
UpdateWindowUI();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user