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:
Robert Roebling 1999-07-11 20:49:54 +00:00
parent 56d7679d3e
commit 9146082cdf
3 changed files with 53 additions and 23 deletions

View File

@ -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");

View File

@ -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();
}

View File

@ -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();
}