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

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-05-28 10:43:39 +00:00
parent a60a147a8c
commit 07850a4950
6 changed files with 78 additions and 78 deletions

View File

@@ -143,7 +143,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
{ {
m_currentlyHighlighted->Draw(dc); m_currentlyHighlighted->Draw(dc);
} }
m_draggedShape->SetShow(TRUE); m_draggedShape->SetShow(true);
m_draggedShape->Draw(dc); m_draggedShape->Draw(dc);
m_currentlyHighlighted = (DragShape*) NULL; m_currentlyHighlighted = (DragShape*) NULL;
@@ -169,7 +169,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
delete m_dragImage; delete m_dragImage;
// Erase the dragged shape from the canvas // Erase the dragged shape from the canvas
m_draggedShape->SetShow(FALSE); m_draggedShape->SetShow(false);
wxClientDC dc(this); wxClientDC dc(this);
EraseShape(m_draggedShape, dc); EraseShape(m_draggedShape, dc);
DrawShapes(dc); DrawShapes(dc);
@@ -229,17 +229,17 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event)
// We're currently dragging. See if we're over another shape. // We're currently dragging. See if we're over another shape.
DragShape* onShape = FindShape(event.GetPosition()); DragShape* onShape = FindShape(event.GetPosition());
bool mustUnhighlightOld = FALSE; bool mustUnhighlightOld = false;
bool mustHighlightNew = FALSE; bool mustHighlightNew = false;
if (m_currentlyHighlighted) if (m_currentlyHighlighted)
{ {
if ((onShape == (DragShape*) NULL) || (m_currentlyHighlighted != onShape)) if ((onShape == (DragShape*) NULL) || (m_currentlyHighlighted != onShape))
mustUnhighlightOld = TRUE; mustUnhighlightOld = true;
} }
if (onShape && (onShape != m_currentlyHighlighted) && onShape->IsShown()) if (onShape && (onShape != m_currentlyHighlighted) && onShape->IsShown())
mustHighlightNew = TRUE; mustHighlightNew = true;
if (mustUnhighlightOld || mustHighlightNew) if (mustUnhighlightOld || mustHighlightNew)
m_dragImage->Hide(); m_dragImage->Hide();
@@ -327,12 +327,12 @@ BEGIN_EVENT_TABLE(MyFrame,wxFrame)
END_EVENT_TABLE() END_EVENT_TABLE()
MyFrame::MyFrame() MyFrame::MyFrame()
: wxFrame( (wxFrame *)NULL, -1, _T("wxDragImage sample"), : wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxDragImage sample"),
wxPoint(20,20), wxSize(470,360) ) wxPoint(20,20), wxSize(470,360) )
{ {
wxMenu *file_menu = new wxMenu(); wxMenu *file_menu = new wxMenu();
file_menu->Append( wxID_ABOUT, _T("&About...")); file_menu->Append( wxID_ABOUT, _T("&About..."));
file_menu->Append( TEST_USE_SCREEN, _T("&Use whole screen for dragging"), _T("Use whole screen"), TRUE); file_menu->Append( TEST_USE_SCREEN, _T("&Use whole screen for dragging"), _T("Use whole screen"), true);
file_menu->Append( wxID_EXIT, _T("E&xit")); file_menu->Append( wxID_EXIT, _T("E&xit"));
wxMenuBar *menu_bar = new wxMenuBar(); wxMenuBar *menu_bar = new wxMenuBar();
@@ -345,12 +345,12 @@ MyFrame::MyFrame()
int widths[] = { -1, 100 }; int widths[] = { -1, 100 };
SetStatusWidths( 2, widths ); SetStatusWidths( 2, widths );
m_canvas = new MyCanvas( this, -1, wxPoint(0,0), wxSize(10,10) ); m_canvas = new MyCanvas( this, wxID_ANY, wxPoint(0,0), wxSize(10,10) );
} }
void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) ) void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) )
{ {
Close( TRUE ); Close( true );
} }
void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) ) void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
@@ -372,7 +372,7 @@ END_EVENT_TABLE()
MyApp::MyApp() MyApp::MyApp()
{ {
// Drag across whole screen // Drag across whole screen
m_useScreen = FALSE; m_useScreen = false;
} }
bool MyApp::OnInit() bool MyApp::OnInit()
@@ -431,9 +431,9 @@ bool MyApp::OnInit()
m_background = bitmap; m_background = bitmap;
#endif #endif
frame->Show( TRUE ); frame->Show( true );
return TRUE; return true;
} }
int MyApp::OnExit() int MyApp::OnExit()
@@ -452,7 +452,7 @@ bool MyApp::TileBitmap(const wxRect& rect, wxDC& dc, wxBitmap& bitmap)
for (j = rect.y; j < rect.y + rect.height; j+= h) for (j = rect.y; j < rect.y + rect.height; j+= h)
dc.DrawBitmap(bitmap, i, j); dc.DrawBitmap(bitmap, i, j);
} }
return TRUE; return true;
} }
void MyApp::OnUseScreen(wxCommandEvent& WXUNUSED(event)) void MyApp::OnUseScreen(wxCommandEvent& WXUNUSED(event))
@@ -468,7 +468,7 @@ DragShape::DragShape(const wxBitmap& bitmap)
m_pos.x = 0; m_pos.x = 0;
m_pos.y = 0; m_pos.y = 0;
m_dragMethod = SHAPE_DRAG_BITMAP; m_dragMethod = SHAPE_DRAG_BITMAP;
m_show = TRUE; m_show = true;
} }
DragShape::~DragShape() DragShape::~DragShape()
@@ -489,11 +489,11 @@ bool DragShape::Draw(wxDC& dc, int op)
memDC.SelectObject(m_bitmap); memDC.SelectObject(m_bitmap);
dc.Blit(m_pos.x, m_pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight(), dc.Blit(m_pos.x, m_pos.y, m_bitmap.GetWidth(), m_bitmap.GetHeight(),
& memDC, 0, 0, op, TRUE); & memDC, 0, 0, op, true);
return TRUE; return true;
} }
else else
return FALSE; return false;
} }

