-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
This commit is contained in:
Włodzimierz Skiba
2004-06-04 17:58:56 +00:00
parent 72213209b7
commit 4fe30bceff
43 changed files with 805 additions and 798 deletions

View File

@@ -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))

View File

@@ -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; }

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -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(_("<B>Name</B><P> 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("<B>Default-state</B><P> 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("<B>Default-value</B><P> 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))

View File

@@ -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; }

View File

@@ -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());

View File

@@ -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();

View File

@@ -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("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
stream << wxT("<settings xmlns=\"http://www.wxwidgets.org/wxs\" version=\"2.5.0.1\">");
@@ -272,7 +272,7 @@ bool ctConfigToolDoc::DoSave(const wxString& filename)
stream << wxT("\n</settings>\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("</setting>");
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)

View File

@@ -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();

View File

@@ -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))
@@ -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,

View File

@@ -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,

View File

@@ -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()

View File

@@ -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;
}
/*!

View File

@@ -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();

View File

@@ -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("</"), TRUE);
Matches(wxT("</"), true);
EatWhitespace();
wxString word;
ReadWord(word, TRUE);
ReadWord(word, true);
EatWhitespace();
m_pos ++;
@@ -264,19 +264,19 @@ bool wxSimpleHtmlParser::ParseAttributes(wxSimpleHtmlTag* tag)
if (IsString())
{
ReadString(attrName, TRUE);
ReadString(attrName, true);
tag->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. <!DOCTYPE ....>
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseDirective()
{
Matches(wxT("<!"), TRUE);
Matches(wxT("<!"), true);
EatWhitespace();
wxString word;
ReadWord(word, TRUE);
ReadWord(word, true);
EatWhitespace();
@@ -323,12 +323,12 @@ wxSimpleHtmlTag* wxSimpleHtmlParser::ParseDirective()
// e.g. <?xml .... ?>
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseXMLDeclaration()
{
Matches(wxT("<?"), TRUE);
Matches(wxT("<?"), true);
EatWhitespace();
wxString word;
ReadWord(word, TRUE);
ReadWord(word, true);
EatWhitespace();
@@ -347,28 +347,28 @@ wxSimpleHtmlTag* wxSimpleHtmlParser::ParseXMLDeclaration()
bool wxSimpleHtmlParser::ParseComment()
{
// Eat the comment tag start
Matches(wxT("<!--"), TRUE);
Matches(wxT("<!--"), true);
while (!Eof() && !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 <P>
return FALSE;
if (name.IsSameAs(wxT("P"), false)) // e.g <P>
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("&gt;"), wxT(">"), TRUE);
value.Replace(wxT("&lt;"), wxT("<"), TRUE);
value.Replace(wxT("&quot;"), wxT("\""), TRUE);
value.Replace(wxT("&apos;"), wxT("'"), TRUE);
value.Replace(wxT("&amp;"), wxT("&"), TRUE); // Note: do this as last to prevent replace problems.
value.Replace(wxT("&gt;"), wxT(">"), true);
value.Replace(wxT("&lt;"), wxT("<"), true);
value.Replace(wxT("&quot;"), wxT("\""), true);
value.Replace(wxT("&apos;"), wxT("'"), true);
value.Replace(wxT("&amp;"), 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("&amp;"), TRUE); // Note: do this as first to prevent replace problems.
newvalue.Replace(wxT(">"), wxT("&gt;"), TRUE);
newvalue.Replace(wxT("<"), wxT("&lt;"), TRUE);
newvalue.Replace(wxT("\""),wxT("&quot;"), TRUE);
newvalue.Replace(wxT("'"), wxT("&apos;"), TRUE);
newvalue.Replace(wxT("&"), wxT("&amp;"), true); // Note: do this as first to prevent replace problems.
newvalue.Replace(wxT(">"), wxT("&gt;"), true);
newvalue.Replace(wxT("<"), wxT("&lt;"), true);
newvalue.Replace(wxT("\""),wxT("&quot;"), true);
newvalue.Replace(wxT("'"), wxT("&apos;"), 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:

View File

@@ -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); }

View File

@@ -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 );
}

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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)

View File

@@ -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); }

View File

@@ -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())

View File

@@ -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();

View File

@@ -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)
@@ -208,7 +208,7 @@ void apViewHTMLFile(const wxString& url)
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);
}

View File

@@ -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; }

View File

@@ -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)

View File

@@ -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.

View File

@@ -133,9 +133,9 @@ bool MyApp::OnInit()
// Create the main frame window
MyFrame* frame = new MyFrame(NULL, "Help Client");
frame->Show(TRUE);
frame->Show(true);
return TRUE;
return true;
}
int MyApp::OnExit()
@@ -147,7 +147,7 @@ int MyApp::OnExit()
// 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;
@@ -183,7 +183,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title)
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)
@@ -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,18 +255,18 @@ 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);

View File

@@ -33,7 +33,6 @@ public:
private:
void OnExit(wxCommandEvent& event);
void OnHelp_Main(wxCommandEvent& event);
void OnHelp_Book1(wxCommandEvent& event);
void OnHelp_Book2(wxCommandEvent& event);

View File

@@ -64,22 +64,22 @@ rhhcConnection::rhhcConnection( bool *isconn_a )
: wxConnection()
{
isconn_3 = isconn_a;
*isconn_3 = TRUE;
*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();
}
@@ -97,7 +97,7 @@ wxRemoteHtmlHelpController::wxRemoteHtmlHelpController(int style )
m_connection = NULL;
m_client = NULL;
m_pid = 0;
isconn_1 = FALSE;
isconn_1 = false;
m_process = NULL;
// defaults
@@ -146,7 +146,7 @@ wxRemoteHtmlHelpController::~wxRemoteHtmlHelpController()
{
if ( isconn_1 )
{
//if (!m_connection->Poke( wxT("--YouAreDead"), wxT("") ) )
// if (!m_connection->Poke( wxT("--YouAreDead"), wxT("") ) )
// wxLogError(wxT("wxRemoteHtmlHelpController - YouAreDead Failed"));
// Kill the server. This could be an option.
@@ -195,12 +195,12 @@ bool wxRemoteHtmlHelpController::DoConnection()
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 );
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;
return false;
}
}
@@ -214,7 +214,7 @@ bool wxRemoteHtmlHelpController::DoConnection()
wxICON_ERROR | wxYES_NO | wxCANCEL ) != wxYES )
{
// no server
return FALSE;
return false;
}
}
nsleep++;
@@ -225,20 +225,20 @@ bool wxRemoteHtmlHelpController::DoConnection()
if (!m_connection->StartAdvise(wxT("Item"))) {
wxLogError(wxT("wxRemoteHtmlHelpController - StartAdvise failed") );
return FALSE;
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)
{
@@ -252,7 +252,7 @@ bool wxRemoteHtmlHelpController::Quit()
// but give error message on MSW - timout?
int sig = 15; //3 = quit; 6 = abort; 9 = kill; 15 = terminate
/*
/*
switch ( sig )
{
default:
@@ -261,7 +261,7 @@ bool wxRemoteHtmlHelpController::Quit()
case -1:
// cancelled
return FALSE;
return false;
case wxSIGNONE:
case wxSIGHUP:
@@ -281,7 +281,7 @@ bool wxRemoteHtmlHelpController::Quit()
case wxSIGTERM:
break;
}
*/
*/
if ( sig == 0 )
{
@@ -317,7 +317,7 @@ bool wxRemoteHtmlHelpController::Quit()
}
return TRUE;
return true;
}
void wxRemoteHtmlHelpController::Display(const wxString& helpfile)
@@ -348,16 +348,16 @@ void wxRemoteHtmlHelpController::Display(const int id)
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
//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 false;
}
return TRUE;
return true;
}
bool wxRemoteHtmlHelpController::DisplayContents()
@@ -365,10 +365,10 @@ bool wxRemoteHtmlHelpController::DisplayContents()
if( isconn_1 ) {
if (!m_connection->Poke( wxT("--DisplayContents"), wxT("") ) ) {
wxLogError(wxT("wxRemoteHtmlHelpController - DisplayContents Failed"));
return FALSE;
return false;
}
}
return TRUE;
return true;
}
void wxRemoteHtmlHelpController::DisplayIndex()
{
@@ -382,10 +382,10 @@ 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 false;
}
}
return TRUE;
return true;
}
void wxRemoteHtmlHelpController::SetTitleFormat(const wxString& format)

