MinGW warning fixes. Source cleaning. Stock items.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31699 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-02-01 20:44:06 +00:00
parent eda6fa912b
commit 677ded9539
12 changed files with 63 additions and 63 deletions

View File

@@ -80,7 +80,7 @@ ctSettings::ctSettings()
}
// Copy constructor
ctSettings::ctSettings(const ctSettings& settings)
ctSettings::ctSettings(const ctSettings& settings) : wxObject()
{
Copy(settings);
}

View File

@@ -56,7 +56,7 @@ public:
~ctConfigItem();
/// Copy constructor.
ctConfigItem(const ctConfigItem& item)
ctConfigItem(const ctConfigItem& item) : wxObject()
{
(*this) = item;
}

View File

@@ -130,11 +130,11 @@ void ctConfigItemsSelector::CreateControls()
item13->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* item15 = new wxButton(item1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0);
wxButton* item15 = new wxButton(item1, wxID_OK);
item15->SetDefault();
item13->Add(item15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* item16 = new wxButton(item1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0);
wxButton* item16 = new wxButton(item1, wxID_CANCEL);
item13->Add(item16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
GetSizer()->Fit(this);

View File

@@ -127,7 +127,7 @@ public:
~ctConfiguration();
/// Copy constructor.
ctConfiguration(const ctConfiguration& configuration)
ctConfiguration(const ctConfiguration& configuration) : wxObject()
{
(*this) = configuration;
}

View File

@@ -259,7 +259,7 @@ void ctConfigToolView::SyncItem(ctConfigTreeCtrl* treeControl, ctConfigItem* ite
{
if (!item->GetParent())
{
item->SetTreeItem(treeControl->AddRoot(_(""), -1, -1, new ctTreeItemData(item)));
item->SetTreeItem(treeControl->AddRoot(wxEmptyString, -1, -1, new ctTreeItemData(item)));
}
else
{
@@ -423,9 +423,8 @@ void ctConfigToolView::AddItem(ctConfigType type, const wxString& msg)
ctConfigItem* sel = GetSelection();
if (sel)
{
wxString name = wxGetTextFromUser(_("Please enter a name for the new item."),
msg, wxT(""));
if (!name.IsEmpty())
wxString name = wxGetTextFromUser(_("Please enter a name for the new item."), msg);
if (!name.empty())
{
ctConfigItem* parent ;
ctConfigItem* insertBefore ;
@@ -474,7 +473,7 @@ void ctConfigToolView::OnRenameItem(wxCommandEvent& WXUNUSED(event))
{
wxString name = wxGetTextFromUser(_("Please enter a new name for the item."),
_("Rename item"), sel->GetName());
if (!name.IsEmpty())
if (!name.empty())
{
sel->SetName(name);
SyncItem(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), sel);
@@ -686,7 +685,7 @@ void ctConfigToolView::OnItemHelp(wxCommandEvent& WXUNUSED(event))
if ( doc && GetSelection() )
{
wxString helpTopic = GetSelection()->GetPropertyString(wxT("help-topic"));
if (!helpTopic.IsEmpty())
if (!helpTopic.empty())
{
wxGetApp().GetReferenceHelpController().DisplaySection(helpTopic);
}
@@ -732,7 +731,7 @@ void ctConfigToolView::OnAddCustomProperty(wxCommandEvent& WXUNUSED(event))
else if (type == wxT("long"))
property->GetVariant() = wxVariant((long) 0, name);
else
property->GetVariant() = wxVariant(wxT(""), name);
property->GetVariant() = wxVariant(wxEmptyString, name);
property->SetCustom(true);
property->SetDescription(descr);
property->SetChoices(choices);
@@ -791,7 +790,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
else if (type == wxT("long"))
property->GetVariant() = wxVariant((long) 0, name);
else
property->GetVariant() = wxVariant(wxT(""), name);
property->GetVariant() = wxVariant(wxEmptyString, name);
}
if (name != oldName)
property->GetVariant().SetName(name);
@@ -910,7 +909,7 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
wxString filename = _T("setup.h");
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
if (path.IsEmpty())
if (path.empty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*");
@@ -942,7 +941,7 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
wxString filename = _T("configurewx.sh");
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
if (path.IsEmpty())
if (path.empty())
path = doc->GetFrameworkDir(false);
wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*");
@@ -1014,7 +1013,7 @@ void ctConfigToolView::OnGo(wxCommandEvent& WXUNUSED(event))
{
ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument();
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
if (!path.IsEmpty())
if (!path.empty())
{
if (wxGetApp().GetSettings().m_defaultFileKind == wxT("Setup file"))
{
@@ -1075,7 +1074,7 @@ void ctConfigToolView::OnGo(wxCommandEvent& WXUNUSED(event))
void ctConfigToolView::OnUpdateGo(wxUpdateUIEvent& event)
{
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
event.Enable(!path.IsEmpty());
event.Enable(!path.empty());
}
//----------------------------------------------------------------------------
@@ -1132,7 +1131,7 @@ bool ctFindReplaceDialog::DoFind(const wxString& textToFind, bool matchCase, boo
return false;
}
if (!sm_currentItem.IsEmpty())
if (!sm_currentItem.empty())
{
currentItem = doc->GetTopItem()->FindItem(sm_currentItem);
}

View File

@@ -166,13 +166,13 @@ void ctCustomPropertyDialog::CreateControls()
item21->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* item23 = new wxButton(item1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0);
wxButton* item23 = new wxButton(item1, wxID_OK);
item21->Add(item23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* item24 = new wxButton(item1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0);
wxButton* item24 = new wxButton(item1, wxID_CANCEL);
item21->Add(item24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* item25 = new wxButton(item1, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, 0);
wxButton* item25 = new wxButton(item1, wxID_HELP);
item21->Add(item25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
GetSizer()->Fit(this);
@@ -217,7 +217,7 @@ void ctCustomPropertyDialog::OnPropertyChoiceAdd( wxCommandEvent& WXUNUSED(event
if ( m_customPropertyEditorType->GetSelection() > -1 && m_customPropertyEditorType->GetStringSelection() == wxT("choice") )
{
wxString str = wxGetTextFromUser(_T("New choice"), _("Add choice"));
if (!str.IsEmpty() && m_propertyChoices)
if (!str.empty() && m_propertyChoices)
{
m_propertyChoices->Append(str);
m_choices.Add(str);

View File

@@ -31,6 +31,7 @@
#include "wx/notebook.h"
#include "wx/dataobj.h"
#include "wx/clipbrd.h"
#include "wx/stockitem.h"
#include "wxconfigtool.h"
#include "mainframe.h"
#include "appsettings.h"
@@ -258,12 +259,12 @@ void ctMainFrame::InitToolBar(wxToolBar* toolBar)
toolBar->AddTool(wxID_SAVE, toolBarBitmaps[2], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxT("Save project"));
toolBar->AddSeparator();
toolBar->AddTool(wxID_CUT, toolBarBitmaps[4], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxT("Cut"));
toolBar->AddTool(wxID_COPY, toolBarBitmaps[3], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxT("Copy"));
toolBar->AddTool(wxID_PASTE, toolBarBitmaps[5], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxT("Paste"));
toolBar->AddTool(wxID_CUT, toolBarBitmaps[4], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxGetStockLabel(wxID_CUT, false));
toolBar->AddTool(wxID_COPY, toolBarBitmaps[3], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxGetStockLabel(wxID_COPY, false));
toolBar->AddTool(wxID_PASTE, toolBarBitmaps[5], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxGetStockLabel(wxID_PASTE, false));
toolBar->AddSeparator();
toolBar->AddTool(wxID_UNDO, toolBarBitmaps[10], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxT("Undo"));
toolBar->AddTool(wxID_REDO, toolBarBitmaps[11], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxT("Redo"));
toolBar->AddTool(wxID_UNDO, toolBarBitmaps[10], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxGetStockLabel(wxID_UNDO, false));
toolBar->AddTool(wxID_REDO, toolBarBitmaps[11], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxGetStockLabel(wxID_REDO, false));
toolBar->AddSeparator();
toolBar->AddTool(ctID_GO, toolBarBitmaps[6], wxNullBitmap, false, wxDefaultCoord, wxDefaultCoord, (wxObject *) NULL, wxT("Save setup.h or configurewx.sh"));
toolBar->AddSeparator();
@@ -282,30 +283,30 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
wxGetApp().GetFileHistory().UseMenu(fileMenu);
fileMenu->Append(wxID_NEW, wxT("&New...\tCtrl+N"), wxT("Create a new settings document"));
fileMenu->Append(wxID_OPEN, wxT("&Open...\tCtrl+O"), wxT("Open a settings document"));
fileMenu->Append(wxID_CLOSE, wxT("&Close\tCtrl+W"), wxT("Close the current settings document"));
fileMenu->Append(wxID_NEW, wxGetStockLabel(wxID_NEW, true, wxT("Ctrl+N")), wxT("Create a new settings document"));
fileMenu->Append(wxID_OPEN, wxGetStockLabel(wxID_OPEN, true, wxT("Ctrl+O")), wxT("Open a settings document"));
fileMenu->Append(wxID_CLOSE, wxGetStockLabel(wxID_CLOSE, true, wxT("Ctrl+W")), wxT("Close the current settings document"));
fileMenu->AppendSeparator();
fileMenu->Append(wxID_SAVE, wxT("&Save\tCtrl+S"), wxT("Save the settings document"));
fileMenu->Append(wxID_SAVEAS, wxT("&Save As..."), wxT("Save the settings document under a new filename"));
fileMenu->Append(wxID_SAVE, wxGetStockLabel(wxID_SAVE, true, wxT("Ctrl+S")), wxT("Save the settings document"));
fileMenu->Append(wxID_SAVEAS, wxGetStockLabel(wxID_SAVEAS), wxT("Save the settings document under a new filename"));
fileMenu->AppendSeparator();
fileMenu->Append(ctID_SAVE_SETUP_FILE, wxT("Save Setup.&h...\tCtrl+H"), wxT("Save the setup.h file"));
fileMenu->Append(ctID_SAVE_CONFIGURE_COMMAND, wxT("Save Configure Script...\tCtrl+G"), wxT("Save the configure script file"));
fileMenu->AppendSeparator();
fileMenu->Append(ctID_GO, wxT("&Go\tF5"), wxT("Quick-save the setup.h or configure.sh file"));
fileMenu->AppendSeparator();
fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt+F4"), wxT("Exit the application"));
fileMenu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT, true, wxT("Alt+F4")), wxT("Exit the application"));
wxGetApp().GetDocManager()->FileHistoryUseMenu(fileMenu);
wxMenu *editMenu = new wxMenu;
editMenu->Append(wxID_UNDO, _("&Undo\tCtrl+Z"));
editMenu->Append(wxID_REDO, _("&Redo\tCtrl+Y"));
editMenu->Append(wxID_UNDO, wxGetStockLabel(wxID_UNDO, true, wxT("Ctrl+Z")));
editMenu->Append(wxID_REDO, wxGetStockLabel(wxID_REDO, true, wxT("Ctrl+Y")));
editMenu->AppendSeparator();
editMenu->Append(wxID_COPY, _("&Copy\tCtrl+C"));
editMenu->Append(wxID_CUT, _("Cu&t\tCtrl+X"));
editMenu->Append(wxID_PASTE, _("&Paste\tCtrl+V"));
editMenu->Append(wxID_COPY, wxGetStockLabel(wxID_CLOSE, true, wxT("Ctrl+C")));
editMenu->Append(wxID_CUT, wxGetStockLabel(wxID_CUT, true, wxT("Ctrl+X")));
editMenu->Append(wxID_PASTE, wxGetStockLabel(wxID_PASTE, true, wxT("Ctrl+V")));
editMenu->AppendSeparator();
wxMenu* itemMenu = new wxMenu;
@@ -331,7 +332,7 @@ wxMenuBar* ctMainFrame::CreateMenuBar()
editMenu->Append(ctID_DELETE_ITEM, _("&Delete Option"), _("Delete a configuration option"));
editMenu->Append(ctID_RENAME_ITEM, _("&Rename Option"), _("Rename a configuration option"));
editMenu->AppendSeparator();
editMenu->Append(wxID_FIND, _("&Find...\tCtrl+F"), _("Search for a string in the settings document"));
editMenu->Append(wxID_FIND, wxGetStockLabel(wxID_FIND, true, wxT("Ctrl+F")), _("Search for a string in the settings document"));
// Save for the command processor.
m_editMenu = editMenu;
@@ -526,7 +527,7 @@ void ctOutputWindow::OnSaveText(wxCommandEvent& WXUNUSED(event))
if (m_codeCtrl->IsModified())
{
wxString filename(m_filenameCtrl->GetValue());
if (!filename.IsEmpty())
if (!filename.empty())
{
m_codeCtrl->SaveFile(filename);
m_codeCtrl->DiscardEdits();

View File

@@ -187,7 +187,7 @@ bool ctPropertyEditor::CanEditDetails()
int row;
ctProperty* prop = FindSelectedProperty(row);
if (!prop || prop->GetEditorType().IsEmpty())
if (!prop || prop->GetEditorType().empty())
return false;
return true;
}
@@ -383,7 +383,7 @@ bool ctPropertyEditor::DisplayDefaultProperty()
bool ctPropertyEditor::EditDefaultProperty(ctConfigItem* item)
{
wxString defaultPropertyName = item->GetDefaultProperty();
if (!defaultPropertyName.IsEmpty())
if (!defaultPropertyName.empty())
{
ctProperty* prop = item->GetProperties().FindProperty(defaultPropertyName);
if (prop)
@@ -809,10 +809,10 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
item4->Add( 5, 5, 1, wxALIGN_CENTRE|wxALL, 5 );
wxButton *item5 = new wxButton( parent, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
wxButton *item5 = new wxButton( parent, wxID_OK);
item4->Add( item5, 0, wxALIGN_CENTRE|wxALL, 5 );
wxButton *item6 = new wxButton( parent, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
wxButton *item6 = new wxButton( parent, wxID_CANCEL);
item4->Add( item6, 0, wxALIGN_CENTRE|wxALL, 5 );
item1->Add( item4, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );

View File

@@ -34,7 +34,7 @@ public:
m_custom = false;
m_show = true;
}
ctProperty(const ctProperty& property) { Copy(property); }
ctProperty(const ctProperty& property) : wxObject() { Copy(property); }
ctProperty(const wxString& descr, const wxVariant& variant,
const wxString& editorType = wxEmptyString,
bool readOnly = false)
@@ -134,7 +134,7 @@ class ctProperties: public wxObject
DECLARE_CLASS(ctProperties)
public:
ctProperties() {}
ctProperties(const ctProperties& properties) { Copy(properties); }
ctProperties(const ctProperties& properties) : wxObject() { Copy(properties); }
~ctProperties() { Clear(); }
void operator = (const ctProperties& properties) { Clear(); Copy(properties); }

View File

@@ -98,14 +98,14 @@ void ctSettingsDialog::CreateControls()
item21->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* item23 = new wxButton(item1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0);
wxButton* item23 = new wxButton(item1, wxID_OK);
item23->SetDefault();
item21->Add(item23, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* item24 = new wxButton(item1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0);
wxButton* item24 = new wxButton(item1, wxID_CANCEL);
item21->Add(item24, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
wxButton* item25 = new wxButton(item1, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, 0);
wxButton* item25 = new wxButton(item1, wxID_HELP);
item21->Add(item25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
#if defined(__WXGTK__) || defined(__WXMAC__)
@@ -163,7 +163,7 @@ void ctSettingsDialog::OnHelp( wxCommandEvent& WXUNUSED(event) )
helpTopic = wxT("Location settings dialog");
}
if (!helpTopic.IsEmpty())
if (!helpTopic.empty())
{
wxGetApp().GetHelpController().DisplaySection(helpTopic);
}