View File

@@ -59,10 +59,10 @@ bool MyApp::OnInit(void)
// Create the main frame window // Create the main frame window
MyFrame *frame = new MyFrame(NULL, _T("Dynamic wxWidgets App"), 50, 50, 450, 340); MyFrame *frame = new MyFrame(NULL, _T("Dynamic wxWidgets App"), 50, 50, 450, 340);
frame->Connect( DYNAMIC_QUIT, -1, wxEVT_COMMAND_MENU_SELECTED, frame->Connect( DYNAMIC_QUIT, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED,
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
&MyFrame::OnQuit ); &MyFrame::OnQuit );
frame->Connect( DYNAMIC_ABOUT, -1, wxEVT_COMMAND_MENU_SELECTED, frame->Connect( DYNAMIC_ABOUT, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED,
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
&MyFrame::OnAbout ); &MyFrame::OnAbout );
@@ -83,26 +83,26 @@ bool MyApp::OnInit(void)
frame->SetMenuBar(menu_bar); frame->SetMenuBar(menu_bar);
// Make a panel with a message // Make a panel with a message
wxPanel *panel = new wxPanel(frame, -1, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL); wxPanel *panel = new wxPanel(frame, wxID_ANY, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL);
(void)new wxStaticText(panel, 311, _T("Hello!"), wxPoint(10, 10), wxSize(-1, -1), 0); (void)new wxStaticText(panel, 311, _T("Hello!"), wxPoint(10, 10), wxDefaultSize, 0);
// Show the frame // Show the frame
frame->Show(TRUE); frame->Show(true);
SetTopWindow(frame); SetTopWindow(frame);
return TRUE; return true;
} }
// My frame constructor // My frame constructor
MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)) wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
{} {}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
{ {
Close(TRUE); Close(true);
} }
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )

View File

