removed SetAutoLayout(true) calls when a corresponding SetSizer() was also called (the latter already calls SetAutoLayout(true) in case of a non-NULL window); usual cleanup: removing tabs and end of line whitespace, TRUE->true, FALSE->false, -1->wxID_ANY, Enable(false)->Disable(), ""->wxEmptyString

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Dimitri Schoolwerth
2004-06-12 23:44:08 +00:00
parent 3d4875664f
commit dabbc6a5a1
47 changed files with 560 additions and 584 deletions

View File

@@ -48,7 +48,6 @@ bool MyApp::OnInit()
sizer->Add(5,5);
sizer->Add(new wxButton(&dlg, wxID_OK, _("OK")), 0, wxALIGN_RIGHT | wxALL, 10);
dlg.SetAutoLayout(true);
dlg.SetSizer(sizer);
sizer->Fit(&dlg);
dlg.Centre();

View File

@@ -169,13 +169,13 @@ bool MMBoardApp::OnInit()
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
frame->Show(TRUE);
frame->Show();
m_caps = TestMultimediaCaps();
if (!m_caps) {
wxMessageBox(_T("Your system has no multimedia capabilities. We are exiting now."), _T("Major error !"), wxOK | wxICON_ERROR, NULL);
return FALSE;
return false;
}
wxString msg;
@@ -186,9 +186,9 @@ bool MMBoardApp::OnInit()
wxMessageBox(msg, _T("Good !"), wxOK | wxICON_INFORMATION, NULL);
// 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;
}
wxUint8 MMBoardApp::TestMultimediaCaps()
@@ -241,7 +241,7 @@ wxUint8 MMBoardApp::TestMultimediaCaps()
// frame constructor
MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
: wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)
{
#ifdef __WXMAC__
// we need this in order to allow the about menu relocation, since ABOUT is
@@ -253,7 +253,7 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi
SetIcon(wxICON(mondrian));
// create a menu bar
wxMenu *menuFile = new wxMenu(wxT(""), wxMENU_TEAROFF);
wxMenu *menuFile = new wxMenu(wxEmptyString, wxMENU_TEAROFF);
// the "About" item should be in the help menu
wxMenu *helpMenu = new wxMenu;
@@ -280,25 +280,25 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi
// Misc variables
m_opened_file = NULL;
m_panel = new wxPanel(this, -1);
m_panel = new wxPanel(this, wxID_ANY);
// Initialize main slider
m_positionSlider = new wxSlider( m_panel, MMBoard_PositionSlider, 0, 0, 60,
wxDefaultPosition, wxSize(300, -1),
wxSL_HORIZONTAL | wxSL_AUTOTICKS);
m_positionSlider->SetPageSize(60); // 60 secs
m_positionSlider->Enable(FALSE);
m_positionSlider->Disable();
// Initialize info panel
wxPanel *infoPanel = new wxPanel( m_panel, -1);
wxPanel *infoPanel = new wxPanel( m_panel, wxID_ANY);
infoPanel->SetBackgroundColour(*wxBLACK);
infoPanel->SetForegroundColour(*wxWHITE);
wxBoxSizer *infoSizer = new wxBoxSizer(wxVERTICAL);
m_fileType = new wxStaticText(infoPanel, -1, wxT(""));
wxStaticLine *line = new wxStaticLine(infoPanel, -1);
m_infoText = new wxStaticText(infoPanel, -1, _T(""));
m_fileType = new wxStaticText(infoPanel, wxID_ANY, wxEmptyString);
wxStaticLine *line = new wxStaticLine(infoPanel, wxID_ANY);
m_infoText = new wxStaticText(infoPanel, wxID_ANY, wxEmptyString);
UpdateInfoText();
@@ -307,7 +307,6 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi
infoSizer->Add(m_infoText, 0, wxGROW | wxALL, 1);
infoPanel->SetSizer(infoSizer);
infoPanel->SetAutoLayout(TRUE);
// Bitmap button panel
wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL);
@@ -318,13 +317,13 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi
wxBitmap pause_bmp(pause_xpm);
m_playButton = new wxBitmapButton(m_panel, MMBoard_PlayButton, play_bmp);
m_playButton->Enable(FALSE);
m_playButton->Disable();
m_pauseButton = new wxBitmapButton(m_panel, MMBoard_PauseButton, pause_bmp);
m_pauseButton->Enable(FALSE);
m_pauseButton->Disable();
m_stopButton = new wxBitmapButton(m_panel, MMBoard_StopButton, stop_bmp);
m_stopButton->Enable(FALSE);
m_stopButton->Disable();
m_ejectButton = new wxBitmapButton(m_panel, MMBoard_EjectButton, eject_bmp);
m_ejectButton->Enable(FALSE);
m_ejectButton->Disable();
buttonSizer->Add(m_playButton, 0, wxALL, 2);
buttonSizer->Add(m_pauseButton, 0, wxALL, 2);
@@ -333,15 +332,14 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi
// Top sizer
m_sizer = new wxBoxSizer(wxVERTICAL);
m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0);
m_sizer->Add(new wxStaticLine(m_panel, wxID_ANY), 0, wxGROW | wxCENTRE, 0);
m_sizer->Add(m_positionSlider, 0, wxCENTRE | wxGROW | wxALL, 2);
m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0);
m_sizer->Add(new wxStaticLine(m_panel, wxID_ANY), 0, wxGROW | wxCENTRE, 0);
m_sizer->Add(buttonSizer, 0, wxALL, 0);
m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0);
m_sizer->Add(new wxStaticLine(m_panel, wxID_ANY), 0, wxGROW | wxCENTRE, 0);
m_sizer->Add(infoPanel, 1, wxCENTRE | wxGROW, 0);
m_panel->SetSizer(m_sizer);
m_panel->SetAutoLayout(TRUE);
m_sizer->Fit(this);
m_sizer->SetSizeHints(this);
@@ -368,7 +366,7 @@ void MMBoardFrame::OpenVideoWindow()
if (m_video_window)
return;
m_video_window = new wxWindow(m_panel, -1, wxDefaultPosition, wxSize(200, 200));
m_video_window = new wxWindow(m_panel, wxID_ANY, wxDefaultPosition, wxSize(200, 200));
m_video_window->SetBackgroundColour(*wxBLACK);
m_sizer->Prepend(m_video_window, 2, wxGROW | wxSHRINK | wxCENTRE, 1);
@@ -391,8 +389,8 @@ void MMBoardFrame::CloseVideoWindow()
void MMBoardFrame::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 MMBoardFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
@@ -439,9 +437,9 @@ void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event))
UpdateInfoText();
// Enable a few buttons
m_playButton->Enable(TRUE);
m_ejectButton->Enable(TRUE);
m_positionSlider->Enable(TRUE);
m_playButton->Enable();
m_ejectButton->Enable();
m_positionSlider->Enable();
if (m_opened_file->NeedWindow()) {
OpenVideoWindow();
@@ -498,32 +496,34 @@ void MMBoardFrame::OnRefreshInfo(wxEvent& WXUNUSED(event))
{
UpdateMMedInfo();
if (m_opened_file->IsStopped()) {
if (m_opened_file->IsStopped())
{
m_refreshTimer->Stop();
m_playButton->Enable(TRUE);
m_stopButton->Enable(FALSE);
m_pauseButton->Enable(FALSE);
m_playButton->Enable();
m_stopButton->Disable();
m_pauseButton->Disable();
}
}
void MMBoardFrame::OnPlay(wxCommandEvent& WXUNUSED(event))
{
m_stopButton->Enable(TRUE);
m_pauseButton->Enable(TRUE);
m_playButton->Enable(FALSE);
m_stopButton->Enable();
m_pauseButton->Enable();
m_playButton->Disable();
if (m_opened_file->IsPaused()) {
if (m_opened_file->IsPaused())
{
m_opened_file->Resume();
return;
}
m_refreshTimer->Start(1000, FALSE);
m_refreshTimer->Start(1000, false);
m_opened_file->Play();
m_stopButton->Enable(TRUE);
m_pauseButton->Enable(TRUE);
m_playButton->Enable(FALSE);
m_stopButton->Enable();
m_pauseButton->Enable();
m_playButton->Disable();
}
void MMBoardFrame::OnStop(wxCommandEvent& WXUNUSED(event))
@@ -531,8 +531,8 @@ void MMBoardFrame::OnStop(wxCommandEvent& WXUNUSED(event))
m_opened_file->Stop();
m_refreshTimer->Stop();
m_stopButton->Enable(FALSE);
m_playButton->Enable(TRUE);
m_stopButton->Disable();
m_playButton->Enable();
UpdateMMedInfo();
}
@@ -541,8 +541,8 @@ void MMBoardFrame::OnPause(wxCommandEvent& WXUNUSED(event))
{
m_opened_file->Pause();
m_playButton->Enable(TRUE);
m_pauseButton->Enable(FALSE);
m_playButton->Enable();
m_pauseButton->Disable();
}
void MMBoardFrame::OnEject(wxCommandEvent& WXUNUSED(event))
@@ -552,11 +552,11 @@ void MMBoardFrame::OnEject(wxCommandEvent& WXUNUSED(event))
delete m_opened_file;
m_opened_file = NULL;
m_playButton->Enable(FALSE);
m_pauseButton->Enable(FALSE);
m_stopButton->Enable(FALSE);
m_ejectButton->Enable(FALSE);
m_positionSlider->Enable(FALSE);
m_playButton->Disable();
m_pauseButton->Disable();
m_stopButton->Disable();
m_ejectButton->Disable();
m_positionSlider->Disable();
UpdateInfoText();
UpdateMMedInfo();

View File

@@ -218,7 +218,7 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event)
if (!m_propertySheet)
return;
if (win.GetName() == wxT(""))
if (win.GetName().empty())
return;
if (wxStrcmp(win.GetName(), wxT("ok")) == 0)

View File

@@ -156,7 +156,7 @@ bool wxPropertyListView::UpdatePropertyList(bool clearEditArea)
if (clearEditArea)
{
m_valueList->Clear();
m_valueText->SetValue( wxT("") );
m_valueText->SetValue(wxEmptyString);
}
wxNode *node = m_propertySheet->GetProperties().GetFirst();
@@ -248,7 +248,7 @@ bool wxPropertyListView::ShowProperty(wxProperty *property, bool select)
}
m_valueList->Clear();
m_valueText->SetValue( wxT("") );
m_valueText->SetValue(wxEmptyString);
if (property)
{
@@ -464,15 +464,15 @@ bool wxPropertyListView::CreateControls()
topsizer->Add( m_cancelButton, 0, wxLEFT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder );
}
m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, _T(""),
m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, wxEmptyString,
wxDefaultPosition, wxSize(wxDefaultSize.x, smallButtonSize.y), wxPROCESS_ENTER);
m_valueText->Enable(false);
m_valueText->Disable();
topsizer->Add( m_valueText, 1, wxALL | wxEXPAND, buttonborder );
if (m_buttonFlags & wxPROP_PULLDOWN)
{
m_editButton = new wxButton(panel, wxID_PROP_EDIT, _T("..."), wxDefaultPosition, smallButtonSize);
m_editButton->Enable(false);
m_editButton->Disable();
topsizer->Add( m_editButton, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder );
}
@@ -826,7 +826,7 @@ bool wxPropertyListValidator::OnSelect(bool select, wxProperty *property, wxProp
bool wxPropertyListValidator::OnValueListSelect(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
wxString s(view->GetValueList()->GetStringSelection());
if (s != wxT(""))
if ( !s.empty() )
{
view->GetValueText()->SetValue(s);
view->RetrieveProperty(property);
@@ -864,11 +864,11 @@ void wxPropertyListValidator::OnEdit(wxProperty *WXUNUSED(property), wxPropertyL
bool wxPropertyListValidator::OnClearControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
view->GetConfirmButton()->Enable(false);
view->GetConfirmButton()->Disable();
if (view->GetCancelButton())
view->GetCancelButton()->Enable(false);
view->GetCancelButton()->Disable();
if (view->GetEditButton())
view->GetEditButton()->Enable(false);
view->GetEditButton()->Disable();
return true;
}
@@ -929,13 +929,13 @@ bool wxRealListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListVi
bool wxRealListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
view->GetConfirmButton()->Enable(true);
view->GetConfirmButton()->Enable();
if (view->GetCancelButton())
view->GetCancelButton()->Enable(true);
view->GetCancelButton()->Enable();
if (view->GetEditButton())
view->GetEditButton()->Enable(false);
view->GetEditButton()->Disable();
if (view->GetValueText())
view->GetValueText()->Enable(true);
view->GetValueText()->Enable();
return true;
}
@@ -991,13 +991,13 @@ bool wxIntegerListValidator::OnRetrieveValue(wxProperty *property, wxPropertyLis
bool wxIntegerListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
view->GetConfirmButton()->Enable(true);
view->GetConfirmButton()->Enable();
if (view->GetCancelButton())
view->GetCancelButton()->Enable(true);
view->GetCancelButton()->Enable();
if (view->GetEditButton())
view->GetEditButton()->Enable(false);
view->GetEditButton()->Disable();
if (view->GetValueText())
view->GetValueText()->Enable(true);
view->GetValueText()->Enable();
return true;
}
@@ -1054,13 +1054,13 @@ bool wxBoolListValidator::OnDisplayValue(wxProperty *property, wxPropertyListVie
bool wxBoolListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
view->GetConfirmButton()->Enable(false);
view->GetConfirmButton()->Disable();
if (view->GetCancelButton())
view->GetCancelButton()->Enable(false);
view->GetCancelButton()->Disable();
if (view->GetEditButton())
view->GetEditButton()->Enable(true);
view->GetEditButton()->Enable();
if (view->GetValueText())
view->GetValueText()->Enable(false);
view->GetValueText()->Disable();
return true;
}
@@ -1069,7 +1069,7 @@ bool wxBoolListValidator::OnPrepareDetailControls(wxProperty *WXUNUSED(property)
if (view->GetValueList())
{
view->ShowListBoxControl(true);
view->GetValueList()->Enable(true);
view->GetValueList()->Enable();
view->GetValueList()->Append(wxT("True"));
view->GetValueList()->Append(wxT("False"));
@@ -1086,7 +1086,7 @@ bool wxBoolListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property),
{
view->GetValueList()->Clear();
view->ShowListBoxControl(false);
view->GetValueList()->Enable(false);
view->GetValueList()->Disable();
}
return true;
}
@@ -1175,27 +1175,27 @@ bool wxStringListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wx
if (!m_strings)
{
if (view->GetEditButton())
view->GetEditButton()->Enable(false);
view->GetEditButton()->Disable();
if (view->GetConfirmButton())
view->GetConfirmButton()->Enable(true);
view->GetConfirmButton()->Enable();
if (view->GetCancelButton())
view->GetCancelButton()->Enable(true);
view->GetCancelButton()->Enable();
if (view->GetValueText())
view->GetValueText()->Enable(true);
view->GetValueText()->Enable();
return true;
}
// Constrained
if (view->GetValueText())
view->GetValueText()->Enable(false);
view->GetValueText()->Disable();
if (view->GetEditButton())
view->GetEditButton()->Enable(true);
view->GetEditButton()->Enable();
if (view->GetConfirmButton())
view->GetConfirmButton()->Enable(false);
view->GetConfirmButton()->Disable();
if (view->GetCancelButton())
view->GetCancelButton()->Enable(false);
view->GetCancelButton()->Disable();
return true;
}
@@ -1206,7 +1206,7 @@ bool wxStringListValidator::OnPrepareDetailControls( wxProperty *property,
if (view->GetValueList())
{
view->ShowListBoxControl(true);
view->GetValueList()->Enable(true);
view->GetValueList()->Enable();
wxStringList::Node *node = m_strings->GetFirst();
while (node)
{
@@ -1231,7 +1231,7 @@ bool wxStringListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property)
{
view->GetValueList()->Clear();
view->ShowListBoxControl(false);
view->GetValueList()->Enable(false);
view->GetValueList()->Disable();
}
return true;
}
@@ -1326,11 +1326,11 @@ bool wxFilenameListValidator::OnDoubleClick(wxProperty *property, wxPropertyList
bool wxFilenameListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
view->GetConfirmButton()->Enable(true);
view->GetConfirmButton()->Enable();
if (view->GetCancelButton())
view->GetCancelButton()->Enable(true);
view->GetCancelButton()->Enable();
if (view->GetEditButton())
view->GetEditButton()->Enable(true);
view->GetEditButton()->Enable();
if (view->GetValueText())
view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING);
return true;
@@ -1349,7 +1349,7 @@ void wxFilenameListValidator::OnEdit(wxProperty *property, wxPropertyListView *v
m_filenameWildCard.GetData(),
0,
parentWindow);
if (s != wxT(""))
if ( !s.empty() )
{
property->GetValue() = s;
view->DisplayProperty(property);
@@ -1415,13 +1415,17 @@ bool wxColourListValidator::OnDoubleClick(wxProperty *property, wxPropertyListVi
bool wxColourListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetConfirmButton())
view->GetConfirmButton()->Enable(true);
view->GetConfirmButton()->Enable();
if (view->GetCancelButton())
view->GetCancelButton()->Enable(true);
view->GetCancelButton()->Enable();
if (view->GetEditButton())
view->GetEditButton()->Enable(true);
view->GetEditButton()->Enable();
if (view->GetValueText())
view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING);
return true;
}
@@ -1509,14 +1513,14 @@ bool wxListOfStringsListValidator::OnDisplayValue(wxProperty *property, wxProper
bool wxListOfStringsListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
if (view->GetEditButton())
view->GetEditButton()->Enable(true);
view->GetEditButton()->Enable();
if (view->GetValueText())
view->GetValueText()->Enable(false);
view->GetValueText()->Disable();
if (view->GetConfirmButton())
view->GetConfirmButton()->Enable(false);
view->GetConfirmButton()->Disable();
if (view->GetCancelButton())
view->GetCancelButton()->Enable(false);
view->GetCancelButton()->Disable();
return true;
}
@@ -1651,9 +1655,9 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList
wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE);
dialog->m_stringText = new wxPropertyStringListEditorText(dialog,
wxID_PROP_SL_TEXT, wxT(""), wxPoint(5, 240),
wxID_PROP_SL_TEXT, wxEmptyString, wxPoint(5, 240),
wxSize(300, wxDefaultSize.y), wxPROCESS_ENTER);
dialog->m_stringText->Enable(false);
dialog->m_stringText->Disable();
wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, wxT("Add"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight));
wxButton *deleteButton = new wxButton(dialog, wxID_PROP_SL_DELETE, wxT("Delete"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight));
@@ -1729,7 +1733,7 @@ void wxPropertyStringListEditorDialog::OnDelete(wxCommandEvent& WXUNUSED(event))
delete[] (wxChar *)node->GetData();
delete node;
m_currentSelection = -1;
m_stringText->SetValue(_T(""));
m_stringText->SetValue(wxEmptyString);
}
void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
@@ -1798,13 +1802,13 @@ void wxPropertyStringListEditorDialog::ShowCurrentSelection()
{
if (m_currentSelection == -1)
{
m_stringText->SetValue(wxT(""));
m_stringText->SetValue(wxEmptyString);
return;
}
wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(m_currentSelection);
wxChar *txt = (wxChar *)node->GetData();
m_stringText->SetValue(txt);
m_stringText->Enable(true);
m_stringText->Enable();
}

