From b3f259c99cee60946ecbb2f329fa7bc994531dba Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 19 Jan 2020 14:53:33 +0100 Subject: [PATCH] Fix reverting to standard cursor in widgets sample Don't set the cursor to wxSTANDARD_CURSOR, but set it to wxNullCursor so the default system cursor is used. --- samples/widgets/widgets.cpp | 9 +++------ samples/widgets/widgets.h | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index 40eedbda7b..b4d5563b1b 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -992,8 +992,8 @@ void WidgetsFrame::OnToggleGlobalBusyCursor(wxCommandEvent& event) void WidgetsFrame::OnToggleBusyCursor(wxCommandEvent& event) { - WidgetsPage::GetAttrs().m_cursor = *(event.IsChecked() ? wxHOURGLASS_CURSOR - : wxSTANDARD_CURSOR); + WidgetsPage::GetAttrs().m_cursor = (event.IsChecked() ? *wxHOURGLASS_CURSOR + : wxNullCursor); CurrentPage()->SetUpWidget(); } @@ -1359,10 +1359,7 @@ void WidgetsPage::SetUpWidget() (*it)->Enable(GetAttrs().m_enabled); (*it)->Show(GetAttrs().m_show); - if ( GetAttrs().m_cursor.IsOk() ) - { - (*it)->SetCursor(GetAttrs().m_cursor); - } + (*it)->SetCursor(GetAttrs().m_cursor); (*it)->SetWindowVariant(GetAttrs().m_variant); diff --git a/samples/widgets/widgets.h b/samples/widgets/widgets.h index 77d4ffe642..ffc6112688 100644 --- a/samples/widgets/widgets.h +++ b/samples/widgets/widgets.h @@ -97,7 +97,7 @@ struct WidgetAttributes m_show = true; m_dir = wxLayout_LeftToRight; m_variant = wxWINDOW_VARIANT_NORMAL; - m_cursor = *wxSTANDARD_CURSOR; + m_cursor = wxNullCursor; m_defaultFlags = wxBORDER_DEFAULT; }