// Saves the doc
bool ctConfigToolDoc::Save()
{
- bool ret = FALSE;
-
if (!IsModified() && m_savedYet) return TRUE;
- if (m_documentFile == wxT("") || !m_savedYet)
- ret = SaveAs();
- else
- ret = OnSaveDocument(m_documentFile);
+
+ bool ret = (m_documentFile == wxT("") || !m_savedYet) ?
+ SaveAs() :
+ OnSaveDocument(m_documentFile);
if ( ret )
SetDocumentSaved(TRUE);
return ret;
m_editMenu = NULL;
m_configurePage = NULL;
m_setupPage = NULL;
+#ifdef USE_CONFIG_BROWSER_PAGE
m_configBrowserPage = NULL;
+#endif
m_mainNotebook = NULL;
m_findDialog = NULL;
m_configurePage = new ctOutputWindow(m_mainNotebook, -1, wxDefaultPosition, wxSize(300, 200),
wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
-#if 0
+#ifdef USE_CONFIG_BROWSER_PAGE
m_configBrowserPage = new ctConfigurationBrowserWindow(m_mainNotebook, -1, wxDefaultPosition, wxSize(300, 200),
wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
#endif
m_mainNotebook->AddPage(m_propertyEditor, _T("Properties"));
-#if 0
+#ifdef USE_CONFIG_BROWSER_PAGE
m_mainNotebook->AddPage(m_configBrowserPage, _T("Configuration Browser"));
#endif
m_mainNotebook->AddPage(m_setupPage, _T("setup.h"));
#include "wx/imaglist.h"
#include "wx/docview.h"
+// #define USE_CONFIG_BROWSER_PAGE
+
class WXDLLEXPORT wxHtmlWindow;
class WXDLLEXPORT wxSplitterWindow;
class WXDLLEXPORT wxNotebookEvent;
class ctPropertyEditor;
class ctOutputWindow;
class ctFindReplaceDialog;
+#ifdef USE_CONFIG_BROWSER_PAGE
class ctConfigurationBrowserWindow;
+#endif
/*!
* \brief The main window of the application.
// The control panel for browsing, adding and removing
// configurations.
+#ifdef USE_CONFIG_BROWSER_PAGE
ctConfigurationBrowserWindow* m_configBrowserPage;
+#endif
ctFindReplaceDialog* m_findDialog;
};
// Convert 6-digit hex string to a colour
wxColour apHexStringToColour(const wxString& hex)
{
- unsigned int r = 0;
- unsigned int g = 0;
- unsigned int b = 0;
- r = wxHexToDec(hex.Mid(0, 2));
- g = wxHexToDec(hex.Mid(2, 2));
- b = wxHexToDec(hex.Mid(4, 2));
+ unsigned int r = wxHexToDec(hex.Mid(0, 2));
+ unsigned int g = wxHexToDec(hex.Mid(2, 2));
+ unsigned int b = wxHexToDec(hex.Mid(4, 2));
return wxColour(r, g, b);
}
}
wxString cmd;
- bool ok = ft->GetOpenCommand(&cmd,
- wxFileType::MessageParameters(filename, _T("")));
+ ft->GetOpenCommand(&cmd, wxFileType::MessageParameters(filename, _T("")));
delete ft;
- ok = (wxExecute(cmd, FALSE) != 0);
-
- return ok;
+ return (wxExecute(cmd, FALSE) != 0);
}
// Find the absolute path where this application has been run from.
wxString left(matchAgainst);
bool success = FALSE;
- int pos = 0;
int matchTextLen = (int) matchText.Length();
while (!success && !matchAgainst.IsEmpty())
{
- pos = left.Find(matchText);
+ int pos = left.Find(matchText);
if (pos == -1)
return FALSE;