View File

@@ -165,7 +165,6 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
m_bDown->SetToolTip(_("Move down"));
#endif
subp->SetAutoLayout(true);
subp->SetSizer(subsizer);
subsizer->Fit(subp);
@@ -181,7 +180,6 @@ wxEditableListBox::wxEditableListBox(wxWindow *parent, wxWindowID id,
sizer->Add(m_listCtrl, 1, wxEXPAND);
SetAutoLayout(true);
SetSizer(sizer);
Layout();
}
@@ -194,7 +192,7 @@ void wxEditableListBox::SetStrings(const wxArrayString& strings)
for (i = 0; i < strings.GetCount(); i++)
m_listCtrl->InsertItem(i, strings[i]);
m_listCtrl->InsertItem(strings.GetCount(), _T(""));
m_listCtrl->InsertItem(strings.GetCount(), wxEmptyString);
m_listCtrl->SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
}
@@ -232,7 +230,7 @@ void wxEditableListBox::OnEndLabelEdit(wxListEvent& event)
// The user edited last (empty) line, i.e. added new entry. We have to
// add new empty line here so that adding one more line is still
// possible:
m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), _T(""));
m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), wxEmptyString);
}
}

View File

@@ -223,7 +223,6 @@ wxObject* wxSizerXmlHandler::Handle_sizer()
if (m_parentSizer == NULL) // setup window:
{
m_parentAsWindow->SetAutoLayout(true);
m_parentAsWindow->SetSizer(sizer);
wxXmlNode *nd = m_node;

View File

@@ -68,7 +68,6 @@ void wxUnknownControlContainer::AddChild(wxWindowBase *child)
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add((wxWindow*)child, 1, wxEXPAND);
SetSizer(sizer);
SetAutoLayout(true);
Layout();
}

View File

@@ -255,7 +255,6 @@ EditorFrame::EditorFrame(wxFrame *parent, const wxString& filename)
m_TreeCtrl->AssignImageList(imgList);
sizer->Add(m_TreeCtrl, 1, wxEXPAND);
SetAutoLayout(true);
SetSizer(sizer);
// Load file:
@@ -533,7 +532,7 @@ void EditorFrame::OnToolbar(wxCommandEvent& event)
case ID_OPEN :
{
wxString cwd = wxGetCwd(); // workaround for 2.2
wxString name = wxFileSelector(_("Open XML resource"), _T(""), _T(""), _T(""), _("XML resources (*.xrc)|*.xrc"), wxOPEN | wxFILE_MUST_EXIST);
wxString name = wxFileSelector(_("Open XML resource"), wxEmptyString, wxEmptyString, wxEmptyString, _("XML resources (*.xrc)|*.xrc"), wxOPEN | wxFILE_MUST_EXIST);
wxSetWorkingDirectory(cwd);
if (!name.IsEmpty())
LoadFile(name);
@@ -547,7 +546,7 @@ void EditorFrame::OnToolbar(wxCommandEvent& event)
case ID_SAVEAS :
{
wxString cwd = wxGetCwd(); // workaround for 2.2
wxString name = wxFileSelector(_("Save as"), _T(""), m_FileName, _T(""), _("XML resources (*.xrc)|*.xrc"), wxSAVE | wxOVERWRITE_PROMPT);
wxString name = wxFileSelector(_("Save as"), wxEmptyString, m_FileName, wxEmptyString, _("XML resources (*.xrc)|*.xrc"), wxSAVE | wxOVERWRITE_PROMPT);
wxSetWorkingDirectory(cwd);
if (!name.IsEmpty())
SaveFile((m_FileName = name));

View File

@@ -36,7 +36,7 @@
wxWindow* PropEditCtrlFont::CreateEditCtrl()
{
PropEditCtrlTxt::CreateEditCtrl();
m_TextCtrl->Enable(false);
m_TextCtrl->Disable();
return m_TextCtrl;
}
@@ -165,7 +165,6 @@ void PropEditCtrlFlags::OnDetails()
sz->Add(sz2, 0, wxALIGN_RIGHT | wxRIGHT | wxBOTTOM, 10);
dlg.SetSizer(sz);
dlg.SetAutoLayout(true);
dlg.Layout();
for (i = 0; i < arr.GetCount(); i++)
@@ -219,7 +218,7 @@ void PropEditCtrlFile::OnDetails()
wxString name = wxFileSelector(_("Choose file"),
wxPathOnly(txt),
wxFileNameFromPath(txt),
_T(""),
wxEmptyString,
GetFileTypes(),
wxOPEN | wxFILE_MUST_EXIST);
if (!name) return;

View File

@@ -66,7 +66,6 @@ void PropEditCtrl::BeginEdit(const wxRect& rect, wxTreeItemId ti)
if (HasClearButton())
sz->Add(new wxButton(this, ID_CLEAR, _T("X"), wxDefaultPosition,
wxSize(16,wxDefaultSize.y)));
SetAutoLayout(true);
SetSizer(sz);
m_Created = true;
}

View File

@@ -60,7 +60,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
int w;
m_Label1->GetSize(&w, &chSize);
m_UserName = new wxTextCtrl(this, wxID_ANY, _T(""));
m_UserName = new wxTextCtrl(this, wxID_ANY, wxEmptyString);
m_UserName->SetFont(* pDoc->ft_Doc);
chSize = (int) (m_UserName->GetCharHeight()*ratio);
@@ -82,7 +82,7 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
layout->width.SameAs(m_Label1, wxWidth);
m_Label2->SetConstraints(layout);
m_Password = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
m_Password = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
m_Password->SetFont(* pDoc->ft_Doc);
layout = new wxLayoutConstraints;
layout->left.SameAs(m_UserName, wxLeft);
@@ -113,8 +113,8 @@ DlgUser::DlgUser(wxWindow *parent, MainDoc *p_Doc, const wxString& title) :
m_OK->SetDefault();
m_UserName->SetFocus();
s_User = _T("");
s_Password = _T("");
s_User = wxEmptyString;
s_Password = wxEmptyString;
Layout();
}