@@ -105,9 +105,9 @@ bool MyApp::OnInit()
MyFrame *frame = new MyFrame(_T("Erase sample"), MyFrame *frame = new MyFrame(_T("Erase sample"),
wxPoint(50, 50), wxSize(450, 340)); wxPoint(50, 50), wxSize(450, 340));
frame->Show(TRUE); frame->Show(true);
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -121,7 +121,7 @@ END_EVENT_TABLE()
// frame constructor // frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size) : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
{ {
SetIcon(wxICON(mondrian)); SetIcon(wxICON(mondrian));
@@ -150,7 +150,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
Close(TRUE); Close(true);
} }
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -167,7 +167,7 @@ BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
END_EVENT_TABLE() END_EVENT_TABLE()
MyCanvas::MyCanvas( MyFrame *parent ) MyCanvas::MyCanvas( MyFrame *parent )
: wxScrolledWindow( parent, -1, wxDefaultPosition, wxDefaultSize, : wxScrolledWindow( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxScrolledWindowStyle | wxScrolledWindowStyle |
wxNO_FULL_REPAINT_ON_RESIZE| wxNO_FULL_REPAINT_ON_RESIZE|
wxSUNKEN_BORDER ) wxSUNKEN_BORDER )
@@ -176,7 +176,7 @@ MyCanvas::MyCanvas( MyFrame *parent )
m_bitmap = wxBitmap( wxICON(mondrian) ); m_bitmap = wxBitmap( wxICON(mondrian) );
new wxStaticBitmap( this, -1, m_bitmap, wxPoint(80,20) ); new wxStaticBitmap( this, wxID_ANY, m_bitmap, wxPoint(80,20) );
} }
void MyCanvas::OnChar( wxKeyEvent &event ) void MyCanvas::OnChar( wxKeyEvent &event )
@@ -211,7 +211,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.SetBrush( *wxBLACK_BRUSH ); dc.SetBrush( *wxBLACK_BRUSH );
dc.DrawRectangle( 0,0,200,50 ); dc.DrawRectangle( 0,0,200,50 );
dc.DrawBitmap( m_bitmap, 10, 20, TRUE ); dc.DrawBitmap( m_bitmap, 10, 20, true );
dc.SetTextForeground(*wxBLUE); dc.SetTextForeground(*wxBLUE);
dc.DrawText(_T("This text is drawn from OnPaint"), 65, 65); dc.DrawText(_T("This text is drawn from OnPaint"), 65, 65);

View File

