Merge branch 'cmake-dialogs-sample' of https://github.com/MaartenBent/wxWidgets

Proper fix for building dialogs sample for CMake.

See https://github.com/wxWidgets/wxWidgets/pull/934
This commit is contained in:
Vadim Zeitlin
2018-09-17 23:31:55 +02:00
3 changed files with 15 additions and 9 deletions

View File

@@ -23,7 +23,17 @@ wx_add_sample(dataview IMPORTANT dataview.cpp mymodels.cpp mymodels.h DEPENDS wx
if(wxUSE_ON_FATAL_EXCEPTION AND (NOT WIN32 OR MSVC)) if(wxUSE_ON_FATAL_EXCEPTION AND (NOT WIN32 OR MSVC))
wx_add_sample(debugrpt LIBRARIES qa DEPENDS wxUSE_DEBUGREPORT) wx_add_sample(debugrpt LIBRARIES qa DEPENDS wxUSE_DEBUGREPORT)
endif() endif()
wx_add_sample(dialogs dialogs.cpp dialogs.h DATA tips.txt) set(SAMPLE_DIALOGS_SRC dialogs.cpp dialogs.h)
if(NOT wxBUILD_SHARED AND (WXMSW OR APPLE)) # AND NOT WXUNIV
wx_list_add_prefix(SAMPLE_DIALOGS_SRC ../../src/generic/ colrdlgg.cpp dirdlgg.cpp filedlgg.cpp)
if(WXMSW)
wx_list_add_prefix(SAMPLE_DIALOGS_SRC ../../src/generic/ fontdlgg.cpp)
endif()
endif()
if(WXGTK2)
wx_list_add_prefix(SAMPLE_DIALOGS_SRC ../../src/generic/ filedlgg.cpp)
endif()
wx_add_sample(dialogs ${SAMPLE_DIALOGS_SRC} DATA tips.txt)
wx_add_sample(dialup nettest.cpp LIBRARIES net DEPENDS wxUSE_DIALUP_MANAGER) wx_add_sample(dialup nettest.cpp LIBRARIES net DEPENDS wxUSE_DIALUP_MANAGER)
wx_add_sample(display DEPENDS wxUSE_DISPLAY) wx_add_sample(display DEPENDS wxUSE_DISPLAY)
wx_add_sample(dnd dnd.cpp RES dnd.rc DATA wxwin.png DEPENDS wxUSE_DRAG_AND_DROP) wx_add_sample(dnd dnd.cpp RES dnd.rc DATA wxwin.png DEPENDS wxUSE_DRAG_AND_DROP)

View File

@@ -21,10 +21,6 @@
<if cond="TOOLKIT=='GTK' and TOOLKIT_VERSION=='2'"> <if cond="TOOLKIT=='GTK' and TOOLKIT_VERSION=='2'">
$(WXTOPDIR)src/generic/filedlgg.cpp $(WXTOPDIR)src/generic/filedlgg.cpp
</if> </if>
<if cond="TOOLKIT=='PM' and WXUNIV=='0' and SHARED=='0'">
$(WXTOPDIR)src/generic/fontdlgg.cpp
$(WXTOPDIR)src/generic/filedlgg.cpp
</if>
</set> </set>
<exe id="dialogs" template="wx_sample" template_append="wx_append"> <exe id="dialogs" template="wx_sample" template_append="wx_append">

View File

@@ -614,15 +614,15 @@ bool MyApp::OnInit()
editMenu->Append(wxID_COPY, "&Copy\tCtrl+C"); editMenu->Append(wxID_COPY, "&Copy\tCtrl+C");
editMenu->Append(wxID_PASTE, "&Paste\tCtrl+V"); editMenu->Append(wxID_PASTE, "&Paste\tCtrl+V");
editMenu->Append(wxID_CLEAR, "&Delete"); editMenu->Append(wxID_CLEAR, "&Delete");
editMenu->AppendSeparator(); editMenu->AppendSeparator();
editMenu->Append(wxID_SELECTALL, "Select All\tCtrl+A"); editMenu->Append(wxID_SELECTALL, "Select All\tCtrl+A");
wxMenuBar *menubar = new wxMenuBar; wxMenuBar *menubar = new wxMenuBar;
menubar->Append(menuDlg, "&Dialogs"); menubar->Append(menuDlg, "&Dialogs");
menubar->Append(editMenu, "&Edit"); menubar->Append(editMenu, "&Edit");
#if wxUSE_ABOUTDLG #if wxUSE_ABOUTDLG
menubar->Append(menuHelp, "&Help"); menubar->Append(menuHelp, "&Help");
#endif // wxUSE_ABOUTDLG #endif // wxUSE_ABOUTDLG
@@ -2146,7 +2146,7 @@ private:
if ( !m_taskbarIcon ) if ( !m_taskbarIcon )
{ {
m_taskbarIcon = new wxTaskBarIcon(); m_taskbarIcon = new wxTaskBarIcon();
m_taskbarIcon->SetIcon(reinterpret_cast<wxTopLevelWindow*>(GetParent())->GetIcon(), m_taskbarIcon->SetIcon(reinterpret_cast<wxTopLevelWindow*>(GetParent())->GetIcon(),
"Dialogs Sample (Persistent)"); "Dialogs Sample (Persistent)");
} }
wxNotificationMessage::UseTaskBarIcon(m_taskbarIcon); wxNotificationMessage::UseTaskBarIcon(m_taskbarIcon);