From 16cafacf24efe3b5a2040adc5fadca9a9a5f77a9 Mon Sep 17 00:00:00 2001 From: Ryan Norton Date: Thu, 17 Feb 2005 13:13:01 +0000 Subject: [PATCH] use without url git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32118 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/sockets/client.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/samples/sockets/client.cpp b/samples/sockets/client.cpp index 4ba2ae6c0e..33993489aa 100644 --- a/samples/sockets/client.cpp +++ b/samples/sockets/client.cpp @@ -76,8 +76,10 @@ public: void OnTest3(wxCommandEvent& event); void OnCloseConnection(wxCommandEvent& event); +#if wxUSE_URL // event handlers for Protocols menu void OnTestURL(wxCommandEvent& event); +#endif // event handlers for DatagramSocket menu (stub) void OnDatagram(wxCommandEvent& event); @@ -117,7 +119,9 @@ enum CLIENT_TEST2, CLIENT_TEST3, CLIENT_CLOSE, +#if wxUSE_URL CLIENT_TESTURL, +#endif CLIENT_DGRAM, // id for socket @@ -137,7 +141,9 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(CLIENT_TEST3, MyFrame::OnTest3) EVT_MENU(CLIENT_CLOSE, MyFrame::OnCloseConnection) EVT_MENU(CLIENT_DGRAM, MyFrame::OnDatagram) +#if wxUSE_URL EVT_MENU(CLIENT_TESTURL, MyFrame::OnTestURL) +#endif EVT_SOCKET(SOCKET_ID, MyFrame::OnSocketEvent) END_EVENT_TABLE() @@ -194,15 +200,19 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, wxID_ANY, m_menuDatagramSocket = new wxMenu(); m_menuDatagramSocket->Append(CLIENT_DGRAM, _("Send Datagram"), _("Test UDP sockets")); +#if wxUSE_URL m_menuProtocols = new wxMenu(); m_menuProtocols->Append(CLIENT_TESTURL, _("Test URL"), _("Get data from the specified URL")); +#endif // Append menus to the menubar m_menuBar = new wxMenuBar(); m_menuBar->Append(m_menuFile, _("&File")); m_menuBar->Append(m_menuSocket, _("&SocketClient")); m_menuBar->Append(m_menuDatagramSocket, _("&DatagramSocket")); +#if wxUSE_URL m_menuBar->Append(m_menuProtocols, _("&Protocols")); +#endif SetMenuBar(m_menuBar); #if wxUSE_STATUSBAR @@ -533,6 +543,8 @@ void MyFrame::OnDatagram(wxCommandEvent& WXUNUSED(event)) m_text->AppendText(_("=== Datagram test ends ===\n")); } +#if wxUSE_URL + void MyFrame::OnTestURL(wxCommandEvent& WXUNUSED(event)) { // Note that we are creating a new socket here, so this @@ -590,6 +602,8 @@ void MyFrame::OnTestURL(wxCommandEvent& WXUNUSED(event)) delete data; } +#endif + void MyFrame::OnSocketEvent(wxSocketEvent& event) { wxString s = _("OnSocketEvent: "); -- 2.45.2