@@ -59,7 +59,7 @@ DEFINE_EVENT_TYPE(wxEVT_MY_CUSTOM_COMMAND)
// it may also be convenient to define an event table macro for this event type // it may also be convenient to define an event table macro for this event type
#define EVT_MY_CUSTOM_COMMAND(id, fn) \ #define EVT_MY_CUSTOM_COMMAND(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \ DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_MY_CUSTOM_COMMAND, id, -1, \ wxEVT_MY_CUSTOM_COMMAND, id, wxID_ANY, \
(wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \ (wxObjectEventFunction)(wxEventFunction) wxStaticCastEvent( wxCommandEventFunction, &fn ), \
(wxObject *) NULL \ (wxObject *) NULL \
), ),
@@ -178,10 +178,10 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_UPDATE_UI(Event_Pop, MyFrame::OnUpdateUIPop) EVT_UPDATE_UI(Event_Pop, MyFrame::OnUpdateUIPop)
EVT_MY_CUSTOM_COMMAND(-1, MyFrame::OnProcessCustom) EVT_MY_CUSTOM_COMMAND(wxID_ANY, MyFrame::OnProcessCustom)
// this would also work: // this would also work:
//EVT_CUSTOM(wxEVT_MY_CUSTOM_COMMAND, -1, MyFrame::OnProcessCustom) //EVT_CUSTOM(wxEVT_MY_CUSTOM_COMMAND, wxID_ANY, MyFrame::OnProcessCustom)
END_EVENT_TABLE() END_EVENT_TABLE()
BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler) BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler)
@@ -212,12 +212,12 @@ bool MyApp::OnInit()
// and show it (the frames, unlike simple controls, are not shown when // and show it (the frames, unlike simple controls, are not shown when
// created initially) // created initially)
frame->Show(TRUE); frame->Show(true);
// success: wxApp::OnRun() will be called which will enter the main message // success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned FALSE here, the // loop and the application will run. If we returned false here, the
// application would exit immediately. // application would exit immediately.
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -226,7 +226,7 @@ bool MyApp::OnInit()
// frame constructor // frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size) : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
{ {
// init members // init members
m_nPush = 0; m_nPush = 0;
@@ -241,7 +241,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
wxMenu *menuEvent = new wxMenu; wxMenu *menuEvent = new wxMenu;
menuEvent->Append(Event_Connect, _T("&Connect\tCtrl-C"), menuEvent->Append(Event_Connect, _T("&Connect\tCtrl-C"),
_T("Connect or disconnect the dynamic event handler"), _T("Connect or disconnect the dynamic event handler"),
TRUE /* checkable */); true /* checkable */);
menuEvent->Append(Event_Dynamic, _T("&Dynamic event\tCtrl-D"), menuEvent->Append(Event_Dynamic, _T("&Dynamic event\tCtrl-D"),
_T("Dynamic event sample - only works after Connect")); _T("Dynamic event sample - only works after Connect"));
menuEvent->AppendSeparator(); menuEvent->AppendSeparator();
@@ -277,7 +277,7 @@ MyFrame::~MyFrame()
// crashes! // crashes!
while ( m_nPush-- != 0 ) while ( m_nPush-- != 0 )
{ {
PopEventHandler(TRUE /* delete handler */); PopEventHandler(true /* delete handler */);
} }
} }
@@ -287,8 +287,8 @@ MyFrame::~MyFrame()
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
// TRUE is to force the frame to close // true is to force the frame to close
Close(TRUE); Close(true);
} }
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -317,7 +317,7 @@ void MyFrame::OnConnect(wxCommandEvent& event)
if ( event.IsChecked() ) if ( event.IsChecked() )
{ {
// disconnect // disconnect
Connect(Event_Dynamic, -1, wxEVT_COMMAND_MENU_SELECTED, Connect(Event_Dynamic, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED,
(wxObjectEventFunction) (wxObjectEventFunction)
(wxEventFunction) (wxEventFunction)
(wxCommandEventFunction)&MyFrame::OnDynamic); (wxCommandEventFunction)&MyFrame::OnDynamic);
@@ -327,7 +327,7 @@ void MyFrame::OnConnect(wxCommandEvent& event)
} }
else // connect else // connect
{ {
Disconnect(Event_Dynamic, -1, wxEVT_COMMAND_MENU_SELECTED); Disconnect(Event_Dynamic, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED);
SetStatusText(_T("You can no more use \"Dynamic\" item in the menu")); SetStatusText(_T("You can no more use \"Dynamic\" item in the menu"));
SetStatusText(_T("Dynamic: off"), Status_Dynamic); SetStatusText(_T("Dynamic: off"), Status_Dynamic);
@@ -349,7 +349,7 @@ void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event))
{ {
wxCHECK_RET( m_nPush, _T("this command should be disabled!") ); wxCHECK_RET( m_nPush, _T("this command should be disabled!") );
PopEventHandler(TRUE /* delete handler */); PopEventHandler(true /* delete handler */);
m_nPush--; m_nPush--;
SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push); SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push);

View File