View File

@@ -82,7 +82,7 @@ public:
// open/close
// create a new file (with the default value of bOverwrite, it will fail if
// the file already exists, otherwise it will overwrite it and succeed)
bool Create(const wxChar *szFileName, bool bOverwrite = FALSE,
bool Create(const wxChar *szFileName, bool bOverwrite = false,
int access = wxS_DEFAULT);
bool Open(const wxChar *szFileName, OpenMode mode = read,
int access = wxS_DEFAULT);

View File

@@ -33,11 +33,11 @@ public:
// start enumerating font facenames (either all of them or those which
// support the given encoding) - will result in OnFacename() being
// called for each available facename (until they are exhausted or
// OnFacename returns FALSE)
// OnFacename returns false)
virtual bool EnumerateFacenames
(
wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all
bool fixedWidthOnly = FALSE
bool fixedWidthOnly = false
);
// enumerate the different encodings either for given font facename or for
@@ -46,15 +46,15 @@ public:
virtual bool EnumerateEncodings(const wxString& facename = wxEmptyString);
// callbacks which are called after one of EnumerateXXX() functions from
// above is invoked - all of them may return FALSE to stop enumeration or
// TRUE to continue with it
// above is invoked - all of them may return false to stop enumeration or
// true to continue with it
// called by EnumerateFacenames
virtual bool OnFacename(const wxString& facename)
{
if (m_Facenames == NULL) m_Facenames = new wxArrayString;
m_Facenames -> Add(facename);
return TRUE;
return true;
}
// called by EnumerateEncodings
@@ -63,7 +63,7 @@ public:
{
if (m_Encodings == NULL) m_Encodings = new wxArrayString;
m_Encodings -> Add(encoding);
return TRUE;
return true;
}
// convenience function that returns array of facenames. Cannot be called

View File

@@ -90,14 +90,14 @@ class WXDLLEXPORT wxLogWindow : public wxLogPassThrough
public:
wxLogWindow(wxFrame *pParent, // the parent frame (can be NULL)
const wxChar *szTitle, // the title of the frame
bool bShow = TRUE, // show window immediately?
bool bPassToOld = TRUE); // pass messages to the old target?
bool bShow = true, // show window immediately?
bool bPassToOld = true); // pass messages to the old target?
~wxLogWindow();
// window operations
// show/hide the log window
void Show(bool bShow = TRUE);
void Show(bool bShow = true);
// retrieve the pointer to the frame
wxFrame *GetFrame() const;
@@ -107,7 +107,7 @@ public:
virtual void OnFrameCreate(wxFrame *frame);
// called if the user closes the window interactively, will not be
// called if it is destroyed for another reason (such as when program
// exits) - return TRUE from here to allow the frame to close, FALSE
// exits) - return true from here to allow the frame to close, false
// to prevent this from happening
virtual bool OnFrameClose(wxFrame *frame);
// called right before the log frame is going to be deleted: will

View File

@@ -55,7 +55,7 @@ public:
@param newmsg if used, new message to display
@returns true if ABORT button has not been pressed
*/
virtual bool Update(int value, const wxString& newmsg = wxT(""));
virtual bool Update(int value, const wxString& newmsg = wxEmptyString);
/* Can be called to continue after the cancel button has been pressed, but
the program decided to continue the operation (e.g., user didn't
@@ -63,7 +63,7 @@ public:
*/
void Resume();
bool Show( bool show = TRUE );
bool Show( bool show = true );
protected:
// callback for optional abort button

View File

@@ -51,7 +51,7 @@ public:
int family,
int style,
int weight,
bool underlined = FALSE,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
@@ -64,7 +64,7 @@ public:
int family,
int style,
int weight,
bool underlined = FALSE,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
@@ -95,7 +95,7 @@ public:
virtual void SetUnderlined( bool underlined );
virtual void SetEncoding(wxFontEncoding encoding);
virtual void SetNoAntiAliasing( bool no = TRUE );
virtual void SetNoAntiAliasing( bool no = true );
virtual bool GetNoAntiAliasing();
// implementation from now on

View File

@@ -51,7 +51,7 @@ public:
int family,
int style,
int weight,
bool underlined = FALSE,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
@@ -64,7 +64,7 @@ public:
int family,
int style,
int weight,
bool underlined = FALSE,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
@@ -95,7 +95,7 @@ public:
virtual void SetUnderlined( bool underlined );
virtual void SetEncoding(wxFontEncoding encoding);
virtual void SetNoAntiAliasing( bool no = TRUE );
virtual void SetNoAntiAliasing( bool no = true );
virtual bool GetNoAntiAliasing();
// implementation from now on

View File

@@ -113,8 +113,8 @@ public:
// Displays help window and focuses index.
bool DisplayIndex();
// Searches for keyword. Returns TRUE and display page if found, return
// FALSE otherwise
// Searches for keyword. Returns true and display page if found, return
// false otherwise
// Syntax of keyword is Altavista-like:
// * words are separated by spaces
// (but "\"hello world\"" is only one world "hello world")

View File

@@ -43,7 +43,7 @@ public:
virtual ~wxFrame();
virtual bool Show(bool show = TRUE);
virtual bool Show(bool show = true);
// Set menu bar
void SetMenuBar(wxMenuBar *menu_bar);
@@ -62,7 +62,7 @@ public:
// Create toolbar
#if wxUSE_TOOLBAR
virtual wxToolBar* CreateToolBar(long style = -1,
wxWindowID id = -1,
wxWindowID id = wxID_ANY,
const wxString& name = wxToolBarNameStr);
virtual void SetToolBar(wxToolBar *toolbar);
virtual void PositionToolBar();
@@ -74,7 +74,7 @@ public:
void OnSysColourChanged(wxSysColourChangedEvent& event);
void OnActivate(wxActivateEvent& event);
virtual void ChangeFont(bool keepOriginalSize = TRUE);
virtual void ChangeFont(bool keepOriginalSize = true);
virtual void ChangeBackgroundColour();
virtual void ChangeForegroundColour();
WXWidget GetMenuBarWidget() const;

View File

@@ -31,7 +31,7 @@ public:
int family,
int style,
int weight,
bool underlined = FALSE,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
{
@@ -53,7 +53,7 @@ public:
int family,
int style,
int weight,
bool underlined = FALSE,
bool underlined = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
@@ -90,7 +90,7 @@ public:
virtual bool IsFree() const;
virtual bool RealizeResource();
virtual WXHANDLE GetResourceHandle() const;
virtual bool FreeResource(bool force = FALSE);
virtual bool FreeResource(bool force = false);
// for consistency with other wxMSW classes
WXHFONT GetHFONT() const;

View File

@@ -69,7 +69,7 @@ public:
// --------
wxTreeCtrl() { Init(); }
wxTreeCtrl(wxWindow *parent, wxWindowID id = -1,
wxTreeCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
@@ -81,7 +81,7 @@ public:
virtual ~wxTreeCtrl();
bool Create(wxWindow *parent, wxWindowID id = -1,
bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT,
@@ -163,13 +163,13 @@ public:
// allow the user to expand the items which don't have any children now
// - but instead add them only when needed, thus minimizing memory
// usage and loading time.
void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE);
void SetItemHasChildren(const wxTreeItemId& item, bool has = true);
// the item will be shown in bold
void SetItemBold(const wxTreeItemId& item, bool bold = TRUE);
void SetItemBold(const wxTreeItemId& item, bool bold = true);
// the item will be shown with a drop highlight
void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = TRUE);
void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true);
// set the items text colour
void SetItemTextColour(const wxTreeItemId& item, const wxColour& col);
@@ -197,15 +197,15 @@ public:
// number of children
// ------------------
// if 'recursively' is FALSE, only immediate children count, otherwise
// if 'recursively' is false, only immediate children count, otherwise
// the returned number is the number of all items in this branch
size_t GetChildrenCount(const wxTreeItemId& item,
bool recursively = TRUE) const;
bool recursively = true) const;
// navigation
// ----------
// wxTreeItemId.IsOk() will return FALSE if there is no such item
// wxTreeItemId.IsOk() will return false if there is no such item
// get the root tree item
wxTreeItemId GetRootItem() const;
@@ -340,7 +340,7 @@ public:
// edited simultaneously)
wxTextCtrl* GetEditControl() const;
// end editing and accept or discard the changes to item label
void EndEditLabel(const wxTreeItemId& item, bool discardChanges = FALSE);
void EndEditLabel(const wxTreeItemId& item, bool discardChanges = false);
// sorting
// this function is called to compare 2 items and should return -1, 0
@@ -371,7 +371,7 @@ public:
// get the bounding rectangle of the item (or of its label only)
bool GetBoundingRect(const wxTreeItemId& item,
wxRect& rect,
bool textOnly = FALSE) const;
bool textOnly = false) const;
// deprecated
// ----------
@@ -433,7 +433,7 @@ public:
// get/set the check state for the item (only for wxTR_MULTIPLE)
bool IsItemChecked(const wxTreeItemId& item) const;
void SetItemCheck(const wxTreeItemId& item, bool check = TRUE);
void SetItemCheck(const wxTreeItemId& item, bool check = true);
// set/get the item state.image (state == -1 means cycle to the next one)
void SetState(const wxTreeItemId& node, int state);
@@ -491,7 +491,7 @@ private:
// the hash storing the items attributes (indexed by item ids)
wxMapTreeAttr m_attrs;
// TRUE if the hash above is not empty
// true if the hash above is not empty
bool m_hasAnyAttr;
// used for dragging

View File

@@ -32,7 +32,7 @@ public:
,int nFamily
,int nStyle
,int nWeight
,bool bUnderlined = FALSE
,bool bUnderlined = false
,const wxString& rsFace = wxEmptyString
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
)
@@ -67,7 +67,7 @@ public:
,int nFamily
,int nStyle
,int nWeight
,bool bUnderlined = FALSE
,bool bUnderlined = false
,const wxString& rsFace = wxEmptyString
,wxFontEncoding vEncoding = wxFONTENCODING_DEFAULT
);
@@ -116,7 +116,7 @@ public:
virtual bool IsFree(void) const;
virtual bool RealizeResource(void);
virtual WXHANDLE GetResourceHandle(void);
virtual bool FreeResource(bool bForce = FALSE);
virtual bool FreeResource(bool bForce = false);
WXHFONT GetHFONT(void) const;

