From: Włodzimierz Skiba Date: Fri, 4 Jun 2004 17:58:56 +0000 (+0000) Subject: -1->wxID_ANY, TRUE->true, FALSE->false & tabs->spaces replacements. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4fe30bceff0445f540e639d2b6d3977d56b34020 -1->wxID_ANY, TRUE->true, FALSE->false & tabs->spaces replacements. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/utils/configtool/src/appsettings.cpp b/utils/configtool/src/appsettings.cpp index 4eecaf4ca4..56af6008d0 100644 --- a/utils/configtool/src/appsettings.cpp +++ b/utils/configtool/src/appsettings.cpp @@ -6,7 +6,7 @@ // Created: 2002-09-04 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) @@ -51,8 +51,8 @@ IMPLEMENT_DYNAMIC_CLASS(ctSettings, wxObject) ctSettings::ctSettings() { m_noUses = 0; - m_showToolBar = TRUE; - m_showWelcomeDialog = TRUE; + m_showToolBar = true; + m_showWelcomeDialog = true; m_exportDir = wxEmptyString; m_frameSize = wxRect(10, 10, 600, 500); @@ -61,20 +61,20 @@ ctSettings::ctSettings() m_appName = wxT("wxWidgets Configuration Tool"); m_appNameShort = wxT("Configuration Tool"); - m_showSplashScreen = FALSE; + m_showSplashScreen = false; m_userName = wxEmptyString; m_frameStatus = ctSHOW_STATUS_NORMAL; - m_loadLastDocument = TRUE; - m_firstTimeRun = TRUE; - m_smallToolbar = TRUE; + m_loadLastDocument = true; + m_firstTimeRun = true; + m_smallToolbar = true; m_mainSashSize = 200; - m_useToolTips = TRUE; - m_showTrayIcon = TRUE; - m_trayIconIsShown = FALSE; - m_useEnvironmentVariable = TRUE; + m_useToolTips = true; + m_showTrayIcon = true; + m_trayIconIsShown = false; + m_useEnvironmentVariable = true; m_frameworkDir = wxEmptyString; - m_matchWholeWord = FALSE; - m_matchCase = FALSE; + m_matchWholeWord = false; + m_matchCase = false; m_defaultFileKind = wxT("Setup file"); } @@ -129,7 +129,7 @@ bool ctSettings::Init() if (m_userName.IsEmpty()) m_userName = wxGetUserName(); - return TRUE; + return true; } // Create new filename @@ -212,13 +212,13 @@ bool ctSettings::LoadConfig() // facility just in case it's trying to load a damaged file. if (runningProgram != 0) { - m_loadLastDocument = FALSE; + m_loadLastDocument = false; } #endif config.Write(wxT("Misc/RunningProgram"), (long) 1); - return TRUE; + return true; } // Save config info @@ -270,7 +270,7 @@ bool ctSettings::SaveConfig() wxGetApp().GetDocManager()->FileHistorySave(config); } - return TRUE; + return true; } void ctSettings::ShowSettingsDialog(const wxString& WXUNUSED(page)) diff --git a/utils/configtool/src/appsettings.h b/utils/configtool/src/appsettings.h index 29fc2da439..7bb000d499 100644 --- a/utils/configtool/src/appsettings.h +++ b/utils/configtool/src/appsettings.h @@ -81,7 +81,7 @@ public: /// May not be needed in this application. wxString& GetLastFilename() { return m_lastFilename; } - /// Returns TRUE if this is the first time the application + /// Returns true if this is the first time the application /// has been run. bool GetFirstTimeRun() const { return m_firstTimeRun; } diff --git a/utils/configtool/src/configbrowser.cpp b/utils/configtool/src/configbrowser.cpp index 0ca4c267f9..372c2ca450 100644 --- a/utils/configtool/src/configbrowser.cpp +++ b/utils/configtool/src/configbrowser.cpp @@ -65,7 +65,7 @@ void ctConfigurationBrowserWindow::CreateControls() wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); item1->SetSizer(item2); - item1->SetAutoLayout(TRUE); + 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); @@ -92,7 +92,7 @@ void ctConfigurationBrowserWindow::OnConfigurationBrowserTreectrl( wxTreeEvent& bool ctConfigurationBrowserWindow::ShowToolTips() { - return TRUE; + return true; } /*! @@ -149,7 +149,7 @@ void ctConfigurationBrowserControlPanel::CreateControls() wxBoxSizer* item6 = new wxBoxSizer(wxVERTICAL); item5->SetSizer(item6); - item5->SetAutoLayout(TRUE); + 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); @@ -242,5 +242,5 @@ void ctConfigurationBrowserControlPanel::OnUpdateRenameConfiguration( wxUpdateUI bool ctConfigurationBrowserControlPanel::ShowToolTips() { - return TRUE; + return true; } diff --git a/utils/configtool/src/configbrowser.h b/utils/configtool/src/configbrowser.h index 10fdac59fb..08c108931f 100644 --- a/utils/configtool/src/configbrowser.h +++ b/utils/configtool/src/configbrowser.h @@ -54,7 +54,7 @@ class ctConfigurationBrowserWindow: public wxPanel public: /// Constructor - ctConfigurationBrowserWindow( wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN ); + ctConfigurationBrowserWindow( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN ); /// Creates the controls and sizers void CreateControls(); diff --git a/utils/configtool/src/configitem.cpp b/utils/configtool/src/configitem.cpp index 0e8519a1bc..05d328e345 100644 --- a/utils/configtool/src/configitem.cpp +++ b/utils/configtool/src/configitem.cpp @@ -33,21 +33,21 @@ IMPLEMENT_CLASS(ctConfigItem, wxObject) ctConfigItem::ctConfigItem() { - m_modified = FALSE; + m_modified = false; m_type = ctTypeBoolCheck; m_treeItemId = wxTreeItemId(); - m_enabled = TRUE; + m_enabled = true; m_parent = NULL; - m_active = TRUE; + m_active = true; } ctConfigItem::ctConfigItem(ctConfigItem* parent, ctConfigType type, const wxString& name) { - m_modified = FALSE; + m_modified = false; m_type = type; m_treeItemId = wxTreeItemId(); - m_enabled = FALSE; - m_active = TRUE; + m_enabled = false; + m_active = true; SetName(name); m_parent = parent; if (parent) @@ -82,7 +82,7 @@ bool ctConfigItem::CanEditProperty(const wxString& propName) const if (prop) return !prop->GetReadOnly(); else - return FALSE; + return false; } /// Assignment operator. @@ -165,7 +165,7 @@ void ctConfigItem::InitProperties() m_properties.AddProperty(prop); } prop->SetDescription(_("Name

The name of the configuration setting.")); - prop->SetReadOnly(TRUE); + prop->SetReadOnly(true); m_properties.AddProperty( new ctProperty( @@ -176,7 +176,7 @@ void ctConfigItem::InitProperties() m_properties.AddProperty( new ctProperty( wxT("Default-state

The default state."), - wxVariant((bool) TRUE, wxT("default-state")), + wxVariant(true, wxT("default-state")), wxT("bool"))); if (GetType() == ctTypeString) @@ -184,7 +184,7 @@ void ctConfigItem::InitProperties() m_properties.AddProperty( new ctProperty( wxT("Default-value

