}
// Copy constructor
-ctSettings::ctSettings(const ctSettings& settings)
+ctSettings::ctSettings(const ctSettings& settings) : wxObject()
{
Copy(settings);
}
ctTypeInteger, // An option with an integer value
ctTypeBoolCheck, // An on/off option
ctTypeBoolRadio // An on/off mutually exclusive option
-};
+};
/*!
* ctConfigItem represents a configuration setting.
~ctConfigItem();
/// Copy constructor.
- ctConfigItem(const ctConfigItem& item)
+ ctConfigItem(const ctConfigItem& item) : wxObject()
{
(*this) = item;
}
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);
*/
class ctConfigItemsSelector: public wxDialog
-{
+{
public:
/// Constructor
ctConfigItemsSelector( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = _("Configuration Items Selector"));
/// Generate the text of a setup.h
wxString GenerateSetup();
-
+
/// Helper function
void GenerateSetup(ctConfigItem* item, wxString& str);
-
+
/// Generate a configure command
wxString GenerateConfigureCommand();
/// Finds the next item in the tree
ctConfigItem* FindNextItem(ctConfigItem* item, bool wrap);
-
+
/// Finds the next sibling in the tree
ctConfigItem* FindNextSibling(ctConfigItem* item);
-
+
protected:
ctConfigItem* m_topItem;
ctConfigItem* m_clipboardItem;
~ctConfiguration();
/// Copy constructor.
- ctConfiguration(const ctConfiguration& configuration)
+ ctConfiguration(const ctConfiguration& configuration) : wxObject()
{
(*this) = configuration;
}
bool Do();
bool Undo();
bool DoAndUndo(bool doCmd); // Combine Do and Undo into one
-
+
protected:
ctConfigItem* m_activeState;
ctConfigItem* m_savedState;
{
if (!item->GetParent())
{
- item->SetTreeItem(treeControl->AddRoot(_(""), -1, -1, new ctTreeItemData(item)));
+ item->SetTreeItem(treeControl->AddRoot(wxEmptyString, -1, -1, new ctTreeItemData(item)));
}
else
{
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 ;
{
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);
if ( doc && GetSelection() )
{
wxString helpTopic = GetSelection()->GetPropertyString(wxT("help-topic"));
- if (!helpTopic.IsEmpty())
+ if (!helpTopic.empty())
{
wxGetApp().GetReferenceHelpController().DisplaySection(helpTopic);
}
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);
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);
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 (*.*)|*.*");
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 (*.*)|*.*");
{
ctConfigToolDoc* doc = (ctConfigToolDoc*) GetDocument();
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
- if (!path.IsEmpty())
+ if (!path.empty())
{
if (wxGetApp().GetSettings().m_defaultFileKind == wxT("Setup file"))
{
void ctConfigToolView::OnUpdateGo(wxUpdateUIEvent& event)
{
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
- event.Enable(!path.IsEmpty());
+ event.Enable(!path.empty());
}
//----------------------------------------------------------------------------
return false;
}
- if (!sm_currentItem.IsEmpty())
+ if (!sm_currentItem.empty())
{
currentItem = doc->GetTopItem()->FindItem(sm_currentItem);
}
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);
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);
void ctCustomPropertyDialog::OnUpdatePropertyChoiceAdd( wxUpdateUIEvent& event )
{
if(m_customPropertyEditorType)
- event.Enable( m_customPropertyEditorType->GetSelection() > -1 &&
+ event.Enable( m_customPropertyEditorType->GetSelection() > -1 &&
m_customPropertyEditorType->GetStringSelection() == wxT("choice") );
}
void ctCustomPropertyDialog::OnUpdatePropertyChoiceRemove( wxUpdateUIEvent& event )
{
if (m_customPropertyEditorType && m_propertyChoices)
- event.Enable( m_customPropertyEditorType->GetSelection() > -1 &&
+ event.Enable( m_customPropertyEditorType->GetSelection() > -1 &&
m_customPropertyEditorType->GetStringSelection() == wxT("choice") &&
m_propertyChoices->GetSelection() > -1 );
}
#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"
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();
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;
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;
if (m_codeCtrl->IsModified())
{
wxString filename(m_filenameCtrl->GetValue());
- if (!filename.IsEmpty())
+ if (!filename.empty())
{
m_codeCtrl->SaveFile(filename);
m_codeCtrl->DiscardEdits();
int row;
ctProperty* prop = FindSelectedProperty(row);
- if (!prop || prop->GetEditorType().IsEmpty())
+ if (!prop || prop->GetEditorType().empty())
return false;
return true;
}
bool ctPropertyEditor::EditDefaultProperty(ctConfigItem* item)
{
wxString defaultPropertyName = item->GetDefaultProperty();
- if (!defaultPropertyName.IsEmpty())
+ if (!defaultPropertyName.empty())
{
ctProperty* prop = item->GetProperties().FindProperty(defaultPropertyName);
if (prop)
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 );
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)
inline const wxArrayString& GetChoices() const { return m_choices; }
inline const wxString& GetDescription() const { return m_description; }
inline bool IsCustom() const { return m_custom; }
-
+
inline void SetName(const wxString& name) { m_variant.SetName(name); }
inline void SetValue(const wxString& value) { m_variant = value; }
inline void SetValue(const wxVariant& value) { m_variant = value; }
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); }
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__)
helpTopic = wxT("Location settings dialog");
}
- if (!helpTopic.IsEmpty())
+ if (!helpTopic.empty())
{
wxGetApp().GetHelpController().DisplaySection(helpTopic);
}
*/
class ctSettingsDialog: public wxDialog
-{
+{
public:
/// Constructor
ctSettingsDialog( wxWindow* parent );
*/
class ctGeneralSettingsDialog: public wxPanel
-{
+{
public:
/// Constructor
ctGeneralSettingsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER|wxTAB_TRAVERSAL );
*/
class ctLocationSettingsDialog: public wxPanel
-{
+{
public:
/// Constructor
ctLocationSettingsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER|wxTAB_TRAVERSAL );