View File

@@ -147,7 +147,6 @@ wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent)
sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10);
SetSizer(sizer);
SetAutoLayout(true);
sizer->Fit(this);
choice->SetSelection(6/*wxART_MESSAGE_BOX*/);

View File

@@ -312,15 +312,15 @@ bool MyApp::OnInit()
#if wxUSE_FINDREPLDLG
wxMenu *find_menu = new wxMenu;
find_menu->Append(DIALOGS_FIND, _T("&Find dialog\tCtrl-F"), _T(""), true);
find_menu->Append(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F"), _T(""), true);
find_menu->Append(DIALOGS_FIND, _T("&Find dialog\tCtrl-F"), wxEmptyString, true);
find_menu->Append(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F"), wxEmptyString, true);
file_menu->Append(wxID_ANY,_T("Searching"),find_menu);
#endif // wxUSE_FINDREPLDLG
#if USE_MODAL_PRESENTATION
wxMenu *modal_menu = new wxMenu;
modal_menu->Append(DIALOGS_MODAL, _T("Mo&dal dialog\tCtrl-W"));
modal_menu->Append(DIALOGS_MODELESS, _T("Modeless &dialog\tCtrl-Z"), _T(""), true);
modal_menu->Append(DIALOGS_MODELESS, _T("Modeless &dialog\tCtrl-Z"), wxEmptyString, true);
file_menu->Append(wxID_ANY,_T("Modal/Modeless"),modal_menu);
#endif // USE_MODAL_PRESENTATION
@@ -531,7 +531,7 @@ void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event))
{
wxString pwd = wxGetPasswordFromUser(_T("Enter password:"),
_T("Password entry dialog"),
_T(""),
wxEmptyString,
this);
if ( !!pwd )
{
@@ -616,8 +616,8 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) )
(
this,
_T("Testing open file dialog"),
_T(""),
_T(""),
wxEmptyString,
wxEmptyString,
#ifdef __WXMOTIF__
_T("C++ files (*.cpp)|*.cpp")
#else
@@ -649,7 +649,7 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) )
static wxString s_extDef;
wxString path = wxFileSelector(
_T("Select the file to load"),
_T(""), _T(""),
wxEmptyString, wxEmptyString,
s_extDef,
_T("Waveform (*.wav)|*.wav|Plain text (*.txt)|*.txt|All files (*.*)|*.*"),
wxCHANGE_DIR,
@@ -675,7 +675,7 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) )
_T("All files (*.*)|*.*|C++ files (*.h;*.cpp)|*.h;*.cpp");
#endif
wxFileDialog dialog(this, _T("Testing open multiple file dialog"),
_T(""), _T(""), wildcards,
wxEmptyString, wxEmptyString, wildcards,
wxMULTIPLE);
if (dialog.ShowModal() == wxID_OK)
@@ -706,7 +706,7 @@ void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) )
{
wxFileDialog dialog(this,
_T("Testing save file dialog"),
_T(""),
wxEmptyString,
_T("myletter.doc"),
_T("Text files (*.txt)|*.txt|Document files (*.doc)|*.doc"),
wxSAVE|wxOVERWRITE_PROMPT);
@@ -1050,7 +1050,6 @@ MyModelessDialog::MyModelessDialog(wxWindow *parent)
sizerTop->Add(btn, 1, wxEXPAND | wxALL, 5);
sizerTop->Add(check, 1, wxEXPAND | wxALL, 5);
SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->SetSizeHints(this);
@@ -1094,7 +1093,6 @@ MyModalDialog::MyModalDialog(wxWindow *parent)
sizerTop->Add(m_btnDelete, 0, wxALIGN_CENTER | wxALL, 5);
sizerTop->Add(btnOk, 0, wxALIGN_CENTER | wxALL, 5);
SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->SetSizeHints(this);
@@ -1118,7 +1116,7 @@ void MyModalDialog::OnButton(wxCommandEvent& event)
#if wxUSE_TEXTDLG
wxGetTextFromUser(_T("Dummy prompt"),
_T("Modal dialog called from dialog"),
_T(""), this);
wxEmptyString, this);
#else
wxMessageBox(_T("Modal dialog called from dialog"));
#endif // wxUSE_TEXTDLG

View File