The default value."), - wxVariant((bool) TRUE, wxT("default-value")), + wxVariant(true, wxT("default-value")), wxT(""))); } else if (GetType() == ctTypeInteger) @@ -265,7 +265,7 @@ void ctConfigItem::ApplyProperty(ctProperty* prop, const wxVariant& WXUNUSED(old { ctConfigToolDoc* doc = GetDocument(); bool oldModified = doc->IsModified(); - doc->Modify(TRUE); + doc->Modify(true); wxString name = prop->GetName(); if (name == wxT("requires") || @@ -469,7 +469,7 @@ bool ctConfigItem::IsInActiveContext() { wxString context = GetPropertyString(wxT("context")); if (context.IsEmpty()) - return TRUE; + return true; wxList contextItems; StringToItems(GetDocument()->GetTopItem(), context, contextItems); @@ -478,9 +478,9 @@ bool ctConfigItem::IsInActiveContext() { ctConfigItem* otherItem = (ctConfigItem*) node->GetData(); if (otherItem->IsEnabled()) - return TRUE; + return true; } - return FALSE; + return false; } /// Evaluate the requires properties: @@ -497,12 +497,12 @@ void ctConfigItem::EvaluateDependencies() wxString enabledIfNot = GetPropertyString(wxT("enabled-if-not")); wxString indeterminateIf = GetPropertyString(wxT("indeterminate-if")); - bool active = TRUE; + bool active = true; bool enabled = IsEnabled(); bool oldEnabled = enabled; bool oldActive = IsActive(); - bool explicitlyEnabled = FALSE; - bool explicitlyDisabled = FALSE; + bool explicitlyEnabled = false; + bool explicitlyDisabled = false; bool inActiveContext = IsInActiveContext(); // Add the parent to the list of dependencies, if the @@ -543,9 +543,9 @@ void ctConfigItem::EvaluateDependencies() if (items.GetCount() > 0 && enabledCount == 0) { // None of the items were enabled - enabled = FALSE; - active = FALSE; - explicitlyDisabled = TRUE; + enabled = false; + active = false; + explicitlyDisabled = true; } } @@ -575,9 +575,9 @@ void ctConfigItem::EvaluateDependencies() // Enable if there were no related items that were enabled if (inContextCount > 0 && (disabledCount == inContextCount) && !explicitlyDisabled) { - explicitlyEnabled = TRUE; - enabled = TRUE; - active = FALSE; + explicitlyEnabled = true; + enabled = true; + active = false; } } @@ -608,9 +608,9 @@ void ctConfigItem::EvaluateDependencies() // Enable if there were no related items that were disabled if (inContextCount > 0 && (enabledCount > 0) && !explicitlyDisabled) { - explicitlyEnabled = TRUE; - enabled = TRUE; - active = FALSE; + explicitlyEnabled = true; + enabled = true; + active = false; } } @@ -644,9 +644,9 @@ void ctConfigItem::EvaluateDependencies() if (inContextCount > 0 && (enabledCount > 0) && !explicitlyEnabled) // if (inContextCount > 0 && (disabledCount > 0) && !explicitlyEnabled) { - enabled = FALSE; - active = FALSE; - explicitlyDisabled = TRUE; + enabled = false; + active = false; + explicitlyDisabled = true; } } @@ -674,22 +674,22 @@ void ctConfigItem::EvaluateDependencies() } if (inContextCount > 0 && enabledCount > 0) { - active = TRUE; - explicitlyEnabled = FALSE; - explicitlyDisabled = FALSE; + active = true; + explicitlyEnabled = false; + explicitlyDisabled = false; } } // Finally check a sort of dependency: whether our // context is active. If not, make this inactive. if (!IsInActiveContext()) - active = FALSE; + active = false; else { // If we didn't explicitly enable or disable it, // then we should make it active. if (!explicitlyEnabled && !explicitlyDisabled) - active = TRUE; + active = true; } SetActive(active); @@ -798,7 +798,7 @@ void ctConfigItem::PropagateRadioButton(wxList& considered) ctConfigItem* child = (ctConfigItem*) node->GetData(); if (child->IsEnabled() && child != this) { - child->Enable(FALSE); + child->Enable(false); child->Sync(); if (!considered.Member(child)) diff --git a/utils/configtool/src/configitem.h b/utils/configtool/src/configitem.h index 3a357d1990..681c54a469 100644 --- a/utils/configtool/src/configitem.h +++ b/utils/configtool/src/configitem.h @@ -179,19 +179,19 @@ public: bool IsModified() const { return m_modified; } /// Mark this as modified. - void Modify(bool modified = TRUE) { m_modified = modified; } + void Modify(bool modified = true) { m_modified = modified; } /// Is this item enabled? (checked/unchecked) bool IsEnabled() const { return m_enabled; } /// Enable or disable (check/uncheck) - void Enable(bool enable = TRUE) { m_enabled = enable; } + void Enable(bool enable = true) { m_enabled = enable; } /// Is this item active? (sensitive to user input) bool IsActive() const { return m_active; } /// Make this (in)active - void SetActive(bool active = TRUE) { m_active = active; } + void SetActive(bool active = true) { m_active = active; } /// Set the type void SetType(ctConfigType type) { m_type = type; } diff --git a/utils/configtool/src/configitemselector.cpp b/utils/configtool/src/configitemselector.cpp index e773e02e30..25cd3714bc 100644 --- a/utils/configtool/src/configitemselector.cpp +++ b/utils/configtool/src/configitemselector.cpp @@ -81,7 +81,7 @@ void ctConfigItemsSelector::CreateControls() wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); item1->SetSizer(item2); - item1->SetAutoLayout(TRUE); + item1->SetAutoLayout(true); wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL); item2->Add(item3, 1, wxGROW|wxALL, 5); @@ -93,7 +93,7 @@ void ctConfigItemsSelector::CreateControls() item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); wxString* item6Strings = NULL; - wxListBox* item6 = new wxListBox(item1, ID_AVAILABLE_CONFIG_ITEMS, wxDefaultPosition, wxSize(-1, 150), 0, item6Strings, wxLB_SINGLE|wxLB_SORT); + wxListBox* item6 = new wxListBox(item1, ID_AVAILABLE_CONFIG_ITEMS, wxDefaultPosition, wxSize(wxDefaultSize.x, 150), 0, item6Strings, wxLB_SINGLE|wxLB_SORT); item3->Add(item6, 1, wxGROW|wxALL, 5); wxStaticText* item7 = new wxStaticText(item1, wxID_STATIC, _("&List of configuration items:"), wxDefaultPosition, wxDefaultSize, 0); @@ -103,7 +103,7 @@ void ctConfigItemsSelector::CreateControls() item3->Add(item8, 0, wxGROW, 5); wxString* item9Strings = NULL; - wxListBox* item9 = new wxListBox(item1, ID_CONFIG_ITEMS, wxDefaultPosition, wxSize(-1, 100), 0, item9Strings, wxLB_SINGLE); + wxListBox* item9 = new wxListBox(item1, ID_CONFIG_ITEMS, wxDefaultPosition, wxSize(wxDefaultSize.x, 100), 0, item9Strings, wxLB_SINGLE); item8->Add(item9, 1, wxGROW|wxALL, 5); wxBoxSizer* item10 = new wxBoxSizer(wxVERTICAL); @@ -189,7 +189,7 @@ void ctConfigItemsSelector::OnOk( wxCommandEvent& event ) bool ctConfigItemsSelector::ShowToolTips() { - return TRUE; + return true; } /*! * Update event handler for ID_CONFIG_ADD @@ -221,22 +221,22 @@ void ctConfigItemsSelector::InitSourceConfigList(ctConfigItem* item) if (!item) return; - bool addIt = FALSE; + bool addIt = false; if (item->GetType() == ctTypeGroup) - addIt = FALSE; + addIt = false; else if (item->GetType() == ctTypeCheckGroup) - addIt = TRUE; + addIt = true; else if (item->GetType() == ctTypeRadioGroup) - addIt = TRUE; + addIt = true; else if (item->GetType() == ctTypeString) - addIt = TRUE; + addIt = true; else if (item->GetType() == ctTypeBoolCheck) - addIt = TRUE; + addIt = true; else if (item->GetType() == ctTypeBoolRadio) - addIt = TRUE; + addIt = true; else if (item->GetType() == ctTypeInteger) - addIt = TRUE; + addIt = true; if (addIt) { masterList->Append(item->GetName()); diff --git a/utils/configtool/src/configitemselector.h b/utils/configtool/src/configitemselector.h index b2dc557b28..c19a3af1a1 100644 --- a/utils/configtool/src/configitemselector.h +++ b/utils/configtool/src/configitemselector.h @@ -52,7 +52,7 @@ class ctConfigItemsSelector: public wxDialog { public: /// Constructor - ctConfigItemsSelector( wxWindow* parent, wxWindowID id = -1, const wxString& caption = _("Configuration Items Selector"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU ); + ctConfigItemsSelector( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = _("Configuration Items Selector"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU ); /// Creates the controls and sizers void CreateControls(); diff --git a/utils/configtool/src/configtooldoc.cpp b/utils/configtool/src/configtooldoc.cpp index 4ef42ebd16..6e7a276271 100644 --- a/utils/configtool/src/configtooldoc.cpp +++ b/utils/configtool/src/configtooldoc.cpp @@ -90,24 +90,24 @@ bool ctConfigToolDoc::OnCloseDocument() UpdateAllViews (NULL, & hint); DeleteItems(); - return TRUE; + return true; } else { - return FALSE; + return false; } } // Saves the doc bool ctConfigToolDoc::Save() { - if (!IsModified() && m_savedYet) return TRUE; + if (!IsModified() && m_savedYet) return true; bool ret = (m_documentFile == wxT("") || !m_savedYet) ? SaveAs() : OnSaveDocument(m_documentFile); if ( ret ) - SetDocumentSaved(TRUE); + SetDocumentSaved(true); return ret; } @@ -136,8 +136,8 @@ bool ctConfigToolDoc::OnCreate(const wxString& path, long flags) SetTopItem(rootItem); - Modify(FALSE); - SetDocumentSaved(FALSE); + Modify(false); + SetDocumentSaved(false); wxString rootName(wxT("untitled")); wxStripExtension(rootName); @@ -156,7 +156,7 @@ bool ctConfigToolDoc::OnCreate(const wxString& path, long flags) ctConfigToolHint hint(NULL, ctInitialUpdate); UpdateAllViews (NULL, & hint); - SetFilename(GetFilename(), TRUE); + SetFilename(GetFilename(), true); } } return success; @@ -181,7 +181,7 @@ bool ctConfigToolDoc::OnSaveDocument(const wxString& filename) if (wxFileExists(tempFilename)) wxRemoveFile(tempFilename); - bool leaveBackup = TRUE; + bool leaveBackup = true; bool saved = DoSave(tempFilename); @@ -219,9 +219,9 @@ bool ctConfigToolDoc::OnSaveDocument(const wxString& filename) wxRemoveFile(tempFilename); } - Modify(FALSE); + Modify(false); ((ctConfigToolView*)GetFirstView())->OnChangeFilename(); - SetDocumentSaved(TRUE); + SetDocumentSaved(true); SetFilename(filename); wxGetApp().GetSettings().m_lastFilename = filename; } else @@ -253,7 +253,7 @@ bool ctConfigToolDoc::OnOpenDocument(const wxString& filename) UpdateAllViews (NULL, & hint); } - SetDocumentSaved(TRUE); // Necessary or it will pop up the Save As dialog + SetDocumentSaved(true); // Necessary or it will pop up the Save As dialog return opened; } @@ -263,7 +263,7 @@ bool ctConfigToolDoc::DoSave(const wxString& filename) { wxFileOutputStream stream(filename); if (!stream.Ok()) - return FALSE; + return false; stream << wxT("\n"); stream << wxT(""); @@ -272,7 +272,7 @@ bool ctConfigToolDoc::DoSave(const wxString& filename) stream << wxT("\n\n"); - return TRUE; + return true; } inline static void OutputIndentation(wxOutputStream& stream, int indent) @@ -368,7 +368,7 @@ bool ctConfigToolDoc::DoSave(ctConfigItem* item, wxOutputStream& stream, int ind OutputIndentation(stream, indent*2); stream << wxT(""); - return TRUE; + return true; } /// Open the settings file @@ -389,20 +389,20 @@ bool ctConfigToolDoc::DoOpen(const wxString& filename) wxSimpleHtmlTag* firstSettingTag = settingsTag->GetChildren(); if (firstSettingTag) DoOpen(firstSettingTag, NULL); - return TRUE; + return true; } - return TRUE; + return true; } } - return FALSE; + return false; } static bool GetHtmlBoolValue(const wxString& value) { if (value == wxT("true") || value == wxT("TRUE") || value == wxT("1")) - return TRUE; + return true; else - return FALSE; + return false; } static int GetHtmlIntegerValue(const wxString& value) @@ -506,7 +506,7 @@ bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent) childTag->GetAttributeValue(description, wxT("description")); if (type == wxT("bool")) - prop->GetVariant() = wxVariant((bool) FALSE, name); + prop->GetVariant() = wxVariant(false, name); else if (type == wxT("double")) prop->GetVariant() = wxVariant((double) 0.0, name); else if (type == wxT("long")) @@ -514,7 +514,7 @@ bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent) else prop->GetVariant() = wxVariant(wxT(""), name); prop->SetDescription(description); - prop->SetCustom(TRUE); + prop->SetCustom(true); prop->SetEditorType(editorType); if (!choices.IsEmpty()) { @@ -532,7 +532,7 @@ bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent) else if (prop->GetVariant().GetType() == wxT("long")) prop->GetVariant() = (long) GetHtmlIntegerValue(childTag->GetNext()->GetTagText()); else if (prop->GetVariant().GetType() == wxT("bool")) - prop->GetVariant() = (bool) GetHtmlBoolValue(childTag->GetNext()->GetTagText()); + prop->GetVariant() = GetHtmlBoolValue(childTag->GetNext()->GetTagText()); else if (prop->GetVariant().GetType() == wxT("double")) prop->GetVariant() = (double) GetHtmlDoubleValue(childTag->GetNext()->GetTagText()); } @@ -541,7 +541,7 @@ bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent) } childTag = childTag->GetNext(); } - return TRUE; + return true; } /// Clear dependencies @@ -679,8 +679,8 @@ wxString ctConfigToolDoc::GenerateConfigureCommand() wxString str; str << wxT("# configurewx\n# Generated by wxConfigTool\n\n"); - wxString path = GetFrameworkDir(TRUE); - bool makeUnix = TRUE; + wxString path = GetFrameworkDir(true); + bool makeUnix = true; if (!path.IsEmpty()) { if (makeUnix) @@ -846,7 +846,7 @@ ctConfigItem* ctConfigToolDoc::FindNextSibling(ctConfigItem* item) ctConfigCommand::ctConfigCommand(const wxString& name, int cmdId, ctConfigItem* activeState, ctConfigItem* savedState, ctConfigItem* parent, ctConfigItem* insertBefore, - bool ignoreFirstTime): wxCommand(TRUE, name) + bool ignoreFirstTime): wxCommand(true, name) { m_activeState = activeState; m_savedState = savedState; @@ -859,7 +859,7 @@ ctConfigCommand::ctConfigCommand(const wxString& name, int cmdId, ctConfigCommand::ctConfigCommand(const wxString& name, int cmdId, ctConfigItem* activeState, ctProperties* properties, - bool ignoreFirstTime): wxCommand(TRUE, name) + bool ignoreFirstTime): wxCommand(true, name) { m_activeState = activeState; m_savedState = NULL; @@ -881,12 +881,12 @@ ctConfigCommand::~ctConfigCommand() bool ctConfigCommand::Do() { - return DoAndUndo(TRUE); + return DoAndUndo(true); } bool ctConfigCommand::Undo() { - return DoAndUndo(FALSE); + return DoAndUndo(false); } // Combine Do and Undo into one @@ -914,7 +914,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd) m_savedState = m_activeState; m_activeState = NULL; - m_savedState->GetDocument()->Modify(TRUE); + m_savedState->GetDocument()->Modify(true); ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView(); view->OnChangeFilename(); } @@ -923,7 +923,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd) wxASSERT(m_savedState != NULL); wxASSERT(m_activeState == NULL); - m_savedState->GetDocument()->Modify(TRUE); + m_savedState->GetDocument()->Modify(true); m_savedState->Attach(m_parent, m_insertBefore); ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView(); view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState); @@ -942,7 +942,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd) wxASSERT(m_savedState != NULL); wxASSERT(m_activeState == NULL); - m_savedState->GetDocument()->Modify(TRUE); + m_savedState->GetDocument()->Modify(true); m_savedState->Attach(m_parent, m_insertBefore); ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView(); view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState); @@ -956,7 +956,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd) wxASSERT(m_savedState == NULL); wxASSERT(m_activeState != NULL); - m_activeState->GetDocument()->Modify(TRUE); + m_activeState->GetDocument()->Modify(true); ctConfigToolView* view = (ctConfigToolView*) m_activeState->GetDocument()->GetFirstView(); m_activeState->Detach(); m_savedState = m_activeState; @@ -972,7 +972,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd) wxASSERT(m_savedState != NULL); wxASSERT(m_activeState == NULL); - m_savedState->GetDocument()->Modify(TRUE); + m_savedState->GetDocument()->Modify(true); m_savedState->Attach(m_parent, m_insertBefore); ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView(); view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState); @@ -986,7 +986,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd) wxASSERT(m_savedState == NULL); wxASSERT(m_activeState != NULL); - m_activeState->GetDocument()->Modify(TRUE); + m_activeState->GetDocument()->Modify(true); m_activeState->Detach(); m_savedState = m_activeState; m_activeState = NULL; @@ -1021,7 +1021,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd) } node = node->GetNext(); } - m_activeState->GetDocument()->Modify(TRUE); + m_activeState->GetDocument()->Modify(true); ctConfigToolView* view = (ctConfigToolView*) m_activeState->GetDocument()->GetFirstView(); if (view) { @@ -1029,12 +1029,12 @@ bool ctConfigCommand::DoAndUndo(bool doCmd) m_activeState->GetDocument()->UpdateAllViews (NULL, & hint); } } - m_ignoreThis = FALSE; + m_ignoreThis = false; break; } } - return TRUE; + return true; } IMPLEMENT_CLASS(ctConfiguration, wxObject) diff --git a/utils/configtool/src/configtooldoc.h b/utils/configtool/src/configtooldoc.h index 6929e5cb55..9a24ff694a 100644 --- a/utils/configtool/src/configtooldoc.h +++ b/utils/configtool/src/configtooldoc.h @@ -39,7 +39,7 @@ public: virtual bool OnCreate(const wxString& path, long flags); virtual bool OnOpenDocument(const wxString& filename); virtual bool OnSaveDocument(const wxString& filename); - virtual bool OnNewDocument() { return TRUE; } + virtual bool OnNewDocument() { return true; } virtual bool OnCloseDocument() ; virtual bool Save(); // Overridden only to correct bug in wxWidgets, docview.cpp @@ -260,10 +260,10 @@ public: ctConfigCommand(const wxString& name, int cmdId, ctConfigItem* activeState, ctConfigItem* savedState, ctConfigItem* parent = NULL, ctConfigItem* insertBefore = NULL, - bool ignoreFirstTime = FALSE); + bool ignoreFirstTime = false); ctConfigCommand(const wxString& name, int cmdId, ctConfigItem* activeState, ctProperties* properties, - bool ignoreFirstTime = FALSE); + bool ignoreFirstTime = false); ~ctConfigCommand(); bool Do(); diff --git a/utils/configtool/src/configtoolview.cpp b/utils/configtool/src/configtoolview.cpp index 7401279af4..726e509bf4 100644 --- a/utils/configtool/src/configtoolview.cpp +++ b/utils/configtool/src/configtoolview.cpp @@ -81,7 +81,7 @@ BEGIN_EVENT_TABLE(ctConfigToolView, wxView) EVT_UPDATE_UI(ctID_EDIT_CUSTOM_PROPERTY, ctConfigToolView::OnUpdateEditCustomProperty) EVT_UPDATE_UI(ctID_DELETE_CUSTOM_PROPERTY, ctConfigToolView::OnUpdateDeleteCustomProperty) - EVT_NOTEBOOK_PAGE_CHANGED(-1, ctConfigToolView::OnTabSelect) + EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, ctConfigToolView::OnTabSelect) EVT_MENU(ctID_SAVE_SETUP_FILE, ctConfigToolView::OnSaveSetupFile) EVT_MENU(ctID_SAVE_CONFIGURE_COMMAND, ctConfigToolView::OnSaveConfigureCommand) @@ -104,12 +104,12 @@ ctConfigToolView::ctConfigToolView() // windows for displaying the view. bool ctConfigToolView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) { - wxGetApp().GetDocManager()->ActivateView(this, TRUE); + wxGetApp().GetDocManager()->ActivateView(this, true); wxGetApp().GetMainFrame()->SetDocument((ctConfigToolDoc*) doc); wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument((ctConfigToolDoc*) doc) ; wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument((ctConfigToolDoc*) doc) ; - return TRUE; + return true; } void ctConfigToolView::OnDraw(wxDC *WXUNUSED(dc)) @@ -181,7 +181,7 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj) { // ctConfigItem& ti = *(ctConfigItem *)hint->m_item; wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem); - } + } break; default: @@ -193,20 +193,20 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj) bool ctConfigToolView::OnClose(bool WXUNUSED(deleteWindow)) { if (!GetDocument()->Close()) - return FALSE; + return false; ctConfigToolHint hint(NULL, ctClear); GetDocument()->UpdateAllViews (NULL, & hint); - wxGetApp().GetDocManager()->ActivateView(this, FALSE); + wxGetApp().GetDocManager()->ActivateView(this, false); - Activate(FALSE); + Activate(false); wxGetApp().GetMainFrame()->SetDocument(NULL); wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ; wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ; - return TRUE; + return true; } void ctConfigToolView::OnChangeFilename() @@ -235,12 +235,12 @@ void ctConfigToolView::OnChangeFilename() // General disabler void ctConfigToolView::OnUpdateDisable(wxUpdateUIEvent& event) { - event.Enable( FALSE ); + event.Enable( false ); } void ctConfigToolView::OnUpdateAddItem(wxUpdateUIEvent& event) { - event.Enable( TRUE ); + event.Enable( true ); } /// Add item and its children to the tree @@ -349,7 +349,7 @@ void ctConfigToolView::OnIconLeftDown(ctConfigTreeCtrl* treeControl, ctConfigIte item->Enable(!item->IsEnabled()); - GetDocument()->Modify(TRUE); + GetDocument()->Modify(true); OnChangeFilename(); SyncItem(treeControl, item); @@ -714,7 +714,7 @@ void ctConfigToolView::OnAddCustomProperty(wxCommandEvent& WXUNUSED(event)) if (doc && sel && editor) { ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(), - -1, _("Add a custom property")); + wxID_ANY, _("Add a custom property")); if (dialog.ShowModal() == wxID_OK) { wxString name = dialog.GetPropertyName(); @@ -731,14 +731,14 @@ void ctConfigToolView::OnAddCustomProperty(wxCommandEvent& WXUNUSED(event)) } ctProperty* property = new ctProperty; if (type == wxT("bool")) - property->GetVariant() = wxVariant((bool) FALSE, name); + property->GetVariant() = wxVariant(false, name); else if (type == wxT("double")) property->GetVariant() = wxVariant((double) 0.0, name); else if (type == wxT("long")) property->GetVariant() = wxVariant((long) 0, name); else property->GetVariant() = wxVariant(wxT(""), name); - property->SetCustom(TRUE); + property->SetCustom(true); property->SetDescription(descr); property->SetChoices(choices); property->SetEditorType(editorType); @@ -769,7 +769,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event)) wxArrayString oldChoices = property->GetChoices(); ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(), - -1, _("Edit custom property")); + wxID_ANY, _("Edit custom property")); dialog.SetPropertyName(oldName); dialog.SetPropertyType(oldType); dialog.SetPropertyDescription(oldDescription); @@ -790,7 +790,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event)) if (type != oldType) { if (type == wxT("bool")) - property->GetVariant() = wxVariant((bool) FALSE, name); + property->GetVariant() = wxVariant(false, name); else if (type == wxT("double")) property->GetVariant() = wxVariant((double) 0.0, name); else if (type == wxT("long")) @@ -810,7 +810,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event)) if (name != oldName) property->GetVariant().SetName(name); - property->SetCustom(TRUE); + property->SetCustom(true); if (descr != oldDescription) property->SetDescription(descr); @@ -916,7 +916,7 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event)) wxString filename = _T("setup.h"); wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir; if (path.IsEmpty()) - path = doc->GetFrameworkDir(FALSE); + path = doc->GetFrameworkDir(false); wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*"); wxFileDialog dialog(wxTheApp->GetTopWindow(), @@ -948,7 +948,7 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event)) wxString filename = _T("configurewx.sh"); wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir; if (path.IsEmpty()) - path = doc->GetFrameworkDir(FALSE); + path = doc->GetFrameworkDir(false); wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*"); wxFileDialog dialog(wxTheApp->GetTopWindow(), @@ -974,12 +974,12 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event)) void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event) { - event.Enable(TRUE); + event.Enable(true); } void ctConfigToolView::OnUpdateSaveConfigureCommand(wxUpdateUIEvent& event) { - event.Enable(TRUE); + event.Enable(true); } /// Find text @@ -1004,14 +1004,14 @@ void ctConfigToolView::OnFind(wxCommandEvent& WXUNUSED(event)) ctFindReplaceDialog::sm_findData.SetFlags(flags); dialog = new ctFindReplaceDialog(wxGetApp().GetMainFrame(), caption, style); - dialog->Show(TRUE); + dialog->Show(true); } } /// Update find text void ctConfigToolView::OnUpdateFind(wxUpdateUIEvent& event) { - event.Enable(TRUE); + event.Enable(true); } /// Save default file type @@ -1088,9 +1088,9 @@ void ctConfigToolView::OnUpdateGo(wxUpdateUIEvent& event) //---------------------------------------------------------------------------- BEGIN_EVENT_TABLE(ctFindReplaceDialog, wxFindReplaceDialog) - EVT_FIND(-1, ctFindReplaceDialog::OnFind) - EVT_FIND_NEXT(-1, ctFindReplaceDialog::OnFind) - EVT_FIND_CLOSE(-1, ctFindReplaceDialog::OnClose) + EVT_FIND(wxID_ANY, ctFindReplaceDialog::OnFind) + EVT_FIND_NEXT(wxID_ANY, ctFindReplaceDialog::OnFind) + EVT_FIND_CLOSE(wxID_ANY, ctFindReplaceDialog::OnClose) END_EVENT_TABLE() wxFindReplaceData ctFindReplaceDialog::sm_findData; @@ -1125,7 +1125,7 @@ bool ctFindReplaceDialog::DoFind(const wxString& textToFind, bool matchCase, boo { ctConfigToolDoc* doc = wxGetApp().GetMainFrame()->GetDocument(); if (!doc) - return FALSE; + return false; ctConfigToolView* view = (ctConfigToolView*) doc->GetFirstView(); ctConfigItem* currentItem = NULL; @@ -1134,7 +1134,7 @@ bool ctFindReplaceDialog::DoFind(const wxString& textToFind, bool matchCase, boo { focusItem = doc->GetTopItem(); if (!focusItem) - return FALSE; + return false; } if (!sm_currentItem.IsEmpty()) @@ -1151,14 +1151,14 @@ bool ctFindReplaceDialog::DoFind(const wxString& textToFind, bool matchCase, boo { sm_currentItem = currentItem->GetName(); wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->SelectItem(currentItem->GetTreeItemId()); - return TRUE; + return true; } else { sm_currentItem = wxEmptyString; } - return FALSE; + return false; } ctConfigItem* ctFindReplaceDialog::FindNextItem(ctConfigToolDoc* doc, diff --git a/utils/configtool/src/configtoolview.h b/utils/configtool/src/configtoolview.h index 287f153523..ead6ab767c 100644 --- a/utils/configtool/src/configtoolview.h +++ b/utils/configtool/src/configtoolview.h @@ -41,7 +41,7 @@ public: bool OnCreate(wxDocument *doc, long flags); void OnDraw(wxDC *dc); void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL); - bool OnClose(bool deleteWindow = TRUE); + bool OnClose(bool deleteWindow = true); void OnChangeFilename(); //// Operations @@ -252,9 +252,9 @@ public: void OnFind(wxFindDialogEvent& event); void OnClose(wxFindDialogEvent& event); - // If wrap is TRUE, go back to the beginning if at the end of the + // If wrap is true, go back to the beginning if at the end of the // document. - bool DoFind(const wxString& textToFind, bool matchCase, bool wholeWord, bool wrap = TRUE); + bool DoFind(const wxString& textToFind, bool matchCase, bool wholeWord, bool wrap = true); ctConfigItem* FindNextItem(ctConfigToolDoc* doc, ctConfigItem* item, diff --git a/utils/configtool/src/configtree.cpp b/utils/configtool/src/configtree.cpp index 7236c81ec2..28e32bddb4 100644 --- a/utils/configtool/src/configtree.cpp +++ b/utils/configtool/src/configtree.cpp @@ -62,8 +62,8 @@ IMPLEMENT_CLASS(ctConfigTreeCtrl, wxTreeCtrl) BEGIN_EVENT_TABLE(ctConfigTreeCtrl, wxTreeCtrl) EVT_MOUSE_EVENTS(ctConfigTreeCtrl::OnMouseEvent) EVT_CHAR(ctConfigTreeCtrl::OnKeyDown) - EVT_TREE_SEL_CHANGED(-1, ctConfigTreeCtrl::OnSelChanged) - EVT_HELP(-1, ctConfigTreeCtrl::OnHelp) + EVT_TREE_SEL_CHANGED(wxID_ANY, ctConfigTreeCtrl::OnSelChanged) + EVT_HELP(wxID_ANY, ctConfigTreeCtrl::OnHelp) END_EVENT_TABLE() ctConfigTreeCtrl::ctConfigTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt, @@ -88,32 +88,32 @@ wxTreeCtrl(parent, id, pt, sz, style) // Load the icons and initialize the tree void ctConfigTreeCtrl::LoadIcons() { - m_imageList = new wxImageList(16, 16, TRUE); + m_imageList = new wxImageList(16, 16, true); m_iconTable.SetImageList(m_imageList); SetImageList(m_imageList); - m_iconTable.AddInfo(_T("Group"), wxIcon(closedfolder_xpm), 0, TRUE); - m_iconTable.AddInfo(_T("Group"), wxIcon(closedfolder_dis_xpm), 0, FALSE); + m_iconTable.AddInfo(_T("Group"), wxIcon(closedfolder_xpm), 0, true); + m_iconTable.AddInfo(_T("Group"), wxIcon(closedfolder_dis_xpm), 0, false); - m_iconTable.AddInfo(_T("Checkbox"), wxIcon(checked_xpm), 0, TRUE); - m_iconTable.AddInfo(_T("Checkbox"), wxIcon(checked_dis_xpm), 0, FALSE); - m_iconTable.AddInfo(_T("Checkbox"), wxIcon(unchecked_xpm), 1, TRUE); - m_iconTable.AddInfo(_T("Checkbox"), wxIcon(unchecked_dis_xpm), 1, FALSE); + m_iconTable.AddInfo(_T("Checkbox"), wxIcon(checked_xpm), 0, true); + m_iconTable.AddInfo(_T("Checkbox"), wxIcon(checked_dis_xpm), 0, false); + m_iconTable.AddInfo(_T("Checkbox"), wxIcon(unchecked_xpm), 1, true); + m_iconTable.AddInfo(_T("Checkbox"), wxIcon(unchecked_dis_xpm), 1, false); - m_iconTable.AddInfo(_T("CheckGroup"), wxIcon(checkedfolder_xpm), 0, TRUE); - m_iconTable.AddInfo(_T("CheckGroup"), wxIcon(checkedfolder_dis_xpm), 0, FALSE); - m_iconTable.AddInfo(_T("CheckGroup"), wxIcon(uncheckedfolder_xpm), 1, TRUE); - m_iconTable.AddInfo(_T("CheckGroup"), wxIcon(uncheckedfolder_dis_xpm), 1, FALSE); + m_iconTable.AddInfo(_T("CheckGroup"), wxIcon(checkedfolder_xpm), 0, true); + m_iconTable.AddInfo(_T("CheckGroup"), wxIcon(checkedfolder_dis_xpm), 0, false); + m_iconTable.AddInfo(_T("CheckGroup"), wxIcon(uncheckedfolder_xpm), 1, true); + m_iconTable.AddInfo(_T("CheckGroup"), wxIcon(uncheckedfolder_dis_xpm), 1, false); - m_iconTable.AddInfo(_T("RadioGroup"), wxIcon(radiofolderon_xpm), 0, TRUE); - m_iconTable.AddInfo(_T("RadioGroup"), wxIcon(radiofolderon_dis_xpm), 0, FALSE); - m_iconTable.AddInfo(_T("RadioGroup"), wxIcon(radiofolderoff_xpm), 1, TRUE); - m_iconTable.AddInfo(_T("RadioGroup"), wxIcon(radiofolderoff_dis_xpm), 1, FALSE); + m_iconTable.AddInfo(_T("RadioGroup"), wxIcon(radiofolderon_xpm), 0, true); + m_iconTable.AddInfo(_T("RadioGroup"), wxIcon(radiofolderon_dis_xpm), 0, false); + m_iconTable.AddInfo(_T("RadioGroup"), wxIcon(radiofolderoff_xpm), 1, true); + m_iconTable.AddInfo(_T("RadioGroup"), wxIcon(radiofolderoff_dis_xpm), 1, false); - m_iconTable.AddInfo(_T("Radiobutton"), wxIcon(radioon_xpm), 0, TRUE); - m_iconTable.AddInfo(_T("Radiobutton"), wxIcon(radioon_dis_xpm), 0, FALSE); - m_iconTable.AddInfo(_T("Radiobutton"), wxIcon(radiooff_xpm), 1, TRUE); - m_iconTable.AddInfo(_T("Radiobutton"), wxIcon(radiooff_dis_xpm), 1, FALSE); + m_iconTable.AddInfo(_T("Radiobutton"), wxIcon(radioon_xpm), 0, true); + m_iconTable.AddInfo(_T("Radiobutton"), wxIcon(radioon_dis_xpm), 0, false); + m_iconTable.AddInfo(_T("Radiobutton"), wxIcon(radiooff_xpm), 1, true); + m_iconTable.AddInfo(_T("Radiobutton"), wxIcon(radiooff_dis_xpm), 1, false); } ctConfigTreeCtrl::~ctConfigTreeCtrl() @@ -214,7 +214,7 @@ void ctConfigTreeCtrl::OnHelp(wxHelpEvent& event) wxGetApp().GetReferenceHelpController().DisplaySection(helpTopic); return; } - } + } } event.Skip(); diff --git a/utils/configtool/src/custompropertydialog.cpp b/utils/configtool/src/custompropertydialog.cpp index 2c6af9c1b8..2be4b2db88 100644 --- a/utils/configtool/src/custompropertydialog.cpp +++ b/utils/configtool/src/custompropertydialog.cpp @@ -77,7 +77,7 @@ void ctCustomPropertyDialog::CreateControls() wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); item1->SetSizer(item2); - item1->SetAutoLayout(TRUE); + item1->SetAutoLayout(true); wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL); item2->Add(item3, 1, wxGROW|wxALL, 5); @@ -128,7 +128,7 @@ void ctCustomPropertyDialog::CreateControls() item13->SetStringSelection(_("string")); item11->Add(item13, 1, wxGROW|wxALL, 5); - wxStaticBox* item14Static = new wxStaticBox(item1, -1, _("Choices")); + wxStaticBox* item14Static = new wxStaticBox(item1, wxID_ANY, _("Choices")); wxStaticBoxSizer* item14 = new wxStaticBoxSizer(item14Static, wxHORIZONTAL); item3->Add(item14, 0, wxGROW|wxALL, 5); @@ -183,7 +183,7 @@ void ctCustomPropertyDialog::CreateControls() bool ctCustomPropertyDialog::ShowToolTips() { - return TRUE; + return true; } /*! diff --git a/utils/configtool/src/custompropertydialog.h b/utils/configtool/src/custompropertydialog.h index 9c27dba1a1..a756d11fc1 100644 --- a/utils/configtool/src/custompropertydialog.h +++ b/utils/configtool/src/custompropertydialog.h @@ -53,7 +53,7 @@ class ctCustomPropertyDialog: public wxDialog { public: /// Constructor - ctCustomPropertyDialog( wxWindow* parent, wxWindowID id = -1, const wxString& caption = _("Edit Custom Property"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU ); + ctCustomPropertyDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = _("Edit Custom Property"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU ); /// Creates the controls and sizers void CreateControls(); diff --git a/utils/configtool/src/htmlparser.cpp b/utils/configtool/src/htmlparser.cpp index d486caad16..9eba43650b 100644 --- a/utils/configtool/src/htmlparser.cpp +++ b/utils/configtool/src/htmlparser.cpp @@ -106,7 +106,7 @@ bool wxSimpleHtmlParser::ParseFile(const wxString& filename) return ParseString(text); } else - return FALSE; + return false; } bool wxSimpleHtmlParser::ParseString(const wxString& str) @@ -131,7 +131,7 @@ bool wxSimpleHtmlParser::ParseString(const wxString& str) bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent) { if (!parent) - return FALSE; + return false; while (!Eof()) { @@ -160,9 +160,9 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent) if (IsCloseTagNeeded(tag->GetName())) { if (!parent->GetParent()) - return FALSE; + return false; parent->GetParent()->AppendTag(tag); - return TRUE; + return true; } else parent->AppendTag(tag); @@ -177,7 +177,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent) if (IsCloseTagNeeded(tag->GetName())) { if (!ParseHtml(tag)) - return FALSE; // Something didn't go ok, so don't continue. + return false; // Something didn't go ok, so don't continue. } } else @@ -195,7 +195,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent) // empty lines at the end of the file... } } - return TRUE; + return true; } // Plain text, up until an angled bracket @@ -207,7 +207,7 @@ bool wxSimpleHtmlParser::ParseText(wxString& text) m_pos ++; } DecodeSpecialChars(text); - return TRUE; + return true; } wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagHeader() @@ -218,7 +218,7 @@ wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagHeader() EatWhitespace(); wxString word; - ReadWord(word, TRUE); + ReadWord(word, true); EatWhitespace(); @@ -239,12 +239,12 @@ wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagHeader() wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagClose() { - Matches(wxT("AppendAttribute(attrName, wxEmptyString); } else if (IsNumeric(GetChar(m_pos))) { - ReadNumber(attrName, TRUE); + ReadNumber(attrName, true); tag->AppendAttribute(attrName, wxEmptyString); } else { // Try to read an attribute name/value pair, or at least a name // without the value - ReadLiteral(attrName, TRUE); + ReadLiteral(attrName, true); EatWhitespace(); if (GetChar(m_pos) == wxT('=')) @@ -285,26 +285,26 @@ bool wxSimpleHtmlParser::ParseAttributes(wxSimpleHtmlTag* tag) EatWhitespace(); if (IsString()) - ReadString(attrValue, TRUE); + ReadString(attrValue, true); else if (!Eof() && !IsTagEndBracket(GetChar(m_pos))) - ReadLiteral(attrValue, TRUE); + ReadLiteral(attrValue, true); } if (!attrName.IsEmpty()) tag->AppendAttribute(attrName, attrValue); } } - return TRUE; + return true; } // e.g. wxSimpleHtmlTag* wxSimpleHtmlParser::ParseDirective() { - Matches(wxT(" wxSimpleHtmlTag* wxSimpleHtmlParser::ParseXMLDeclaration() { - Matches(wxT(""), TRUE)) + while (!Eof() && !Matches(wxT("-->"), true)) { m_pos ++; } - return TRUE; + return true; } bool wxSimpleHtmlParser::EatWhitespace() { while (!Eof() && IsWhitespace(GetChar(m_pos))) m_pos ++; - return TRUE; + return true; } bool wxSimpleHtmlParser::EatWhitespace(int& pos) { while (!Eof(pos) && IsWhitespace(GetChar(pos))) pos ++; - return TRUE; + return true; } bool wxSimpleHtmlParser::ReadString(wxString& str, bool eatIt) @@ -388,10 +388,10 @@ bool wxSimpleHtmlParser::ReadString(wxString& str, bool eatIt) if (eatIt) m_pos = pos; DecodeSpecialChars(str); - return TRUE; + return true; } else - return FALSE; + return false; } bool wxSimpleHtmlParser::ReadWord(wxString& str, bool eatIt) @@ -399,7 +399,7 @@ bool wxSimpleHtmlParser::ReadWord(wxString& str, bool eatIt) int pos = m_pos; if (!IsAlpha(GetChar(pos))) - return FALSE; + return false; str += (wxChar) GetChar(pos) ; pos ++; @@ -412,7 +412,7 @@ bool wxSimpleHtmlParser::ReadWord(wxString& str, bool eatIt) if (eatIt) m_pos = pos; DecodeSpecialChars(str); - return TRUE; + return true; } bool wxSimpleHtmlParser::ReadNumber(wxString& str, bool eatIt) @@ -420,7 +420,7 @@ bool wxSimpleHtmlParser::ReadNumber(wxString& str, bool eatIt) int pos = m_pos; if (!IsNumeric(GetChar(pos))) - return FALSE; + return false; str += (wxChar) GetChar(pos) ; pos ++; @@ -433,7 +433,7 @@ bool wxSimpleHtmlParser::ReadNumber(wxString& str, bool eatIt) if (eatIt) m_pos = pos; DecodeSpecialChars(str); - return TRUE; + return true; } // Could be number, string, whatever, but read up until whitespace or end of tag (but not a quoted string) @@ -449,7 +449,7 @@ bool wxSimpleHtmlParser::ReadLiteral(wxString& str, bool eatIt) if (eatIt) m_pos = pos; DecodeSpecialChars(str); - return TRUE; + return true; } bool wxSimpleHtmlParser::IsComment() @@ -514,12 +514,12 @@ bool wxSimpleHtmlParser::IsNumeric(int ch) bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name) { - if (name.IsSameAs(wxT("P"), FALSE)) // e.g

