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("
- 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("") << wxSimpleHtmlParser::EncodeSpecialChars(m_name) << 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); + wxRemoteHtmlHelpController(int style = wxHF_DEFAULT_STYLE); + ~wxRemoteHtmlHelpController(); + void OnQuit(void); - void SetService(wxString& a_service); - void SetServer(wxString& a_appname); //could be wxHelpController::SetViewer + 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); + //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) {}; + //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); + //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(); + void OnExit(wxCommandEvent& event); + bool DoConnection(); - rhhcConnection *m_connection; - rhhcClient *m_client; - wxProcess *m_process; + 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; + 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("