// and show it (the frames, unlike simple controls, are not shown when
// created initially)
- frame->Show(TRUE);
+ frame->Show(true);
// 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.
- return TRUE;
+ return true;
#else
wxMessageBox( _T("This sample has to be compiled with wxUSE_ACCESSIBILITY"), _T("Building error"), wxOK);
- return FALSE;
+ return false;
#endif // wxUSE_ACCESSIBILITY
}
// Gets a variant representing the selected children
// of this object.
// Acceptable values:
- // - a null variant (IsNull() returns TRUE)
+ // - a null variant (IsNull() returns true)
// - a list variant (GetType() == wxT("list"))
// - an integer representing the selected child element,
// or 0 if this object is selected (GetType() == wxT("long"))
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
- : wxFrame(NULL, -1, title, pos, size, style)
+ : wxFrame(NULL, wxID_ANY, title, pos, size, style)
{
m_textCtrl = NULL;
#endif // wxUSE_STATUSBAR
- wxSplitterWindow* splitter = new wxSplitterWindow(this, -1);
+ wxSplitterWindow* splitter = new wxSplitterWindow(this, wxID_ANY);
splitter->SetAccessible(new SplitterWindowAccessible(splitter));
- wxListBox* listBox = new wxListBox(splitter, -1);
+ wxListBox* listBox = new wxListBox(splitter, wxID_ANY);
listBox->Append(wxT("Cabbages"));
listBox->Append(wxT("Kings"));
listBox->Append(wxT("Sealing wax"));
listBox->CreateAccessible();
listBox->SetHelpText(wxT("This is a sample wxWidgets listbox, with a number of items in it."));
- m_textCtrl = new wxTextCtrl(splitter, -1, wxT(""), wxDefaultPosition,
+ m_textCtrl = new wxTextCtrl(splitter, wxID_ANY, wxT(""), wxDefaultPosition,
wxDefaultSize, wxTE_MULTILINE);
m_textCtrl->CreateAccessible();
m_textCtrl->SetHelpText(wxT("This is a sample wxWidgets multiline text control."));
splitter->SplitHorizontally(listBox, m_textCtrl, 150);
#if 0
- wxScrolledWindow* scrolledWindow = new wxScrolledWindow(this, -1);
+ wxScrolledWindow* scrolledWindow = new wxScrolledWindow(this, wxID_ANY);
scrolledWindow->SetAccessible(new ScrolledWindowAccessible(scrolledWindow));
#endif
}
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))
wxString str;
str.Printf(wxT("Name = %s; Role = %s"), name.c_str(), role.c_str());
- str.Pad(indent, wxT(' '), FALSE);
+ str.Pad(indent, wxT(' '), false);
Log(str);
}
{
wxString str;
str.Printf(wxT("There are %d children."), (int) childCount);
- str.Pad(indent, wxT(' '), FALSE);
+ str.Pad(indent, wxT(' '), false);
Log(str);
Log(wxT(""));
}
wxString str;
str.Printf(wxT("%d) Name = %s; Role = %s"), i, name.c_str(), role.c_str());
- str.Pad(indent, wxT(' '), FALSE);
+ str.Pad(indent, wxT(' '), false);
Log(str);
VARIANT var;
{
wxString str;
str.Printf(wxT("This is a real object."));
- str.Pad(indent+4, wxT(' '), FALSE);
+ str.Pad(indent+4, wxT(' '), false);
Log(str);
if (pDisp->QueryInterface(IID_IAccessible, (LPVOID*) & childObject) == S_OK)
{
wxString str;
str.Printf(wxT("This is an element."));
- str.Pad(indent+4, wxT(' '), FALSE);
+ str.Pad(indent+4, wxT(' '), false);
Log(str);
}
// Log(wxT(""));
// Gets a variant representing the selected children
// of this object.
// Acceptable values:
-// - a null variant (IsNull() returns TRUE)
+// - a null variant (IsNull() returns true)
// - a list variant (GetType() == wxT("list"))
// - an integer representing the selected child element,
// or 0 if this object is selected (GetType() == wxT("long"))
#include "null.xpm"
BEGIN_EVENT_TABLE(wxArtBrowserDialog, wxDialog)
- EVT_LIST_ITEM_SELECTED(-1, wxArtBrowserDialog::OnSelectItem)
- EVT_CHOICE(-1, wxArtBrowserDialog::OnChooseClient)
+ EVT_LIST_ITEM_SELECTED(wxID_ANY, wxArtBrowserDialog::OnSelectItem)
+ EVT_CHOICE(wxID_ANY, wxArtBrowserDialog::OnChooseClient)
END_EVENT_TABLE()
wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent)
- : wxDialog(parent, -1, _T("Art resources browser"),
+ : wxDialog(parent, wxID_ANY, _T("Art resources browser"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
wxSizer *subsizer;
- wxChoice *choice = new wxChoice(this, -1);
+ wxChoice *choice = new wxChoice(this, wxID_ANY);
FillClients(choice);
subsizer = new wxBoxSizer(wxHORIZONTAL);
- subsizer->Add(new wxStaticText(this, -1, _T("Client:")), 0, wxALIGN_CENTER_VERTICAL);
+ subsizer->Add(new wxStaticText(this, wxID_ANY, _T("Client:")), 0, wxALIGN_CENTER_VERTICAL);
subsizer->Add(choice, 1, wxLEFT, 5);
sizer->Add(subsizer, 0, wxALL | wxEXPAND, 10);
subsizer = new wxBoxSizer(wxHORIZONTAL);
- m_list = new wxListCtrl(this, -1, wxDefaultPosition, wxSize(250, 300),
+ m_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 300),
wxLC_REPORT | wxSUNKEN_BORDER);
m_list->InsertColumn(0, _T("wxArtID"));
subsizer->Add(m_list, 1, wxEXPAND | wxRIGHT, 10);
wxSizer *subsub = new wxBoxSizer(wxVERTICAL);
- m_canvas = new wxStaticBitmap(this, -1, wxBitmap(null_xpm));
+ m_canvas = new wxStaticBitmap(this, wxID_ANY, wxBitmap(null_xpm));
subsub->Add(m_canvas);
subsub->Add(100, 100);
subsizer->Add(subsub);
sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10);
SetSizer(sizer);
- SetAutoLayout(TRUE);
+ SetAutoLayout(true);
sizer->Fit(this);
choice->SetSelection(6/*wxART_MESSAGE_BOX*/);
// create the main application window
MyFrame *frame = new MyFrame(_T("wxArtProvider sample"),
wxPoint(50, 50), wxSize(450, 340));
- frame->Show(TRUE);
- return TRUE;
+ frame->Show(true);
+ return true;
}
// ----------------------------------------------------------------------------
// frame constructor
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style)
- : wxFrame(NULL, -1, title, pos, size, style)
+ : wxFrame(NULL, wxID_ANY, title, pos, size, style)
{
SetIcon(wxICON(mondrian));
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::OnLogs(wxCommandEvent& WXUNUSED(event))
frame->Show(true);
// 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.
return true;
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
- // TRUE is to force the frame to close
+ // true is to force the frame to close
Close(true);
}
MyFrame *frame = new MyFrame(_T("Caret wxWidgets sample"),
wxPoint(50, 50), wxSize(450, 340));
- frame->Show(TRUE);
+ frame->Show(true);
// 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.
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
// frame constructor
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)
{
// set the frame icon
SetIcon(wxICON(mondrian));
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))
END_EVENT_TABLE()
MyCanvas::MyCanvas( wxWindow *parent )
- : wxScrolledWindow( parent, -1,
+ : wxScrolledWindow( parent, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
wxSUNKEN_BORDER )
{
// create the main program window
MyFrame *frame = new MyFrame;
- frame->Show(TRUE);
+ frame->Show(true);
SetTopWindow(frame);
// use our config object...
wxICON_INFORMATION | wxOK);
}
- return TRUE;
+ return true;
}
int MyApp::OnExit()
// main frame ctor
MyFrame::MyFrame()
- : wxFrame((wxFrame *) NULL, -1, _T("wxConfig Demo"))
+ : wxFrame((wxFrame *) NULL, wxID_ANY, _T("wxConfig Demo"))
{
// menu
wxMenu *file_menu = new wxMenu;
// child controls
wxPanel *panel = new wxPanel(this);
- (void)new wxStaticText(panel, -1, _T("These controls remember their values!"),
+ (void)new wxStaticText(panel, wxID_ANY, _T("These controls remember their values!"),
wxPoint(10, 10), wxSize(300, 20));
- m_text = new wxTextCtrl(panel, -1, _T(""), wxPoint(10, 40), wxSize(300, 20));
- m_check = new wxCheckBox(panel, -1, _T("show welcome message box at startup"),
+ m_text = new wxTextCtrl(panel, wxID_ANY, _T(""), wxPoint(10, 40), wxSize(300, 20));
+ m_check = new wxCheckBox(panel, wxID_ANY, _T("show welcome message box at startup"),
wxPoint(10, 70), wxSize(300, 20));
// restore the control's values from the config
void MyFrame::OnQuit(wxCommandEvent&)
{
- Close(TRUE);
+ Close(true);
}
void MyFrame::OnAbout(wxCommandEvent&)
#if wxUSE_CHOICE
panel = new wxPanel(m_notebook);
- m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,-1), 5, choices );
- m_choiceSorted = new wxChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,-1),
+ m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,wxDefaultSize.y), 5, choices );
+ m_choiceSorted = new wxChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,wxDefaultSize.y),
5, choices, wxCB_SORT );
SetChoiceClientData(wxT("choice"), m_choice);
(void)new wxStaticBox( panel, wxID_ANY, _T("&Box around combobox"),
wxPoint(5, 5), wxSize(150, 100));
m_combo = new MyComboBox( panel, ID_COMBO, _T("This"),
- wxPoint(20,25), wxSize(120, -1),
+ wxPoint(20,25), wxSize(120, wxDefaultSize.y),
5, choices,
wxCB_READONLY | wxPROCESS_ENTER);
m_combo->SetBackgroundColour(*wxBLUE);
m_gaugeVert = new wxGauge( panel, wxID_ANY, 100,
wxPoint(195,35), wxSize(30, 90),
wxGA_VERTICAL | wxGA_SMOOTH | wxNO_BORDER );
- m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1),
+ m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,wxDefaultSize.y),
wxSL_AUTOTICKS | wxSL_LABELS );
m_slider->SetTickFreq(40, 0);
#if wxUSE_TOOLTIPS
(void)new wxStaticText( panel, wxID_ANY,
_T("Drag the slider!"),
wxPoint(250,30),
- wxSize(240, -1)
+ wxSize(240, wxDefaultSize.y)
);
#else
(void)new wxStaticText( panel, wxID_ANY,
int initialSpinValue = -5;
wxString s;
s << initialSpinValue;
- m_spintext = new wxTextCtrl( panel, wxID_ANY, s, wxPoint(20,160), wxSize(80,-1) );
+ m_spintext = new wxTextCtrl( panel, wxID_ANY, s, wxPoint(20,160), wxSize(80,wxDefaultSize.y) );
#if wxUSE_SPINBTN
- m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,160), wxSize(80, -1) );
+ m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,160), wxSize(80, wxDefaultSize.y) );
m_spinbutton->SetRange(-40,30);
m_spinbutton->SetValue(initialSpinValue);
#endif // wxUSE_SPINBTN
#if wxUSE_SPINCTRL
- m_spinctrl = new wxSpinCtrl( panel, ID_SPINCTRL, _T(""), wxPoint(200, 160), wxSize(80, -1) );
+ m_spinctrl = new wxSpinCtrl( panel, ID_SPINCTRL, _T(""), wxPoint(200, 160), wxSize(80, wxDefaultSize.y) );
m_spinctrl->SetRange(10,30);
m_spinctrl->SetValue(15);
#endif // wxUSE_SPINCTRL
wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer *csizer =
- new wxStaticBoxSizer (new wxStaticBox (panel, wxID_ANY, _T("Show Buttons")),
- wxHORIZONTAL );
+ new wxStaticBoxSizer (new wxStaticBox (panel, wxID_ANY, _T("Show Buttons")), wxHORIZONTAL );
wxCheckBox *check1, *check2, *check3, *check4, *check14, *checkBig;
check1 = new wxCheckBox (panel, ID_SIZER_CHECK1, _T("1"));
}
case ID_LISTBOX_SEL_STR:
{
- if (m_listbox->FindString(_T("This")) > -1)
+ if (m_listbox->FindString(_T("This")) != wxNOT_FOUND)
m_listbox->SetStringSelection( _T("This") );
- if (m_listboxSorted->FindString(_T("This")) > -1)
+ if (m_listboxSorted->FindString(_T("This")) != wxNOT_FOUND)
m_listboxSorted->SetStringSelection( _T("This") );
m_lbSelectNum->WarpPointer( 40, 14 );
break;