- return FALSE; + if (name.IsSameAs(wxT("P"), false)) // e.g

+ return false; // ToDo add more items here. - return TRUE; + return true; } // Encode/Decode Special Characters. @@ -527,11 +527,11 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name) /* static */ void wxSimpleHtmlParser::DecodeSpecialChars(wxString &value) { // XML translation - value.Replace(wxT(">"), wxT(">"), TRUE); - value.Replace(wxT("<"), wxT("<"), TRUE); - value.Replace(wxT("""), wxT("\""), TRUE); - value.Replace(wxT("'"), wxT("'"), TRUE); - value.Replace(wxT("&"), wxT("&"), TRUE); // Note: do this as last to prevent replace problems. + value.Replace(wxT(">"), wxT(">"), true); + value.Replace(wxT("<"), wxT("<"), true); + value.Replace(wxT("""), wxT("\""), true); + value.Replace(wxT("'"), wxT("'"), true); + value.Replace(wxT("&"), wxT("&"), true); // Note: do this as last to prevent replace problems. } /* static */ wxString wxSimpleHtmlParser::EncodeSpecialChars(const wxString &value) @@ -539,11 +539,11 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name) wxString newvalue = value; // XML translation - newvalue.Replace(wxT("&"), wxT("&"), TRUE); // Note: do this as first to prevent replace problems. - newvalue.Replace(wxT(">"), wxT(">"), TRUE); - newvalue.Replace(wxT("<"), wxT("<"), TRUE); - newvalue.Replace(wxT("\""),wxT("""), TRUE); - newvalue.Replace(wxT("'"), wxT("'"), TRUE); + newvalue.Replace(wxT("&"), wxT("&"), true); // Note: do this as first to prevent replace problems. + newvalue.Replace(wxT(">"), wxT(">"), true); + newvalue.Replace(wxT("<"), wxT("<"), true); + newvalue.Replace(wxT("\""),wxT("""), true); + newvalue.Replace(wxT("'"), wxT("'"), true); return newvalue; } @@ -591,10 +591,10 @@ bool wxSimpleHtmlParser::WriteFile(wxString& filename) if (fstream.Ok()) { Write(fstream); - return TRUE; + return true; } else - return FALSE; + return false; } /* @@ -819,10 +819,10 @@ bool wxSimpleHtmlTag::GetAttributeValue(wxString& value, const wxString& attrNam if (attr) { value = attr->GetValue(); - return TRUE; + return true; } else - return FALSE; + return false; } // Search forward from this tag until we find a tag with this name & attribute @@ -845,14 +845,14 @@ bool wxSimpleHtmlTag::FindTextUntilTagClose(wxString& text, const wxString& tagN while (tag) { if (tag->GetType() == wxSimpleHtmlTag_Close && tag->NameIs(tagName)) - return TRUE; + return true; if (tag->GetType() == wxSimpleHtmlTag_Text) text += tag->GetText(); tag = tag->m_next; } - return TRUE; + return true; } @@ -874,7 +874,7 @@ wxSimpleHtmlTag* wxSimpleHtmlTag::GetChild(int i) const void wxSimpleHtmlTag::Write(wxOutputStream& stream) { // Some helpers to layout the open and close tags. - static bool sbUseTab = TRUE; + static bool sbUseTab = true; static size_t snTabLevel = 0; #if 0 // Enable if no tabs should be used to align the tags. @@ -907,13 +907,13 @@ void wxSimpleHtmlTag::Write(wxOutputStream& stream) } if(!m_children) { - sbUseTab = FALSE; // We're putting the open a close tag on the same line, + sbUseTab = false; // We're putting the open a close tag on the same line, // so we don't wan't any tabs stream << wxT(">"); } else { - // sbUseTab = TRUE; + // sbUseTab = true; stream << wxT(">\n"); } snTabLevel++; @@ -958,7 +958,7 @@ void wxSimpleHtmlTag::Write(wxOutputStream& stream) stream << wxT("\t"); } stream << wxT("\n"); - sbUseTab = TRUE; + sbUseTab = true; break; } default: diff --git a/utils/configtool/src/htmlparser.h b/utils/configtool/src/htmlparser.h index 486b2f0c3e..53bc33e943 100644 --- a/utils/configtool/src/htmlparser.h +++ b/utils/configtool/src/htmlparser.h @@ -172,11 +172,11 @@ public: bool EatWhitespace(); // Throw away whitespace bool EatWhitespace(int& pos); // Throw away whitespace: using 'pos' - bool ReadString(wxString& str, bool eatIt = FALSE); - bool ReadWord(wxString& str, bool eatIt = FALSE); - bool ReadNumber(wxString& str, bool eatIt = FALSE); + bool ReadString(wxString& str, bool eatIt = false); + bool ReadWord(wxString& str, bool eatIt = false); + bool ReadNumber(wxString& str, bool eatIt = false); // Could be number, string, whatever, but read up until whitespace. - bool ReadLiteral(wxString& str, bool eatIt = FALSE); + bool ReadLiteral(wxString& str, bool eatIt = false); bool IsComment(); bool IsDirective(); @@ -190,9 +190,9 @@ public: bool IsAlpha(int ch); bool IsWordChar(int ch); bool IsNumeric(int ch); - // Check if a specific tag needs a close tag. If not this function should return FALSE. + // Check if a specific tag needs a close tag. If not this function should return false. // If no close tag is needed the result will be that the tag will be insert in a none - // hierarchical way. i.e. if the function would return FALSE all the time we would get + // hierarchical way. i.e. if the function would return false all the time we would get // a flat list of all tags (like it used to be previously). virtual bool IsCloseTagNeeded(const wxString &name); @@ -206,7 +206,7 @@ public: static wxString EncodeSpecialChars(const wxString &value); // Matches this string (case insensitive) - bool Matches(const wxString& tok, bool eatIt = FALSE) ; + bool Matches(const wxString& tok, bool eatIt = false) ; bool Eof() const { return (m_pos >= m_length); } bool Eof(int pos) const { return (pos >= m_length); } diff --git a/utils/configtool/src/mainframe.cpp b/utils/configtool/src/mainframe.cpp index b91d75eb53..cb090e8cca 100644 --- a/utils/configtool/src/mainframe.cpp +++ b/utils/configtool/src/mainframe.cpp @@ -90,8 +90,7 @@ BEGIN_EVENT_TABLE(ctMainFrame, wxDocParentFrame) END_EVENT_TABLE() // Define my frame constructor -ctMainFrame::ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, - long style): +ctMainFrame::ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxDocParentFrame(manager, parent, id, title, pos, size, style) { m_document = NULL; @@ -104,24 +103,24 @@ ctMainFrame::ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, m_mainNotebook = NULL; m_findDialog = NULL; - m_treeSplitterWindow = new wxSplitterWindow(this, -1, wxDefaultPosition, wxSize(400, 300), + m_treeSplitterWindow = new wxSplitterWindow(this, wxID_ANY, wxDefaultPosition, wxSize(400, 300), wxSP_3DSASH|wxSP_3DBORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN); - m_configTreeCtrl = new ctConfigTreeCtrl(m_treeSplitterWindow, -1, wxDefaultPosition, wxDefaultSize, + m_configTreeCtrl = new ctConfigTreeCtrl(m_treeSplitterWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN); - m_mainNotebook = new wxNotebook(m_treeSplitterWindow, -1, wxDefaultPosition, wxSize(300, 300), + m_mainNotebook = new wxNotebook(m_treeSplitterWindow, wxID_ANY, wxDefaultPosition, wxSize(300, 300), wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN); - m_propertyEditor = new ctPropertyEditor(m_mainNotebook, -1, wxDefaultPosition, wxSize(300, 200), + m_propertyEditor = new ctPropertyEditor(m_mainNotebook, wxID_ANY, wxDefaultPosition, wxSize(300, 200), wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN); - m_setupPage = new ctOutputWindow(m_mainNotebook, -1, wxDefaultPosition, wxSize(300, 200), + m_setupPage = new ctOutputWindow(m_mainNotebook, wxID_ANY, wxDefaultPosition, wxSize(300, 200), wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN); - m_configurePage = new ctOutputWindow(m_mainNotebook, -1, wxDefaultPosition, wxSize(300, 200), + m_configurePage = new ctOutputWindow(m_mainNotebook, wxID_ANY, wxDefaultPosition, wxSize(300, 200), wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN); #ifdef USE_CONFIG_BROWSER_PAGE - m_configBrowserPage = new ctConfigurationBrowserWindow(m_mainNotebook, -1, wxDefaultPosition, wxSize(300, 200), + m_configBrowserPage = new ctConfigurationBrowserWindow(m_mainNotebook, wxID_ANY, wxDefaultPosition, wxSize(300, 200), wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN); #endif @@ -151,12 +150,12 @@ ctMainFrame::ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, if (wxGetApp().GetSettings().m_showToolBar) { - menuBar->Check(ctID_SHOW_TOOLBAR, TRUE); + menuBar->Check(ctID_SHOW_TOOLBAR, true); } else { - menuBar->Check(ctID_SHOW_TOOLBAR, FALSE); - GetToolBar()->Show(FALSE); + menuBar->Check(ctID_SHOW_TOOLBAR, false); + GetToolBar()->Show(false); ResizeFrame(); } } @@ -178,7 +177,7 @@ void ctMainFrame::OnCloseWindow(wxCloseEvent& event) m_findDialog = NULL; } - Show(FALSE); + Show(false); if (IsMaximized()) wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_MAXIMIZED ; @@ -247,22 +246,22 @@ void ctMainFrame::InitToolBar(wxToolBar* toolBar) toolBarBitmaps[12] = wxBitmap(help_xpm); toolBarBitmaps[13] = wxBitmap(helpcs_xpm); - toolBar->AddTool(wxID_NEW, toolBarBitmaps[0], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("New project")); - toolBar->AddTool(wxID_OPEN, toolBarBitmaps[1], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Open project")); - toolBar->AddTool(wxID_SAVE, toolBarBitmaps[2], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Save project")); + toolBar->AddTool(wxID_NEW, toolBarBitmaps[0], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("New project")); + toolBar->AddTool(wxID_OPEN, toolBarBitmaps[1], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Open project")); + toolBar->AddTool(wxID_SAVE, toolBarBitmaps[2], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Save project")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_CUT, toolBarBitmaps[4], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Cut")); - toolBar->AddTool(wxID_COPY, toolBarBitmaps[3], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Copy")); - toolBar->AddTool(wxID_PASTE, toolBarBitmaps[5], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Paste")); + toolBar->AddTool(wxID_CUT, toolBarBitmaps[4], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Cut")); + toolBar->AddTool(wxID_COPY, toolBarBitmaps[3], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Copy")); + toolBar->AddTool(wxID_PASTE, toolBarBitmaps[5], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Paste")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_UNDO, toolBarBitmaps[10], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Undo")); - toolBar->AddTool(wxID_REDO, toolBarBitmaps[11], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Redo")); + toolBar->AddTool(wxID_UNDO, toolBarBitmaps[10], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Undo")); + toolBar->AddTool(wxID_REDO, toolBarBitmaps[11], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Redo")); toolBar->AddSeparator(); - toolBar->AddTool(ctID_GO, toolBarBitmaps[6], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Save setup.h or configurewx.sh")); + toolBar->AddTool(ctID_GO, toolBarBitmaps[6], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Save setup.h or configurewx.sh")); toolBar->AddSeparator(); - toolBar->AddTool(ctID_ITEM_HELP, toolBarBitmaps[12], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Show help for this option")); - toolBar->AddTool(wxID_HELP_CONTEXT, toolBarBitmaps[13], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Show help on the clicked item")); + toolBar->AddTool(ctID_ITEM_HELP, toolBarBitmaps[12], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Show help for this option")); + toolBar->AddTool(wxID_HELP_CONTEXT, toolBarBitmaps[13], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Show help on the clicked item")); // after adding the buttons to the toolbar, must call Realize() to reflect // the changes @@ -404,7 +403,7 @@ void ctMainFrame::UpdateFrameTitle() // General disabler void ctMainFrame::OnUpdateDisable(wxUpdateUIEvent& event) { - event.Enable( FALSE ); + event.Enable( false ); } /*! @@ -453,7 +452,7 @@ void ctOutputWindow::CreateWindows() item5->SetHelpText(_("Regenerates the code.")); #if 0 - m_filenameCtrl = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTE_READONLY); + m_filenameCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTE_READONLY); item2->Add( m_filenameCtrl, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); m_filenameCtrl->SetHelpText(_("Shows the filename where the code is being saved.")); #else @@ -461,10 +460,10 @@ void ctOutputWindow::CreateWindows() #endif // The code editor - m_codeCtrl = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxSize(100, 100), wxTE_RICH|wxTE_MULTILINE|wxSUNKEN_BORDER); + m_codeCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(100, 100), wxTE_RICH|wxTE_MULTILINE|wxSUNKEN_BORDER); item0->Add( m_codeCtrl, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 ); - SetAutoLayout( TRUE ); + SetAutoLayout( true ); SetSizer( item0 ); } diff --git a/utils/configtool/src/propeditor.cpp b/utils/configtool/src/propeditor.cpp index 9b20dc3fca..d184199412 100644 --- a/utils/configtool/src/propeditor.cpp +++ b/utils/configtool/src/propeditor.cpp @@ -65,7 +65,7 @@ ctPropertyEditor::~ctPropertyEditor() void ctPropertyEditor::CreateControls(wxWindow* parent) { - m_elementTitleTextCtrl = new wxTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); + m_elementTitleTextCtrl = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY); wxBitmap detailsIcon(ellipsis_xpm); wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); @@ -75,7 +75,7 @@ void ctPropertyEditor::CreateControls(wxWindow* parent) wxTextCtrl *item2 = m_elementTitleTextCtrl; item1->Add( item2, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - wxButton *item3a = new wxButton( parent, ctID_ATTRIBUTE_EDITOR_EDIT_DETAILS, wxT("Edit..."), wxDefaultPosition, wxSize(-1, -1)); + wxButton *item3a = new wxButton( parent, ctID_ATTRIBUTE_EDITOR_EDIT_DETAILS, wxT("Edit...")); item1->Add( item3a, 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5 ); item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 ); @@ -95,11 +95,11 @@ void ctPropertyEditor::CreateControls(wxWindow* parent) // TODO: show or hide description window // if (some-setting) -// ShowDescriptionWindow(FALSE); +// ShowDescriptionWindow(false); item0->Add( m_splitterWindow, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 ); - this->SetAutoLayout( TRUE ); + this->SetAutoLayout(true); this->SetSizer( item0 ); /// Add help text @@ -146,7 +146,7 @@ void ctPropertyEditor::ShowDescriptionWindow(bool show) { // TODO int pos = 100; - m_propertyDescriptionWindow->Show(TRUE); + m_propertyDescriptionWindow->Show(true); if (!m_splitterWindow->IsSplit()) { m_splitterWindow->SplitHorizontally(m_propertyDescriptionWindow, m_attributeEditorGrid, pos); @@ -182,13 +182,13 @@ void ctPropertyEditor::OnUpdateEditDetails(wxUpdateUIEvent& event) bool ctPropertyEditor::CanEditDetails() { if (!m_item) - return FALSE; + return false; int row; ctProperty* prop = FindSelectedProperty(row); if (!prop || prop->GetEditorType().IsEmpty()) - return FALSE; - return TRUE; + return false; + return true; } /// Shows the item @@ -261,7 +261,7 @@ void ctPropertyEditor::UpdateItem() while (node) { ctProperty* prop = (ctProperty*) node->GetData(); - DisplayProperty(i, prop, TRUE); + DisplayProperty(i, prop, true); i ++; node = node->GetNext(); @@ -300,7 +300,7 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly } else { - m_attributeEditorGrid->SetReadOnly(row, 1, FALSE); + m_attributeEditorGrid->SetReadOnly(row, 1, false); m_attributeEditorGrid->SetCellTextColour(row, 1, * wxBLACK); } @@ -308,7 +308,7 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly m_attributeEditorGrid->SetCellValue(row, 1, ctConvertToSingleText(prop->GetValue())); if (valueOnly) - return TRUE; + return true; // Set the value type if (prop->GetEditorType() == _T("choice")) @@ -347,24 +347,24 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly new ctGridCellTextEditor); } - return TRUE; + return true; } /// Display attribute value bool ctPropertyEditor::DisplayProperty(ctProperty* prop) { if (!m_item) - return FALSE; + return false; int index = m_item->GetProperties().GetList().IndexOf(prop); - return DisplayProperty(index, prop, TRUE); + return DisplayProperty(index, prop, true); } /// Display the default property bool ctPropertyEditor::DisplayDefaultProperty() { if (!m_item) - return FALSE; + return false; wxString str = m_item->GetDefaultProperty(); @@ -375,7 +375,7 @@ bool ctPropertyEditor::DisplayDefaultProperty() this->m_attributeEditorGrid->SelectRow(index); this->m_attributeEditorGrid->SetGridCursor(index, 1); } - return TRUE; + return true; } /// Edit the default property @@ -393,12 +393,12 @@ bool ctPropertyEditor::EditDefaultProperty(ctConfigItem* item) this->m_attributeEditorGrid->SelectRow(index); this->m_attributeEditorGrid->SetGridCursor(index, 1); EditDetails(wxTheApp->GetTopWindow()); - return TRUE; + return true; } } } - return FALSE; + return false; } /// Find the selected property @@ -446,7 +446,7 @@ bool ctPropertyEditor::EditDetails(wxWindow* WXUNUSED(parent)) int row; ctProperty* prop = FindSelectedProperty(row); if (!prop) - return FALSE; + return false; wxString type(prop->GetEditorType()); wxString value = m_attributeEditorGrid->GetCellValue(row, 1); @@ -457,16 +457,16 @@ bool ctPropertyEditor::EditDetails(wxWindow* WXUNUSED(parent)) wxString msg; msg.Printf(wxT("Edit %s:"), (const wxChar*) prop->GetName()); ctMultiLineTextEditor dialog(wxTheApp->GetTopWindow(), - -1, wxT("Edit Text Property"), msg, value); + wxID_ANY, wxT("Edit Text Property"), msg, value); if (dialog.ShowModal() == wxID_OK) { value = ctConvertToSingleText(dialog.GetText()); m_attributeEditorGrid->SetCellValue(row, 1, value); ApplyCellValueToProperty(row, 1); - return TRUE; + return true; } else - return FALSE; + return false; } else if (type == _T("filename")) { @@ -486,10 +486,10 @@ bool ctPropertyEditor::EditDetails(wxWindow* WXUNUSED(parent)) m_attributeEditorGrid->SetCellValue(row, 1, value); ApplyCellValueToProperty(row, 1); - return TRUE; + return true; } else - return FALSE; + return false; } else if (type == _T("configitems")) { @@ -497,7 +497,7 @@ bool ctPropertyEditor::EditDetails(wxWindow* WXUNUSED(parent)) ctConfigItem::StringToArray(value, items); ctConfigItemsSelector dialog(wxTheApp->GetTopWindow(), - -1, wxT("Select Configuration Items")); + wxID_ANY, wxT("Select Configuration Items")); dialog.SetConfigList(items); if (dialog.ShowModal() == wxID_OK) { @@ -507,14 +507,14 @@ bool ctPropertyEditor::EditDetails(wxWindow* WXUNUSED(parent)) m_attributeEditorGrid->SetCellValue(row, 1, newValue); ApplyCellValueToProperty(row, 1); - return TRUE; + return true; } else - return FALSE; + return false; } } - return FALSE; + return false; } /// Intercept selection event. @@ -589,12 +589,12 @@ void ctPropertyEditor::OnDClickCell(wxGridEvent& WXUNUSED(event)) /// item object. void ctPropertyEditor::ApplyCellValueToProperty(int row, int col) { - static bool s_Applying = FALSE; + static bool s_Applying = false; if (s_Applying) return; - s_Applying = TRUE; + s_Applying = true; if (col == 1 && m_item) { ctProperty* prop = m_item->GetProperties().GetNth(row); @@ -608,9 +608,9 @@ void ctPropertyEditor::ApplyCellValueToProperty(int row, int col) if (prop->GetVariant().GetType() == _T("bool")) { if (value == _T("1")) - variant = (bool) TRUE; + variant = true; else - variant = (bool) FALSE; + variant = false; } else if (prop->GetVariant().GetType() == _T("long")) { @@ -634,19 +634,19 @@ void ctPropertyEditor::ApplyCellValueToProperty(int row, int col) if (prop->GetName() == _T("description")) UpdateDescription(row); } - s_Applying = FALSE; + s_Applying = false; } /// Apply the cell value to the property, and notify the /// item object. void ctPropertyEditor::ApplyPropertyValue(ctConfigItem* item, ctProperty* property, const wxVariant& variant) { - static bool s_Applying = FALSE; + static bool s_Applying = false; if (s_Applying) return; - s_Applying = TRUE; + s_Applying = true; // Save the old values ctProperties* oldProperties = new ctProperties(item->GetProperties()); @@ -667,9 +667,9 @@ void ctPropertyEditor::ApplyPropertyValue(ctConfigItem* item, ctProperty* proper // But when we Undo or Redo, the changed properties will be applied. item->GetDocument()->GetCommandProcessor()->Submit( new ctConfigCommand(menuLabel, ctCMD_APPLY_PROPERTY, - item, oldProperties, TRUE)); + item, oldProperties, true)); - s_Applying = FALSE; + s_Applying = false; } /*! @@ -734,7 +734,7 @@ bool ctPropertyEditorGrid::ClearAttributes() { if (GetNumberRows() > 0) DeleteRows(0, GetNumberRows()); - return TRUE; + return true; } /*! @@ -801,7 +801,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, -1, wxT(""), wxDefaultPosition, wxSize(330,180), wxTE_MULTILINE|wxTE_RICH ); + wxTextCtrl *item3 = new wxTextCtrl( parent, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(330,180), wxTE_MULTILINE|wxTE_RICH ); item1->Add( item3, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); wxBoxSizer *item4 = new wxBoxSizer( wxHORIZONTAL ); @@ -826,11 +826,11 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg) item3->SetFocus(); ((wxButton*) FindWindow(wxID_OK))->SetDefault(); - parent->SetAutoLayout( TRUE ); + parent->SetAutoLayout( true ); parent->SetSizer(item0); item0->Fit(parent); - return TRUE; + return true; } /* @@ -839,14 +839,14 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg) */ BEGIN_EVENT_TABLE(ctSplitterWindow, wxSplitterWindow) - EVT_SPLITTER_SASH_POS_CHANGED(-1, ctSplitterWindow::OnChangeSash) + EVT_SPLITTER_SASH_POS_CHANGED(wxID_ANY, ctSplitterWindow::OnChangeSash) END_EVENT_TABLE() ctSplitterWindow::ctSplitterWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style): wxSplitterWindow(parent, id, pos, size, style) { - m_updateSettings = FALSE; + m_updateSettings = false; m_position = 0; } diff --git a/utils/configtool/src/propeditor.h b/utils/configtool/src/propeditor.h index 6fa790c41b..ae9f9fab73 100644 --- a/utils/configtool/src/propeditor.h +++ b/utils/configtool/src/propeditor.h @@ -75,7 +75,7 @@ class ctPropertyEditor: public wxPanel void UpdateItem(); /// Display attribute at given row - bool DisplayProperty(int row, ctProperty* prop, bool valueOnly = FALSE); + bool DisplayProperty(int row, ctProperty* prop, bool valueOnly = false); /// Display attribute value bool DisplayProperty(ctProperty* prop); diff --git a/utils/configtool/src/property.cpp b/utils/configtool/src/property.cpp index d8e3c9ab88..5682362b4f 100644 --- a/utils/configtool/src/property.cpp +++ b/utils/configtool/src/property.cpp @@ -7,7 +7,7 @@ // Created: 2003-06-03 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) @@ -111,9 +111,9 @@ ctProperty* ctProperties::FindOrCreateProperty(const wxString& name) void ctProperties::Clear() { - m_list.DeleteContents(TRUE); + m_list.DeleteContents(true); m_list.Clear(); - m_list.DeleteContents(FALSE); + m_list.DeleteContents(false); } void ctProperties::Copy(const ctProperties& properties) @@ -144,7 +144,7 @@ void ctProperties::SetProperty(const wxString& name, long value) void ctProperties::SetProperty(const wxString& name, bool value) { ctProperty* prop = FindOrCreateProperty(name); - prop->GetVariant() = (bool) value; + prop->GetVariant() = value; } void ctProperties::SetProperty(const wxString& name, const wxVariant& value) diff --git a/utils/configtool/src/property.h b/utils/configtool/src/property.h index f9928c0471..06fbf4d8f6 100644 --- a/utils/configtool/src/property.h +++ b/utils/configtool/src/property.h @@ -7,7 +7,7 @@ // Created: 2003-06-03 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// #ifndef _CT_PROPERTY_H_ @@ -30,30 +30,30 @@ class ctProperty: public wxObject public: ctProperty() { - m_readOnly = FALSE; - m_custom = FALSE; - m_show = TRUE; + m_readOnly = false; + m_custom = false; + m_show = true; } ctProperty(const ctProperty& property) { Copy(property); } ctProperty(const wxString& descr, const wxVariant& variant, const wxString& editorType = wxEmptyString, - bool readOnly = FALSE) + bool readOnly = false) { m_description = descr; m_variant = variant; m_editorType = editorType; - m_show = TRUE; + m_show = true; m_readOnly = readOnly; - m_custom = FALSE; + m_custom = false; } ctProperty(const wxString& name, const wxString& value = wxEmptyString) { m_variant.SetName(name); m_variant = value; - m_readOnly = FALSE; - m_custom = FALSE; - m_show = TRUE; + m_readOnly = false; + m_custom = false; + m_show = true; } void operator= (const ctProperty& property) { Copy(property); } diff --git a/utils/configtool/src/settingsdialog.cpp b/utils/configtool/src/settingsdialog.cpp index 4d0784a198..b43838777c 100644 --- a/utils/configtool/src/settingsdialog.cpp +++ b/utils/configtool/src/settingsdialog.cpp @@ -76,7 +76,7 @@ void ctSettingsDialog::CreateControls() wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); item1->SetSizer(item2); - item1->SetAutoLayout(TRUE); + item1->SetAutoLayout(true); wxNotebook* item3 = new wxNotebook(item1, ID_NOTEBOOK, wxDefaultPosition, wxSize(200, 200), wxNB_TOP); wxNotebookSizer* item3Sizer = new wxNotebookSizer(item3); @@ -102,7 +102,7 @@ void ctSettingsDialog::CreateControls() item21->Add(item25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); #if defined(__WXGTK__) || defined(__WXMAC__) - wxContextHelpButton* item26 = new wxContextHelpButton(item1, wxID_CONTEXT_HELP, wxDefaultPosition, wxSize(20, -1), wxBU_AUTODRAW); + wxContextHelpButton* item26 = new wxContextHelpButton(item1, wxID_CONTEXT_HELP, wxDefaultPosition, wxSize(20, wxDefaultSize.y), wxBU_AUTODRAW); item21->Add(item26, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); #endif @@ -168,7 +168,7 @@ void ctSettingsDialog::OnHelp( wxCommandEvent& WXUNUSED(event) ) bool ctSettingsDialog::ShowToolTips() { - return TRUE; + return true; } /*! @@ -211,14 +211,14 @@ void ctGeneralSettingsDialog::CreateControls() wxBoxSizer* item5 = new wxBoxSizer(wxVERTICAL); item4->SetSizer(item5); - item4->SetAutoLayout(TRUE); + item4->SetAutoLayout(true); - wxStaticBox* item6Static = new wxStaticBox(item4, -1, _("General settings")); + wxStaticBox* item6Static = new wxStaticBox(item4, wxID_ANY, _("General settings")); wxStaticBoxSizer* item6 = new wxStaticBoxSizer(item6Static, wxVERTICAL); item5->Add(item6, 1, wxGROW|wxALL, 5); wxCheckBox* item7 = new wxCheckBox(item4, ID_LOAD_LAST_DOCUMENT, _("&Load last document"), wxDefaultPosition, wxDefaultSize, 0); - item7->SetValue(FALSE); + item7->SetValue(false); item7->SetHelpText(_("Check to load the last document on startup")); #if wxUSE_TOOLTIPS if (ShowToolTips()) @@ -227,7 +227,7 @@ void ctGeneralSettingsDialog::CreateControls() item6->Add(item7, 0, wxALIGN_LEFT|wxALL, 5); wxCheckBox* item8 = new wxCheckBox(item4, ID_SHOW_TOOLTIPS, _("&Show tooltips"), wxDefaultPosition, wxDefaultSize, 0); - item8->SetValue(FALSE); + item8->SetValue(false); item8->SetHelpText(_("Check to show tooltips")); #if wxUSE_TOOLTIPS if (ShowToolTips()) @@ -242,7 +242,7 @@ void ctGeneralSettingsDialog::CreateControls() _("Setup file"), _("Configure script") }; - wxChoice* item10 = new wxChoice(item4, ID_DEFAULT_FILE_KIND, wxDefaultPosition, wxSize(200, -1), 2, item10Strings, 0); + wxChoice* item10 = new wxChoice(item4, ID_DEFAULT_FILE_KIND, wxDefaultPosition, wxSize(200, wxDefaultSize.y), 2, item10Strings, 0); item10->SetStringSelection(_("Setup file")); item10->SetHelpText(_("Select the default kind of file to save using Go")); #if wxUSE_TOOLTIPS @@ -265,7 +265,7 @@ void ctGeneralSettingsDialog::CreateControls() bool ctGeneralSettingsDialog::ShowToolTips() { - return TRUE; + return true; } /*! @@ -313,9 +313,9 @@ void ctLocationSettingsDialog::CreateControls() wxBoxSizer* item12 = new wxBoxSizer(wxVERTICAL); item11->SetSizer(item12); - item11->SetAutoLayout(TRUE); + item11->SetAutoLayout(true); - wxStaticBox* item13Static = new wxStaticBox(item11, -1, _("Locations")); + wxStaticBox* item13Static = new wxStaticBox(item11, wxID_ANY, _("Locations")); wxStaticBoxSizer* item13 = new wxStaticBoxSizer(item13Static, wxVERTICAL); item12->Add(item13, 1, wxGROW|wxALL, 5); @@ -325,7 +325,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, -1), 0); + wxTextCtrl* item16 = new wxTextCtrl(item11, ID_WXWIN_HIERARCHY, _(""), wxDefaultPosition, wxSize(200, wxDefaultSize.y), 0); item16->SetHelpText(_("Enter the root path of the wxWidgets hierarchy")); #if wxUSE_TOOLTIPS if (ShowToolTips()) @@ -347,7 +347,7 @@ void ctLocationSettingsDialog::CreateControls() item18->Add(60, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxCheckBox* item20 = new wxCheckBox(item11, ID_USE_WXWIN, _("&Use WXWIN environment variable"), wxDefaultPosition, wxDefaultSize, 0); - item20->SetValue(FALSE); + item20->SetValue(false); item20->SetHelpText(_("Check to use the value of WXWIN instead")); #if wxUSE_TOOLTIPS if (ShowToolTips()) diff --git a/utils/configtool/src/settingsdialog.h b/utils/configtool/src/settingsdialog.h index 507c151fe9..a58b0645f3 100644 --- a/utils/configtool/src/settingsdialog.h +++ b/utils/configtool/src/settingsdialog.h @@ -57,7 +57,7 @@ class ctSettingsDialog: public wxDialog { public: /// Constructor - ctSettingsDialog( wxWindow* parent, wxWindowID id = -1, + ctSettingsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& caption = _("Configuration Settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -98,7 +98,7 @@ class ctGeneralSettingsDialog: public wxPanel { public: /// Constructor - ctGeneralSettingsDialog( wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER|wxTAB_TRAVERSAL ); + ctGeneralSettingsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER|wxTAB_TRAVERSAL ); /// Creates the controls and sizers void CreateControls(); @@ -126,7 +126,7 @@ class ctLocationSettingsDialog: public wxPanel { public: /// Constructor - ctLocationSettingsDialog( wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER|wxTAB_TRAVERSAL ); + ctLocationSettingsDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxNO_BORDER|wxTAB_TRAVERSAL ); /// Creates the controls and sizers void CreateControls(); diff --git a/utils/configtool/src/utils.cpp b/utils/configtool/src/utils.cpp index 8af87a6d8e..f4d1920389 100644 --- a/utils/configtool/src/utils.cpp +++ b/utils/configtool/src/utils.cpp @@ -6,7 +6,7 @@ // Created: 2002-09-04 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -182,7 +182,7 @@ void apViewHTMLFile(const wxString& url) STARTUPINFO siStartInfo; memset(&siStartInfo, 0, sizeof(STARTUPINFO)); siStartInfo.cb = sizeof(STARTUPINFO); - CreateProcess(NULL, szCmdName, NULL, NULL, FALSE, 0, NULL, + CreateProcess(NULL, szCmdName, NULL, NULL, false, 0, NULL, NULL, &siStartInfo, &piProcInfo ); } if(lRes == ERROR_SUCCESS) @@ -204,11 +204,11 @@ void apViewHTMLFile(const wxString& url) { // TODO: some kind of configuration dialog here. wxMessageBox(_("Could not determine the command for running the browser."), - wxT("Browsing problem"), wxOK|wxICON_EXCLAMATION); + wxT("Browsing problem"), wxOK|wxICON_EXCLAMATION); return ; } - ok = (wxExecute(cmd, FALSE) != 0); + ok = (wxExecute(cmd, false) != 0); #endif } @@ -251,14 +251,14 @@ bool apInvokeAppForFile(const wxString& filename) msg.Printf(wxT("Sorry, could not determine what application to invoke for extension %s\nYou may need to edit your MIME types."), ext.c_str()); wxMessageBox(msg, wxT("Application Invocation"), wxICON_EXCLAMATION|wxOK); - return FALSE; + return false; } wxString cmd; ft->GetOpenCommand(&cmd, wxFileType::MessageParameters(filename, _T(""))); delete ft; - return (wxExecute(cmd, FALSE) != 0); + return (wxExecute(cmd, false) != 0); } // Find the absolute path where this application has been run from. @@ -337,7 +337,7 @@ void apAddContextHelpButton(wxWindow* #ifdef __WXMAC__ wxSize buttonSize(20, 20); #else - wxSize buttonSize(-1, -1); + wxSize buttonSize = wxDefaultSize; #endif wxButton *contextButton = new wxContextHelpButton( parent, wxID_CONTEXT_HELP, wxDefaultPosition, buttonSize); @@ -408,7 +408,7 @@ void wxIconInfo::SetIconId(int state, bool enabled, int iconId) wxIconTable::wxIconTable(wxImageList* imageList) { m_imageList = imageList; - DeleteContents(TRUE); + DeleteContents(true); } void wxIconTable::AppendInfo(wxIconInfo* info) @@ -429,7 +429,7 @@ bool wxIconTable::AddInfo(const wxString& name, const wxIcon& icon, int state, b Append(info); } info->SetIconId(state, enabled, m_imageList->Add(icon)); - return TRUE; + return true; } wxIconInfo* wxIconTable::FindInfo(const wxString& name) const @@ -457,9 +457,9 @@ bool wxIconTable::SetIconId(const wxString& name, int state, bool enabled, int i { wxIconInfo* info = FindInfo(name); if (!info) - return FALSE; + return false; info->SetIconId(state, enabled, iconId); - return TRUE; + return true; } // Output stream operators @@ -511,27 +511,27 @@ bool ctMatchString(const wxString& matchAgainst, const wxString& matchText, bool { // Fast operation if not matching against whole words only if (!wholeWordOnly) - return (matchAgainst.Find(matchText) != -1); + return (matchAgainst.Find(matchText) != wxNOT_FOUND); wxString left(matchAgainst); - bool success = FALSE; + bool success = false; int matchTextLen = (int) matchText.Length(); while (!success && !matchAgainst.IsEmpty()) { int pos = left.Find(matchText); - if (pos == -1) - return FALSE; + if (pos == wxNOT_FOUND) + return false; - bool firstCharOK = FALSE; - bool lastCharOK = FALSE; + bool firstCharOK = false; + bool lastCharOK = false; if (pos == 0 || !wxIsalnum(left[(size_t) (pos-1)])) - firstCharOK = TRUE; + firstCharOK = true; if (((pos + matchTextLen) == (int) left.Length()) || !wxIsalnum(left[(size_t) (pos + matchTextLen)])) - lastCharOK = TRUE; + lastCharOK = true; if (firstCharOK && lastCharOK) - success = TRUE; + success = true; left = left.Mid(pos+1); } diff --git a/utils/configtool/src/utils.h b/utils/configtool/src/utils.h index 587bc5b376..8402525c30 100644 --- a/utils/configtool/src/utils.h +++ b/utils/configtool/src/utils.h @@ -113,15 +113,15 @@ and has a convenient API. For example, the following adds icons for a checkbox item that can be: on/enabled, off/enabled, on/disabled,off/disabled. - m_iconTable.AddInfo("Checkbox", wxICON(checked), 0, TRUE); - m_iconTable.AddInfo("Checkbox", wxICON(checked_dis), 0, FALSE); - m_iconTable.AddInfo("Checkbox", wxICON(unchecked), 1, TRUE); - m_iconTable.AddInfo("Checkbox", wxICON(unchecked_dis), 1, FALSE); + m_iconTable.AddInfo("Checkbox", wxICON(checked), 0, true); + m_iconTable.AddInfo("Checkbox", wxICON(checked_dis), 0, false); + m_iconTable.AddInfo("Checkbox", wxICON(unchecked), 1, true); + m_iconTable.AddInfo("Checkbox", wxICON(unchecked_dis), 1, false); When you update the item image in response to (e.g.) user interaction, you can say something like this: - int iconId = m_iconTable.GetIconId("Checkbox", 0, FALSE); + int iconId = m_iconTable.GetIconId("Checkbox", 0, false); treeCtrl.SetItemImage(itemId, iconId, wxTreeItemIcon_Normal); treeCtrl.SetItemImage(itemId, iconId, wxTreeItemIcon_Selected); @@ -145,7 +145,7 @@ public: int GetStateCount() const { return m_maxStates; }; void SetStateCount(int count) { m_maxStates = count; } - int GetIconId(int state, bool enabled = TRUE) const; + int GetIconId(int state, bool enabled = true) const; void SetIconId(int state, bool enabled, int iconId); const wxString& GetName() const { return m_name; } @@ -178,7 +178,7 @@ public: wxIconInfo* FindInfo(const wxString& name) const; - int GetIconId(const wxString& name, int state, bool enabled = TRUE) const; + int GetIconId(const wxString& name, int state, bool enabled = true) const; bool SetIconId(const wxString& name, int state, bool enabled, int iconId) ; void SetImageList(wxImageList* imageList) { m_imageList = imageList; } diff --git a/utils/configtool/src/wxconfigtool.cpp b/utils/configtool/src/wxconfigtool.cpp index 65efe5bd58..cd2f5af42f 100644 --- a/utils/configtool/src/wxconfigtool.cpp +++ b/utils/configtool/src/wxconfigtool.cpp @@ -121,7 +121,7 @@ bool ctApp::OnInit(void) wxString helpFilePath(GetFullAppPath(_("configtool"))); m_helpController->Initialize(helpFilePath); - ctMainFrame* frame = new ctMainFrame(m_docManager, NULL, -1, wxGetApp().GetSettings().GetAppName(), + ctMainFrame* frame = new ctMainFrame(m_docManager, NULL, wxID_ANY, wxGetApp().GetSettings().GetAppName(), GetSettings().m_frameSize.GetPosition(), GetSettings().m_frameSize.GetSize(), wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN); SetTopWindow(frame); @@ -130,12 +130,12 @@ bool ctApp::OnInit(void) { case ctSHOW_STATUS_MAXIMIZED: { - frame->Maximize(TRUE); + frame->Maximize(true); break; } case ctSHOW_STATUS_MINIMIZED: { - frame->Iconize(TRUE); + frame->Iconize(true); break; } default: @@ -172,7 +172,7 @@ bool ctApp::OnInit(void) // Load the file wxDocument* doc = m_docManager->CreateDocument(arg, wxDOC_SILENT); if (doc) - doc->SetDocumentSaved(TRUE); + doc->SetDocumentSaved(true); } else { @@ -181,13 +181,13 @@ bool ctApp::OnInit(void) // Load the file that was last loaded wxDocument* doc = m_docManager->CreateDocument(GetSettings().m_lastFilename, wxDOC_SILENT); if (doc) - doc->SetDocumentSaved(TRUE); + doc->SetDocumentSaved(true); } } - GetTopWindow()->Show(TRUE); + GetTopWindow()->Show(true); - return TRUE; + return true; } int ctApp::OnExit(void) diff --git a/utils/configtool/src/wxconfigtool.h b/utils/configtool/src/wxconfigtool.h index c1afc994f3..d2b9b926fe 100644 --- a/utils/configtool/src/wxconfigtool.h +++ b/utils/configtool/src/wxconfigtool.h @@ -62,7 +62,7 @@ public: /// Returns the notebook window. wxNotebook* GetNotebookWindow() { return m_notebookWindow; } - /// Returns TRUE if the application should show tooltips. + /// Returns true if the application should show tooltips. virtual bool UsingTooltips(); /// Returns the help controller object for the manual. diff --git a/utils/helpview/src/client.cpp b/utils/helpview/src/client.cpp index 218d658a70..66dc71fde5 100644 --- a/utils/helpview/src/client.cpp +++ b/utils/helpview/src/client.cpp @@ -2,7 +2,7 @@ // Name: client.cpp // Purpose: Remote help sample client // Author: Julian Smart -// Modified by: Eric Dowty +// Modified by: Eric Dowty // Created: 25/01/99 // RCS-ID: $Id$ // Copyright: (c) Julian Smart @@ -95,9 +95,9 @@ wxListBox *the_list = NULL; bool MyApp::OnInit() { wxString a_appname, a_service, a_windowname, a_book; - + m_help = NULL; - + // for MSW (DDE classes), a_service is 'service name', apparently an arbitrary string // for Unix, should be a valid file name (for a nonexistent file) // for nonMSW, nonUnix, must be port number, for example "4242" (TCP/IP based classes) @@ -105,62 +105,62 @@ bool MyApp::OnInit() a_service = "/tmp/wxWidgets-helpconnection"; //a_service = "4242"; a_windowname = "HTML Help Test: %s"; - + #if defined(__WXMSW__) a_appname = "helpview.exe"; #else a_appname = "./helpview"; #endif - + //a_book = "helpfiles/testing.hhp"; a_book = "test.zip"; - - wxConfig *conf = (wxConfig*) wxConfig::Get(); - + + wxConfig *conf = (wxConfig*) wxConfig::Get(); + #if defined(USE_REMOTE) m_help = new wxRemoteHtmlHelpController(); - m_help->SetServer( a_appname ); - m_help->SetService( a_service ); + m_help->SetServer( a_appname ); + m_help->SetService( a_service ); #else m_help = new wxHtmlHelpController(); #endif - - //this is a dummy for wxRemoteHtmlHelpController + + //this is a dummy for wxRemoteHtmlHelpController m_help->UseConfig(conf); - - m_help->AddBook( a_book ); - m_help->SetTitleFormat( a_windowname ); - - // Create the main frame window + + m_help->AddBook( a_book ); + m_help->SetTitleFormat( a_windowname ); + + // Create the main frame window MyFrame* frame = new MyFrame(NULL, "Help Client"); - frame->Show(TRUE); - - return TRUE; + frame->Show(true); + + return true; } int MyApp::OnExit() { delete m_help; - delete wxConfig::Set(NULL); + delete wxConfig::Set(NULL); return 0; } // Define my frame constructor MyFrame::MyFrame(wxFrame *frame, const wxString& title) -: wxFrame(frame, -1, title, wxDefaultPosition, wxSize( 200, 100 ) ) +: wxFrame(frame, wxID_ANY, title, wxDefaultPosition, wxSize( 200, 100 ) ) { m_panel = NULL; - + // Give it an icon SetIcon(wxICON(mondrian)); - + // Make a menubar wxMenu *file_menu = new wxMenu; - + file_menu->Append(CLIENT_HELPMAIN, "Help - Main"); file_menu->Append(CLIENT_HELPBOOK1, "Help - Book1"); file_menu->Append(CLIENT_HELPBOOK2, "Help - Book2"); - + file_menu->Append(CLIENT_HELPINDEX, "Help - DisplayIndex"); file_menu->Append(CLIENT_HELPCONTENTS, "Help - DisplayContents"); file_menu->Append(CLIENT_HELPSEARCH, "Help - KeywordSearch"); @@ -168,71 +168,71 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title) file_menu->Append(CLIENT_HELPADDBOOK, "Help - AddBook"); file_menu->Append(CLIENT_HELPTEMPDIR, "Help - SetTempDir"); file_menu->Append(CLIENT_HELPQUIT, "Help - Kill Server"); - + file_menu->Append(DIALOG_MODAL, "Modal dialog"); file_menu->Append(CLIENT_QUIT, "Quit"); - + wxMenuBar *menu_bar = new wxMenuBar; - + menu_bar->Append(file_menu, "File"); - + // Associate the menu bar with the frame SetMenuBar(menu_bar); - + // Make a panel m_panel = new wxPanel(this ); - + m_modalbutton = new wxButton( this, BUTTON_MODAL, "Modal Dialog", - wxPoint(10,10), wxSize(-1, -1) ); + wxPoint(10,10), wxDefaultSize ); } void MyFrame::OnHelp_Book1(wxCommandEvent& event) { - wxGetApp().m_help->Display( "book1.htm" ); + wxGetApp().m_help->Display( "book1.htm" ); } void MyFrame::OnHelp_Book2(wxCommandEvent& event) { - wxGetApp().m_help->Display( "book2.htm" ); + wxGetApp().m_help->Display( "book2.htm" ); } void MyFrame::OnHelp_Main(wxCommandEvent& event) { - wxGetApp().m_help->Display( "main.htm" ); + wxGetApp().m_help->Display( "main.htm" ); } void MyFrame::OnHelp_Index(wxCommandEvent& event) { - wxGetApp().m_help->DisplayIndex( ); + wxGetApp().m_help->DisplayIndex( ); } void MyFrame::OnHelp_Contents(wxCommandEvent& event) { - wxGetApp().m_help->DisplayContents( ); + wxGetApp().m_help->DisplayContents( ); } void MyFrame::OnHelp_Search(wxCommandEvent& event) { - wxGetApp().m_help->KeywordSearch( "enjoy" ); + wxGetApp().m_help->KeywordSearch( "enjoy" ); } void MyFrame::OnHelp_Title(wxCommandEvent& event) { - wxGetApp().m_help->SetTitleFormat( "Another_Title: %s" ); + wxGetApp().m_help->SetTitleFormat( "Another_Title: %s" ); } void MyFrame::OnHelp_Addbook(wxCommandEvent& event) { - wxGetApp().m_help->AddBook("helpfiles/another.hhp" ); + wxGetApp().m_help->AddBook("helpfiles/another.hhp" ); } void MyFrame::OnHelp_Tempdir(wxCommandEvent& event) { - wxGetApp().m_help->SetTempDir( "tempdir" ); + wxGetApp().m_help->SetTempDir( "tempdir" ); } void MyFrame::OnHelp_Quitserver(wxCommandEvent& event) { - // if (!wxGetApp().m_help->m_connection->Poke( wxT("--YouAreDead"), wxT("") ) ) - // wxLogError(wxT("wxRemoteHtmlHelpController - YouAreDead Failed")); - - wxGetApp().m_help->Quit(); + // if (!wxGetApp().m_help->m_connection->Poke( wxT("--YouAreDead"), wxT("") ) ) + // wxLogError(wxT("wxRemoteHtmlHelpController - YouAreDead Failed")); + + wxGetApp().m_help->Quit(); } void MyFrame::OnExit(wxCommandEvent& event) @@ -247,7 +247,7 @@ void MyFrame::ModalDlg(wxCommandEvent& WXUNUSED(event)) } BEGIN_EVENT_TABLE(MyModalDialog, wxDialog) -EVT_BUTTON(-1, MyModalDialog::OnButton) +EVT_BUTTON(wxID_ANY, MyModalDialog::OnButton) END_EVENT_TABLE() // ---------------------------------------------------------------------------- @@ -255,23 +255,23 @@ END_EVENT_TABLE() // ---------------------------------------------------------------------------- MyModalDialog::MyModalDialog(wxWindow *parent) -: wxDialog(parent, -1, wxString("Modal dialog")) +: wxDialog(parent, wxID_ANY, wxString("Modal dialog")) { wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); - - m_main = new wxButton(this, -1, "Main"); - m_book1 = new wxButton(this, -1, "Book1"); - m_book2 = new wxButton(this, -1, "Book2"); + + m_main = new wxButton(this, wxID_ANY, "Main"); + m_book1 = new wxButton(this, wxID_ANY, "Book1"); + m_book2 = new wxButton(this, wxID_ANY, "Book2"); sizerTop->Add(m_main, 0, wxALIGN_CENTER | wxALL, 5); sizerTop->Add(m_book1, 0, wxALIGN_CENTER | wxALL, 5); sizerTop->Add(m_book2, 0, wxALIGN_CENTER | wxALL, 5); - - SetAutoLayout(TRUE); + + SetAutoLayout(true); SetSizer(sizerTop); - + sizerTop->SetSizeHints(this); sizerTop->Fit(this); - + m_main->SetFocus(); m_main->SetDefault(); } diff --git a/utils/helpview/src/client.h b/utils/helpview/src/client.h index e5b919adb4..05e9b90bfd 100644 --- a/utils/helpview/src/client.h +++ b/utils/helpview/src/client.h @@ -15,11 +15,11 @@ class MyApp: public wxApp public: virtual bool OnInit(); virtual int OnExit(); - + #if defined(USE_REMOTE) - wxRemoteHtmlHelpController *m_help; + wxRemoteHtmlHelpController *m_help; #else - wxHtmlHelpController *m_help; + wxHtmlHelpController *m_help; #endif }; @@ -30,26 +30,25 @@ class MyFrame: public wxFrame { public: MyFrame(wxFrame *frame, const wxString& title); - + private: void OnExit(wxCommandEvent& event); - - void OnHelp_Main(wxCommandEvent& event); - void OnHelp_Book1(wxCommandEvent& event); - void OnHelp_Book2(wxCommandEvent& event); - void OnHelp_Index(wxCommandEvent& event); - void OnHelp_Contents(wxCommandEvent& event); - void OnHelp_Search(wxCommandEvent& event); - void OnHelp_Title(wxCommandEvent& event); - void OnHelp_Addbook(wxCommandEvent& event); - void OnHelp_Tempdir(wxCommandEvent& event); - void OnHelp_Quitserver(wxCommandEvent& event); - - void ModalDlg(wxCommandEvent& event); - + void OnHelp_Main(wxCommandEvent& event); + void OnHelp_Book1(wxCommandEvent& event); + void OnHelp_Book2(wxCommandEvent& event); + void OnHelp_Index(wxCommandEvent& event); + void OnHelp_Contents(wxCommandEvent& event); + void OnHelp_Search(wxCommandEvent& event); + void OnHelp_Title(wxCommandEvent& event); + void OnHelp_Addbook(wxCommandEvent& event); + void OnHelp_Tempdir(wxCommandEvent& event); + void OnHelp_Quitserver(wxCommandEvent& event); + + void ModalDlg(wxCommandEvent& event); + wxPanel *m_panel; - wxButton *m_modalbutton; - + wxButton *m_modalbutton; + DECLARE_EVENT_TABLE() }; @@ -57,14 +56,14 @@ class MyModalDialog : public wxDialog { public: MyModalDialog(wxWindow *parent); - + private: void OnButton(wxCommandEvent& event); - + wxButton *m_main; wxButton *m_book1; wxButton *m_book2; - + DECLARE_EVENT_TABLE() }; diff --git a/utils/helpview/src/remhelp.cpp b/utils/helpview/src/remhelp.cpp index a1d7f23630..ccd6dfa615 100644 --- a/utils/helpview/src/remhelp.cpp +++ b/utils/helpview/src/remhelp.cpp @@ -2,7 +2,7 @@ // Name: remhelp.cpp // Purpose: Remote help controller class // Author: Eric Dowty -// Modified by: +// Modified by: // Created: 2002-11-18 // RCS-ID: $Id$ // Copyright: (c) Julian Smart @@ -57,30 +57,30 @@ rhhcClient::rhhcClient( bool *isconn_a ) wxConnectionBase *rhhcClient::OnMakeConnection() { - return new rhhcConnection( isconn_2 ); + return new rhhcConnection( isconn_2 ); } rhhcConnection::rhhcConnection( bool *isconn_a ) : wxConnection() { - isconn_3 = isconn_a; - *isconn_3 = TRUE; + isconn_3 = isconn_a; + *isconn_3 = true; } rhhcConnection::~rhhcConnection() { - *isconn_3 = FALSE; + *isconn_3 = false; } bool rhhcConnection::OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format) { - return TRUE; + return true; } bool rhhcConnection::OnDisconnect() { - *isconn_3 = FALSE; - + *isconn_3 = false; + return wxConnection::OnDisconnect(); } @@ -93,196 +93,196 @@ IMPLEMENT_CLASS(wxRemoteHtmlHelpController, wxHelpControllerBase) wxRemoteHtmlHelpController::wxRemoteHtmlHelpController(int style ) { - m_style = style; - m_connection = NULL; - m_client = NULL; - m_pid = 0; - isconn_1 = FALSE; - m_process = NULL; - - // defaults - // - // server app is assumed to be local - // + m_style = style; + m_connection = NULL; + m_client = NULL; + m_pid = 0; + isconn_1 = false; + m_process = NULL; + + // defaults + // + // server app is assumed to be local + // // for MSW (DDE classes), a_service is 'service name', apparently an arbitrary string // for Unix, should be a valid file name (for a nonexistent file) // for nonMSW, nonUnix, must be port number, for example "4242" (TCP/IP based classes) // should be unique to the client app - - wxString thename = wxGetApp().GetAppName(); + + wxString thename = wxGetApp().GetAppName(); #if defined(__WXMSW__) - m_appname = wxT("helpview.exe"); - m_service = thename + wxString(wxT("_helpservice")); + m_appname = wxT("helpview.exe"); + m_service = thename + wxString(wxT("_helpservice")); #elif defined(__UNIX__) - m_appname = wxT("./helpview"); - m_service = wxT("/tmp/") + thename + wxString(wxT("_helpservice")); + m_appname = wxT("./helpview"); + m_service = wxT("/tmp/") + thename + wxString(wxT("_helpservice")); #else - m_appname = wxT("./helpview"); - m_service = wxT("4242"); + m_appname = wxT("./helpview"); + m_service = wxT("4242"); #endif - - m_book = thename + wxT(".hhp"); // or .htb or .zip - m_windowname = thename + wxT(" Help: %s"); - //underscores for spaces - m_windowname.Replace( wxT(" "), wxT("_") ); + + m_book = thename + wxT(".hhp"); // or .htb or .zip + m_windowname = thename + wxT(" Help: %s"); + //underscores for spaces + m_windowname.Replace( wxT(" "), wxT("_") ); } void wxRemoteHtmlHelpController::SetService(wxString& a_service) { - m_service = a_service; + m_service = a_service; } void wxRemoteHtmlHelpController::SetServer(wxString& a_appname) { - m_appname = a_appname; + m_appname = a_appname; } void wxRemoteHtmlHelpController::OnQuit() { - //kill the Server here? - //this function is not called ? + //kill the Server here? + //this function is not called ? } wxRemoteHtmlHelpController::~wxRemoteHtmlHelpController() { if ( isconn_1 ) { - //if (!m_connection->Poke( wxT("--YouAreDead"), wxT("") ) ) - // wxLogError(wxT("wxRemoteHtmlHelpController - YouAreDead Failed")); - - // Kill the server. This could be an option. - Quit(); - - m_connection->Disconnect(); + // if (!m_connection->Poke( wxT("--YouAreDead"), wxT("") ) ) + // wxLogError(wxT("wxRemoteHtmlHelpController - YouAreDead Failed")); + + // Kill the server. This could be an option. + Quit(); + + m_connection->Disconnect(); delete m_connection; - + delete m_process; m_process = NULL; } if( m_client ) - delete m_client; //should be automatic? - + delete m_client; //should be automatic? + } bool wxRemoteHtmlHelpController::DoConnection() { wxString cmd, blank; int nsleep; - + blank = wxT(" "); - + // ignored under DDE, host name in TCP/IP based classes wxString hostName = wxT("localhost"); - + // Create a new client if( !m_client ) m_client = new rhhcClient(&isconn_1); - + nsleep = 0; - - // suppress the log messages from MakeConnection() + + // suppress the log messages from MakeConnection() { - wxLogNull nolog; - - //first try to connect assuming server is running - if( !isconn_1 ) - m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") ); - - //if not, start server - if( !isconn_1 ) { - - wxString stylestr; - stylestr.Printf( wxT("--Style%d"), m_style ); - - cmd = m_appname + blank + m_service + blank + m_windowname + blank + m_book + blank + stylestr; - - m_process = new wxProcess(NULL); - m_pid = wxExecute( cmd, FALSE, m_process ); - // leaks - wxExecute itself (if not deleted) and in wxExecute at - // wxExecuteData *data = new wxExecuteData; - if( m_pid <= 0 ) { - wxLogError( wxT("wxRemoteHtmlHelpController - Failed to start Help server") ); - return FALSE; - } + wxLogNull nolog; + + //first try to connect assuming server is running + if( !isconn_1 ) + m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") ); + + //if not, start server + if( !isconn_1 ) { + + wxString stylestr; + stylestr.Printf( wxT("--Style%d"), m_style ); + + cmd = m_appname + blank + m_service + blank + m_windowname + blank + m_book + blank + stylestr; + + m_process = new wxProcess(NULL); + m_pid = wxExecute( cmd, false, m_process ); + // leaks - wxExecute itself (if not deleted) and in wxExecute at + // wxExecuteData *data = new wxExecuteData; + if( m_pid <= 0 ) { + wxLogError( wxT("wxRemoteHtmlHelpController - Failed to start Help server") ); + return false; + } } - + while ( !isconn_1 ) { - //try every second for a while, then leave it to user - wxSleep(1); - if( nsleep > 4 ) { - if ( wxMessageBox( wxT("Failed to make connection to Help server.\nRetry?") , - wxT("wxRemoteHtmlHelpController Error"), - wxICON_ERROR | wxYES_NO | wxCANCEL ) != wxYES ) - { - // no server - return FALSE; - } - } - nsleep++; - - m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") ); + //try every second for a while, then leave it to user + wxSleep(1); + if( nsleep > 4 ) { + if ( wxMessageBox( wxT("Failed to make connection to Help server.\nRetry?") , + wxT("wxRemoteHtmlHelpController Error"), + wxICON_ERROR | wxYES_NO | wxCANCEL ) != wxYES ) + { + // no server + return false; + } + } + nsleep++; + + m_connection = (rhhcConnection *)m_client->MakeConnection(hostName, m_service, wxT("HELP") ); } } - + if (!m_connection->StartAdvise(wxT("Item"))) { - wxLogError(wxT("wxRemoteHtmlHelpController - StartAdvise failed") ); - return FALSE; + wxLogError(wxT("wxRemoteHtmlHelpController - StartAdvise failed") ); + return false; } - - return TRUE; + + return true; } bool wxRemoteHtmlHelpController::LoadFile(const wxString& WXUNUSED(file)) { - return TRUE; + return true; } bool wxRemoteHtmlHelpController::DisplaySection(int sectionNo) { Display(sectionNo); - return TRUE; + return true; } bool wxRemoteHtmlHelpController::DisplayBlock(long blockNo) { - return DisplaySection((int)blockNo); + return DisplaySection((int)blockNo); } bool wxRemoteHtmlHelpController::Quit() { - //this code from exec sample - branches left in for testing - // sig = 3, 6, 9 or 12 all kill server with no apparent problem - // but give error message on MSW - timout? - int sig = 15; //3 = quit; 6 = abort; 9 = kill; 15 = terminate - - /* - switch ( sig ) - { - default: - wxFAIL_MSG( _T("unexpected return value") ); - // fall through - - case -1: - // cancelled - return FALSE; - - case wxSIGNONE: - case wxSIGHUP: - case wxSIGINT: - case wxSIGQUIT: - case wxSIGILL: - case wxSIGTRAP: - case wxSIGABRT: - case wxSIGEMT: - case wxSIGFPE: - case wxSIGKILL: - case wxSIGBUS: - case wxSIGSEGV: - case wxSIGSYS: - case wxSIGPIPE: - case wxSIGALRM: - case wxSIGTERM: - break; - } - */ - + //this code from exec sample - branches left in for testing + // sig = 3, 6, 9 or 12 all kill server with no apparent problem + // but give error message on MSW - timout? + int sig = 15; //3 = quit; 6 = abort; 9 = kill; 15 = terminate + +/* + switch ( sig ) + { + default: + wxFAIL_MSG( _T("unexpected return value") ); + // fall through + + case -1: + // cancelled + return false; + + case wxSIGNONE: + case wxSIGHUP: + case wxSIGINT: + case wxSIGQUIT: + case wxSIGILL: + case wxSIGTRAP: + case wxSIGABRT: + case wxSIGEMT: + case wxSIGFPE: + case wxSIGKILL: + case wxSIGBUS: + case wxSIGSEGV: + case wxSIGSYS: + case wxSIGPIPE: + case wxSIGALRM: + case wxSIGTERM: + break; + } +*/ + if ( sig == 0 ) { if ( wxProcess::Exists(m_pid) ) @@ -302,22 +302,22 @@ bool wxRemoteHtmlHelpController::Quit() static const wxChar *errorText[] = { _T(""), // no error - _T("signal not supported"), - _T("permission denied"), - _T("no such process"), - _T("unspecified error"), + _T("signal not supported"), + _T("permission denied"), + _T("no such process"), + _T("unspecified error"), }; - - // sig = 3, 6, 9 or 12 all kill server with no apparent problem - // but give error message on MSW - timout? - // + + // sig = 3, 6, 9 or 12 all kill server with no apparent problem + // but give error message on MSW - timout? + // //wxLogError(_T("Failed to kill process %ld with signal %d: %s"), // m_pid, sig, errorText[rc]); } } - - - return TRUE; + + + return true; } void wxRemoteHtmlHelpController::Display(const wxString& helpfile) @@ -327,8 +327,8 @@ void wxRemoteHtmlHelpController::Display(const wxString& helpfile) } if (!m_connection->Execute( helpfile, -1 ) ) - wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed")); - + wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed")); + } void wxRemoteHtmlHelpController::Display(const int id) @@ -336,74 +336,74 @@ void wxRemoteHtmlHelpController::Display(const int id) if( !isconn_1 ) { if( !DoConnection() ) return; } - - wxString intstring; - intstring.Printf( "--intstring%d", id ); + + wxString intstring; + intstring.Printf( "--intstring%d", id ); if (!m_connection->Execute( intstring, -1 ) ) - wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed")); - + wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed")); + } bool wxRemoteHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg) { - //ignore show_wait_msg - there shouldn't be a delay in this step - //show_wait_msg = TRUE could be transmitted with ++AddBook - m_book = book; - - if( isconn_1 ) { - if (!m_connection->Poke( wxT("--AddBook"), (char*)book.c_str() ) ) - wxLogError(wxT("wxRemoteHtmlHelpController - AddBook Failed")); - return FALSE; - } - - return TRUE; + //ignore show_wait_msg - there shouldn't be a delay in this step + //show_wait_msg = true could be transmitted with ++AddBook + m_book = book; + + if( isconn_1 ) { + if (!m_connection->Poke( wxT("--AddBook"), (char*)book.c_str() ) ) + wxLogError(wxT("wxRemoteHtmlHelpController - AddBook Failed")); + return false; + } + + return true; } bool wxRemoteHtmlHelpController::DisplayContents() { - if( isconn_1 ) { - if (!m_connection->Poke( wxT("--DisplayContents"), wxT("") ) ) { - wxLogError(wxT("wxRemoteHtmlHelpController - DisplayContents Failed")); - return FALSE; - } - } - return TRUE; + if( isconn_1 ) { + if (!m_connection->Poke( wxT("--DisplayContents"), wxT("") ) ) { + wxLogError(wxT("wxRemoteHtmlHelpController - DisplayContents Failed")); + return false; + } + } + return true; } void wxRemoteHtmlHelpController::DisplayIndex() { - if( isconn_1 ) { - if (!m_connection->Poke( wxT("--DisplayIndex"), wxT("") ) ) - wxLogError(wxT("wxRemoteHtmlHelpController - DisplayIndex Failed")); - } + if( isconn_1 ) { + if (!m_connection->Poke( wxT("--DisplayIndex"), wxT("") ) ) + wxLogError(wxT("wxRemoteHtmlHelpController - DisplayIndex Failed")); + } } bool wxRemoteHtmlHelpController::KeywordSearch(const wxString& keyword) { - if( isconn_1 ) { - if (!m_connection->Poke( wxT("--KeywordSearch"), (char*)keyword.c_str() ) ) { - wxLogError(wxT("wxRemoteHtmlHelpController - KeywordSearch Failed")); - return FALSE; - } - } - return TRUE; + if( isconn_1 ) { + if (!m_connection->Poke( wxT("--KeywordSearch"), (char*)keyword.c_str() ) ) { + wxLogError(wxT("wxRemoteHtmlHelpController - KeywordSearch Failed")); + return false; + } + } + return true; } void wxRemoteHtmlHelpController::SetTitleFormat(const wxString& format) { - m_windowname = format; - m_windowname.Replace( wxT(" "), wxT("_") ); - - if( isconn_1 ) { - if (!m_connection->Poke( wxT("--SetTitleFormat"), (char*)format.c_str() ) ) - wxLogError(wxT("wxRemoteHtmlHelpController - SetTitleFormat Failed")); - } + m_windowname = format; + m_windowname.Replace( wxT(" "), wxT("_") ); + + if( isconn_1 ) { + if (!m_connection->Poke( wxT("--SetTitleFormat"), (char*)format.c_str() ) ) + wxLogError(wxT("wxRemoteHtmlHelpController - SetTitleFormat Failed")); + } } void wxRemoteHtmlHelpController::SetTempDir(const wxString& path) { - if( isconn_1 ) { - if (!m_connection->Poke( wxT("--SetTempDir"), (char*)path.c_str() ) ) - wxLogError(wxT("wxRemoteHtmlHelpController - SetTempDir Failed")); - } + if( isconn_1 ) { + if (!m_connection->Poke( wxT("--SetTempDir"), (char*)path.c_str() ) ) + wxLogError(wxT("wxRemoteHtmlHelpController - SetTempDir Failed")); + } } diff --git a/utils/helpview/src/remhelp.h b/utils/helpview/src/remhelp.h index b5cdd853fa..6858b468dd 100644 --- a/utils/helpview/src/remhelp.h +++ b/utils/helpview/src/remhelp.h @@ -2,7 +2,7 @@ // Name: remhelp.h // Purpose: Remote help controller class // Author: Eric Dowty -// Modified by: +// Modified by: // Created: 2002-11-18 // RCS-ID: $Id$ // Copyright: (c) Julian Smart @@ -30,68 +30,68 @@ public: bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format); bool OnDisconnect(); - bool *isconn_3; + bool *isconn_3; }; class rhhcClient: public wxClient { public: - rhhcClient(bool *isconn_a); - //~rhhcClient( ); + rhhcClient(bool *isconn_a); + //~rhhcClient( ); wxConnectionBase *OnMakeConnection(); - bool *isconn_2; + bool *isconn_2; }; class wxRemoteHtmlHelpController : public wxHelpControllerBase { - DECLARE_CLASS(wxRemoteHtmlHelpController) + DECLARE_CLASS(wxRemoteHtmlHelpController) public: - wxRemoteHtmlHelpController(int style = wxHF_DEFAULT_STYLE); - ~wxRemoteHtmlHelpController(); - void OnQuit(void); - - void SetService(wxString& a_service); - void SetServer(wxString& a_appname); //could be wxHelpController::SetViewer - - //standard wxHtmlHelpController functions - bool AddBook(const wxString& book, bool show_wait_msg = FALSE); - void Display(const wxString& x); - void Display(const int id); - bool DisplayContents(); - void DisplayIndex(); - bool KeywordSearch(const wxString& keyword); - void SetTempDir(const wxString& path); - void SetTitleFormat(const wxString& format); - - //dummies - config is in server - void UseConfig(wxConfigBase* config, const wxString& rootpath = wxEmptyString) {}; - void ReadCustomization(wxConfigBase* cfg, wxString path = wxEmptyString) {}; - void WriteCustomization(wxConfigBase* cfg, wxString path = wxEmptyString) {}; - - //virtuals from wxHelpControllerBase - not in wxHtmlHelpController - //won't compile without these - bool LoadFile(const class wxString &); //dummy - bool DisplaySection(int); - bool DisplayBlock(long); - bool Quit(void); + wxRemoteHtmlHelpController(int style = wxHF_DEFAULT_STYLE); + ~wxRemoteHtmlHelpController(); + void OnQuit(void); + + void SetService(wxString& a_service); + void SetServer(wxString& a_appname); //could be wxHelpController::SetViewer + + //standard wxHtmlHelpController functions + bool AddBook(const wxString& book, bool show_wait_msg = false); + void Display(const wxString& x); + void Display(const int id); + bool DisplayContents(); + void DisplayIndex(); + bool KeywordSearch(const wxString& keyword); + void SetTempDir(const wxString& path); + void SetTitleFormat(const wxString& format); + + //dummies - config is in server + void UseConfig(wxConfigBase* config, const wxString& rootpath = wxEmptyString) {}; + void ReadCustomization(wxConfigBase* cfg, wxString path = wxEmptyString) {}; + void WriteCustomization(wxConfigBase* cfg, wxString path = wxEmptyString) {}; + + //virtuals from wxHelpControllerBase - not in wxHtmlHelpController + //won't compile without these + bool LoadFile(const class wxString &); //dummy + bool DisplaySection(int); + bool DisplayBlock(long); + bool Quit(void); private: - void OnExit(wxCommandEvent& event); - bool DoConnection(); - - rhhcConnection *m_connection; - rhhcClient *m_client; - wxProcess *m_process; - - int m_pid; - int m_style; - wxString m_appname; - wxString m_service; - wxString m_windowname; - wxString m_book; - bool isconn_1; + void OnExit(wxCommandEvent& event); + bool DoConnection(); + + rhhcConnection *m_connection; + rhhcClient *m_client; + wxProcess *m_process; + + int m_pid; + int m_style; + wxString m_appname; + wxString m_service; + wxString m_windowname; + wxString m_book; + bool isconn_1; }; #endif - // _WX_REMHELP_H_ + // _WX_REMHELP_H_ diff --git a/utils/hhp2cached/hhp2cached.cpp b/utils/hhp2cached/hhp2cached.cpp index 655f4f8dbb..2321d28cb8 100644 --- a/utils/hhp2cached/hhp2cached.cpp +++ b/utils/hhp2cached/hhp2cached.cpp @@ -38,5 +38,5 @@ bool MyApp::OnInit() data.AddBook(argv[i]); } - return FALSE; + return false; } diff --git a/utils/tex2rtf/src/bmputils.h b/utils/tex2rtf/src/bmputils.h index 11d30eacaa..e05358c0be 100644 --- a/utils/tex2rtf/src/bmputils.h +++ b/utils/tex2rtf/src/bmputils.h @@ -36,8 +36,8 @@ static unsigned long getint(FILE *fp) c = getc(fp); c1 = getc(fp); c2 = getc(fp); c3 = getc(fp); return (long)((long) c) + (((long) c1) << 8) + - (((long) c2) << 16) + - (((long) c3) << 24); + (((long) c2) << 16) + + (((long) c3) << 24); } bool GetBMPHeader(FILE *fp, int *Width, int *Height, int *Planes, int *BitsPerPixel) @@ -149,12 +149,12 @@ bool OutputBitmapData(FILE *fd) #ifdef __WXMSW__ struct mfPLACEABLEHEADER { - DWORD key; - HANDLE hmf; - RECT bbox; - WORD inch; - DWORD reserved; - WORD checksum; + DWORD key; + HANDLE hmf; + RECT bbox; + WORD inch; + DWORD reserved; + WORD checksum; }; // Returns size in TWIPS diff --git a/utils/tex2rtf/src/htmlutil.cpp b/utils/tex2rtf/src/htmlutil.cpp index 1e8def80c6..c3233630b7 100644 --- a/utils/tex2rtf/src/htmlutil.cpp +++ b/utils/tex2rtf/src/htmlutil.cpp @@ -910,7 +910,7 @@ void HTMLOnMacro(int macroId, int no_args, bool start) if (htmlWorkshopFiles) HTMLWorkshopAddToContents(2, topicName, SubsectionsName); SetCurrentOutput(Subsections); - HTMLHead(); + HTMLHead(); TexOutput(_T("")); OutputCurrentSection(); TexOutput(_T("\n")); @@ -991,7 +991,7 @@ void HTMLOnMacro(int macroId, int no_args, bool start) if (htmlWorkshopFiles) HTMLWorkshopAddToContents(3, topicName, SubsubsectionsName); SetCurrentOutput(Subsubsections); - HTMLHead(); + HTMLHead(); TexOutput(_T("")); OutputCurrentSection(); TexOutput(_T("\n")); @@ -1133,7 +1133,7 @@ void HTMLOnMacro(int macroId, int no_args, bool start) else wxSnprintf(buf, sizeof(buf), _T("\n")); TexOutput(buf); - OutputFont(); + OutputFont(); } else TexOutput(_T("&")); @@ -1182,7 +1182,7 @@ void HTMLOnMacro(int macroId, int no_args, bool start) else wxSnprintf(buf, sizeof(buf), _T("\n")); TexOutput(buf); - OutputFont(); + OutputFont(); } else { @@ -1971,15 +1971,15 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start) // If a filename is supplied, use it, otherwise try to // use the filename associated with the reference (from this document). if (helpRefFilename) - { + { TraverseChildrenFromChunk(helpRefFilename); TexOutput(_T("#")); - } + } else if (refFilename) - { + { TexOutput(ConvertCase(refFilename)); TexOutput(_T("#")); - } + } TexOutput(refName); TexOutput(_T("\">")); if (helpRefText) @@ -2059,7 +2059,7 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start) // If we have found the existing filename, make the inline // image point to the original file (could be PS, for example) if (originalFilename && (wxStrcmp(inlineFilename, originalFilename) != 0)) - { + { TexOutput(_T("")); @@ -2068,17 +2068,17 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start) TexOutput(_T("\"")); TexOutput(alignment); TexOutput(_T(">")); - } + } else #endif - { + { TexOutput(_T("")); delete[] inlineFilename; - } + } } else { @@ -2195,27 +2195,36 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start) { if ( start ) { // DHS - if (TwoColWidthA > -1) { + if (TwoColWidthA > -1) + { wxChar buf[100]; wxSnprintf(buf, sizeof(buf), _T("\n\n"),TwoColWidthA); TexOutput(buf); - } else + } + else + { TexOutput(_T("\n\n")); - OutputFont(); + } + OutputFont(); } else TexOutput(_T("\n\n")); } if (arg_no == 2) { // DHS - if ( start ) { - if (TwoColWidthB > -1) { + if ( start ) + { + if (TwoColWidthB > -1) + { wxChar buf[100]; wxSnprintf(buf, sizeof(buf), _T("\n\n"),TwoColWidthB); TexOutput(buf); - } else - TexOutput(_T("\n\n")); - OutputFont(); + } + else + { + TexOutput(_T("\n\n")); + } + OutputFont(); } else TexOutput(_T("\n\n")); } @@ -2701,7 +2710,7 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start) if (compatibilityMode) { TexOutput(_T("\n")); - OutputFont(); + OutputFont(); /* for (int i = 0; i < noColumns; i++) { @@ -2797,7 +2806,7 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start) { wxStrcpy(buf2, _T("#000000")); wxChar buf[100]; - wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name); + wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name); OnError(buf); } TexOutput(_T("")); TraverseChildrenFromChunk(DocumentTitle); TexOutput(_T("\n")); @@ -3022,7 +3031,7 @@ bool HTMLGo(void) else { SetCurrentOutput(tmpTitle); - HTMLHeadTo(tmpTitle); + HTMLHeadTo(tmpTitle); if (contentsString) wxFprintf(tmpTitle, _T("%s\n\n"), contentsString); else @@ -3239,7 +3248,7 @@ void GenerateHTMLWorkshopFiles(wxChar *fname) _T(" \n") _T(" \n") _T(" \n"), - texTopic->filename, topicName, s); + texTopic->filename, topicName, s); node1 = node1->GetNext(); } } @@ -3271,10 +3280,10 @@ void HTMLWorkshopAddToContents(int level, wxChar *s, wxChar *file) _T("

  • \n") _T(" \n") _T(" \n") + _T("\">\n") _T(" \n")); HTMLWorkshopLastLevel = level; } diff --git a/utils/tex2rtf/src/rtfutils.cpp b/utils/tex2rtf/src/rtfutils.cpp index 20bd6e35f0..37b8fad4ec 100644 --- a/utils/tex2rtf/src/rtfutils.cpp +++ b/utils/tex2rtf/src/rtfutils.cpp @@ -242,22 +242,22 @@ void WriteWinHelpContentsFileLine(wxChar *topicName, wxChar *xitle, int level) int d=0; while ( (xitle[s]!=0)&&(d<255) ) { - wxChar ch=xitle[s]&0xff; - if (ch==0x5c) { - wxChar ch1=xitle[s+1]&0xff; - wxChar ch2=xitle[s+2]&0xff; - wxChar ch3=xitle[s+3]&0xff; - s+=4; // next character - if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]='ö'; } - if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]='ä'; } - if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]='ü'; } - if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]='Ö'; } - if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]='Ä'; } - if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]='Ü'; } - } else { - title[d++]=ch; - s++; - } + wxChar ch=xitle[s]&0xff; + if (ch==0x5c) { + wxChar ch1=xitle[s+1]&0xff; + wxChar ch2=xitle[s+2]&0xff; + wxChar ch3=xitle[s+3]&0xff; + s+=4; // next character + if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]='ö'; } + if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]='ä'; } + if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]='ü'; } + if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]='Ö'; } + if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]='Ä'; } + if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]='Ü'; } + } else { + title[d++]=ch; + s++; + } } title[d]=0; @@ -1637,7 +1637,7 @@ void RTFOnMacro(int macroId, int no_args, bool start) } else SetCurrentOutput(NULL); // Don't write it into the contents, or anywhere else - } + } else SetCurrentOutput(NULL); // Don't write it into the contents, or anywhere else } @@ -2187,9 +2187,9 @@ void RTFOnMacro(int macroId, int no_args, bool start) TraverseChildrenFromChunk(descriptionItemArg); TexOutput(_T("}\\tab")); descriptionItemArg = NULL; - } - else - { + } + else + { wxSnprintf(indentBuf, sizeof(indentBuf), _T("\\tab{\\b %d.}\\tab"), struc->currentItem); TexOutput(indentBuf); } @@ -2203,9 +2203,9 @@ void RTFOnMacro(int macroId, int no_args, bool start) TraverseChildrenFromChunk(descriptionItemArg); TexOutput(_T("}\\tab")); descriptionItemArg = NULL; - } - else - { + } + else + { if (bulletFile && winHelp) { if (winHelpVersion > 3) // Transparent bitmap @@ -2233,7 +2233,7 @@ void RTFOnMacro(int macroId, int no_args, bool start) } break; } - } + } } } break; @@ -2581,8 +2581,8 @@ void RTFOnMacro(int macroId, int no_args, bool start) { if (start) { - if ( issuedNewParagraph == 0 ) - { + if ( issuedNewParagraph == 0 ) + { TexOutput(_T("\\par\\pard")); issuedNewParagraph ++; @@ -2591,29 +2591,29 @@ void RTFOnMacro(int macroId, int no_args, bool start) // we have a suitable set of styles. #if 0 if (winHelp && !inTabular && (ParSkip > 0)) - { + { TexOutput(_T("\\par")); issuedNewParagraph ++; - } + } #endif WriteEnvironmentStyles(); - } - // 1 is a whole paragraph if ParSkip == 0, - // half a paragraph if ParSkip > 0 - else if ( issuedNewParagraph == 1 ) - { - // Don't need a par at all if we've already had one, - // and ParSkip == 0. + } + // 1 is a whole paragraph if ParSkip == 0, + // half a paragraph if ParSkip > 0 + else if ( issuedNewParagraph == 1 ) + { + // Don't need a par at all if we've already had one, + // and ParSkip == 0. #if 0 // Extra par if parskip is more than zero (usually looks best.) if (winHelp && !inTabular && (ParSkip > 0)) - { + { TexOutput(_T("\\par")); issuedNewParagraph ++; - } + } #endif WriteEnvironmentStyles(); - } + } /* if (!issuedNewParagraph || (issuedNewParagraph > 1)) { @@ -4221,11 +4221,11 @@ bool RTFOnArgument(int macroId, int arg_no, bool start) wxFprintf(Popups, _T("+{\\footnote %s}\n"), GetBrowseString()); savedOutput = CurrentOutput1; SetCurrentOutput(Popups); - } - else - { + } + else + { SetCurrentOutput(savedOutput); - } + } return true; } return true; @@ -4254,7 +4254,7 @@ bool RTFOnArgument(int macroId, int arg_no, bool start) if (start) { TexOutput(_T("{\\ul ")); - } + } else { TexOutput(_T("}")); @@ -5015,11 +5015,11 @@ bool RTFOnArgument(int macroId, int arg_no, bool start) wxSnprintf(buf, sizeof(buf), _T("{%s%d "), ((macroId == ltFCOL) ? _T("\\cf") : _T("\\cb")), pos); TexOutput(buf); } - else - { - wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name); + else + { + wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name); OnError(buf); - } + } break; } case 2: diff --git a/utils/tex2rtf/src/table.h b/utils/tex2rtf/src/table.h index 4597318e3a..5a7e5baaf2 100644 --- a/utils/tex2rtf/src/table.h +++ b/utils/tex2rtf/src/table.h @@ -21,7 +21,7 @@ struct ColumnData int spacing; // Space between columns in twips bool leftBorder; bool rightBorder; - bool absWidth; // If FALSE (the default), don't use an absolute width if you can help it. + bool absWidth; // If false (the default), don't use an absolute width if you can help it. }; extern ColumnData TableData[]; diff --git a/utils/tex2rtf/src/tex2any.cpp b/utils/tex2rtf/src/tex2any.cpp index 33db0d44bf..dbc5360ba3 100644 --- a/utils/tex2rtf/src/tex2any.cpp +++ b/utils/tex2rtf/src/tex2any.cpp @@ -109,7 +109,7 @@ int subsectionFont = 12; // largeFont1; int titleFont = LARGEFont3; int authorFont = LargeFont2; int mirrorMargins = true; -bool winHelp = false; // Output in Windows Help format if TRUE, linear otherwise +bool winHelp = false; // Output in Windows Help format if true, linear otherwise bool isInteractive = false; bool runTwice = false; int convertMode = TEX_RTF; @@ -117,7 +117,7 @@ bool checkCurleyBraces = false; bool checkSyntax = false; bool headerRule = false; bool footerRule = false; -bool compatibilityMode = false; // If TRUE, maximum Latex compatibility +bool compatibilityMode = false; // If true, maximum Latex compatibility // (Quality of RTF generation deteriorate) bool generateHPJ; // Generate WinHelp Help Project file wxChar *winHelpTitle = NULL; // Windows Help title @@ -151,7 +151,7 @@ wxChar *followedLinkColourString = NULL; bool combineSubSections = false; bool htmlWorkshopFiles = false; bool ignoreBadRefs = false; -wxChar *htmlFaceName = NULL; +wxChar *htmlFaceName = NULL; extern int passNumber; @@ -204,12 +204,12 @@ int CurrentInputIndex = 0; wxChar *TexFileRoot = NULL; wxChar *TexBibName = NULL; // Bibliography output file name wxChar *TexTmpBibName = NULL; // Temporary bibliography output file name -bool isSync = false; // If TRUE, should not yield to other processes. -bool stopRunning = false; // If TRUE, should abort. +bool isSync = false; // If true, should not yield to other processes. +bool stopRunning = false; // If true, should abort. static int currentColumn = 0; wxChar *currentArgData = NULL; -bool haveArgData = false; // If TRUE, we're simulating the data. +bool haveArgData = false; // If true, we're simulating the data. TexChunk *currentArgument = NULL; TexChunk *nextChunk = NULL; bool isArgOptional = false; @@ -227,7 +227,7 @@ TexMacroDef *VerbatimMacroDef = NULL; TexRef::TexRef(const wxChar *label, const wxChar *file, - const wxChar *section, const wxChar *sectionN) + const wxChar *section, const wxChar *sectionN) { refLabel = copystring(label); refFile = file ? copystring(file) : (wxChar*) NULL; @@ -967,7 +967,7 @@ void MacroError(wxChar *buffer) * Parse an argument. * 'environment' specifies the name of the macro IFF if we're looking for the end * of an environment, e.g. \end{itemize}. Otherwise it's NULL. - * 'parseToBrace' is TRUE if the argument should extend to the next right brace, + * 'parseToBrace' is true if the argument should extend to the next right brace, * e.g. in {\bf an argument} as opposed to \vskip 30pt * */ diff --git a/utils/tex2rtf/src/tex2any.h b/utils/tex2rtf/src/tex2any.h index 97c6d0d123..107bbd0c1d 100644 --- a/utils/tex2rtf/src/tex2any.h +++ b/utils/tex2rtf/src/tex2any.h @@ -217,7 +217,7 @@ extern int sectionFont; extern int subsectionFont; extern int titleFont; extern int authorFont; -extern bool winHelp; // Output in Windows Help format if TRUE, linear otherwise +extern bool winHelp; // Output in Windows Help format if true, linear otherwise extern bool isInteractive; extern bool runTwice; extern int convertMode; @@ -332,7 +332,7 @@ extern void FakeCurrentSection(wxChar *fakeSection, bool addToContents = true); */ extern wxChar *currentArgData; -extern bool haveArgData; // If TRUE, we're simulating the data. +extern bool haveArgData; // If true, we're simulating the data. void StartSimulateArgument(wxChar *data); void EndSimulateArgument(void); @@ -345,7 +345,7 @@ void EndSimulateArgument(void); void OnMacro(int macroId, int no_args, bool start); // Called on start/end of argument examination. -// Return TRUE at the start of an argument to traverse +// Return true at the start of an argument to traverse // (output) the argument. bool OnArgument(int macroId, int arg_no, bool start); diff --git a/utils/tex2rtf/src/tex2rtf.cpp b/utils/tex2rtf/src/tex2rtf.cpp index 45b76ffc48..e3b7b8ce4f 100644 --- a/utils/tex2rtf/src/tex2rtf.cpp +++ b/utils/tex2rtf/src/tex2rtf.cpp @@ -1086,9 +1086,9 @@ void OnInform(const wxChar *msg) (*frame->textWindow) << msg << _T("\n"); /* This whole block of code is just wrong I think. It would behave completely wrong under anything other than MSW due to the ELSE - with no statement, and the cout calls would fail under MSW, as - the code in this block is compiled if !NO_GUI This code has been - here since v1.1 of this file too. - gt + with no statement, and the cout calls would fail under MSW, as + the code in this block is compiled if !NO_GUI This code has been + here since v1.1 of this file too. - gt else #ifdef __WXMSW__ { diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index 70f3eec1c7..0f2c6385b5 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -449,7 +449,7 @@ void ReadTexReferences(wxChar *filename) if (!istr.eof()) { istr >> file; - istr >> sectionName; + istr >> sectionName; char ch; istr.get(ch); // Read past space istr.get(ch); @@ -1627,15 +1627,15 @@ void Tex2RTFYield(bool force) static int yieldCount = 0; if (isSync) - return; + return; if (force) - yieldCount = 0; + yieldCount = 0; if (yieldCount == 0) { - if (wxTheApp) - wxYield(); - yieldCount = 10; + if (wxTheApp) + wxYield(); + yieldCount = 10; } yieldCount --; #endif @@ -1713,7 +1713,7 @@ wxChar *ConvertCase(wxChar *s) } #if !WXWIN_COMPATIBILITY_2 -// if substring is TRUE, search for str1 in str2 +// if substring is true, search for str1 in str2 bool StringMatch(const wxChar *str1, const wxChar *str2, bool subString, bool exact) { diff --git a/utils/tex2rtf/src/wxhlpblk.h b/utils/tex2rtf/src/wxhlpblk.h index 6cfeb75e41..85d1739c3a 100644 --- a/utils/tex2rtf/src/wxhlpblk.h +++ b/utils/tex2rtf/src/wxhlpblk.h @@ -1,10 +1,10 @@ /* - * File: wxhlpblk.h - * Purpose: Text blocks used in wxHelp - * Author: Julian Smart - * Created: 1993 - * Updated: - * Copyright: (c) 1993, AIAI, University of Edinburgh + * File: wxhlpblk.h + * Purpose: Text blocks used in wxHelp + * Author: Julian Smart + * Created: 1993 + * Updated: + * Copyright: (c) 1993, AIAI, University of Edinburgh */ /* sccsid[] = "%W% %G%" */ diff --git a/utils/tex2rtf/src/xlputils.cpp b/utils/tex2rtf/src/xlputils.cpp index 375e0a86c6..b687adbf45 100644 --- a/utils/tex2rtf/src/xlputils.cpp +++ b/utils/tex2rtf/src/xlputils.cpp @@ -399,7 +399,7 @@ void XLPOnMacro(int macroId, int no_args, bool start) } break; } - } + } } } break;