// Created: 2002-09-04
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence:
+// Licence:
/////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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);
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");
}
if (m_userName.IsEmpty())
m_userName = wxGetUserName();
- return TRUE;
+ return true;
}
// Create new filename
// 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
wxGetApp().GetDocManager()->FileHistorySave(config);
}
- return TRUE;
+ return true;
}
void ctSettings::ShowSettingsDialog(const wxString& WXUNUSED(page))
/// 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; }
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);
bool ctConfigurationBrowserWindow::ShowToolTips()
{
- return TRUE;
+ return true;
}
/*!
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);
bool ctConfigurationBrowserControlPanel::ShowToolTips()
{
- return TRUE;
+ return true;
}
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();
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)
if (prop)
return !prop->GetReadOnly();
else
- return FALSE;
+ return false;
}
/// Assignment operator.
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(
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)
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)
{
ctConfigToolDoc* doc = GetDocument();
bool oldModified = doc->IsModified();
- doc->Modify(TRUE);
+ doc->Modify(true);
wxString name = prop->GetName();
if (name == wxT("requires") ||
{
wxString context = GetPropertyString(wxT("context"));
if (context.IsEmpty())
- return TRUE;
+ return true;
wxList contextItems;
StringToItems(GetDocument()->GetTopItem(), context, contextItems);
{
ctConfigItem* otherItem = (ctConfigItem*) node->GetData();
if (otherItem->IsEnabled())
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/// Evaluate the requires properties:
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
if (items.GetCount() > 0 && enabledCount == 0)
{
// None of the items were enabled
- enabled = FALSE;
- active = FALSE;
- explicitlyDisabled = TRUE;
+ enabled = false;
+ active = false;
+ explicitlyDisabled = true;
}
}
// 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;
}
}
// 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;
}
}
if (inContextCount > 0 && (enabledCount > 0) && !explicitlyEnabled)
// if (inContextCount > 0 && (disabledCount > 0) && !explicitlyEnabled)
{
- enabled = FALSE;
- active = FALSE;
- explicitlyDisabled = TRUE;
+ enabled = false;
+ active = false;
+ explicitlyDisabled = true;
}
}
}
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);
ctConfigItem* child = (ctConfigItem*) node->GetData();
if (child->IsEnabled() && child != this)
{
- child->Enable(FALSE);
+ child->Enable(false);
child->Sync();
if (!considered.Member(child))
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; }
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);
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);
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);
bool ctConfigItemsSelector::ShowToolTips()
{
- return TRUE;
+ return true;
}
/*!
* Update event handler for ID_CONFIG_ADD
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());
{
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();
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;
}
SetTopItem(rootItem);
- Modify(FALSE);
- SetDocumentSaved(FALSE);
+ Modify(false);
+ SetDocumentSaved(false);
wxString rootName(wxT("untitled"));
wxStripExtension(rootName);
ctConfigToolHint hint(NULL, ctInitialUpdate);
UpdateAllViews (NULL, & hint);
- SetFilename(GetFilename(), TRUE);
+ SetFilename(GetFilename(), true);
}
}
return success;
if (wxFileExists(tempFilename))
wxRemoveFile(tempFilename);
- bool leaveBackup = TRUE;
+ bool leaveBackup = true;
bool saved = DoSave(tempFilename);
wxRemoveFile(tempFilename);
}
- Modify(FALSE);
+ Modify(false);
((ctConfigToolView*)GetFirstView())->OnChangeFilename();
- SetDocumentSaved(TRUE);
+ SetDocumentSaved(true);
SetFilename(filename);
wxGetApp().GetSettings().m_lastFilename = filename;
} else
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;
}
{
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\">");
stream << wxT("\n</settings>\n");
- return TRUE;
+ return true;
}
inline static void OutputIndentation(wxOutputStream& stream, int indent)
OutputIndentation(stream, indent*2);
stream << wxT("</setting>");
- return TRUE;
+ return true;
}
/// Open the settings file
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)
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"))
else
prop->GetVariant() = wxVariant(wxT(""), name);
prop->SetDescription(description);
- prop->SetCustom(TRUE);
+ prop->SetCustom(true);
prop->SetEditorType(editorType);
if (!choices.IsEmpty())
{
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());
}
}
childTag = childTag->GetNext();
}
- return TRUE;
+ return true;
}
/// Clear dependencies
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)
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;
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;
bool ctConfigCommand::Do()
{
- return DoAndUndo(TRUE);
+ return DoAndUndo(true);
}
bool ctConfigCommand::Undo()
{
- return DoAndUndo(FALSE);
+ return DoAndUndo(false);
}
// Combine Do and Undo into one
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();
}
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);
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);
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;
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);
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;
}
node = node->GetNext();
}
- m_activeState->GetDocument()->Modify(TRUE);
+ m_activeState->GetDocument()->Modify(true);
ctConfigToolView* view = (ctConfigToolView*) m_activeState->GetDocument()->GetFirstView();
if (view)
{
m_activeState->GetDocument()->UpdateAllViews (NULL, & hint);
}
}
- m_ignoreThis = FALSE;
+ m_ignoreThis = false;
break;
}
}
- return TRUE;
+ return true;
}
IMPLEMENT_CLASS(ctConfiguration, wxObject)
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
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();
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)
// 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))
{
// ctConfigItem& ti = *(ctConfigItem *)hint->m_item;
wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem);
- }
+ }
break;
default:
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()
// 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
item->Enable(!item->IsEnabled());
- GetDocument()->Modify(TRUE);
+ GetDocument()->Modify(true);
OnChangeFilename();
SyncItem(treeControl, item);
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();
}
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);
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);
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"))
if (name != oldName)
property->GetVariant().SetName(name);
- property->SetCustom(TRUE);
+ property->SetCustom(true);
if (descr != oldDescription)
property->SetDescription(descr);
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(),
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(),
void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event)
{
- event.Enable(TRUE);
+ event.Enable(true);
}
void ctConfigToolView::OnUpdateSaveConfigureCommand(wxUpdateUIEvent& event)
{
- event.Enable(TRUE);
+ event.Enable(true);
}
/// Find text
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
//----------------------------------------------------------------------------
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;
{
ctConfigToolDoc* doc = wxGetApp().GetMainFrame()->GetDocument();
if (!doc)
- return FALSE;
+ return false;
ctConfigToolView* view = (ctConfigToolView*) doc->GetFirstView();
ctConfigItem* currentItem = NULL;
{
focusItem = doc->GetTopItem();
if (!focusItem)
- return FALSE;
+ return false;
}
if (!sm_currentItem.IsEmpty())
{
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,
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
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,
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,
// 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()
wxGetApp().GetReferenceHelpController().DisplaySection(helpTopic);
return;
}
- }
+ }
}
event.Skip();
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);
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);
bool ctCustomPropertyDialog::ShowToolTips()
{
- return TRUE;
+ return true;
}
/*!
{
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();
return ParseString(text);
}
else
- return FALSE;
+ return false;
}
bool wxSimpleHtmlParser::ParseString(const wxString& str)
bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
{
if (!parent)
- return FALSE;
+ return false;
while (!Eof())
{
if (IsCloseTagNeeded(tag->GetName()))
{
if (!parent->GetParent())
- return FALSE;
+ return false;
parent->GetParent()->AppendTag(tag);
- return TRUE;
+ return true;
}
else
parent->AppendTag(tag);
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
// empty lines at the end of the file...
}
}
- return TRUE;
+ return true;
}
// Plain text, up until an angled bracket
m_pos ++;
}
DecodeSpecialChars(text);
- return TRUE;
+ return true;
}
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagHeader()
EatWhitespace();
wxString word;
- ReadWord(word, TRUE);
+ ReadWord(word, true);
EatWhitespace();
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagClose()
{
- Matches(wxT("</"), TRUE);
+ Matches(wxT("</"), true);
EatWhitespace();
wxString word;
- ReadWord(word, TRUE);
+ ReadWord(word, true);
EatWhitespace();
m_pos ++;
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('='))
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();
// e.g. <?xml .... ?>
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseXMLDeclaration()
{
- Matches(wxT("<?"), TRUE);
+ Matches(wxT("<?"), true);
EatWhitespace();
wxString word;
- ReadWord(word, TRUE);
+ ReadWord(word, true);
EatWhitespace();
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)
if (eatIt)
m_pos = pos;
DecodeSpecialChars(str);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
bool wxSimpleHtmlParser::ReadWord(wxString& str, bool eatIt)
int pos = m_pos;
if (!IsAlpha(GetChar(pos)))
- return FALSE;
+ return false;
str += (wxChar) GetChar(pos) ;
pos ++;
if (eatIt)
m_pos = pos;
DecodeSpecialChars(str);
- return TRUE;
+ return true;
}
bool wxSimpleHtmlParser::ReadNumber(wxString& str, bool eatIt)
int pos = m_pos;
if (!IsNumeric(GetChar(pos)))
- return FALSE;
+ return false;
str += (wxChar) GetChar(pos) ;
pos ++;
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)
if (eatIt)
m_pos = pos;
DecodeSpecialChars(str);
- return TRUE;
+ return true;
}
bool wxSimpleHtmlParser::IsComment()
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.
/* 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)
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;
}
if (fstream.Ok())
{
Write(fstream);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
/*
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
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;
}
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.
}
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++;
stream << wxT("\t");
}
stream << wxT("</") << wxSimpleHtmlParser::EncodeSpecialChars(m_name) << wxT(">\n");
- sbUseTab = TRUE;
+ sbUseTab = true;
break;
}
default:
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();
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);
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); }
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;
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
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();
}
}
m_findDialog = NULL;
}
- Show(FALSE);
+ Show(false);
if (IsMaximized())
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_MAXIMIZED ;
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
// General disabler
void ctMainFrame::OnUpdateDisable(wxUpdateUIEvent& event)
{
- event.Enable( FALSE );
+ event.Enable( false );
}
/*!
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
#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 );
}
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 );
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 );
// 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
{
// TODO
int pos = 100;
- m_propertyDescriptionWindow->Show(TRUE);
+ m_propertyDescriptionWindow->Show(true);
if (!m_splitterWindow->IsSplit())
{
m_splitterWindow->SplitHorizontally(m_propertyDescriptionWindow, m_attributeEditorGrid, pos);
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
while (node)
{
ctProperty* prop = (ctProperty*) node->GetData();
- DisplayProperty(i, prop, TRUE);
+ DisplayProperty(i, prop, true);
i ++;
node = node->GetNext();
}
else
{
- m_attributeEditorGrid->SetReadOnly(row, 1, FALSE);
+ m_attributeEditorGrid->SetReadOnly(row, 1, false);
m_attributeEditorGrid->SetCellTextColour(row, 1, * wxBLACK);
}
m_attributeEditorGrid->SetCellValue(row, 1, ctConvertToSingleText(prop->GetValue()));
if (valueOnly)
- return TRUE;
+ return true;
// Set the value type
if (prop->GetEditorType() == _T("choice"))
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();
this->m_attributeEditorGrid->SelectRow(index);
this->m_attributeEditorGrid->SetGridCursor(index, 1);
}
- return TRUE;
+ return true;
}
/// Edit the default property
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
int row;
ctProperty* prop = FindSelectedProperty(row);
if (!prop)
- return FALSE;
+ return false;
wxString type(prop->GetEditorType());
wxString value = m_attributeEditorGrid->GetCellValue(row, 1);
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"))
{
m_attributeEditorGrid->SetCellValue(row, 1, value);
ApplyCellValueToProperty(row, 1);
- return TRUE;
+ return true;
}
else
- return FALSE;
+ return false;
}
else if (type == _T("configitems"))
{
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)
{
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.
/// 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);
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"))
{
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());
// 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;
}
/*!
{
if (GetNumberRows() > 0)
DeleteRows(0, GetNumberRows());
- return TRUE;
+ return true;
}
/*!
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 );
item3->SetFocus();
((wxButton*) FindWindow(wxID_OK))->SetDefault();
- parent->SetAutoLayout( TRUE );
+ parent->SetAutoLayout( true );
parent->SetSizer(item0);
item0->Fit(parent);
- return TRUE;
+ return true;
}
/*
*/
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;
}
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);
// Created: 2003-06-03
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence:
+// Licence:
/////////////////////////////////////////////////////////////////////////////
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
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)
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)
// Created: 2003-06-03
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence:
+// Licence:
/////////////////////////////////////////////////////////////////////////////
#ifndef _CT_PROPERTY_H_
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); }
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);
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
bool ctSettingsDialog::ShowToolTips()
{
- return TRUE;
+ return true;
}
/*!
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())
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())
_("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
bool ctGeneralSettingsDialog::ShowToolTips()
{
- return TRUE;
+ return true;
}
/*!
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);
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())
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())
{
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,
{
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();
{
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();
// Created: 2002-09-04
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence:
+// Licence:
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
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)
{
// 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
}
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.
#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);
wxIconTable::wxIconTable(wxImageList* imageList)
{
m_imageList = imageList;
- DeleteContents(TRUE);
+ DeleteContents(true);
}
void wxIconTable::AppendInfo(wxIconInfo* info)
Append(info);
}
info->SetIconId(state, enabled, m_imageList->Add(icon));
- return TRUE;
+ return true;
}
wxIconInfo* wxIconTable::FindInfo(const wxString& name) const
{
wxIconInfo* info = FindInfo(name);
if (!info)
- return FALSE;
+ return false;
info->SetIconId(state, enabled, iconId);
- return TRUE;
+ return true;
}
// Output stream operators
{
// 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);
}
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);
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; }
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; }
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);
{
case ctSHOW_STATUS_MAXIMIZED:
{
- frame->Maximize(TRUE);
+ frame->Maximize(true);
break;
}
case ctSHOW_STATUS_MINIMIZED:
{
- frame->Iconize(TRUE);
+ frame->Iconize(true);
break;
}
default:
// Load the file
wxDocument* doc = m_docManager->CreateDocument(arg, wxDOC_SILENT);
if (doc)
- doc->SetDocumentSaved(TRUE);
+ doc->SetDocumentSaved(true);
}
else
{
// 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)
/// 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.
// 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
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)
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");
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)
}
BEGIN_EVENT_TABLE(MyModalDialog, wxDialog)
-EVT_BUTTON(-1, MyModalDialog::OnButton)
+EVT_BUTTON(wxID_ANY, MyModalDialog::OnButton)
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();
}
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
};
{
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()
};
{
public:
MyModalDialog(wxWindow *parent);
-
+
private:
void OnButton(wxCommandEvent& event);
-
+
wxButton *m_main;
wxButton *m_book1;
wxButton *m_book2;
-
+
DECLARE_EVENT_TABLE()
};
// 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
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();
}
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) )
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)
}
if (!m_connection->Execute( helpfile, -1 ) )
- wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed"));
-
+ wxLogError(wxT("wxRemoteHtmlHelpController - Display Failed"));
+
}
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"));
+ }
}
// 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
bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format);
bool OnDisconnect();
- bool *isconn_3;
+ bool *isconn_3;
};
class rhhcClient: public wxClient
{
public:
- rhhcClient(bool *isconn_a);
- //~rhhcClient( );
+ rhhcClient(bool *isconn_a);
+ //~rhhcClient( );
wxConnectionBase *OnMakeConnection();
- bool *isconn_2;
+ bool *isconn_2;
};
class wxRemoteHtmlHelpController : public wxHelpControllerBase
{
- DECLARE_CLASS(wxRemoteHtmlHelpController)
+ DECLARE_CLASS(wxRemoteHtmlHelpController)
public:
- wxRemoteHtmlHelpController(int style = wxHF_DEFAULT_STYLE);
- ~wxRemoteHtmlHelpController();
- void OnQuit(void);
-
- void SetService(wxString& a_service);
- void SetServer(wxString& a_appname); //could be wxHelpController::SetViewer
-
- //standard wxHtmlHelpController functions
- bool AddBook(const wxString& book, bool show_wait_msg = FALSE);
- void Display(const wxString& x);
- void Display(const int id);
- bool DisplayContents();
- void DisplayIndex();
- bool KeywordSearch(const wxString& keyword);
- void SetTempDir(const wxString& path);
- void SetTitleFormat(const wxString& format);
-
- //dummies - config is in server
- void UseConfig(wxConfigBase* config, const wxString& rootpath = wxEmptyString) {};
- void ReadCustomization(wxConfigBase* cfg, wxString path = wxEmptyString) {};
- void WriteCustomization(wxConfigBase* cfg, wxString path = wxEmptyString) {};
-
- //virtuals from wxHelpControllerBase - not in wxHtmlHelpController
- //won't compile without these
- bool LoadFile(const class wxString &); //dummy
- bool DisplaySection(int);
- bool DisplayBlock(long);
- bool Quit(void);
+ wxRemoteHtmlHelpController(int style = wxHF_DEFAULT_STYLE);
+ ~wxRemoteHtmlHelpController();
+ void OnQuit(void);
+
+ void SetService(wxString& a_service);
+ void SetServer(wxString& a_appname); //could be wxHelpController::SetViewer
+
+ //standard wxHtmlHelpController functions
+ bool AddBook(const wxString& book, bool show_wait_msg = false);
+ void Display(const wxString& x);
+ void Display(const int id);
+ bool DisplayContents();
+ void DisplayIndex();
+ bool KeywordSearch(const wxString& keyword);
+ void SetTempDir(const wxString& path);
+ void SetTitleFormat(const wxString& format);
+
+ //dummies - config is in server
+ void UseConfig(wxConfigBase* config, const wxString& rootpath = wxEmptyString) {};
+ void ReadCustomization(wxConfigBase* cfg, wxString path = wxEmptyString) {};
+ void WriteCustomization(wxConfigBase* cfg, wxString path = wxEmptyString) {};
+
+ //virtuals from wxHelpControllerBase - not in wxHtmlHelpController
+ //won't compile without these
+ bool LoadFile(const class wxString &); //dummy
+ bool DisplaySection(int);
+ bool DisplayBlock(long);
+ bool Quit(void);
private:
- void OnExit(wxCommandEvent& event);
- bool DoConnection();
-
- rhhcConnection *m_connection;
- rhhcClient *m_client;
- wxProcess *m_process;
-
- int m_pid;
- int m_style;
- wxString m_appname;
- wxString m_service;
- wxString m_windowname;
- wxString m_book;
- bool isconn_1;
+ void OnExit(wxCommandEvent& event);
+ bool DoConnection();
+
+ rhhcConnection *m_connection;
+ rhhcClient *m_client;
+ wxProcess *m_process;
+
+ int m_pid;
+ int m_style;
+ wxString m_appname;
+ wxString m_service;
+ wxString m_windowname;
+ wxString m_book;
+ bool isconn_1;
};
#endif
- // _WX_REMHELP_H_
+ // _WX_REMHELP_H_
data.AddBook(argv[i]);
}
- return FALSE;
+ return false;
}
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)
#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
if (htmlWorkshopFiles) HTMLWorkshopAddToContents(2, topicName, SubsectionsName);
SetCurrentOutput(Subsections);
- HTMLHead();
+ HTMLHead();
TexOutput(_T("<title>"));
OutputCurrentSection();
TexOutput(_T("</title></head>\n"));
if (htmlWorkshopFiles) HTMLWorkshopAddToContents(3, topicName, SubsubsectionsName);
SetCurrentOutput(Subsubsections);
- HTMLHead();
+ HTMLHead();
TexOutput(_T("<title>"));
OutputCurrentSection();
TexOutput(_T("</title></head>\n"));
else
wxSnprintf(buf, sizeof(buf), _T("\n<TD ALIGN=LEFT>"));
TexOutput(buf);
- OutputFont();
+ OutputFont();
}
else
TexOutput(_T("&"));
else
wxSnprintf(buf, sizeof(buf), _T("<TR>\n<TD ALIGN=LEFT>"));
TexOutput(buf);
- OutputFont();
+ OutputFont();
}
else
{
// If a filename is supplied, use it, otherwise try to
// use the filename associated with the reference (from this document).
if (helpRefFilename)
- {
+ {
TraverseChildrenFromChunk(helpRefFilename);
TexOutput(_T("#"));
- }
+ }
else if (refFilename)
- {
+ {
TexOutput(ConvertCase(refFilename));
TexOutput(_T("#"));
- }
+ }
TexOutput(refName);
TexOutput(_T("\">"));
if (helpRefText)
// If we have found the existing filename, make the inline
// image point to the original file (could be PS, for example)
if (originalFilename && (wxStrcmp(inlineFilename, originalFilename) != 0))
- {
+ {
TexOutput(_T("<A HREF=\""));
TexOutput(ConvertCase(originalFilename));
TexOutput(_T("\">"));
TexOutput(_T("\""));
TexOutput(alignment);
TexOutput(_T("></A>"));
- }
+ }
else
#endif
- {
+ {
TexOutput(_T("<img src=\""));
TexOutput(ConvertCase(wxFileNameFromPath(inlineFilename)));
TexOutput(_T("\""));
TexOutput(alignment);
TexOutput(_T(">"));
delete[] inlineFilename;
- }
+ }
}
else
{
{
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();
+ }
+ OutputFont();
} else
TexOutput(_T("\n</FONT></TD>\n"));
}
if (arg_no == 2)
{
// DHS
- if ( start ) {
- if (TwoColWidthB > -1) {
+ if ( start )
+ {
+ if (TwoColWidthB > -1)
+ {
wxChar buf[100];
wxSnprintf(buf, sizeof(buf), _T("\n<TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthB);
TexOutput(buf);
- } else
- TexOutput(_T("\n<TD VALIGN=TOP>\n"));
- OutputFont();
+ }
+ else
+ {
+ TexOutput(_T("\n<TD VALIGN=TOP>\n"));
+ }
+ OutputFont();
} else
TexOutput(_T("\n</FONT></TD></TR>\n"));
}
if (compatibilityMode)
{
TexOutput(_T("<TR>\n<TD>"));
- OutputFont();
+ OutputFont();
/*
for (int i = 0; i < noColumns; i++)
{
{
wxStrcpy(buf2, _T("#000000"));
wxChar buf[100];
- wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name);
+ wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name);
OnError(buf);
}
TexOutput(_T("<FONT COLOR=\""));
if (DocumentTitle)
{
SetCurrentOutput(tmpTitle);
- HTMLHead();
+ HTMLHead();
TexOutput(_T("\n<HEAD><TITLE>"));
TraverseChildrenFromChunk(DocumentTitle);
TexOutput(_T("</TITLE></HEAD>\n"));
else
{
SetCurrentOutput(tmpTitle);
- HTMLHeadTo(tmpTitle);
+ HTMLHeadTo(tmpTitle);
if (contentsString)
wxFprintf(tmpTitle, _T("<TITLE>%s</TITLE></HEAD>\n\n"), contentsString);
else
_T(" <param name=\"Local\" value=\"%s#%s\">\n")
_T(" <param name=\"Name\" value=\"%s\">\n")
_T(" </OBJECT>\n"),
- texTopic->filename, topicName, s);
+ texTopic->filename, topicName, s);
node1 = node1->GetNext();
}
}
_T(" <LI> <OBJECT type=\"text/sitemap\">\n")
_T(" <param name=\"Local\" value=\"%s#%s\">\n")
_T(" <param name=\"Name\" value=\""),
- file, s);
+ file, s);
OutputCurrentSection();
wxFprintf(HTMLWorkshopContents,
- _T("\">\n")
+ _T("\">\n")
_T(" </OBJECT>\n"));
HTMLWorkshopLastLevel = level;
}
int d=0;
while ( (xitle[s]!=0)&&(d<255) )
{
- wxChar ch=xitle[s]&0xff;
- if (ch==0x5c) {
- wxChar ch1=xitle[s+1]&0xff;
- wxChar ch2=xitle[s+2]&0xff;
- wxChar ch3=xitle[s+3]&0xff;
- s+=4; // next character
- if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]='ö'; }
- if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]='ä'; }
- if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]='ü'; }
- if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]='Ö'; }
- if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]='Ä'; }
- if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]='Ü'; }
- } else {
- title[d++]=ch;
- s++;
- }
+ wxChar ch=xitle[s]&0xff;
+ if (ch==0x5c) {
+ wxChar ch1=xitle[s+1]&0xff;
+ wxChar ch2=xitle[s+2]&0xff;
+ wxChar ch3=xitle[s+3]&0xff;
+ s+=4; // next character
+ if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x36)) { title[d++]='ö'; }
+ if ((ch1==0x27)&&(ch2==0x65)&&(ch3==0x34)) { title[d++]='ä'; }
+ if ((ch1==0x27)&&(ch2==0x66)&&(ch3==0x63)) { title[d++]='ü'; }
+ if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x36)) { title[d++]='Ö'; }
+ if ((ch1==0x27)&&(ch2==0x63)&&(ch3==0x34)) { title[d++]='Ä'; }
+ if ((ch1==0x27)&&(ch2==0x64)&&(ch3==0x63)) { title[d++]='Ü'; }
+ } else {
+ title[d++]=ch;
+ s++;
+ }
}
title[d]=0;
}
else
SetCurrentOutput(NULL); // Don't write it into the contents, or anywhere else
- }
+ }
else
SetCurrentOutput(NULL); // Don't write it into the contents, or anywhere else
}
TraverseChildrenFromChunk(descriptionItemArg);
TexOutput(_T("}\\tab"));
descriptionItemArg = NULL;
- }
- else
- {
+ }
+ else
+ {
wxSnprintf(indentBuf, sizeof(indentBuf), _T("\\tab{\\b %d.}\\tab"), struc->currentItem);
TexOutput(indentBuf);
}
TraverseChildrenFromChunk(descriptionItemArg);
TexOutput(_T("}\\tab"));
descriptionItemArg = NULL;
- }
- else
- {
+ }
+ else
+ {
if (bulletFile && winHelp)
{
if (winHelpVersion > 3) // Transparent bitmap
}
break;
}
- }
+ }
}
}
break;
{
if (start)
{
- if ( issuedNewParagraph == 0 )
- {
+ if ( issuedNewParagraph == 0 )
+ {
TexOutput(_T("\\par\\pard"));
issuedNewParagraph ++;
// we have a suitable set of styles.
#if 0
if (winHelp && !inTabular && (ParSkip > 0))
- {
+ {
TexOutput(_T("\\par"));
issuedNewParagraph ++;
- }
+ }
#endif
WriteEnvironmentStyles();
- }
- // 1 is a whole paragraph if ParSkip == 0,
- // half a paragraph if ParSkip > 0
- else if ( issuedNewParagraph == 1 )
- {
- // Don't need a par at all if we've already had one,
- // and ParSkip == 0.
+ }
+ // 1 is a whole paragraph if ParSkip == 0,
+ // half a paragraph if ParSkip > 0
+ else if ( issuedNewParagraph == 1 )
+ {
+ // Don't need a par at all if we've already had one,
+ // and ParSkip == 0.
#if 0
// Extra par if parskip is more than zero (usually looks best.)
if (winHelp && !inTabular && (ParSkip > 0))
- {
+ {
TexOutput(_T("\\par"));
issuedNewParagraph ++;
- }
+ }
#endif
WriteEnvironmentStyles();
- }
+ }
/*
if (!issuedNewParagraph || (issuedNewParagraph > 1))
{
wxFprintf(Popups, _T("+{\\footnote %s}\n"), GetBrowseString());
savedOutput = CurrentOutput1;
SetCurrentOutput(Popups);
- }
- else
- {
+ }
+ else
+ {
SetCurrentOutput(savedOutput);
- }
+ }
return true;
}
return true;
if (start)
{
TexOutput(_T("{\\ul "));
- }
+ }
else
{
TexOutput(_T("}"));
wxSnprintf(buf, sizeof(buf), _T("{%s%d "), ((macroId == ltFCOL) ? _T("\\cf") : _T("\\cb")), pos);
TexOutput(buf);
}
- else
- {
- wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name);
+ else
+ {
+ wxSnprintf(buf, sizeof(buf), _T("Could not find colour name %s"), name);
OnError(buf);
- }
+ }
break;
}
case 2:
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[];
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;
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
bool combineSubSections = false;
bool htmlWorkshopFiles = false;
bool ignoreBadRefs = false;
-wxChar *htmlFaceName = NULL;
+wxChar *htmlFaceName = NULL;
extern int passNumber;
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;
TexRef::TexRef(const wxChar *label, const wxChar *file,
- const wxChar *section, const wxChar *sectionN)
+ const wxChar *section, const wxChar *sectionN)
{
refLabel = copystring(label);
refFile = file ? copystring(file) : (wxChar*) NULL;
* 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
*
*/
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;
*/
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);
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);
(*frame->textWindow) << msg << _T("\n");
/* This whole block of code is just wrong I think. It would behave
completely wrong under anything other than MSW due to the ELSE
- with no statement, and the cout calls would fail under MSW, as
- the code in this block is compiled if !NO_GUI This code has been
- here since v1.1 of this file too. - gt
+ with no statement, and the cout calls would fail under MSW, as
+ the code in this block is compiled if !NO_GUI This code has been
+ here since v1.1 of this file too. - gt
else
#ifdef __WXMSW__
{
if (!istr.eof())
{
istr >> file;
- istr >> sectionName;
+ istr >> sectionName;
char ch;
istr.get(ch); // Read past space
istr.get(ch);
static int yieldCount = 0;
if (isSync)
- return;
+ return;
if (force)
- yieldCount = 0;
+ yieldCount = 0;
if (yieldCount == 0)
{
- if (wxTheApp)
- wxYield();
- yieldCount = 10;
+ if (wxTheApp)
+ wxYield();
+ yieldCount = 10;
}
yieldCount --;
#endif
}
#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)
{
/*
- * File: wxhlpblk.h
- * Purpose: Text blocks used in wxHelp
- * Author: Julian Smart
- * Created: 1993
- * Updated:
- * Copyright: (c) 1993, AIAI, University of Edinburgh
+ * File: wxhlpblk.h
+ * Purpose: Text blocks used in wxHelp
+ * Author: Julian Smart
+ * Created: 1993
+ * Updated:
+ * Copyright: (c) 1993, AIAI, University of Edinburgh
*/
/* sccsid[] = "%W% %G%" */
}
break;
}
- }
+ }
}
}
break;