@@ -338,18 +338,18 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_IDLE(MyFrame::OnIdle) EVT_IDLE(MyFrame::OnIdle)
EVT_TIMER(-1, MyFrame::OnTimer) EVT_TIMER(wxID_ANY, MyFrame::OnTimer)
END_EVENT_TABLE() END_EVENT_TABLE()
BEGIN_EVENT_TABLE(MyPipeFrame, wxFrame) BEGIN_EVENT_TABLE(MyPipeFrame, wxFrame)
EVT_BUTTON(Exec_Btn_Send, MyPipeFrame::OnBtnSend) EVT_BUTTON(Exec_Btn_Send, MyPipeFrame::OnBtnSend)
EVT_BUTTON(Exec_Btn_Get, MyPipeFrame::OnBtnGet) EVT_BUTTON(Exec_Btn_Get, MyPipeFrame::OnBtnGet)
EVT_TEXT_ENTER(-1, MyPipeFrame::OnTextEnter) EVT_TEXT_ENTER(wxID_ANY, MyPipeFrame::OnTextEnter)
EVT_CLOSE(MyPipeFrame::OnClose) EVT_CLOSE(MyPipeFrame::OnClose)
EVT_END_PROCESS(-1, MyPipeFrame::OnProcessTerm) EVT_END_PROCESS(wxID_ANY, MyPipeFrame::OnProcessTerm)
END_EVENT_TABLE() END_EVENT_TABLE()
// Create a new application object: this macro will allow wxWidgets to create // Create a new application object: this macro will allow wxWidgets to create
@@ -375,13 +375,13 @@ bool MyApp::OnInit()
wxDefaultPosition, wxSize(500, 140)); wxDefaultPosition, wxSize(500, 140));
// Show it and tell the application that it's our main window // Show it and tell the application that it's our main window
frame->Show(TRUE); frame->Show(true);
SetTopWindow(frame); SetTopWindow(frame);
// success: wxApp::OnRun() will be called which will enter the main message // success: wxApp::OnRun() will be called which will enter the main message
// loop and the application will run. If we returned FALSE here, the // loop and the application will run. If we returned false here, the
// application would exit immediately. // application would exit immediately.
return TRUE; return true;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -394,7 +394,7 @@ bool MyApp::OnInit()
// frame constructor // frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size), : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size),
m_timerIdleWakeUp(this) m_timerIdleWakeUp(this)
{ {
m_pidLast = 0; m_pidLast = 0;
@@ -452,7 +452,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
SetMenuBar(menuBar); SetMenuBar(menuBar);
// create the listbox in which we will show misc messages as they come // create the listbox in which we will show misc messages as they come
m_lbox = new wxListBox(this, -1); m_lbox = new wxListBox(this, wxID_ANY);
wxFont font(12, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFont font(12, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL,
wxFONTWEIGHT_NORMAL); wxFONTWEIGHT_NORMAL);
if ( font.Ok() ) if ( font.Ok() )
@@ -471,8 +471,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
// TRUE is to force the frame to close // true is to force the frame to close
Close(TRUE); Close(true);
} }
void MyFrame::OnClear(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnClear(wxCommandEvent& WXUNUSED(event))
@@ -669,11 +669,11 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event))
wxYES_NO | wxCANCEL | wxICON_QUESTION, this) ) wxYES_NO | wxCANCEL | wxICON_QUESTION, this) )
{ {
case wxYES: case wxYES:
sync = TRUE; sync = true;
break; break;
case wxNO: case wxNO:
sync = FALSE; sync = false;
break; break;
default: default:
@@ -823,23 +823,23 @@ bool MyFrame::GetDDEServer()
wxString server = wxGetTextFromUser(_T("Server to connect to:"), wxString server = wxGetTextFromUser(_T("Server to connect to:"),
DIALOG_TITLE, m_server); DIALOG_TITLE, m_server);
if ( !server ) if ( !server )
return FALSE; return false;
m_server = server; m_server = server;
wxString topic = wxGetTextFromUser(_T("DDE topic:"), DIALOG_TITLE, m_topic); wxString topic = wxGetTextFromUser(_T("DDE topic:"), DIALOG_TITLE, m_topic);
if ( !topic ) if ( !topic )
return FALSE; return false;
m_topic = topic; m_topic = topic;
wxString cmd = wxGetTextFromUser(_T("DDE command:"), DIALOG_TITLE, m_cmdDde); wxString cmd = wxGetTextFromUser(_T("DDE command:"), DIALOG_TITLE, m_cmdDde);
if ( !cmd ) if ( !cmd )
return FALSE; return false;
m_cmdDde = cmd; m_cmdDde = cmd;
return TRUE; return true;
} }
void MyFrame::OnDDEExec(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnDDEExec(wxCommandEvent& WXUNUSED(event))
@@ -963,7 +963,7 @@ void MyProcess::OnTerminate(int pid, int status)
bool MyPipedProcess::HasInput() bool MyPipedProcess::HasInput()
{ {
bool hasInput = FALSE; bool hasInput = false;
if ( IsInputAvailable() ) if ( IsInputAvailable() )
{ {
@@ -975,7 +975,7 @@ bool MyPipedProcess::HasInput()
m_parent->GetLogListBox()->Append(msg); m_parent->GetLogListBox()->Append(msg);
hasInput = TRUE; hasInput = true;
} }
if ( IsErrorAvailable() ) if ( IsErrorAvailable() )
@@ -988,7 +988,7 @@ bool MyPipedProcess::HasInput()
m_parent->GetLogListBox()->Append(msg); m_parent->GetLogListBox()->Append(msg);
hasInput = TRUE; hasInput = true;
} }
return hasInput; return hasInput;
@@ -1020,7 +1020,7 @@ bool MyPipedProcess2::HasInput()
m_input.clear(); m_input.clear();
// call us once again - may be we'll have output // call us once again - may be we'll have output
return TRUE; return true;
} }
return MyPipedProcess::HasInput(); return MyPipedProcess::HasInput();
@@ -1033,7 +1033,7 @@ bool MyPipedProcess2::HasInput()
MyPipeFrame::MyPipeFrame(wxFrame *parent, MyPipeFrame::MyPipeFrame(wxFrame *parent,
const wxString& cmd, const wxString& cmd,
wxProcess *process) wxProcess *process)
: wxFrame(parent, -1, cmd), : wxFrame(parent, wxID_ANY, cmd),
m_process(process), m_process(process),
// in a real program we'd check that the streams are !NULL here // in a real program we'd check that the streams are !NULL here
m_in(*process->GetInputStream()), m_in(*process->GetInputStream()),
@@ -1041,13 +1041,13 @@ MyPipeFrame::MyPipeFrame(wxFrame *parent,
{ {
m_process->SetNextHandler(this); m_process->SetNextHandler(this);
wxPanel *panel = new wxPanel(this, -1); wxPanel *panel = new wxPanel(this, wxID_ANY);
m_textIn = new wxTextCtrl(panel, -1, _T(""), m_textIn = new wxTextCtrl(panel, wxID_ANY, _T(""),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER); wxTE_PROCESS_ENTER);
m_textOut = new wxTextCtrl(panel, -1, _T("")); m_textOut = new wxTextCtrl(panel, wxID_ANY, _T(""));
m_textOut->SetEditable(FALSE); m_textOut->SetEditable(false);
wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
sizerTop->Add(m_textIn, 0, wxGROW | wxALL, 5); sizerTop->Add(m_textIn, 0, wxGROW | wxALL, 5);

View File

@@ -127,7 +127,7 @@ private:
class MyApp : public wxApp class MyApp : public wxApp
{ {
public: public:
virtual bool OnInit() { (new MyFrame())->Show(); return TRUE; } virtual bool OnInit() { (new MyFrame())->Show(); return true; }
}; };
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -192,7 +192,7 @@ IMPLEMENT_APP(MyApp)
// frame constructor // frame constructor
MyFrame::MyFrame() MyFrame::MyFrame()
: wxFrame(NULL, -1, _T("HtmlLbox wxWidgets Sample"), : wxFrame(NULL, wxID_ANY, _T("HtmlLbox wxWidgets Sample"),
wxDefaultPosition, wxSize(400, 500)) wxDefaultPosition, wxSize(400, 500))
{ {
// set the frame icon // set the frame icon
@@ -248,7 +248,7 @@ MyFrame::MyFrame()
// create the child controls // create the child controls
m_hlbox = new MyHtmlListBox(this); m_hlbox = new MyHtmlListBox(this);
wxTextCtrl *text = new wxTextCtrl(this, -1, _T(""), wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, _T(""),
wxDefaultPosition, wxDefaultSize, wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE); wxTE_MULTILINE);
delete wxLog::SetActiveTarget(new wxLogTextCtrl(text)); delete wxLog::SetActiveTarget(new wxLogTextCtrl(text));
@@ -272,8 +272,8 @@ MyFrame::~MyFrame()
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
// TRUE is to force the frame to close // true is to force the frame to close
Close(TRUE); Close(true);
} }
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -398,7 +398,7 @@ void MyFrame::OnLboxSelect(wxCommandEvent& event)
// ============================================================================ // ============================================================================
MyHtmlListBox::MyHtmlListBox(wxWindow *parent, bool multi) MyHtmlListBox::MyHtmlListBox(wxWindow *parent, bool multi)
: wxHtmlListBox(parent, -1, wxDefaultPosition, wxDefaultSize, : wxHtmlListBox(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
multi ? wxLB_MULTIPLE : 0) multi ? wxLB_MULTIPLE : 0)
{ {
m_change = true; m_change = true;