View File

@@ -55,7 +55,7 @@ public:
void SetServer(wxString& a_appname); //could be wxHelpController::SetViewer
//standard wxHtmlHelpController functions
bool AddBook(const wxString& book, bool show_wait_msg = FALSE);
bool AddBook(const wxString& book, bool show_wait_msg = false);
void Display(const wxString& x);
void Display(const int id);
bool DisplayContents();

View File

@@ -38,5 +38,5 @@ bool MyApp::OnInit()
data.AddBook(argv[i]);
}
return FALSE;
return false;
}

View File

@@ -2195,12 +2195,16 @@ 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<TR><TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthA);
TexOutput(buf);
} else
}
else
{
TexOutput(_T("\n<TR><TD VALIGN=TOP>\n"));
}
OutputFont();
} else
TexOutput(_T("\n</FONT></TD>\n"));
@@ -2208,13 +2212,18 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
if (arg_no == 2)
{
// DHS
if ( start ) {
if (TwoColWidthB > -1) {
if ( start )
{
if (TwoColWidthB > -1)
{
wxChar buf[100];
wxSnprintf(buf, sizeof(buf), _T("\n<TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthB);
TexOutput(buf);
} else
}
else
{
TexOutput(_T("\n<TD VALIGN=TOP>\n"));
}
OutputFont();
} else
TexOutput(_T("\n</FONT></TD></TR>\n"));

View File

@@ -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[];

View File

@@ -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
@@ -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;
@@ -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
*
*/

View File

@@ -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);

View File

@@ -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)
{