@@ -146,18 +146,18 @@ GridFrame::GridFrame()
fileMenu->Append( wxID_EXIT, _T("E&xit\tAlt-X") );
wxMenu *viewMenu = new wxMenu;
viewMenu->Append( ID_TOGGLEROWLABELS, _T("&Row labels"), _T(""), wxITEM_CHECK );
viewMenu->Append( ID_TOGGLECOLLABELS, _T("&Col labels"), _T(""), wxITEM_CHECK );
viewMenu->Append( ID_TOGGLEEDIT, _T("&Editable"), _T(""), wxITEM_CHECK );
viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), _T(""), wxITEM_CHECK );
viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), _T(""), wxITEM_CHECK );
viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), _T(""), wxITEM_CHECK );
viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), _T(""), wxITEM_CHECK );
viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width..."), _T("") );
viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width..."), _T("") );
viewMenu->Append( ID_TOGGLEROWLABELS, _T("&Row labels"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_TOGGLECOLLABELS, _T("&Col labels"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_TOGGLEEDIT, _T("&Editable"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_TOGGLEROWSIZING, _T("Ro&w drag-resize"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_TOGGLECOLSIZING, _T("C&ol drag-resize"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_TOGGLEGRIDSIZING, _T("&Grid drag-resize"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_TOGGLEGRIDLINES, _T("&Grid Lines"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_SET_HIGHLIGHT_WIDTH, _T("&Set Cell Highlight Width...") );
viewMenu->Append( ID_SET_RO_HIGHLIGHT_WIDTH, _T("&Set Cell RO Highlight Width...") );
viewMenu->Append( ID_AUTOSIZECOLS, _T("&Auto-size cols") );
viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), _T(""), wxITEM_CHECK );
viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), _T(""), wxITEM_CHECK );
viewMenu->Append( ID_CELLOVERFLOW, _T("&Overflow cells"), wxEmptyString, wxITEM_CHECK );
viewMenu->Append( ID_RESIZECELL, _T("&Resize cell (7,1)"), wxEmptyString, wxITEM_CHECK );
wxMenu *rowLabelMenu = new wxMenu;
@@ -344,7 +344,6 @@ GridFrame::GridFrame()
0,
wxEXPAND );
SetAutoLayout(true);
SetSizer( topSizer );
topSizer->Fit( this );
@@ -761,7 +760,7 @@ void GridFrame::OnAddToSelectToggle(wxCommandEvent& event)
void GridFrame::OnLabelLeftClick( wxGridEvent& ev )
{
logBuf = _T("");
logBuf = wxEmptyString;
if ( ev.GetRow() != -1 )
{
logBuf << _T("Left click on row label ") << ev.GetRow();
@@ -787,7 +786,7 @@ void GridFrame::OnLabelLeftClick( wxGridEvent& ev )
void GridFrame::OnCellLeftClick( wxGridEvent& ev )
{
logBuf = _T("");
logBuf = wxEmptyString;
logBuf << _T("Left click at row ") << ev.GetRow()
<< _T(" col ") << ev.GetCol();
wxLogMessage( wxT("%s"), logBuf.c_str() );
@@ -801,7 +800,7 @@ void GridFrame::OnCellLeftClick( wxGridEvent& ev )
void GridFrame::OnRowSize( wxGridSizeEvent& ev )
{
logBuf = _T("");
logBuf = wxEmptyString;
logBuf << _T("Resized row ") << ev.GetRowOrCol();
wxLogMessage( wxT("%s"), logBuf.c_str() );
@@ -811,7 +810,7 @@ void GridFrame::OnRowSize( wxGridSizeEvent& ev )
void GridFrame::OnColSize( wxGridSizeEvent& ev )
{
logBuf = _T("");
logBuf = wxEmptyString;
logBuf << _T("Resized col ") << ev.GetRowOrCol();
wxLogMessage( wxT("%s"), logBuf.c_str() );
@@ -821,7 +820,7 @@ void GridFrame::OnColSize( wxGridSizeEvent& ev )
void GridFrame::OnSelectCell( wxGridEvent& ev )
{
logBuf = _T("");
logBuf = wxEmptyString;
if ( ev.Selecting() )
logBuf << _T("Selected ");
else
@@ -841,7 +840,7 @@ void GridFrame::OnSelectCell( wxGridEvent& ev )
void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev )
{
logBuf = _T("");
logBuf = wxEmptyString;
if ( ev.Selecting() )
logBuf << _T("Selected ");
else
@@ -861,7 +860,7 @@ void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev )
void GridFrame::OnCellValueChanged( wxGridEvent& ev )
{
logBuf = _T("");
logBuf = wxEmptyString;
logBuf << _T("Value changed for cell at")
<< _T(" row ") << ev.GetRow()
<< _T(" col ") << ev.GetCol();

View File

@@ -595,7 +595,7 @@ void MyFrame::ShowHelp(int commandId, wxHelpControllerBase& helpController)
{
wxString key = wxGetTextFromUser(_T("Search for?"),
_T("Search help for keyword"),
_T(""),
wxEmptyString,
this);
if(! key.IsEmpty())
helpController.KeywordSearch(key);
@@ -666,7 +666,6 @@ MyModalDialog::MyModalDialog(wxWindow *parent)
sizerTop->Add(text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
sizerTop->Add(sizerRow, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->SetSizeHints(this);

View File

@@ -178,7 +178,6 @@
topsizer -> Add(bu1, 0, wxALL | wxALIGN_RIGHT, 15);
dlg.SetAutoLayout(true);
dlg.SetSizer(topsizer);
topsizer -> Fit(&dlg);

View File

@@ -400,14 +400,14 @@ LboxTestFrame::LboxTestFrame(const wxString& title)
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(panel, LboxTest_Change, _T("C&hange current"));
m_textChange = new wxTextCtrl(panel, LboxTest_ChangeText, _T(""));
m_textChange = new wxTextCtrl(panel, LboxTest_ChangeText, wxEmptyString);
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textChange, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
sizerRow = new wxBoxSizer(wxHORIZONTAL);
btn = new wxButton(panel, LboxTest_Delete, _T("&Delete this item"));
m_textDelete = new wxTextCtrl(panel, LboxTest_DeleteText, _T(""));
m_textDelete = new wxTextCtrl(panel, LboxTest_DeleteText, wxEmptyString);
sizerRow->Add(btn, 0, wxRIGHT, 5);
sizerRow->Add(m_textDelete, 1, wxLEFT, 5);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
@@ -457,7 +457,6 @@ LboxTestFrame::LboxTestFrame(const wxString& title)
Reset();
m_dirty = false;
panel->SetAutoLayout(true);
panel->SetSizer(sizerTop);
sizerTop->Fit(this);

View File

@@ -315,8 +315,6 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
m_panel->SetSizer(m_sizerFrame);
m_panel->SetAutoLayout(true);
m_sizerFrame->Fit(this);
m_sizerFrame->SetSizeHints(this);

View File

@@ -492,7 +492,6 @@ MyAboutDialog::MyAboutDialog(wxWindow *parent)
sizerTop->Add(-1, 10, 1, wxGROW);
sizerTop->Add(statbarBottom, 0, wxGROW);
SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->Fit(this);
@@ -620,7 +619,7 @@ void MyStatusBar::DoToggle()
m_statbmp->Refresh();
#endif
SetStatusText(_T(""), Field_Clock);
SetStatusText(wxEmptyString, Field_Clock);
}
}

View File

@@ -52,7 +52,7 @@
class WXDLLEXPORT wxFontPreviewer : public wxWindow
{
public:
wxFontPreviewer(wxWindow *parent) : wxWindow(parent, -1) {}
wxFontPreviewer(wxWindow *parent) : wxWindow(parent, wxID_ANY) {}
private:
void OnPaint(wxPaintEvent& event);
@@ -167,7 +167,7 @@ static wxString wxColourDialogNames[NUM_COLS]={wxT("ORANGE"),
void wxGenericFontDialog::Init()
{
m_useEvents = FALSE;
m_useEvents = false;
m_previewer = NULL;
Create( m_parent ) ;
}
@@ -183,11 +183,11 @@ void wxGenericFontDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
bool wxGenericFontDialog::DoCreate(wxWindow *parent)
{
if ( !wxDialog::Create( parent , -1 , _T("Choose Font") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE,
if ( !wxDialog::Create( parent , wxID_ANY , _T("Choose Font") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE,
_T("fontdialog") ) )
{
wxFAIL_MSG( wxT("wxFontDialog creation failed") );
return FALSE;
return false;
}
InitializeFont();
@@ -197,7 +197,7 @@ bool wxGenericFontDialog::DoCreate(wxWindow *parent)
wxCommandEvent dummy;
OnChangeFont(dummy);
return TRUE;
return true;
}
int wxGenericFontDialog::ShowModal()
@@ -315,7 +315,6 @@ void wxGenericFontDialog::CreateWidgets()
sizer->Add(cancelButton, 0, wxRIGHT, 10);
topsizer->Add(sizer, 0, wxALIGN_RIGHT | wxBOTTOM, 10);
SetAutoLayout(TRUE);
SetSizer(topsizer);
topsizer->SetSizeHints(this);
topsizer->Fit(this);
@@ -328,7 +327,7 @@ void wxGenericFontDialog::CreateWidgets()
delete[] pointSizes;
// Don't block events any more
m_useEvents = TRUE;
m_useEvents = true;
}
void wxGenericFontDialog::InitializeFont()
@@ -337,7 +336,7 @@ void wxGenericFontDialog::InitializeFont()
int fontWeight = wxNORMAL;
int fontStyle = wxNORMAL;
int fontSize = 12;
int fontUnderline = FALSE;
bool fontUnderline = false;
if (m_fontData.m_initialFont.Ok())
{
@@ -348,7 +347,8 @@ void wxGenericFontDialog::InitializeFont()
fontUnderline = m_fontData.m_initialFont.GetUnderlined();
}
dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
dialogFont = wxFont(fontSize, fontFamily, fontStyle,
fontWeight, fontUnderline);
if (m_previewer)
m_previewer->SetFont(dialogFont);
@@ -366,7 +366,7 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event))
dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
m_previewer->SetFont(dialogFont);
if (colourChoice->GetStringSelection() != wxT(""))
if ( !colourChoice->GetStringSelection().empty() )
{
wxColour col = wxTheColourDatabase->Find(colourChoice->GetStringSelection());
if (col.Ok())

View File

@@ -156,7 +156,7 @@ BEGIN_EVENT_TABLE(wxLogDialog, wxDialog)
#if wxUSE_FILE
EVT_BUTTON(wxID_SAVE, wxLogDialog::OnSave)
#endif // wxUSE_FILE
EVT_LIST_ITEM_SELECTED(-1, wxLogDialog::OnListSelect)
EVT_LIST_ITEM_SELECTED(wxID_ANY, wxLogDialog::OnListSelect)
END_EVENT_TABLE()
#endif // wxUSE_LOG_DIALOG
@@ -168,8 +168,8 @@ END_EVENT_TABLE()
#if wxUSE_FILE && wxUSE_FILEDLG
// pass an uninitialized file object, the function will ask the user for the
// filename and try to open it, returns TRUE on success (file was opened),
// FALSE if file couldn't be opened/created and -1 if the file selection
// filename and try to open it, returns true on success (file was opened),
// false if file couldn't be opened/created and -1 if the file selection
// dialog was cancelled
static int OpenLogFile(wxFile& file, wxString *filename = NULL, wxWindow *parent = NULL);
@@ -235,7 +235,7 @@ void wxLogGui::Clear()
{
m_bErrors =
m_bWarnings =
m_bHasMessages = FALSE;
m_bHasMessages = false;
m_aMessages.Empty();
m_aSeverity.Empty();
@@ -248,7 +248,7 @@ void wxLogGui::Flush()
return;
// do it right now to block any new calls to Flush() while we're here
m_bHasMessages = FALSE;
m_bHasMessages = false;
wxString appName = wxTheApp->GetAppName();
if ( !!appName )
@@ -340,7 +340,7 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
m_aMessages.Add(szString);
m_aSeverity.Add(wxLOG_Message);
m_aTimes.Add((long)t);
m_bHasMessages = TRUE;
m_bHasMessages = true;
}
break;
@@ -404,20 +404,20 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
m_aSeverity.Empty();
m_aTimes.Empty();
#endif // wxUSE_LOG_DIALOG
m_bErrors = TRUE;
m_bErrors = true;
}
// fall through
case wxLOG_Warning:
if ( !m_bErrors ) {
// for the warning we don't discard the info messages
m_bWarnings = TRUE;
m_bWarnings = true;
}
m_aMessages.Add(szString);
m_aSeverity.Add((int)level);
m_aTimes.Add((long)t);
m_bHasMessages = TRUE;
m_bHasMessages = true;
break;
}
}
@@ -479,11 +479,11 @@ BEGIN_EVENT_TABLE(wxLogFrame, wxFrame)
END_EVENT_TABLE()
wxLogFrame::wxLogFrame(wxFrame *pParent, wxLogWindow *log, const wxChar *szTitle)
: wxFrame(pParent, -1, szTitle)
: wxFrame(pParent, wxID_ANY, szTitle)
{
m_log = log;
m_pTextCtrl = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition,
m_pTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxDefaultSize,
wxTE_MULTILINE |
wxHSCROLL |
@@ -522,7 +522,7 @@ void wxLogFrame::DoClose()
{
// instead of closing just hide the window to be able to Show() it
// later
Show(FALSE);
Show(false);
}
}
@@ -595,7 +595,7 @@ wxLogWindow::wxLogWindow(wxFrame *pParent,
m_pLogFrame = new wxLogFrame(pParent, this, szTitle);
if ( bShow )
m_pLogFrame->Show(TRUE);
m_pLogFrame->Show();
}
void wxLogWindow::Show(bool bShow)
@@ -667,7 +667,7 @@ void wxLogWindow::OnFrameCreate(wxFrame * WXUNUSED(frame))
bool wxLogWindow::OnFrameClose(wxFrame * WXUNUSED(frame))
{
// allow to close
return TRUE;
return true;
}
void wxLogWindow::OnFrameDelete(wxFrame * WXUNUSED(frame))
@@ -697,7 +697,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
const wxArrayLong& times,
const wxString& caption,
long style)
: wxDialog(parent, -1, caption,
: wxDialog(parent, wxID_ANY, caption,
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
@@ -728,7 +728,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
while ( !!msg );
}
m_showingDetails = FALSE; // not initially
m_showingDetails = false; // not initially
m_listctrl = (wxListCtrl *)NULL;
#if wxUSE_STATLINE
@@ -781,7 +781,7 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
default:
wxFAIL_MSG(_T("incorrect log style"));
}
sizerAll->Add(new wxStaticBitmap(this, -1, bitmap), 0);
sizerAll->Add(new wxStaticBitmap(this, wxID_ANY, bitmap), 0);
const wxString& message = messages.Last();
sizerAll->Add(CreateTextSizer(message), 1,
@@ -790,7 +790,6 @@ wxLogDialog::wxLogDialog(wxWindow *parent,
sizerTop->Add(sizerAll, 0, wxALL | wxEXPAND, MARGIN);
SetAutoLayout(TRUE);
SetSizer(sizerTop);
// see comments in OnDetails()
@@ -830,11 +829,11 @@ void wxLogDialog::CreateDetailsControls()
#endif // wxUSE_FILE
#if wxUSE_STATLINE
m_statline = new wxStaticLine(this, -1);
m_statline = new wxStaticLine(this, wxID_ANY);
#endif // wxUSE_STATLINE
// create the list ctrl now
m_listctrl = new wxListCtrl(this, -1,
m_listctrl = new wxListCtrl(this, wxID_ANY,
wxDefaultPosition, wxDefaultSize,
wxSUNKEN_BORDER |
wxLC_REPORT |
@@ -858,7 +857,7 @@ void wxLogDialog::CreateDetailsControls()
wxART_INFORMATION
};
bool loadedIcons = TRUE;
bool loadedIcons = true;
for ( size_t icon = 0; icon < WXSIZEOF(icons); icon++ )
{
@@ -869,7 +868,7 @@ void wxLogDialog::CreateDetailsControls()
// Degrade gracefully.
if ( !bmp.Ok() )
{
loadedIcons = FALSE;
loadedIcons = false;
break;
}
@@ -1077,7 +1076,7 @@ void wxLogDialog::OnDetails(wxCommandEvent& WXUNUSED(event))
// VS: this is neccessary in order to force frame redraw under
// WindowMaker or fvwm2 (and probably other broken WMs).
// Otherwise, detailed list wouldn't be displayed.
Show(TRUE);
Show();
#endif // wxGTK
}
@@ -1094,8 +1093,8 @@ wxLogDialog::~wxLogDialog()
#if wxUSE_FILE && wxUSE_FILEDLG
// pass an uninitialized file object, the function will ask the user for the
// filename and try to open it, returns TRUE on success (file was opened),
// FALSE if file couldn't be opened/created and -1 if the file selection
// filename and try to open it, returns true on success (file was opened),
// false if file couldn't be opened/created and -1 if the file selection
// dialog was cancelled
static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
{
@@ -1111,18 +1110,18 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
// ---------
bool bOk;
if ( wxFile::Exists(filename) ) {
bool bAppend = FALSE;
bool bAppend = false;
wxString strMsg;
strMsg.Printf(_("Append log to file '%s' (choosing [No] will overwrite it)?"),
filename.c_str());
switch ( wxMessageBox(strMsg, _("Question"),
wxICON_QUESTION | wxYES_NO | wxCANCEL) ) {
case wxYES:
bAppend = TRUE;
bAppend = true;
break;
case wxNO:
bAppend = FALSE;
bAppend = false;
break;
case wxCANCEL:
@@ -1136,7 +1135,7 @@ static int OpenLogFile(wxFile& file, wxString *pFilename, wxWindow *parent)
bOk = file.Open(filename, wxFile::write_append);
}
else {
bOk = file.Create(filename, TRUE /* overwrite */);
bOk = file.Create(filename, true /* overwrite */);
}
}
else {

View File

@@ -85,7 +85,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
int maximum,
wxWindow *parent,
int style)
: wxDialog(parent, -1, title)
: wxDialog(parent, wxID_ANY, title)
{
// we may disappear at any moment, let the others know about it
SetExtraStyle(GetExtraStyle() | wxWS_EX_TRANSIENT);
@@ -101,7 +101,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
// FIXME: should probably have a (extended?) window style for this
if ( !hasAbortButton )
{
EnableCloseButton(FALSE);
EnableCloseButton(false);
}
#endif // wxMSW
@@ -124,7 +124,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
long widthText;
dc.GetTextExtent(message, &widthText, NULL, NULL, NULL, NULL);
m_msg = new wxStaticText(this, -1, message);
m_msg = new wxStaticText(this, wxID_ANY, message);
c = new wxLayoutConstraints;
c->left.SameAs(this, wxLeft, 2*LAYOUT_X_MARGIN);
c->top.SameAs(this, wxTop, 2*LAYOUT_Y_MARGIN);
@@ -143,7 +143,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
// note that we can't use wxGA_SMOOTH because it happens to
// cause the dialog to be modal. Have an extra
// style argument to wxProgressDialog, perhaps.
m_gauge = new wxGauge(this, -1, m_maximum,
m_gauge = new wxGauge(this, wxID_ANY, m_maximum,
wxDefaultPosition, wxDefaultSize,
wxGA_HORIZONTAL);
@@ -227,7 +227,7 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
m_btnAbort = (wxButton *)NULL;
}
SetAutoLayout(TRUE);
SetAutoLayout(true);
Layout();
sizeDlg.y += 2*LAYOUT_Y_MARGIN;
@@ -247,12 +247,12 @@ wxProgressDialog::wxProgressDialog(wxString const &title,
else
{
if ( m_parentTop )
m_parentTop->Enable(FALSE);
m_parentTop->Disable();
m_winDisabler = NULL;
}
Show(TRUE);
Enable(TRUE); // enable this window
Show();
Enable();
// this one can be initialized even if the others are unknown for now
//
@@ -270,7 +270,7 @@ wxStaticText *wxProgressDialog::CreateLabel(const wxString& text,
{
wxLayoutConstraints *c;
wxStaticText *label = new wxStaticText(this, -1, _("unknown"));
wxStaticText *label = new wxStaticText(this, wxID_ANY, _("unknown"));
c = new wxLayoutConstraints;
// VZ: I like the labels be centered - if the others don't mind, you may
@@ -285,7 +285,7 @@ wxStaticText *wxProgressDialog::CreateLabel(const wxString& text,
c->height.AsIs();
label->SetConstraints(c);
wxStaticText *dummy = new wxStaticText(this, -1, text);
wxStaticText *dummy = new wxStaticText(this, wxID_ANY, text);
c = new wxLayoutConstraints;
c->right.LeftOf(label);
c->top.SameAs(label, wxTop, 0);
@@ -338,7 +338,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
if ( value == m_maximum )
{
// so that we return TRUE below and that out [Cancel] handler knew what
// so that we return true below and that out [Cancel] handler knew what
// to do
m_state = Finished;
if( !(GetWindowStyle() & wxPD_AUTO_HIDE) )
@@ -351,7 +351,7 @@ wxProgressDialog::Update(int value, const wxString& newmsg)
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
else // enable the button to give the user a way to close the dlg
{
EnableCloseButton(TRUE);
EnableCloseButton();
}
#endif // __WXMSW__
@@ -437,7 +437,7 @@ void wxProgressDialog::OnClose(wxCloseEvent& event)
if ( m_state == Uncancelable )
{
// can't close this dialog
event.Veto(TRUE);
event.Veto();
}
else if ( m_state == Finished )
{
@@ -471,7 +471,7 @@ void wxProgressDialog::ReenableOtherWindows()
else
{
if ( m_parentTop )
m_parentTop->Enable(TRUE);
m_parentTop->Enable();
}
}

View File

@@ -100,7 +100,7 @@ public:
wxTipProvider *tipProvider,
bool showAtStartup);
// the tip dialog has "Show tips on startup" checkbox - return TRUE if it
// the tip dialog has "Show tips on startup" checkbox - return true if it
// was checked (or wasn't unchecked)
bool ShowTipsOnStartup() const { return m_checkbox->GetValue(); }
@@ -202,7 +202,7 @@ END_EVENT_TABLE()
wxTipDialog::wxTipDialog(wxWindow *parent,
wxTipProvider *tipProvider,
bool showAtStartup)
: wxDialog(parent, -1, _("Tip of the Day"),
: wxDialog(parent, wxID_ANY, _("Tip of the Day"),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
@@ -212,12 +212,12 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
wxButton *btnClose = new wxButton(this, wxID_CANCEL, _("&Close"));
m_checkbox = new wxCheckBox(this, -1, _("&Show tips at startup"));
m_checkbox = new wxCheckBox(this, wxID_ANY, _("&Show tips at startup"));
m_checkbox->SetValue(showAtStartup);
wxButton *btnNext = new wxButton(this, wxID_NEXT_TIP, _("&Next Tip"));
wxStaticText *text = new wxStaticText(this, -1, _("Did you know..."), wxDefaultPosition, wxSize(-1,30) );
wxStaticText *text = new wxStaticText(this, wxID_ANY, _("Did you know..."), wxDefaultPosition, wxSize(-1,30) );
#if defined(__WXMSW__) || defined(__WXPM__)
text->SetFont(wxFont(16, wxSWISS, wxNORMAL, wxBOLD));
#else
@@ -226,7 +226,7 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
//
// text->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
m_text = new wxTextCtrl(this, -1, wxT(""),
m_text = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxSize(200, 160),
wxTE_MULTILINE |
wxTE_READONLY |
@@ -248,12 +248,12 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
// vBitmap.SetId(wxICON_TIP); // OS/2 specific bitmap method--OS/2 wxBitmaps all have an ID.
// // and for StatBmp's under OS/2 it MUST be a valid resource ID.
//
// wxStaticBitmap* bmp = new wxStaticBitmap(this, -1, vBitmap);
// wxStaticBitmap* bmp = new wxStaticBitmap(this, wxID_ANY, vBitmap);
//
//#else
wxIcon icon = wxArtProvider::GetIcon(wxART_TIP, wxART_CMN_DIALOG);
wxStaticBitmap *bmp = new wxStaticBitmap(this, -1, icon);
wxStaticBitmap *bmp = new wxStaticBitmap(this, wxID_ANY, icon);
//#endif
@@ -277,7 +277,6 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
SetTipText();
SetAutoLayout(TRUE);
SetSizer( topsizer );
topsizer->SetSizeHints( this );

View File

@@ -176,11 +176,11 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data)
if (data)
{
m_Data = data;
m_DataCreated = FALSE;
m_DataCreated = false;
} else
{
m_Data = new wxHtmlHelpData();
m_DataCreated = TRUE;
m_DataCreated = true;
}
m_ContentsBox = NULL;
@@ -208,7 +208,7 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data)
m_Cfg.w = 700;
m_Cfg.h = 480;
m_Cfg.sashpos = 240;
m_Cfg.navig_on = TRUE;
m_Cfg.navig_on = true;
m_NormalFonts = m_FixedFonts = NULL;
m_NormalFace = m_FixedFace = wxEmptyString;
@@ -223,7 +223,7 @@ void wxHtmlHelpFrame::Init(wxHtmlHelpData* data)
#endif
m_PagesHash = NULL;
m_UpdateContents = TRUE;
m_UpdateContents = true;
m_helpController = (wxHelpControllerBase*) NULL;
}
@@ -304,7 +304,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
m_Splitter = new wxSplitterWindow(this);
m_HtmlWin = new wxHtmlHelpHtmlWindow(this, m_Splitter);
m_NavigPan = new wxPanel(m_Splitter, -1);
m_NavigPan = new wxPanel(m_Splitter, wxID_ANY);
m_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK,
wxDefaultPosition, wxDefaultSize);
wxNotebookSizer *nbs = new wxNotebookSizer(m_NavigNotebook);
@@ -312,7 +312,6 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
navigSizer = new wxBoxSizer(wxVERTICAL);
navigSizer->Add(nbs, 1, wxEXPAND);
m_NavigPan->SetAutoLayout(TRUE);
m_NavigPan->SetSizer(navigSizer);
}
else
@@ -333,7 +332,6 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
topsizer->Add(0, 10);
dummy->SetAutoLayout(TRUE);
dummy->SetSizer(topsizer);
if ( style & wxHF_BOOKMARKS )
@@ -390,7 +388,6 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE);
wxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
dummy->SetAutoLayout(TRUE);
dummy->SetSizer(topsizer);
m_IndexText = new wxTextCtrl(dummy, wxID_HTML_INDEXTEXT, wxEmptyString,
@@ -431,7 +428,6 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
wxWindow *dummy = new wxPanel(m_NavigNotebook, wxID_HTML_INDEXPAGE);
wxSizer *sizer = new wxBoxSizer(wxVERTICAL);
dummy->SetAutoLayout(TRUE);
dummy->SetSizer(sizer);
m_SearchText = new wxTextCtrl(dummy, wxID_HTML_SEARCHTEXT,
@@ -440,8 +436,8 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
wxTE_PROCESS_ENTER);
m_SearchChoice = new wxChoice(dummy, wxID_HTML_SEARCHCHOICE,
wxDefaultPosition, wxDefaultSize);
m_SearchCaseSensitive = new wxCheckBox(dummy, -1, _("Case sensitive"));
m_SearchWholeWords = new wxCheckBox(dummy, -1, _("Whole words only"));
m_SearchCaseSensitive = new wxCheckBox(dummy, wxID_ANY, _("Case sensitive"));
m_SearchWholeWords = new wxCheckBox(dummy, wxID_ANY, _("Whole words only"));
m_SearchButton = new wxButton(dummy, wxID_HTML_SEARCHBUTTON, _("Search"));
#if wxUSE_TOOLTIPS
m_SearchButton->SetToolTip(_("Search contents of help book(s) for all occurences of the text you typed above"));
@@ -461,7 +457,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
m_SearchPage = notebook_page;
}
m_HtmlWin->Show(TRUE);
m_HtmlWin->Show();
RefreshLists();
@@ -480,12 +476,12 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
if ( m_Cfg.navig_on )
{
m_NavigPan->Show(TRUE);
m_NavigPan->Show();
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
}
else
{
m_NavigPan->Show(FALSE);
m_NavigPan->Show(false);
m_Splitter->Initialize(m_HtmlWin);
}
}
@@ -497,7 +493,7 @@ bool wxHtmlHelpFrame::Create(wxWindow* parent, wxWindowID id,
m_Splitter->UpdateSize();
return TRUE;
return true;
}
wxHtmlHelpFrame::~wxHtmlHelpFrame()
@@ -549,26 +545,26 @@ void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style)
toolBar->AddTool(wxID_HTML_PANEL, wpanelBitmap, wxNullBitmap,
FALSE, -1, -1, (wxObject *) NULL,
false, -1, -1, (wxObject *) NULL,
_("Show/hide navigation panel"));
toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_BACK, wbackBitmap, wxNullBitmap,
FALSE, -1, -1, (wxObject *) NULL,
false, -1, -1, (wxObject *) NULL,
_("Go back"));
toolBar->AddTool(wxID_HTML_FORWARD, wforwardBitmap, wxNullBitmap,
FALSE, -1, -1, (wxObject *) NULL,
false, -1, -1, (wxObject *) NULL,
_("Go forward"));
toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_UPNODE, wupnodeBitmap, wxNullBitmap,
FALSE, -1, -1, (wxObject *) NULL,
false, -1, -1, (wxObject *) NULL,
_("Go one level up in document hierarchy"));
toolBar->AddTool(wxID_HTML_UP, wupBitmap, wxNullBitmap,
FALSE, -1, -1, (wxObject *) NULL,
false, -1, -1, (wxObject *) NULL,
_("Previous page"));
toolBar->AddTool(wxID_HTML_DOWN, wdownBitmap, wxNullBitmap,
FALSE, -1, -1, (wxObject *) NULL,
false, -1, -1, (wxObject *) NULL,
_("Next page"));
if ((style & wxHF_PRINT) || (style & wxHF_OPEN_FILES))
@@ -576,19 +572,19 @@ void wxHtmlHelpFrame::AddToolbarButtons(wxToolBar *toolBar, int style)
if (style & wxHF_OPEN_FILES)
toolBar->AddTool(wxID_HTML_OPENFILE, wopenBitmap, wxNullBitmap,
FALSE, -1, -1, (wxObject *) NULL,
false, -1, -1, (wxObject *) NULL,
_("Open HTML document"));
#if wxUSE_PRINTING_ARCHITECTURE
if (style & wxHF_PRINT)
toolBar->AddTool(wxID_HTML_PRINT, wprintBitmap, wxNullBitmap,
FALSE, -1, -1, (wxObject *) NULL,
false, -1, -1, (wxObject *) NULL,
_("Print this page"));
#endif
toolBar->AddSeparator();
toolBar->AddTool(wxID_HTML_OPTIONS, woptionsBitmap, wxNullBitmap,
FALSE, -1, -1, (wxObject *) NULL,
false, -1, -1, (wxObject *) NULL,
_("Display options dialog"));
}
#endif //wxUSE_TOOLBAR
@@ -609,9 +605,10 @@ bool wxHtmlHelpFrame::Display(const wxString& x)
{
m_HtmlWin->LoadPage(url);
NotifyPageChanged();
return TRUE;
return true;
}
return FALSE;
return false;
}
bool wxHtmlHelpFrame::Display(const int id)
@@ -621,9 +618,10 @@ bool wxHtmlHelpFrame::Display(const int id)
{
m_HtmlWin->LoadPage(url);
NotifyPageChanged();
return TRUE;
return true;
}
return FALSE;
return false;
}
@@ -631,22 +629,26 @@ bool wxHtmlHelpFrame::Display(const int id)
bool wxHtmlHelpFrame::DisplayContents()
{
if (! m_ContentsBox)
return FALSE;
return false;
if (!m_Splitter->IsSplit())
{
m_NavigPan->Show(TRUE);
m_HtmlWin->Show(TRUE);
m_NavigPan->Show();
m_HtmlWin->Show();
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
m_Cfg.navig_on = TRUE;
m_Cfg.navig_on = true;
}
m_NavigNotebook->SetSelection(0);
if (m_Data->GetBookRecArray().GetCount() > 0)
{
wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
if (!book.GetStart().IsEmpty())
m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart()));
}
return TRUE;
return true;
}
@@ -654,21 +656,25 @@ bool wxHtmlHelpFrame::DisplayContents()
bool wxHtmlHelpFrame::DisplayIndex()
{
if (! m_IndexList)
return FALSE;
return false;
if (!m_Splitter->IsSplit())
{
m_NavigPan->Show(TRUE);
m_HtmlWin->Show(TRUE);
m_NavigPan->Show();
m_HtmlWin->Show();
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
}
m_NavigNotebook->SetSelection(1);
if (m_Data->GetBookRecArray().GetCount() > 0)
{
wxHtmlBookRecord& book = m_Data->GetBookRecArray()[0];
if (!book.GetStart().IsEmpty())
m_HtmlWin->LoadPage(book.GetFullPath(book.GetStart()));
}
return TRUE;
return true;
}
@@ -695,8 +701,8 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
if (!m_Splitter->IsSplit())
{
m_NavigPan->Show(TRUE);
m_HtmlWin->Show(TRUE);
m_NavigPan->Show();
m_HtmlWin->Show();
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
}
@@ -705,7 +711,7 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
m_NavigNotebook->SetSelection(m_SearchPage);
m_SearchList->Clear();
m_SearchText->SetValue(keyword);
m_SearchButton->Enable(false);
m_SearchButton->Disable();
if (m_SearchChoice->GetSelection() != 0)
book = m_SearchChoice->GetStringSelection();
@@ -728,7 +734,7 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
curi = status.GetCurIndex();
if (curi % 32 == 0
#if wxUSE_PROGRESSDLG
&& progress.Update(curi) == FALSE
&& !progress.Update(curi)
#endif
)
break;
@@ -742,7 +748,7 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
}
}
m_SearchButton->Enable(TRUE);
m_SearchButton->Enable();
m_SearchText->SetSelection(0, keyword.Length());
m_SearchText->SetFocus();
}
@@ -750,14 +756,14 @@ bool wxHtmlHelpFrame::KeywordSearch(const wxString& keyword,
{
m_NavigNotebook->SetSelection(m_IndexPage);
m_IndexList->Clear();
m_IndexButton->Enable(false);
m_IndexButtonAll->Enable(false);
m_IndexButton->Disable();
m_IndexButtonAll->Disable();
m_IndexText->SetValue(keyword);
wxCommandEvent dummy;
OnIndexFind(dummy); // what a hack...
m_IndexButton->Enable(true);
m_IndexButtonAll->Enable(true);
m_IndexButton->Enable();
m_IndexButtonAll->Enable();
foundcnt = m_IndexList->GetCount();
}
@@ -818,7 +824,7 @@ void wxHtmlHelpFrame::CreateContents()
m_ContentsBox->DeleteAllItems();
roots[0] = m_ContentsBox->AddRoot(_("(Help)"));
imaged[0] = TRUE;
imaged[0] = true;
for (it = m_Data->GetContents(), i = 0; i < cnt; i++, it++)
{
@@ -837,9 +843,9 @@ void wxHtmlHelpFrame::CreateContents()
roots[1] = m_ContentsBox->AppendItem(roots[0],
it->m_Name, IMG_Book, -1,
new wxHtmlHelpTreeItemData(i));
m_ContentsBox->SetItemBold(roots[1], TRUE);
m_ContentsBox->SetItemBold(roots[1], true);
}
imaged[1] = TRUE;
imaged[1] = true;
}
// ...and their contents:
else
@@ -847,7 +853,7 @@ void wxHtmlHelpFrame::CreateContents()
roots[it->m_Level + 1] = m_ContentsBox->AppendItem(
roots[it->m_Level], it->m_Name, IMG_Page,
-1, new wxHtmlHelpTreeItemData(i));
imaged[it->m_Level + 1] = FALSE;
imaged[it->m_Level + 1] = false;
}
m_PagesHash->Put(it->GetFullPath(),
@@ -865,7 +871,7 @@ void wxHtmlHelpFrame::CreateContents()
m_ContentsBox->SetItemImage(roots[it->m_Level], image);
m_ContentsBox->SetItemImage(roots[it->m_Level], image,
wxTreeItemIcon_Selected);
imaged[it->m_Level] = TRUE;
imaged[it->m_Level] = true;
}
}
}
@@ -1048,31 +1054,31 @@ public:
wxHtmlWindow *TestWin;
wxHtmlHelpFrameOptionsDialog(wxWindow *parent)
: wxDialog(parent, -1, wxString(_("Help Browser Options")))
: wxDialog(parent, wxID_ANY, wxString(_("Help Browser Options")))
{
wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
wxFlexGridSizer *sizer = new wxFlexGridSizer(2, 3, 2, 5);
sizer->Add(new wxStaticText(this, -1, _("Normal font:")));
sizer->Add(new wxStaticText(this, -1, _("Fixed font:")));
sizer->Add(new wxStaticText(this, -1, _("Font size:")));
sizer->Add(new wxStaticText(this, wxID_ANY, _("Normal font:")));
sizer->Add(new wxStaticText(this, wxID_ANY, _("Fixed font:")));
sizer->Add(new wxStaticText(this, wxID_ANY, _("Font size:")));
sizer->Add(NormalFont = new wxComboBox(this, -1, wxEmptyString, wxDefaultPosition,
sizer->Add(NormalFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxSize(200, 200),
0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
sizer->Add(FixedFont = new wxComboBox(this, -1, wxEmptyString, wxDefaultPosition,
sizer->Add(FixedFont = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition,
wxSize(200, 200),
0, NULL, wxCB_DROPDOWN | wxCB_READONLY));
sizer->Add(FontSize = new wxSpinCtrl(this, -1));
sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY));
FontSize->SetRange(2, 100);
topsizer->Add(sizer, 0, wxLEFT|wxRIGHT|wxTOP, 10);
topsizer->Add(new wxStaticText(this, -1, _("Preview:")),
topsizer->Add(new wxStaticText(this, wxID_ANY, _("Preview:")),
0, wxLEFT | wxTOP, 10);
topsizer->Add(TestWin = new wxHtmlWindow(this, -1, wxDefaultPosition, wxSize(20, 150),
topsizer->Add(TestWin = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxSize(20, 150),
wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER),
1, wxEXPAND | wxLEFT|wxTOP|wxRIGHT, 10);
@@ -1083,7 +1089,6 @@ public:
sizer2->Add(new wxButton(this, wxID_CANCEL, _("Cancel")), 0, wxALL, 10);
topsizer->Add(sizer2, 0, wxALIGN_RIGHT);
SetAutoLayout(TRUE);
SetSizer(topsizer);
topsizer->Fit(this);
Centre(wxBOTH);
@@ -1137,8 +1142,8 @@ public:
};
BEGIN_EVENT_TABLE(wxHtmlHelpFrameOptionsDialog, wxDialog)
EVT_COMBOBOX(-1, wxHtmlHelpFrameOptionsDialog::OnUpdate)
EVT_SPINCTRL(-1, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin)
EVT_COMBOBOX(wxID_ANY, wxHtmlHelpFrameOptionsDialog::OnUpdate)
EVT_SPINCTRL(wxID_ANY, wxHtmlHelpFrameOptionsDialog::OnUpdateSpin)
END_EVENT_TABLE()
void wxHtmlHelpFrame::OptionsDialog()
@@ -1157,7 +1162,7 @@ void wxHtmlHelpFrame::OptionsDialog()
if (m_FixedFonts == NULL)
{
wxFontEnumerator enu;
enu.EnumerateFacenames(wxFONTENCODING_SYSTEM, TRUE);
enu.EnumerateFacenames(wxFONTENCODING_SYSTEM, true /*enum fixed width only*/);
m_FixedFonts = new wxArrayString;
*m_FixedFonts = *enu.GetFacenames();
m_FixedFonts->Sort(wxStringSortAscending);
@@ -1169,12 +1174,12 @@ void wxHtmlHelpFrame::OptionsDialog()
// are so that we can pass them to the dialog:
if (m_NormalFace.empty())
{
wxFont fnt(m_FontSize, wxSWISS, wxNORMAL, wxNORMAL, FALSE);
wxFont fnt(m_FontSize, wxSWISS, wxNORMAL, wxNORMAL, false);
m_NormalFace = fnt.GetFaceName();
}
if (m_FixedFace.empty())
{
wxFont fnt(m_FontSize, wxMODERN, wxNORMAL, wxNORMAL, FALSE);
wxFont fnt(m_FontSize, wxMODERN, wxNORMAL, wxNORMAL, false);
m_FixedFace = fnt.GetFaceName();
}
@@ -1217,7 +1222,7 @@ void wxHtmlHelpFrame::NotifyPageChanged()
if (ha)
{
bool olduc = m_UpdateContents;
m_UpdateContents = FALSE;
m_UpdateContents = false;
m_ContentsBox->SelectItem(ha->m_Id);
m_ContentsBox->EnsureVisible(ha->m_Id);
m_UpdateContents = olduc;
@@ -1345,14 +1350,14 @@ void wxHtmlHelpFrame::OnToolbar(wxCommandEvent& event)
{
m_Cfg.sashpos = m_Splitter->GetSashPosition();
m_Splitter->Unsplit(m_NavigPan);
m_Cfg.navig_on = FALSE;
m_Cfg.navig_on = false;
}
else
{
m_NavigPan->Show(TRUE);
m_HtmlWin->Show(TRUE);
m_NavigPan->Show();
m_HtmlWin->Show();
m_Splitter->SplitVertically(m_NavigPan, m_HtmlWin, m_Cfg.sashpos);
m_Cfg.navig_on = TRUE;
m_Cfg.navig_on = true;
}
}
break;
@@ -1458,10 +1463,10 @@ void wxHtmlHelpFrame::OnContentsSel(wxTreeEvent& event)
if (pg && m_UpdateContents)
{
it = m_Data->GetContents() + (pg->m_Id);
m_UpdateContents = FALSE;
m_UpdateContents = false;
if (it->m_Page[0] != 0)
m_HtmlWin->LoadPage(it->GetFullPath());
m_UpdateContents = TRUE;
m_UpdateContents = true;
}
}
@@ -1490,7 +1495,7 @@ void wxHtmlHelpFrame::OnIndexFind(wxCommandEvent& event)
const wxChar *cstr = sr.c_str();
wxChar mybuff[512];
wxChar *ptr;
bool first = TRUE;
bool first = true;
m_IndexList->Clear();
int cnt = m_Data->GetIndexCnt();
@@ -1513,7 +1518,7 @@ void wxHtmlHelpFrame::OnIndexFind(wxCommandEvent& event)
if (index[i].m_Page[0] != 0)
m_HtmlWin->LoadPage(index[i].GetFullPath());
NotifyPageChanged();
first = FALSE;
first = false;
}
}
}
@@ -1533,7 +1538,7 @@ void wxHtmlHelpFrame::OnIndexAll(wxCommandEvent& WXUNUSED(event))
m_IndexList->Clear();
int cnt = m_Data->GetIndexCnt();
bool first = TRUE;
bool first = true;
wxHtmlContentsItem* index = m_Data->GetIndex();
for (int i = 0; i < cnt; i++)
@@ -1544,7 +1549,7 @@ void wxHtmlHelpFrame::OnIndexAll(wxCommandEvent& WXUNUSED(event))
if (index[i].m_Page[0] != 0)
m_HtmlWin->LoadPage(index[i].GetFullPath());
NotifyPageChanged();
first = FALSE;
first = false;
}
}
@@ -1612,7 +1617,7 @@ void wxHtmlHelpFrame::OnCloseWindow(wxCloseEvent& evt)
#ifdef __WXMAC__
void wxHtmlHelpFrame::OnClose(wxCommandEvent& event)
{
Close(TRUE);
Close(true);
}
void wxHtmlHelpFrame::OnAbout(wxCommandEvent& event)

