-1->wxID_ANY, TRUE->true and FALSE->false replacements.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-06-02 17:03:20 +00:00
parent ba44343285
commit b62ca03d6f
9 changed files with 125 additions and 125 deletions

View File

@@ -157,11 +157,11 @@ bool MyApp::OnInit()
MyFrame *frame = new MyFrame();
// Show it and tell the application that it's our main window
frame->Show(TRUE);
frame->Show(true);
SetTopWindow(frame);
// success
return TRUE;
return true;
}
// --------------------------------------------------------------------------
@@ -169,7 +169,7 @@ bool MyApp::OnInit()
// --------------------------------------------------------------------------
// frame constructor
MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, -1,
MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, wxID_ANY,
_("wxSocket demo: Client"),
wxDefaultPosition, wxSize(300, 200))
{
@@ -209,7 +209,7 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, -1,
CreateStatusBar(2);
// Make a textctrl for logging
m_text = new wxTextCtrl(this, -1,
m_text = new wxTextCtrl(this, wxID_ANY,
_("Welcome to wxSocket demo: Client\nClient ready\n"),
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxTE_READONLY);
@@ -222,9 +222,9 @@ MyFrame::MyFrame() : wxFrame((wxFrame *)NULL, -1,
m_sock->SetNotify(wxSOCKET_CONNECTION_FLAG |
wxSOCKET_INPUT_FLAG |
wxSOCKET_LOST_FLAG);
m_sock->Notify(TRUE);
m_sock->Notify(true);
m_busy = FALSE;
m_busy = false;
UpdateStatusBar();
}
@@ -238,8 +238,8 @@ MyFrame::~MyFrame()
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
// TRUE is to force the frame to close
Close(TRUE);
// true is to force the frame to close
Close(true);
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -253,8 +253,8 @@ void MyFrame::OnOpenConnection(wxCommandEvent& WXUNUSED(event))
{
wxIPV4address addr;
m_menuSocket->Enable(CLIENT_OPEN, FALSE);
m_menuSocket->Enable(CLIENT_CLOSE, FALSE);
m_menuSocket->Enable(CLIENT_OPEN, false);
m_menuSocket->Enable(CLIENT_CLOSE, false);
// Ask user for server address
wxString hostname = wxGetTextFromUser(
@@ -271,21 +271,21 @@ void MyFrame::OnOpenConnection(wxCommandEvent& WXUNUSED(event))
// There are two ways to use Connect(): blocking and non-blocking,
// depending on the value passed as the 'wait' (2nd) parameter.
//
// Connect(addr, TRUE) will wait until the connection completes,
// returning TRUE on success and FALSE on failure. This call blocks
// Connect(addr, true) will wait until the connection completes,
// returning true on success and false on failure. This call blocks
// the GUI (this might be changed in future releases to honour the
// wxSOCKET_BLOCK flag).
//
// Connect(addr, FALSE) will issue a nonblocking connection request
// and return immediately. If the return value is TRUE, then the
// Connect(addr, false) will issue a nonblocking connection request
// and return immediately. If the return value is true, then the
// connection has been already succesfully established. If it is
// FALSE, you must wait for the request to complete, either with
// false, you must wait for the request to complete, either with
// WaitOnConnect() or by watching wxSOCKET_CONNECTION / LOST
// events (please read the documentation).
//
// WaitOnConnect() itself never blocks the GUI (this might change
// in the future to honour the wxSOCKET_BLOCK flag). This call will
// return FALSE on timeout, or TRUE if the connection request
// return false on timeout, or true if the connection request
// completes, which in turn might mean:
//
// a) That the connection was successfully established
@@ -298,13 +298,13 @@ void MyFrame::OnOpenConnection(wxCommandEvent& WXUNUSED(event))
//
// For blocking Connect:
//
// bool success = client->Connect(addr, TRUE);
// bool success = client->Connect(addr, true);
//
// For nonblocking Connect:
//
// client->Connect(addr, FALSE);
// client->Connect(addr, false);
//
// bool waitmore = TRUE;
// bool waitmore = true;
// while (! client->WaitOnConnect(seconds, millis) && waitmore )
// {
// // possibly give some feedback to the user,
@@ -315,7 +315,7 @@ void MyFrame::OnOpenConnection(wxCommandEvent& WXUNUSED(event))
// And that's all :-)
m_text->AppendText(_("\nTrying to connect (timeout = 10 sec) ...\n"));
m_sock->Connect(addr, FALSE);
m_sock->Connect(addr, false);
m_sock->WaitOnConnect(10);
if (m_sock->IsConnected())
@@ -337,7 +337,7 @@ void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event))
unsigned char len;
// Disable socket menu entries (exception: Close Session)
m_busy = TRUE;
m_busy = true;
UpdateStatusBar();
m_text->AppendText(_("\n=== Test 1 begins ===\n"));
@@ -387,7 +387,7 @@ void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event))
m_text->AppendText(_("=== Test 1 ends ===\n"));
delete[] buf2;
m_busy = FALSE;
m_busy = false;
UpdateStatusBar();
}
@@ -398,7 +398,7 @@ void MyFrame::OnTest2(wxCommandEvent& WXUNUSED(event))
size_t len;
// Disable socket menu entries (exception: Close Session)
m_busy = TRUE;
m_busy = true;
UpdateStatusBar();
m_text->AppendText(_("\n=== Test 2 begins ===\n"));
@@ -456,7 +456,7 @@ void MyFrame::OnTest2(wxCommandEvent& WXUNUSED(event))
m_text->AppendText(_("=== Test 2 ends ===\n"));
delete[] msg2;
m_busy = FALSE;
m_busy = false;
UpdateStatusBar();
}
@@ -467,7 +467,7 @@ void MyFrame::OnTest3(wxCommandEvent& WXUNUSED(event))
unsigned char len;
// Disable socket menu entries (exception: Close Session)
m_busy = TRUE;
m_busy = true;
UpdateStatusBar();
m_text->AppendText(_("\n=== Test 3 begins ===\n"));
@@ -514,7 +514,7 @@ void MyFrame::OnTest3(wxCommandEvent& WXUNUSED(event))
m_text->AppendText(_("=== Test 3 ends ===\n"));
delete[] buf2;
m_busy = FALSE;
m_busy = false;
UpdateStatusBar();
}