View File

@@ -223,7 +223,6 @@ wxObject* wxSizerXmlHandler::Handle_sizer()
if (m_parentSizer == NULL) // setup window:
{
m_parentAsWindow->SetAutoLayout(true);
m_parentAsWindow->SetSizer(sizer);
wxXmlNode *nd = m_node;

View File

@@ -68,7 +68,6 @@ void wxUnknownControlContainer::AddChild(wxWindowBase *child)
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add((wxWindow*)child, 1, wxEXPAND);
SetSizer(sizer);
SetAutoLayout(true);
Layout();
}

View File

@@ -65,7 +65,6 @@ void ctConfigurationBrowserWindow::CreateControls()
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
item1->SetSizer(item2);
item1->SetAutoLayout(true);
wxSplitterWindow* item3 = new wxSplitterWindow(item1, ID_CONFIGBROWSER_SPLITTERWINDOW, wxDefaultPosition, wxSize(400, 400), wxSP_3DBORDER|wxSP_3DSASH|wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE);
wxTreeCtrl* item4 = new wxTreeCtrl(item3, ID_CONFIGURATION_BROWSER_TREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_SINGLE|wxNO_BORDER);
@@ -149,7 +148,6 @@ void ctConfigurationBrowserControlPanel::CreateControls()
wxBoxSizer* item6 = new wxBoxSizer(wxVERTICAL);
item5->SetSizer(item6);
item5->SetAutoLayout(true);
wxStaticText* item7 = new wxStaticText(item5, wxID_STATIC, _("Browse, add and remove configurations"), wxDefaultPosition, wxDefaultSize, 0);
item6->Add(item7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5);
@@ -170,7 +168,7 @@ void ctConfigurationBrowserControlPanel::CreateControls()
wxStaticText* item13 = new wxStaticText(item5, ID_CONFIGURATION_NAME, _("Configuration:"), wxDefaultPosition, wxDefaultSize, 0);
item6->Add(item13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5);
wxTextCtrl* item14 = new wxTextCtrl(item5, ID_CONFIGURATION_DESCRIPTION, _(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
wxTextCtrl* item14 = new wxTextCtrl(item5, ID_CONFIGURATION_DESCRIPTION, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
item6->Add(item14, 1, wxGROW|wxALL, 5);
////@end ctConfigurationBrowserControlPanel content construction

View File

@@ -81,7 +81,6 @@ void ctConfigItemsSelector::CreateControls()
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
item1->SetSizer(item2);
item1->SetAutoLayout(true);
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
item2->Add(item3, 1, wxGROW|wxALL, 5);

View File

@@ -77,7 +77,6 @@ void ctCustomPropertyDialog::CreateControls()
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
item1->SetSizer(item2);
item1->SetAutoLayout(true);
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
item2->Add(item3, 1, wxGROW|wxALL, 5);
@@ -88,7 +87,7 @@ void ctCustomPropertyDialog::CreateControls()
wxStaticText* item5 = new wxStaticText(item1, wxID_STATIC, _("&Name:"), wxDefaultPosition, wxDefaultSize, 0);
item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
wxTextCtrl* item6 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYNAME, _(""), wxDefaultPosition, wxDefaultSize, 0);
wxTextCtrl* item6 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYNAME, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
item3->Add(item6, 0, wxGROW|wxALL, 5);
wxBoxSizer* item7 = new wxBoxSizer(wxHORIZONTAL);
@@ -148,7 +147,7 @@ void ctCustomPropertyDialog::CreateControls()
wxStaticText* item19 = new wxStaticText(item1, wxID_STATIC, _("&Description:"), wxDefaultPosition, wxDefaultSize, 0);
item3->Add(item19, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
wxTextCtrl* item20 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYDESCRIPTION, _(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
wxTextCtrl* item20 = new wxTextCtrl(item1, ID_CUSTOMPROPERTYDESCRIPTION, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_RICH);
item3->Add(item20, 1, wxGROW|wxALL, 5);
wxBoxSizer* item21 = new wxBoxSizer(wxHORIZONTAL);

View File

@@ -99,7 +99,6 @@ void ctPropertyEditor::CreateControls(wxWindow* parent)
item0->Add( m_splitterWindow, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
this->SetAutoLayout(true);
this->SetSizer( item0 );
/// Add help text
@@ -159,7 +158,7 @@ void ctPropertyEditor::ClearEditor()
{
m_attributeEditorGrid->ClearAttributes();
m_propertyDescriptionWindow->SetPage(WrapDescription(wxEmptyString));
m_elementTitleTextCtrl->SetValue(_T(""));
m_elementTitleTextCtrl->SetValue(wxEmptyString);
}
/// Handles detailed editing event.
@@ -801,7 +800,7 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
wxStaticText *item2 = new wxStaticText( parent, wxID_STATIC, msg, wxDefaultPosition, wxDefaultSize, 0 );
item1->Add( item2, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT, 5 );
wxTextCtrl *item3 = new wxTextCtrl( parent, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(330,180), wxTE_MULTILINE|wxTE_RICH );
wxTextCtrl *item3 = new wxTextCtrl( parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(330,180), wxTE_MULTILINE|wxTE_RICH );
item1->Add( item3, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxBoxSizer *item4 = new wxBoxSizer( wxHORIZONTAL );
@@ -826,7 +825,6 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
item3->SetFocus();
((wxButton*) FindWindow(wxID_OK))->SetDefault();
parent->SetAutoLayout( true );
parent->SetSizer(item0);
item0->Fit(parent);

View File

@@ -76,7 +76,6 @@ void ctSettingsDialog::CreateControls()
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
item1->SetSizer(item2);
item1->SetAutoLayout(true);
wxNotebook* item3 = new wxNotebook(item1, ID_NOTEBOOK, wxDefaultPosition, wxSize(200, 200), wxNB_TOP);
wxNotebookSizer* item3Sizer = new wxNotebookSizer(item3);
@@ -211,7 +210,6 @@ void ctGeneralSettingsDialog::CreateControls()
wxBoxSizer* item5 = new wxBoxSizer(wxVERTICAL);
item4->SetSizer(item5);
item4->SetAutoLayout(true);
wxStaticBox* item6Static = new wxStaticBox(item4, wxID_ANY, _("General settings"));
wxStaticBoxSizer* item6 = new wxStaticBoxSizer(item6Static, wxVERTICAL);
@@ -313,7 +311,6 @@ void ctLocationSettingsDialog::CreateControls()
wxBoxSizer* item12 = new wxBoxSizer(wxVERTICAL);
item11->SetSizer(item12);
item11->SetAutoLayout(true);
wxStaticBox* item13Static = new wxStaticBox(item11, wxID_ANY, _("Locations"));
wxStaticBoxSizer* item13 = new wxStaticBoxSizer(item13Static, wxVERTICAL);
@@ -325,7 +322,7 @@ void ctLocationSettingsDialog::CreateControls()
wxBoxSizer* item15 = new wxBoxSizer(wxHORIZONTAL);
item13->Add(item15, 0, wxGROW, 5);
wxTextCtrl* item16 = new wxTextCtrl(item11, ID_WXWIN_HIERARCHY, _(""), wxDefaultPosition, wxSize(200, wxDefaultSize.y), 0);
wxTextCtrl* item16 = new wxTextCtrl(item11, ID_WXWIN_HIERARCHY, wxEmptyString, wxDefaultPosition, wxSize(200, wxDefaultSize.y), 0);
item16->SetHelpText(_("Enter the root path of the wxWidgets hierarchy"));
#if wxUSE_TOOLTIPS
if (ShowToolTips())

View File

@@ -266,7 +266,6 @@ MyModalDialog::MyModalDialog(wxWindow *parent)
sizerTop->Add(m_book1, 0, wxALIGN_CENTER | wxALL, 5);
sizerTop->Add(m_book2, 0, wxALIGN_CENTER | wxALL, 5);
SetAutoLayout(true);
SetSizer(sizerTop);
sizerTop->SetSizeHints(this);

View File

@@ -35,7 +35,7 @@ wxDllWidget::wxDllWidget(wxWindow *parent,
long style)
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL | wxNO_BORDER,
className + wxT("_container")),
m_widget(NULL), m_lib(NULL), m_controlAdded(FALSE)
m_widget(NULL), m_lib(NULL), m_controlAdded(false)
{
SetBackgroundColour(wxColour(255, 0, 255));
if ( !!className )
@@ -53,11 +53,10 @@ void wxDllWidget::AddChild(wxWindowBase *child)
wxPanel::AddChild(child);
m_controlAdded = TRUE;
m_controlAdded = true;
wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add((wxWindow*)child, 1, wxEXPAND);
SetSizer(sizer);
SetAutoLayout(TRUE);
Layout();
}
@@ -85,7 +84,7 @@ bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className,
{
delete m_lib;
m_lib = NULL;
return FALSE;
return false;
}
DLL_WidgetFactory_t factory;
@@ -94,7 +93,7 @@ bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className,
{
delete m_lib;
m_lib = NULL;
return FALSE;
return false;
}
if ( !factory(className, this, style, &m_widget, &m_cmdFunc) )
@@ -103,10 +102,10 @@ bool wxDllWidget::LoadWidget(const wxString& dll, const wxString& className,
delete m_lib;
m_lib = NULL;
m_widget = NULL;
return FALSE;
return false;
}
return TRUE;
return true;
}
void wxDllWidget::UnloadWidget()

View File

@@ -41,7 +41,7 @@ Example of use:
{
public:
MyWindow(wxWindow *parent, long style)
: wxWindow(parent, -1) {}
: wxWindow(parent, wxID_ANY) {}
int HandleCommand(int cmd, const wxString& param)
{
@@ -75,7 +75,7 @@ class wxDllWidget : public wxPanel
{
public:
wxDllWidget(wxWindow *parent,
wxWindowID id = -1,
wxWindowID id = wxID_ANY,
const wxString& dllName = wxEmptyString,
const wxString& className = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
@@ -132,12 +132,12 @@ private:
{ \
*classInst = new widget(parent, style); \
*cmdFunc = SendCommandTo##widget; \
return TRUE; \
return true; \
}
#define END_WIDGET_LIBRARY() \
return FALSE; \
return false; \
}
#endif // __DLLWIDGET_H__

View File

@@ -9,7 +9,7 @@ class TestWindow : public wxWindow
{
public:
TestWindow(wxWindow *parent, long style)
: wxWindow(parent, -1)
: wxWindow(parent, wxID_ANY)
{
SetBackgroundColour(wxColour("white"));
}