-1->wxID_ANY, TRUE->true, FALSE->false & tabs->spaces replacements.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -51,8 +51,8 @@ IMPLEMENT_DYNAMIC_CLASS(ctSettings, wxObject)
|
|||||||
ctSettings::ctSettings()
|
ctSettings::ctSettings()
|
||||||
{
|
{
|
||||||
m_noUses = 0;
|
m_noUses = 0;
|
||||||
m_showToolBar = TRUE;
|
m_showToolBar = true;
|
||||||
m_showWelcomeDialog = TRUE;
|
m_showWelcomeDialog = true;
|
||||||
m_exportDir = wxEmptyString;
|
m_exportDir = wxEmptyString;
|
||||||
|
|
||||||
m_frameSize = wxRect(10, 10, 600, 500);
|
m_frameSize = wxRect(10, 10, 600, 500);
|
||||||
@@ -61,20 +61,20 @@ ctSettings::ctSettings()
|
|||||||
|
|
||||||
m_appName = wxT("wxWidgets Configuration Tool");
|
m_appName = wxT("wxWidgets Configuration Tool");
|
||||||
m_appNameShort = wxT("Configuration Tool");
|
m_appNameShort = wxT("Configuration Tool");
|
||||||
m_showSplashScreen = FALSE;
|
m_showSplashScreen = false;
|
||||||
m_userName = wxEmptyString;
|
m_userName = wxEmptyString;
|
||||||
m_frameStatus = ctSHOW_STATUS_NORMAL;
|
m_frameStatus = ctSHOW_STATUS_NORMAL;
|
||||||
m_loadLastDocument = TRUE;
|
m_loadLastDocument = true;
|
||||||
m_firstTimeRun = TRUE;
|
m_firstTimeRun = true;
|
||||||
m_smallToolbar = TRUE;
|
m_smallToolbar = true;
|
||||||
m_mainSashSize = 200;
|
m_mainSashSize = 200;
|
||||||
m_useToolTips = TRUE;
|
m_useToolTips = true;
|
||||||
m_showTrayIcon = TRUE;
|
m_showTrayIcon = true;
|
||||||
m_trayIconIsShown = FALSE;
|
m_trayIconIsShown = false;
|
||||||
m_useEnvironmentVariable = TRUE;
|
m_useEnvironmentVariable = true;
|
||||||
m_frameworkDir = wxEmptyString;
|
m_frameworkDir = wxEmptyString;
|
||||||
m_matchWholeWord = FALSE;
|
m_matchWholeWord = false;
|
||||||
m_matchCase = FALSE;
|
m_matchCase = false;
|
||||||
m_defaultFileKind = wxT("Setup file");
|
m_defaultFileKind = wxT("Setup file");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ bool ctSettings::Init()
|
|||||||
if (m_userName.IsEmpty())
|
if (m_userName.IsEmpty())
|
||||||
m_userName = wxGetUserName();
|
m_userName = wxGetUserName();
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create new filename
|
// Create new filename
|
||||||
@@ -212,13 +212,13 @@ bool ctSettings::LoadConfig()
|
|||||||
// facility just in case it's trying to load a damaged file.
|
// facility just in case it's trying to load a damaged file.
|
||||||
if (runningProgram != 0)
|
if (runningProgram != 0)
|
||||||
{
|
{
|
||||||
m_loadLastDocument = FALSE;
|
m_loadLastDocument = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
config.Write(wxT("Misc/RunningProgram"), (long) 1);
|
config.Write(wxT("Misc/RunningProgram"), (long) 1);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save config info
|
// Save config info
|
||||||
@@ -270,7 +270,7 @@ bool ctSettings::SaveConfig()
|
|||||||
wxGetApp().GetDocManager()->FileHistorySave(config);
|
wxGetApp().GetDocManager()->FileHistorySave(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctSettings::ShowSettingsDialog(const wxString& WXUNUSED(page))
|
void ctSettings::ShowSettingsDialog(const wxString& WXUNUSED(page))
|
||||||
|
@@ -81,7 +81,7 @@ public:
|
|||||||
/// May not be needed in this application.
|
/// May not be needed in this application.
|
||||||
wxString& GetLastFilename() { return m_lastFilename; }
|
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.
|
/// has been run.
|
||||||
bool GetFirstTimeRun() const { return m_firstTimeRun; }
|
bool GetFirstTimeRun() const { return m_firstTimeRun; }
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ void ctConfigurationBrowserWindow::CreateControls()
|
|||||||
|
|
||||||
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
||||||
item1->SetSizer(item2);
|
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);
|
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);
|
wxTreeCtrl* item4 = new wxTreeCtrl(item3, ID_CONFIGURATION_BROWSER_TREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_SINGLE|wxNO_BORDER);
|
||||||
@@ -92,7 +92,7 @@ void ctConfigurationBrowserWindow::OnConfigurationBrowserTreectrl( wxTreeEvent&
|
|||||||
|
|
||||||
bool ctConfigurationBrowserWindow::ShowToolTips()
|
bool ctConfigurationBrowserWindow::ShowToolTips()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -149,7 +149,7 @@ void ctConfigurationBrowserControlPanel::CreateControls()
|
|||||||
|
|
||||||
wxBoxSizer* item6 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item6 = new wxBoxSizer(wxVERTICAL);
|
||||||
item5->SetSizer(item6);
|
item5->SetSizer(item6);
|
||||||
item5->SetAutoLayout(TRUE);
|
item5->SetAutoLayout(true);
|
||||||
|
|
||||||
wxStaticText* item7 = new wxStaticText(item5, wxID_STATIC, _("Browse, add and remove configurations"), wxDefaultPosition, wxDefaultSize, 0);
|
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);
|
item6->Add(item7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5);
|
||||||
@@ -242,5 +242,5 @@ void ctConfigurationBrowserControlPanel::OnUpdateRenameConfiguration( wxUpdateUI
|
|||||||
|
|
||||||
bool ctConfigurationBrowserControlPanel::ShowToolTips()
|
bool ctConfigurationBrowserControlPanel::ShowToolTips()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -54,7 +54,7 @@ class ctConfigurationBrowserWindow: public wxPanel
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// 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
|
/// Creates the controls and sizers
|
||||||
void CreateControls();
|
void CreateControls();
|
||||||
|
@@ -33,21 +33,21 @@ IMPLEMENT_CLASS(ctConfigItem, wxObject)
|
|||||||
|
|
||||||
ctConfigItem::ctConfigItem()
|
ctConfigItem::ctConfigItem()
|
||||||
{
|
{
|
||||||
m_modified = FALSE;
|
m_modified = false;
|
||||||
m_type = ctTypeBoolCheck;
|
m_type = ctTypeBoolCheck;
|
||||||
m_treeItemId = wxTreeItemId();
|
m_treeItemId = wxTreeItemId();
|
||||||
m_enabled = TRUE;
|
m_enabled = true;
|
||||||
m_parent = NULL;
|
m_parent = NULL;
|
||||||
m_active = TRUE;
|
m_active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctConfigItem::ctConfigItem(ctConfigItem* parent, ctConfigType type, const wxString& name)
|
ctConfigItem::ctConfigItem(ctConfigItem* parent, ctConfigType type, const wxString& name)
|
||||||
{
|
{
|
||||||
m_modified = FALSE;
|
m_modified = false;
|
||||||
m_type = type;
|
m_type = type;
|
||||||
m_treeItemId = wxTreeItemId();
|
m_treeItemId = wxTreeItemId();
|
||||||
m_enabled = FALSE;
|
m_enabled = false;
|
||||||
m_active = TRUE;
|
m_active = true;
|
||||||
SetName(name);
|
SetName(name);
|
||||||
m_parent = parent;
|
m_parent = parent;
|
||||||
if (parent)
|
if (parent)
|
||||||
@@ -82,7 +82,7 @@ bool ctConfigItem::CanEditProperty(const wxString& propName) const
|
|||||||
if (prop)
|
if (prop)
|
||||||
return !prop->GetReadOnly();
|
return !prop->GetReadOnly();
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Assignment operator.
|
/// Assignment operator.
|
||||||
@@ -165,7 +165,7 @@ void ctConfigItem::InitProperties()
|
|||||||
m_properties.AddProperty(prop);
|
m_properties.AddProperty(prop);
|
||||||
}
|
}
|
||||||
prop->SetDescription(_("<B>Name</B><P> The name of the configuration setting."));
|
prop->SetDescription(_("<B>Name</B><P> The name of the configuration setting."));
|
||||||
prop->SetReadOnly(TRUE);
|
prop->SetReadOnly(true);
|
||||||
|
|
||||||
m_properties.AddProperty(
|
m_properties.AddProperty(
|
||||||
new ctProperty(
|
new ctProperty(
|
||||||
@@ -176,7 +176,7 @@ void ctConfigItem::InitProperties()
|
|||||||
m_properties.AddProperty(
|
m_properties.AddProperty(
|
||||||
new ctProperty(
|
new ctProperty(
|
||||||
wxT("<B>Default-state</B><P> The default state."),
|
wxT("<B>Default-state</B><P> The default state."),
|
||||||
wxVariant((bool) TRUE, wxT("default-state")),
|
wxVariant(true, wxT("default-state")),
|
||||||
wxT("bool")));
|
wxT("bool")));
|
||||||
|
|
||||||
if (GetType() == ctTypeString)
|
if (GetType() == ctTypeString)
|
||||||
@@ -184,7 +184,7 @@ void ctConfigItem::InitProperties()
|
|||||||
m_properties.AddProperty(
|
m_properties.AddProperty(
|
||||||
new ctProperty(
|
new ctProperty(
|
||||||
wxT("<B>Default-value</B><P> The default value."),
|
wxT("<B>Default-value</B><P> The default value."),
|
||||||
wxVariant((bool) TRUE, wxT("default-value")),
|
wxVariant(true, wxT("default-value")),
|
||||||
wxT("")));
|
wxT("")));
|
||||||
}
|
}
|
||||||
else if (GetType() == ctTypeInteger)
|
else if (GetType() == ctTypeInteger)
|
||||||
@@ -265,7 +265,7 @@ void ctConfigItem::ApplyProperty(ctProperty* prop, const wxVariant& WXUNUSED(old
|
|||||||
{
|
{
|
||||||
ctConfigToolDoc* doc = GetDocument();
|
ctConfigToolDoc* doc = GetDocument();
|
||||||
bool oldModified = doc->IsModified();
|
bool oldModified = doc->IsModified();
|
||||||
doc->Modify(TRUE);
|
doc->Modify(true);
|
||||||
|
|
||||||
wxString name = prop->GetName();
|
wxString name = prop->GetName();
|
||||||
if (name == wxT("requires") ||
|
if (name == wxT("requires") ||
|
||||||
@@ -469,7 +469,7 @@ bool ctConfigItem::IsInActiveContext()
|
|||||||
{
|
{
|
||||||
wxString context = GetPropertyString(wxT("context"));
|
wxString context = GetPropertyString(wxT("context"));
|
||||||
if (context.IsEmpty())
|
if (context.IsEmpty())
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
wxList contextItems;
|
wxList contextItems;
|
||||||
StringToItems(GetDocument()->GetTopItem(), context, contextItems);
|
StringToItems(GetDocument()->GetTopItem(), context, contextItems);
|
||||||
@@ -478,9 +478,9 @@ bool ctConfigItem::IsInActiveContext()
|
|||||||
{
|
{
|
||||||
ctConfigItem* otherItem = (ctConfigItem*) node->GetData();
|
ctConfigItem* otherItem = (ctConfigItem*) node->GetData();
|
||||||
if (otherItem->IsEnabled())
|
if (otherItem->IsEnabled())
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Evaluate the requires properties:
|
/// Evaluate the requires properties:
|
||||||
@@ -497,12 +497,12 @@ void ctConfigItem::EvaluateDependencies()
|
|||||||
wxString enabledIfNot = GetPropertyString(wxT("enabled-if-not"));
|
wxString enabledIfNot = GetPropertyString(wxT("enabled-if-not"));
|
||||||
wxString indeterminateIf = GetPropertyString(wxT("indeterminate-if"));
|
wxString indeterminateIf = GetPropertyString(wxT("indeterminate-if"));
|
||||||
|
|
||||||
bool active = TRUE;
|
bool active = true;
|
||||||
bool enabled = IsEnabled();
|
bool enabled = IsEnabled();
|
||||||
bool oldEnabled = enabled;
|
bool oldEnabled = enabled;
|
||||||
bool oldActive = IsActive();
|
bool oldActive = IsActive();
|
||||||
bool explicitlyEnabled = FALSE;
|
bool explicitlyEnabled = false;
|
||||||
bool explicitlyDisabled = FALSE;
|
bool explicitlyDisabled = false;
|
||||||
bool inActiveContext = IsInActiveContext();
|
bool inActiveContext = IsInActiveContext();
|
||||||
|
|
||||||
// Add the parent to the list of dependencies, if the
|
// Add the parent to the list of dependencies, if the
|
||||||
@@ -543,9 +543,9 @@ void ctConfigItem::EvaluateDependencies()
|
|||||||
if (items.GetCount() > 0 && enabledCount == 0)
|
if (items.GetCount() > 0 && enabledCount == 0)
|
||||||
{
|
{
|
||||||
// None of the items were enabled
|
// None of the items were enabled
|
||||||
enabled = FALSE;
|
enabled = false;
|
||||||
active = FALSE;
|
active = false;
|
||||||
explicitlyDisabled = TRUE;
|
explicitlyDisabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -575,9 +575,9 @@ void ctConfigItem::EvaluateDependencies()
|
|||||||
// Enable if there were no related items that were enabled
|
// Enable if there were no related items that were enabled
|
||||||
if (inContextCount > 0 && (disabledCount == inContextCount) && !explicitlyDisabled)
|
if (inContextCount > 0 && (disabledCount == inContextCount) && !explicitlyDisabled)
|
||||||
{
|
{
|
||||||
explicitlyEnabled = TRUE;
|
explicitlyEnabled = true;
|
||||||
enabled = TRUE;
|
enabled = true;
|
||||||
active = FALSE;
|
active = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -608,9 +608,9 @@ void ctConfigItem::EvaluateDependencies()
|
|||||||
// Enable if there were no related items that were disabled
|
// Enable if there were no related items that were disabled
|
||||||
if (inContextCount > 0 && (enabledCount > 0) && !explicitlyDisabled)
|
if (inContextCount > 0 && (enabledCount > 0) && !explicitlyDisabled)
|
||||||
{
|
{
|
||||||
explicitlyEnabled = TRUE;
|
explicitlyEnabled = true;
|
||||||
enabled = TRUE;
|
enabled = true;
|
||||||
active = FALSE;
|
active = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,9 +644,9 @@ void ctConfigItem::EvaluateDependencies()
|
|||||||
if (inContextCount > 0 && (enabledCount > 0) && !explicitlyEnabled)
|
if (inContextCount > 0 && (enabledCount > 0) && !explicitlyEnabled)
|
||||||
// if (inContextCount > 0 && (disabledCount > 0) && !explicitlyEnabled)
|
// if (inContextCount > 0 && (disabledCount > 0) && !explicitlyEnabled)
|
||||||
{
|
{
|
||||||
enabled = FALSE;
|
enabled = false;
|
||||||
active = FALSE;
|
active = false;
|
||||||
explicitlyDisabled = TRUE;
|
explicitlyDisabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -674,22 +674,22 @@ void ctConfigItem::EvaluateDependencies()
|
|||||||
}
|
}
|
||||||
if (inContextCount > 0 && enabledCount > 0)
|
if (inContextCount > 0 && enabledCount > 0)
|
||||||
{
|
{
|
||||||
active = TRUE;
|
active = true;
|
||||||
explicitlyEnabled = FALSE;
|
explicitlyEnabled = false;
|
||||||
explicitlyDisabled = FALSE;
|
explicitlyDisabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally check a sort of dependency: whether our
|
// Finally check a sort of dependency: whether our
|
||||||
// context is active. If not, make this inactive.
|
// context is active. If not, make this inactive.
|
||||||
if (!IsInActiveContext())
|
if (!IsInActiveContext())
|
||||||
active = FALSE;
|
active = false;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If we didn't explicitly enable or disable it,
|
// If we didn't explicitly enable or disable it,
|
||||||
// then we should make it active.
|
// then we should make it active.
|
||||||
if (!explicitlyEnabled && !explicitlyDisabled)
|
if (!explicitlyEnabled && !explicitlyDisabled)
|
||||||
active = TRUE;
|
active = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetActive(active);
|
SetActive(active);
|
||||||
@@ -798,7 +798,7 @@ void ctConfigItem::PropagateRadioButton(wxList& considered)
|
|||||||
ctConfigItem* child = (ctConfigItem*) node->GetData();
|
ctConfigItem* child = (ctConfigItem*) node->GetData();
|
||||||
if (child->IsEnabled() && child != this)
|
if (child->IsEnabled() && child != this)
|
||||||
{
|
{
|
||||||
child->Enable(FALSE);
|
child->Enable(false);
|
||||||
child->Sync();
|
child->Sync();
|
||||||
|
|
||||||
if (!considered.Member(child))
|
if (!considered.Member(child))
|
||||||
|
@@ -179,19 +179,19 @@ public:
|
|||||||
bool IsModified() const { return m_modified; }
|
bool IsModified() const { return m_modified; }
|
||||||
|
|
||||||
/// Mark this as 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)
|
/// Is this item enabled? (checked/unchecked)
|
||||||
bool IsEnabled() const { return m_enabled; }
|
bool IsEnabled() const { return m_enabled; }
|
||||||
|
|
||||||
/// Enable or disable (check/uncheck)
|
/// 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)
|
/// Is this item active? (sensitive to user input)
|
||||||
bool IsActive() const { return m_active; }
|
bool IsActive() const { return m_active; }
|
||||||
|
|
||||||
/// Make this (in)active
|
/// Make this (in)active
|
||||||
void SetActive(bool active = TRUE) { m_active = active; }
|
void SetActive(bool active = true) { m_active = active; }
|
||||||
|
|
||||||
/// Set the type
|
/// Set the type
|
||||||
void SetType(ctConfigType type) { m_type = type; }
|
void SetType(ctConfigType type) { m_type = type; }
|
||||||
|
@@ -81,7 +81,7 @@ void ctConfigItemsSelector::CreateControls()
|
|||||||
|
|
||||||
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
||||||
item1->SetSizer(item2);
|
item1->SetSizer(item2);
|
||||||
item1->SetAutoLayout(TRUE);
|
item1->SetAutoLayout(true);
|
||||||
|
|
||||||
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
|
||||||
item2->Add(item3, 1, wxGROW|wxALL, 5);
|
item2->Add(item3, 1, wxGROW|wxALL, 5);
|
||||||
@@ -93,7 +93,7 @@ void ctConfigItemsSelector::CreateControls()
|
|||||||
item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
|
item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5);
|
||||||
|
|
||||||
wxString* item6Strings = NULL;
|
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);
|
item3->Add(item6, 1, wxGROW|wxALL, 5);
|
||||||
|
|
||||||
wxStaticText* item7 = new wxStaticText(item1, wxID_STATIC, _("&List of configuration items:"), wxDefaultPosition, wxDefaultSize, 0);
|
wxStaticText* item7 = new wxStaticText(item1, wxID_STATIC, _("&List of configuration items:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
@@ -103,7 +103,7 @@ void ctConfigItemsSelector::CreateControls()
|
|||||||
item3->Add(item8, 0, wxGROW, 5);
|
item3->Add(item8, 0, wxGROW, 5);
|
||||||
|
|
||||||
wxString* item9Strings = NULL;
|
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);
|
item8->Add(item9, 1, wxGROW|wxALL, 5);
|
||||||
|
|
||||||
wxBoxSizer* item10 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item10 = new wxBoxSizer(wxVERTICAL);
|
||||||
@@ -189,7 +189,7 @@ void ctConfigItemsSelector::OnOk( wxCommandEvent& event )
|
|||||||
|
|
||||||
bool ctConfigItemsSelector::ShowToolTips()
|
bool ctConfigItemsSelector::ShowToolTips()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
/*!
|
/*!
|
||||||
* Update event handler for ID_CONFIG_ADD
|
* Update event handler for ID_CONFIG_ADD
|
||||||
@@ -221,22 +221,22 @@ void ctConfigItemsSelector::InitSourceConfigList(ctConfigItem* item)
|
|||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool addIt = FALSE;
|
bool addIt = false;
|
||||||
|
|
||||||
if (item->GetType() == ctTypeGroup)
|
if (item->GetType() == ctTypeGroup)
|
||||||
addIt = FALSE;
|
addIt = false;
|
||||||
else if (item->GetType() == ctTypeCheckGroup)
|
else if (item->GetType() == ctTypeCheckGroup)
|
||||||
addIt = TRUE;
|
addIt = true;
|
||||||
else if (item->GetType() == ctTypeRadioGroup)
|
else if (item->GetType() == ctTypeRadioGroup)
|
||||||
addIt = TRUE;
|
addIt = true;
|
||||||
else if (item->GetType() == ctTypeString)
|
else if (item->GetType() == ctTypeString)
|
||||||
addIt = TRUE;
|
addIt = true;
|
||||||
else if (item->GetType() == ctTypeBoolCheck)
|
else if (item->GetType() == ctTypeBoolCheck)
|
||||||
addIt = TRUE;
|
addIt = true;
|
||||||
else if (item->GetType() == ctTypeBoolRadio)
|
else if (item->GetType() == ctTypeBoolRadio)
|
||||||
addIt = TRUE;
|
addIt = true;
|
||||||
else if (item->GetType() == ctTypeInteger)
|
else if (item->GetType() == ctTypeInteger)
|
||||||
addIt = TRUE;
|
addIt = true;
|
||||||
if (addIt)
|
if (addIt)
|
||||||
{
|
{
|
||||||
masterList->Append(item->GetName());
|
masterList->Append(item->GetName());
|
||||||
|
@@ -52,7 +52,7 @@ class ctConfigItemsSelector: public wxDialog
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// 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
|
/// Creates the controls and sizers
|
||||||
void CreateControls();
|
void CreateControls();
|
||||||
|
@@ -90,24 +90,24 @@ bool ctConfigToolDoc::OnCloseDocument()
|
|||||||
UpdateAllViews (NULL, & hint);
|
UpdateAllViews (NULL, & hint);
|
||||||
|
|
||||||
DeleteItems();
|
DeleteItems();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Saves the doc
|
// Saves the doc
|
||||||
bool ctConfigToolDoc::Save()
|
bool ctConfigToolDoc::Save()
|
||||||
{
|
{
|
||||||
if (!IsModified() && m_savedYet) return TRUE;
|
if (!IsModified() && m_savedYet) return true;
|
||||||
|
|
||||||
bool ret = (m_documentFile == wxT("") || !m_savedYet) ?
|
bool ret = (m_documentFile == wxT("") || !m_savedYet) ?
|
||||||
SaveAs() :
|
SaveAs() :
|
||||||
OnSaveDocument(m_documentFile);
|
OnSaveDocument(m_documentFile);
|
||||||
if ( ret )
|
if ( ret )
|
||||||
SetDocumentSaved(TRUE);
|
SetDocumentSaved(true);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,8 +136,8 @@ bool ctConfigToolDoc::OnCreate(const wxString& path, long flags)
|
|||||||
|
|
||||||
SetTopItem(rootItem);
|
SetTopItem(rootItem);
|
||||||
|
|
||||||
Modify(FALSE);
|
Modify(false);
|
||||||
SetDocumentSaved(FALSE);
|
SetDocumentSaved(false);
|
||||||
|
|
||||||
wxString rootName(wxT("untitled"));
|
wxString rootName(wxT("untitled"));
|
||||||
wxStripExtension(rootName);
|
wxStripExtension(rootName);
|
||||||
@@ -156,7 +156,7 @@ bool ctConfigToolDoc::OnCreate(const wxString& path, long flags)
|
|||||||
ctConfigToolHint hint(NULL, ctInitialUpdate);
|
ctConfigToolHint hint(NULL, ctInitialUpdate);
|
||||||
UpdateAllViews (NULL, & hint);
|
UpdateAllViews (NULL, & hint);
|
||||||
|
|
||||||
SetFilename(GetFilename(), TRUE);
|
SetFilename(GetFilename(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return success;
|
return success;
|
||||||
@@ -181,7 +181,7 @@ bool ctConfigToolDoc::OnSaveDocument(const wxString& filename)
|
|||||||
if (wxFileExists(tempFilename))
|
if (wxFileExists(tempFilename))
|
||||||
wxRemoveFile(tempFilename);
|
wxRemoveFile(tempFilename);
|
||||||
|
|
||||||
bool leaveBackup = TRUE;
|
bool leaveBackup = true;
|
||||||
|
|
||||||
bool saved = DoSave(tempFilename);
|
bool saved = DoSave(tempFilename);
|
||||||
|
|
||||||
@@ -219,9 +219,9 @@ bool ctConfigToolDoc::OnSaveDocument(const wxString& filename)
|
|||||||
wxRemoveFile(tempFilename);
|
wxRemoveFile(tempFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
Modify(FALSE);
|
Modify(false);
|
||||||
((ctConfigToolView*)GetFirstView())->OnChangeFilename();
|
((ctConfigToolView*)GetFirstView())->OnChangeFilename();
|
||||||
SetDocumentSaved(TRUE);
|
SetDocumentSaved(true);
|
||||||
SetFilename(filename);
|
SetFilename(filename);
|
||||||
wxGetApp().GetSettings().m_lastFilename = filename;
|
wxGetApp().GetSettings().m_lastFilename = filename;
|
||||||
} else
|
} else
|
||||||
@@ -253,7 +253,7 @@ bool ctConfigToolDoc::OnOpenDocument(const wxString& filename)
|
|||||||
UpdateAllViews (NULL, & hint);
|
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;
|
return opened;
|
||||||
}
|
}
|
||||||
@@ -263,7 +263,7 @@ bool ctConfigToolDoc::DoSave(const wxString& filename)
|
|||||||
{
|
{
|
||||||
wxFileOutputStream stream(filename);
|
wxFileOutputStream stream(filename);
|
||||||
if (!stream.Ok())
|
if (!stream.Ok())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
stream << wxT("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
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("<settings xmlns=\"http://www.wxwidgets.org/wxs\" version=\"2.5.0.1\">");
|
||||||
@@ -272,7 +272,7 @@ bool ctConfigToolDoc::DoSave(const wxString& filename)
|
|||||||
|
|
||||||
stream << wxT("\n</settings>\n");
|
stream << wxT("\n</settings>\n");
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static void OutputIndentation(wxOutputStream& stream, int indent)
|
inline static void OutputIndentation(wxOutputStream& stream, int indent)
|
||||||
@@ -368,7 +368,7 @@ bool ctConfigToolDoc::DoSave(ctConfigItem* item, wxOutputStream& stream, int ind
|
|||||||
OutputIndentation(stream, indent*2);
|
OutputIndentation(stream, indent*2);
|
||||||
stream << wxT("</setting>");
|
stream << wxT("</setting>");
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Open the settings file
|
/// Open the settings file
|
||||||
@@ -389,20 +389,20 @@ bool ctConfigToolDoc::DoOpen(const wxString& filename)
|
|||||||
wxSimpleHtmlTag* firstSettingTag = settingsTag->GetChildren();
|
wxSimpleHtmlTag* firstSettingTag = settingsTag->GetChildren();
|
||||||
if (firstSettingTag)
|
if (firstSettingTag)
|
||||||
DoOpen(firstSettingTag, NULL);
|
DoOpen(firstSettingTag, NULL);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool GetHtmlBoolValue(const wxString& value)
|
static bool GetHtmlBoolValue(const wxString& value)
|
||||||
{
|
{
|
||||||
if (value == wxT("true") || value == wxT("TRUE") || value == wxT("1"))
|
if (value == wxT("true") || value == wxT("TRUE") || value == wxT("1"))
|
||||||
return TRUE;
|
return true;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int GetHtmlIntegerValue(const wxString& value)
|
static int GetHtmlIntegerValue(const wxString& value)
|
||||||
@@ -506,7 +506,7 @@ bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent)
|
|||||||
childTag->GetAttributeValue(description, wxT("description"));
|
childTag->GetAttributeValue(description, wxT("description"));
|
||||||
|
|
||||||
if (type == wxT("bool"))
|
if (type == wxT("bool"))
|
||||||
prop->GetVariant() = wxVariant((bool) FALSE, name);
|
prop->GetVariant() = wxVariant(false, name);
|
||||||
else if (type == wxT("double"))
|
else if (type == wxT("double"))
|
||||||
prop->GetVariant() = wxVariant((double) 0.0, name);
|
prop->GetVariant() = wxVariant((double) 0.0, name);
|
||||||
else if (type == wxT("long"))
|
else if (type == wxT("long"))
|
||||||
@@ -514,7 +514,7 @@ bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent)
|
|||||||
else
|
else
|
||||||
prop->GetVariant() = wxVariant(wxT(""), name);
|
prop->GetVariant() = wxVariant(wxT(""), name);
|
||||||
prop->SetDescription(description);
|
prop->SetDescription(description);
|
||||||
prop->SetCustom(TRUE);
|
prop->SetCustom(true);
|
||||||
prop->SetEditorType(editorType);
|
prop->SetEditorType(editorType);
|
||||||
if (!choices.IsEmpty())
|
if (!choices.IsEmpty())
|
||||||
{
|
{
|
||||||
@@ -532,7 +532,7 @@ bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent)
|
|||||||
else if (prop->GetVariant().GetType() == wxT("long"))
|
else if (prop->GetVariant().GetType() == wxT("long"))
|
||||||
prop->GetVariant() = (long) GetHtmlIntegerValue(childTag->GetNext()->GetTagText());
|
prop->GetVariant() = (long) GetHtmlIntegerValue(childTag->GetNext()->GetTagText());
|
||||||
else if (prop->GetVariant().GetType() == wxT("bool"))
|
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"))
|
else if (prop->GetVariant().GetType() == wxT("double"))
|
||||||
prop->GetVariant() = (double) GetHtmlDoubleValue(childTag->GetNext()->GetTagText());
|
prop->GetVariant() = (double) GetHtmlDoubleValue(childTag->GetNext()->GetTagText());
|
||||||
}
|
}
|
||||||
@@ -541,7 +541,7 @@ bool ctConfigToolDoc::DoOpen(wxSimpleHtmlTag* tag, ctConfigItem* parent)
|
|||||||
}
|
}
|
||||||
childTag = childTag->GetNext();
|
childTag = childTag->GetNext();
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Clear dependencies
|
/// Clear dependencies
|
||||||
@@ -679,8 +679,8 @@ wxString ctConfigToolDoc::GenerateConfigureCommand()
|
|||||||
wxString str;
|
wxString str;
|
||||||
str << wxT("# configurewx\n# Generated by wxConfigTool\n\n");
|
str << wxT("# configurewx\n# Generated by wxConfigTool\n\n");
|
||||||
|
|
||||||
wxString path = GetFrameworkDir(TRUE);
|
wxString path = GetFrameworkDir(true);
|
||||||
bool makeUnix = TRUE;
|
bool makeUnix = true;
|
||||||
if (!path.IsEmpty())
|
if (!path.IsEmpty())
|
||||||
{
|
{
|
||||||
if (makeUnix)
|
if (makeUnix)
|
||||||
@@ -846,7 +846,7 @@ ctConfigItem* ctConfigToolDoc::FindNextSibling(ctConfigItem* item)
|
|||||||
ctConfigCommand::ctConfigCommand(const wxString& name, int cmdId,
|
ctConfigCommand::ctConfigCommand(const wxString& name, int cmdId,
|
||||||
ctConfigItem* activeState, ctConfigItem* savedState,
|
ctConfigItem* activeState, ctConfigItem* savedState,
|
||||||
ctConfigItem* parent, ctConfigItem* insertBefore,
|
ctConfigItem* parent, ctConfigItem* insertBefore,
|
||||||
bool ignoreFirstTime): wxCommand(TRUE, name)
|
bool ignoreFirstTime): wxCommand(true, name)
|
||||||
{
|
{
|
||||||
m_activeState = activeState;
|
m_activeState = activeState;
|
||||||
m_savedState = savedState;
|
m_savedState = savedState;
|
||||||
@@ -859,7 +859,7 @@ ctConfigCommand::ctConfigCommand(const wxString& name, int cmdId,
|
|||||||
|
|
||||||
ctConfigCommand::ctConfigCommand(const wxString& name, int cmdId,
|
ctConfigCommand::ctConfigCommand(const wxString& name, int cmdId,
|
||||||
ctConfigItem* activeState, ctProperties* properties,
|
ctConfigItem* activeState, ctProperties* properties,
|
||||||
bool ignoreFirstTime): wxCommand(TRUE, name)
|
bool ignoreFirstTime): wxCommand(true, name)
|
||||||
{
|
{
|
||||||
m_activeState = activeState;
|
m_activeState = activeState;
|
||||||
m_savedState = NULL;
|
m_savedState = NULL;
|
||||||
@@ -881,12 +881,12 @@ ctConfigCommand::~ctConfigCommand()
|
|||||||
|
|
||||||
bool ctConfigCommand::Do()
|
bool ctConfigCommand::Do()
|
||||||
{
|
{
|
||||||
return DoAndUndo(TRUE);
|
return DoAndUndo(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ctConfigCommand::Undo()
|
bool ctConfigCommand::Undo()
|
||||||
{
|
{
|
||||||
return DoAndUndo(FALSE);
|
return DoAndUndo(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combine Do and Undo into one
|
// Combine Do and Undo into one
|
||||||
@@ -914,7 +914,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
|
|||||||
m_savedState = m_activeState;
|
m_savedState = m_activeState;
|
||||||
m_activeState = NULL;
|
m_activeState = NULL;
|
||||||
|
|
||||||
m_savedState->GetDocument()->Modify(TRUE);
|
m_savedState->GetDocument()->Modify(true);
|
||||||
ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView();
|
ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView();
|
||||||
view->OnChangeFilename();
|
view->OnChangeFilename();
|
||||||
}
|
}
|
||||||
@@ -923,7 +923,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
|
|||||||
wxASSERT(m_savedState != NULL);
|
wxASSERT(m_savedState != NULL);
|
||||||
wxASSERT(m_activeState == NULL);
|
wxASSERT(m_activeState == NULL);
|
||||||
|
|
||||||
m_savedState->GetDocument()->Modify(TRUE);
|
m_savedState->GetDocument()->Modify(true);
|
||||||
m_savedState->Attach(m_parent, m_insertBefore);
|
m_savedState->Attach(m_parent, m_insertBefore);
|
||||||
ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView();
|
ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView();
|
||||||
view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState);
|
view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState);
|
||||||
@@ -942,7 +942,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
|
|||||||
wxASSERT(m_savedState != NULL);
|
wxASSERT(m_savedState != NULL);
|
||||||
wxASSERT(m_activeState == NULL);
|
wxASSERT(m_activeState == NULL);
|
||||||
|
|
||||||
m_savedState->GetDocument()->Modify(TRUE);
|
m_savedState->GetDocument()->Modify(true);
|
||||||
m_savedState->Attach(m_parent, m_insertBefore);
|
m_savedState->Attach(m_parent, m_insertBefore);
|
||||||
ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView();
|
ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView();
|
||||||
view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState);
|
view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState);
|
||||||
@@ -956,7 +956,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
|
|||||||
wxASSERT(m_savedState == NULL);
|
wxASSERT(m_savedState == NULL);
|
||||||
wxASSERT(m_activeState != NULL);
|
wxASSERT(m_activeState != NULL);
|
||||||
|
|
||||||
m_activeState->GetDocument()->Modify(TRUE);
|
m_activeState->GetDocument()->Modify(true);
|
||||||
ctConfigToolView* view = (ctConfigToolView*) m_activeState->GetDocument()->GetFirstView();
|
ctConfigToolView* view = (ctConfigToolView*) m_activeState->GetDocument()->GetFirstView();
|
||||||
m_activeState->Detach();
|
m_activeState->Detach();
|
||||||
m_savedState = m_activeState;
|
m_savedState = m_activeState;
|
||||||
@@ -972,7 +972,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
|
|||||||
wxASSERT(m_savedState != NULL);
|
wxASSERT(m_savedState != NULL);
|
||||||
wxASSERT(m_activeState == NULL);
|
wxASSERT(m_activeState == NULL);
|
||||||
|
|
||||||
m_savedState->GetDocument()->Modify(TRUE);
|
m_savedState->GetDocument()->Modify(true);
|
||||||
m_savedState->Attach(m_parent, m_insertBefore);
|
m_savedState->Attach(m_parent, m_insertBefore);
|
||||||
ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView();
|
ctConfigToolView* view = (ctConfigToolView*) m_savedState->GetDocument()->GetFirstView();
|
||||||
view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState);
|
view->AddItems(wxGetApp().GetMainFrame()->GetConfigTreeCtrl(), m_savedState);
|
||||||
@@ -986,7 +986,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
|
|||||||
wxASSERT(m_savedState == NULL);
|
wxASSERT(m_savedState == NULL);
|
||||||
wxASSERT(m_activeState != NULL);
|
wxASSERT(m_activeState != NULL);
|
||||||
|
|
||||||
m_activeState->GetDocument()->Modify(TRUE);
|
m_activeState->GetDocument()->Modify(true);
|
||||||
m_activeState->Detach();
|
m_activeState->Detach();
|
||||||
m_savedState = m_activeState;
|
m_savedState = m_activeState;
|
||||||
m_activeState = NULL;
|
m_activeState = NULL;
|
||||||
@@ -1021,7 +1021,7 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
|
|||||||
}
|
}
|
||||||
node = node->GetNext();
|
node = node->GetNext();
|
||||||
}
|
}
|
||||||
m_activeState->GetDocument()->Modify(TRUE);
|
m_activeState->GetDocument()->Modify(true);
|
||||||
ctConfigToolView* view = (ctConfigToolView*) m_activeState->GetDocument()->GetFirstView();
|
ctConfigToolView* view = (ctConfigToolView*) m_activeState->GetDocument()->GetFirstView();
|
||||||
if (view)
|
if (view)
|
||||||
{
|
{
|
||||||
@@ -1029,12 +1029,12 @@ bool ctConfigCommand::DoAndUndo(bool doCmd)
|
|||||||
m_activeState->GetDocument()->UpdateAllViews (NULL, & hint);
|
m_activeState->GetDocument()->UpdateAllViews (NULL, & hint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_ignoreThis = FALSE;
|
m_ignoreThis = false;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPLEMENT_CLASS(ctConfiguration, wxObject)
|
IMPLEMENT_CLASS(ctConfiguration, wxObject)
|
||||||
|
@@ -39,7 +39,7 @@ public:
|
|||||||
virtual bool OnCreate(const wxString& path, long flags);
|
virtual bool OnCreate(const wxString& path, long flags);
|
||||||
virtual bool OnOpenDocument(const wxString& filename);
|
virtual bool OnOpenDocument(const wxString& filename);
|
||||||
virtual bool OnSaveDocument(const wxString& filename);
|
virtual bool OnSaveDocument(const wxString& filename);
|
||||||
virtual bool OnNewDocument() { return TRUE; }
|
virtual bool OnNewDocument() { return true; }
|
||||||
virtual bool OnCloseDocument() ;
|
virtual bool OnCloseDocument() ;
|
||||||
virtual bool Save(); // Overridden only to correct bug in wxWidgets, docview.cpp
|
virtual bool Save(); // Overridden only to correct bug in wxWidgets, docview.cpp
|
||||||
|
|
||||||
@@ -260,10 +260,10 @@ public:
|
|||||||
ctConfigCommand(const wxString& name, int cmdId,
|
ctConfigCommand(const wxString& name, int cmdId,
|
||||||
ctConfigItem* activeState, ctConfigItem* savedState,
|
ctConfigItem* activeState, ctConfigItem* savedState,
|
||||||
ctConfigItem* parent = NULL, ctConfigItem* insertBefore = NULL,
|
ctConfigItem* parent = NULL, ctConfigItem* insertBefore = NULL,
|
||||||
bool ignoreFirstTime = FALSE);
|
bool ignoreFirstTime = false);
|
||||||
ctConfigCommand(const wxString& name, int cmdId,
|
ctConfigCommand(const wxString& name, int cmdId,
|
||||||
ctConfigItem* activeState, ctProperties* properties,
|
ctConfigItem* activeState, ctProperties* properties,
|
||||||
bool ignoreFirstTime = FALSE);
|
bool ignoreFirstTime = false);
|
||||||
~ctConfigCommand();
|
~ctConfigCommand();
|
||||||
|
|
||||||
bool Do();
|
bool Do();
|
||||||
|
@@ -81,7 +81,7 @@ BEGIN_EVENT_TABLE(ctConfigToolView, wxView)
|
|||||||
EVT_UPDATE_UI(ctID_EDIT_CUSTOM_PROPERTY, ctConfigToolView::OnUpdateEditCustomProperty)
|
EVT_UPDATE_UI(ctID_EDIT_CUSTOM_PROPERTY, ctConfigToolView::OnUpdateEditCustomProperty)
|
||||||
EVT_UPDATE_UI(ctID_DELETE_CUSTOM_PROPERTY, ctConfigToolView::OnUpdateDeleteCustomProperty)
|
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_SETUP_FILE, ctConfigToolView::OnSaveSetupFile)
|
||||||
EVT_MENU(ctID_SAVE_CONFIGURE_COMMAND, ctConfigToolView::OnSaveConfigureCommand)
|
EVT_MENU(ctID_SAVE_CONFIGURE_COMMAND, ctConfigToolView::OnSaveConfigureCommand)
|
||||||
@@ -104,12 +104,12 @@ ctConfigToolView::ctConfigToolView()
|
|||||||
// windows for displaying the view.
|
// windows for displaying the view.
|
||||||
bool ctConfigToolView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
|
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()->SetDocument((ctConfigToolDoc*) doc);
|
||||||
wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument((ctConfigToolDoc*) doc) ;
|
wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument((ctConfigToolDoc*) doc) ;
|
||||||
wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument((ctConfigToolDoc*) doc) ;
|
wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument((ctConfigToolDoc*) doc) ;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctConfigToolView::OnDraw(wxDC *WXUNUSED(dc))
|
void ctConfigToolView::OnDraw(wxDC *WXUNUSED(dc))
|
||||||
@@ -193,20 +193,20 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj)
|
|||||||
bool ctConfigToolView::OnClose(bool WXUNUSED(deleteWindow))
|
bool ctConfigToolView::OnClose(bool WXUNUSED(deleteWindow))
|
||||||
{
|
{
|
||||||
if (!GetDocument()->Close())
|
if (!GetDocument()->Close())
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
ctConfigToolHint hint(NULL, ctClear);
|
ctConfigToolHint hint(NULL, ctClear);
|
||||||
GetDocument()->UpdateAllViews (NULL, & hint);
|
GetDocument()->UpdateAllViews (NULL, & hint);
|
||||||
|
|
||||||
wxGetApp().GetDocManager()->ActivateView(this, FALSE);
|
wxGetApp().GetDocManager()->ActivateView(this, false);
|
||||||
|
|
||||||
Activate(FALSE);
|
Activate(false);
|
||||||
|
|
||||||
wxGetApp().GetMainFrame()->SetDocument(NULL);
|
wxGetApp().GetMainFrame()->SetDocument(NULL);
|
||||||
wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ;
|
wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ;
|
||||||
wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ;
|
wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ;
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctConfigToolView::OnChangeFilename()
|
void ctConfigToolView::OnChangeFilename()
|
||||||
@@ -235,12 +235,12 @@ void ctConfigToolView::OnChangeFilename()
|
|||||||
// General disabler
|
// General disabler
|
||||||
void ctConfigToolView::OnUpdateDisable(wxUpdateUIEvent& event)
|
void ctConfigToolView::OnUpdateDisable(wxUpdateUIEvent& event)
|
||||||
{
|
{
|
||||||
event.Enable( FALSE );
|
event.Enable( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctConfigToolView::OnUpdateAddItem(wxUpdateUIEvent& event)
|
void ctConfigToolView::OnUpdateAddItem(wxUpdateUIEvent& event)
|
||||||
{
|
{
|
||||||
event.Enable( TRUE );
|
event.Enable( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add item and its children to the tree
|
/// Add item and its children to the tree
|
||||||
@@ -349,7 +349,7 @@ void ctConfigToolView::OnIconLeftDown(ctConfigTreeCtrl* treeControl, ctConfigIte
|
|||||||
|
|
||||||
item->Enable(!item->IsEnabled());
|
item->Enable(!item->IsEnabled());
|
||||||
|
|
||||||
GetDocument()->Modify(TRUE);
|
GetDocument()->Modify(true);
|
||||||
OnChangeFilename();
|
OnChangeFilename();
|
||||||
|
|
||||||
SyncItem(treeControl, item);
|
SyncItem(treeControl, item);
|
||||||
@@ -714,7 +714,7 @@ void ctConfigToolView::OnAddCustomProperty(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (doc && sel && editor)
|
if (doc && sel && editor)
|
||||||
{
|
{
|
||||||
ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
|
ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
|
||||||
-1, _("Add a custom property"));
|
wxID_ANY, _("Add a custom property"));
|
||||||
if (dialog.ShowModal() == wxID_OK)
|
if (dialog.ShowModal() == wxID_OK)
|
||||||
{
|
{
|
||||||
wxString name = dialog.GetPropertyName();
|
wxString name = dialog.GetPropertyName();
|
||||||
@@ -731,14 +731,14 @@ void ctConfigToolView::OnAddCustomProperty(wxCommandEvent& WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
ctProperty* property = new ctProperty;
|
ctProperty* property = new ctProperty;
|
||||||
if (type == wxT("bool"))
|
if (type == wxT("bool"))
|
||||||
property->GetVariant() = wxVariant((bool) FALSE, name);
|
property->GetVariant() = wxVariant(false, name);
|
||||||
else if (type == wxT("double"))
|
else if (type == wxT("double"))
|
||||||
property->GetVariant() = wxVariant((double) 0.0, name);
|
property->GetVariant() = wxVariant((double) 0.0, name);
|
||||||
else if (type == wxT("long"))
|
else if (type == wxT("long"))
|
||||||
property->GetVariant() = wxVariant((long) 0, name);
|
property->GetVariant() = wxVariant((long) 0, name);
|
||||||
else
|
else
|
||||||
property->GetVariant() = wxVariant(wxT(""), name);
|
property->GetVariant() = wxVariant(wxT(""), name);
|
||||||
property->SetCustom(TRUE);
|
property->SetCustom(true);
|
||||||
property->SetDescription(descr);
|
property->SetDescription(descr);
|
||||||
property->SetChoices(choices);
|
property->SetChoices(choices);
|
||||||
property->SetEditorType(editorType);
|
property->SetEditorType(editorType);
|
||||||
@@ -769,7 +769,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
|
|||||||
wxArrayString oldChoices = property->GetChoices();
|
wxArrayString oldChoices = property->GetChoices();
|
||||||
|
|
||||||
ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
|
ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(),
|
||||||
-1, _("Edit custom property"));
|
wxID_ANY, _("Edit custom property"));
|
||||||
dialog.SetPropertyName(oldName);
|
dialog.SetPropertyName(oldName);
|
||||||
dialog.SetPropertyType(oldType);
|
dialog.SetPropertyType(oldType);
|
||||||
dialog.SetPropertyDescription(oldDescription);
|
dialog.SetPropertyDescription(oldDescription);
|
||||||
@@ -790,7 +790,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (type != oldType)
|
if (type != oldType)
|
||||||
{
|
{
|
||||||
if (type == wxT("bool"))
|
if (type == wxT("bool"))
|
||||||
property->GetVariant() = wxVariant((bool) FALSE, name);
|
property->GetVariant() = wxVariant(false, name);
|
||||||
else if (type == wxT("double"))
|
else if (type == wxT("double"))
|
||||||
property->GetVariant() = wxVariant((double) 0.0, name);
|
property->GetVariant() = wxVariant((double) 0.0, name);
|
||||||
else if (type == wxT("long"))
|
else if (type == wxT("long"))
|
||||||
@@ -810,7 +810,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event))
|
|||||||
if (name != oldName)
|
if (name != oldName)
|
||||||
property->GetVariant().SetName(name);
|
property->GetVariant().SetName(name);
|
||||||
|
|
||||||
property->SetCustom(TRUE);
|
property->SetCustom(true);
|
||||||
|
|
||||||
if (descr != oldDescription)
|
if (descr != oldDescription)
|
||||||
property->SetDescription(descr);
|
property->SetDescription(descr);
|
||||||
@@ -916,7 +916,7 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event))
|
|||||||
wxString filename = _T("setup.h");
|
wxString filename = _T("setup.h");
|
||||||
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
|
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
|
||||||
if (path.IsEmpty())
|
if (path.IsEmpty())
|
||||||
path = doc->GetFrameworkDir(FALSE);
|
path = doc->GetFrameworkDir(false);
|
||||||
wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*");
|
wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*");
|
||||||
|
|
||||||
wxFileDialog dialog(wxTheApp->GetTopWindow(),
|
wxFileDialog dialog(wxTheApp->GetTopWindow(),
|
||||||
@@ -948,7 +948,7 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
|
|||||||
wxString filename = _T("configurewx.sh");
|
wxString filename = _T("configurewx.sh");
|
||||||
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
|
wxString path = wxGetApp().GetSettings().m_lastSetupSaveDir;
|
||||||
if (path.IsEmpty())
|
if (path.IsEmpty())
|
||||||
path = doc->GetFrameworkDir(FALSE);
|
path = doc->GetFrameworkDir(false);
|
||||||
wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*");
|
wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*");
|
||||||
|
|
||||||
wxFileDialog dialog(wxTheApp->GetTopWindow(),
|
wxFileDialog dialog(wxTheApp->GetTopWindow(),
|
||||||
@@ -974,12 +974,12 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event)
|
void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event)
|
||||||
{
|
{
|
||||||
event.Enable(TRUE);
|
event.Enable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctConfigToolView::OnUpdateSaveConfigureCommand(wxUpdateUIEvent& event)
|
void ctConfigToolView::OnUpdateSaveConfigureCommand(wxUpdateUIEvent& event)
|
||||||
{
|
{
|
||||||
event.Enable(TRUE);
|
event.Enable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find text
|
/// Find text
|
||||||
@@ -1004,14 +1004,14 @@ void ctConfigToolView::OnFind(wxCommandEvent& WXUNUSED(event))
|
|||||||
ctFindReplaceDialog::sm_findData.SetFlags(flags);
|
ctFindReplaceDialog::sm_findData.SetFlags(flags);
|
||||||
|
|
||||||
dialog = new ctFindReplaceDialog(wxGetApp().GetMainFrame(), caption, style);
|
dialog = new ctFindReplaceDialog(wxGetApp().GetMainFrame(), caption, style);
|
||||||
dialog->Show(TRUE);
|
dialog->Show(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Update find text
|
/// Update find text
|
||||||
void ctConfigToolView::OnUpdateFind(wxUpdateUIEvent& event)
|
void ctConfigToolView::OnUpdateFind(wxUpdateUIEvent& event)
|
||||||
{
|
{
|
||||||
event.Enable(TRUE);
|
event.Enable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Save default file type
|
/// Save default file type
|
||||||
@@ -1088,9 +1088,9 @@ void ctConfigToolView::OnUpdateGo(wxUpdateUIEvent& event)
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(ctFindReplaceDialog, wxFindReplaceDialog)
|
BEGIN_EVENT_TABLE(ctFindReplaceDialog, wxFindReplaceDialog)
|
||||||
EVT_FIND(-1, ctFindReplaceDialog::OnFind)
|
EVT_FIND(wxID_ANY, ctFindReplaceDialog::OnFind)
|
||||||
EVT_FIND_NEXT(-1, ctFindReplaceDialog::OnFind)
|
EVT_FIND_NEXT(wxID_ANY, ctFindReplaceDialog::OnFind)
|
||||||
EVT_FIND_CLOSE(-1, ctFindReplaceDialog::OnClose)
|
EVT_FIND_CLOSE(wxID_ANY, ctFindReplaceDialog::OnClose)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
wxFindReplaceData ctFindReplaceDialog::sm_findData;
|
wxFindReplaceData ctFindReplaceDialog::sm_findData;
|
||||||
@@ -1125,7 +1125,7 @@ bool ctFindReplaceDialog::DoFind(const wxString& textToFind, bool matchCase, boo
|
|||||||
{
|
{
|
||||||
ctConfigToolDoc* doc = wxGetApp().GetMainFrame()->GetDocument();
|
ctConfigToolDoc* doc = wxGetApp().GetMainFrame()->GetDocument();
|
||||||
if (!doc)
|
if (!doc)
|
||||||
return FALSE;
|
return false;
|
||||||
ctConfigToolView* view = (ctConfigToolView*) doc->GetFirstView();
|
ctConfigToolView* view = (ctConfigToolView*) doc->GetFirstView();
|
||||||
|
|
||||||
ctConfigItem* currentItem = NULL;
|
ctConfigItem* currentItem = NULL;
|
||||||
@@ -1134,7 +1134,7 @@ bool ctFindReplaceDialog::DoFind(const wxString& textToFind, bool matchCase, boo
|
|||||||
{
|
{
|
||||||
focusItem = doc->GetTopItem();
|
focusItem = doc->GetTopItem();
|
||||||
if (!focusItem)
|
if (!focusItem)
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sm_currentItem.IsEmpty())
|
if (!sm_currentItem.IsEmpty())
|
||||||
@@ -1151,14 +1151,14 @@ bool ctFindReplaceDialog::DoFind(const wxString& textToFind, bool matchCase, boo
|
|||||||
{
|
{
|
||||||
sm_currentItem = currentItem->GetName();
|
sm_currentItem = currentItem->GetName();
|
||||||
wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->SelectItem(currentItem->GetTreeItemId());
|
wxGetApp().GetMainFrame()->GetConfigTreeCtrl()->SelectItem(currentItem->GetTreeItemId());
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sm_currentItem = wxEmptyString;
|
sm_currentItem = wxEmptyString;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctConfigItem* ctFindReplaceDialog::FindNextItem(ctConfigToolDoc* doc,
|
ctConfigItem* ctFindReplaceDialog::FindNextItem(ctConfigToolDoc* doc,
|
||||||
|
@@ -41,7 +41,7 @@ public:
|
|||||||
bool OnCreate(wxDocument *doc, long flags);
|
bool OnCreate(wxDocument *doc, long flags);
|
||||||
void OnDraw(wxDC *dc);
|
void OnDraw(wxDC *dc);
|
||||||
void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
|
void OnUpdate(wxView *sender, wxObject *hint = (wxObject *) NULL);
|
||||||
bool OnClose(bool deleteWindow = TRUE);
|
bool OnClose(bool deleteWindow = true);
|
||||||
void OnChangeFilename();
|
void OnChangeFilename();
|
||||||
|
|
||||||
//// Operations
|
//// Operations
|
||||||
@@ -252,9 +252,9 @@ public:
|
|||||||
void OnFind(wxFindDialogEvent& event);
|
void OnFind(wxFindDialogEvent& event);
|
||||||
void OnClose(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.
|
// 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* FindNextItem(ctConfigToolDoc* doc,
|
||||||
ctConfigItem* item,
|
ctConfigItem* item,
|
||||||
|
@@ -62,8 +62,8 @@ IMPLEMENT_CLASS(ctConfigTreeCtrl, wxTreeCtrl)
|
|||||||
BEGIN_EVENT_TABLE(ctConfigTreeCtrl, wxTreeCtrl)
|
BEGIN_EVENT_TABLE(ctConfigTreeCtrl, wxTreeCtrl)
|
||||||
EVT_MOUSE_EVENTS(ctConfigTreeCtrl::OnMouseEvent)
|
EVT_MOUSE_EVENTS(ctConfigTreeCtrl::OnMouseEvent)
|
||||||
EVT_CHAR(ctConfigTreeCtrl::OnKeyDown)
|
EVT_CHAR(ctConfigTreeCtrl::OnKeyDown)
|
||||||
EVT_TREE_SEL_CHANGED(-1, ctConfigTreeCtrl::OnSelChanged)
|
EVT_TREE_SEL_CHANGED(wxID_ANY, ctConfigTreeCtrl::OnSelChanged)
|
||||||
EVT_HELP(-1, ctConfigTreeCtrl::OnHelp)
|
EVT_HELP(wxID_ANY, ctConfigTreeCtrl::OnHelp)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
ctConfigTreeCtrl::ctConfigTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt,
|
ctConfigTreeCtrl::ctConfigTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pt,
|
||||||
@@ -88,32 +88,32 @@ wxTreeCtrl(parent, id, pt, sz, style)
|
|||||||
// Load the icons and initialize the tree
|
// Load the icons and initialize the tree
|
||||||
void ctConfigTreeCtrl::LoadIcons()
|
void ctConfigTreeCtrl::LoadIcons()
|
||||||
{
|
{
|
||||||
m_imageList = new wxImageList(16, 16, TRUE);
|
m_imageList = new wxImageList(16, 16, true);
|
||||||
m_iconTable.SetImageList(m_imageList);
|
m_iconTable.SetImageList(m_imageList);
|
||||||
SetImageList(m_imageList);
|
SetImageList(m_imageList);
|
||||||
|
|
||||||
m_iconTable.AddInfo(_T("Group"), wxIcon(closedfolder_xpm), 0, TRUE);
|
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_dis_xpm), 0, false);
|
||||||
|
|
||||||
m_iconTable.AddInfo(_T("Checkbox"), wxIcon(checked_xpm), 0, TRUE);
|
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(checked_dis_xpm), 0, false);
|
||||||
m_iconTable.AddInfo(_T("Checkbox"), wxIcon(unchecked_xpm), 1, TRUE);
|
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(unchecked_dis_xpm), 1, false);
|
||||||
|
|
||||||
m_iconTable.AddInfo(_T("CheckGroup"), wxIcon(checkedfolder_xpm), 0, TRUE);
|
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(checkedfolder_dis_xpm), 0, false);
|
||||||
m_iconTable.AddInfo(_T("CheckGroup"), wxIcon(uncheckedfolder_xpm), 1, TRUE);
|
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(uncheckedfolder_dis_xpm), 1, false);
|
||||||
|
|
||||||
m_iconTable.AddInfo(_T("RadioGroup"), wxIcon(radiofolderon_xpm), 0, TRUE);
|
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(radiofolderon_dis_xpm), 0, false);
|
||||||
m_iconTable.AddInfo(_T("RadioGroup"), wxIcon(radiofolderoff_xpm), 1, TRUE);
|
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(radiofolderoff_dis_xpm), 1, false);
|
||||||
|
|
||||||
m_iconTable.AddInfo(_T("Radiobutton"), wxIcon(radioon_xpm), 0, TRUE);
|
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(radioon_dis_xpm), 0, false);
|
||||||
m_iconTable.AddInfo(_T("Radiobutton"), wxIcon(radiooff_xpm), 1, TRUE);
|
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(radiooff_dis_xpm), 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctConfigTreeCtrl::~ctConfigTreeCtrl()
|
ctConfigTreeCtrl::~ctConfigTreeCtrl()
|
||||||
|
@@ -77,7 +77,7 @@ void ctCustomPropertyDialog::CreateControls()
|
|||||||
|
|
||||||
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
||||||
item1->SetSizer(item2);
|
item1->SetSizer(item2);
|
||||||
item1->SetAutoLayout(TRUE);
|
item1->SetAutoLayout(true);
|
||||||
|
|
||||||
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL);
|
||||||
item2->Add(item3, 1, wxGROW|wxALL, 5);
|
item2->Add(item3, 1, wxGROW|wxALL, 5);
|
||||||
@@ -128,7 +128,7 @@ void ctCustomPropertyDialog::CreateControls()
|
|||||||
item13->SetStringSelection(_("string"));
|
item13->SetStringSelection(_("string"));
|
||||||
item11->Add(item13, 1, wxGROW|wxALL, 5);
|
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);
|
wxStaticBoxSizer* item14 = new wxStaticBoxSizer(item14Static, wxHORIZONTAL);
|
||||||
item3->Add(item14, 0, wxGROW|wxALL, 5);
|
item3->Add(item14, 0, wxGROW|wxALL, 5);
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ void ctCustomPropertyDialog::CreateControls()
|
|||||||
|
|
||||||
bool ctCustomPropertyDialog::ShowToolTips()
|
bool ctCustomPropertyDialog::ShowToolTips()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@@ -53,7 +53,7 @@ class ctCustomPropertyDialog: public wxDialog
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// 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
|
/// Creates the controls and sizers
|
||||||
void CreateControls();
|
void CreateControls();
|
||||||
|
@@ -106,7 +106,7 @@ bool wxSimpleHtmlParser::ParseFile(const wxString& filename)
|
|||||||
return ParseString(text);
|
return ParseString(text);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSimpleHtmlParser::ParseString(const wxString& str)
|
bool wxSimpleHtmlParser::ParseString(const wxString& str)
|
||||||
@@ -131,7 +131,7 @@ bool wxSimpleHtmlParser::ParseString(const wxString& str)
|
|||||||
bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
|
bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
|
||||||
{
|
{
|
||||||
if (!parent)
|
if (!parent)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
while (!Eof())
|
while (!Eof())
|
||||||
{
|
{
|
||||||
@@ -160,9 +160,9 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
|
|||||||
if (IsCloseTagNeeded(tag->GetName()))
|
if (IsCloseTagNeeded(tag->GetName()))
|
||||||
{
|
{
|
||||||
if (!parent->GetParent())
|
if (!parent->GetParent())
|
||||||
return FALSE;
|
return false;
|
||||||
parent->GetParent()->AppendTag(tag);
|
parent->GetParent()->AppendTag(tag);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
parent->AppendTag(tag);
|
parent->AppendTag(tag);
|
||||||
@@ -177,7 +177,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
|
|||||||
if (IsCloseTagNeeded(tag->GetName()))
|
if (IsCloseTagNeeded(tag->GetName()))
|
||||||
{
|
{
|
||||||
if (!ParseHtml(tag))
|
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
|
else
|
||||||
@@ -195,7 +195,7 @@ bool wxSimpleHtmlParser::ParseHtml(wxSimpleHtmlTag* parent)
|
|||||||
// empty lines at the end of the file...
|
// empty lines at the end of the file...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plain text, up until an angled bracket
|
// Plain text, up until an angled bracket
|
||||||
@@ -207,7 +207,7 @@ bool wxSimpleHtmlParser::ParseText(wxString& text)
|
|||||||
m_pos ++;
|
m_pos ++;
|
||||||
}
|
}
|
||||||
DecodeSpecialChars(text);
|
DecodeSpecialChars(text);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagHeader()
|
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagHeader()
|
||||||
@@ -218,7 +218,7 @@ wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagHeader()
|
|||||||
EatWhitespace();
|
EatWhitespace();
|
||||||
|
|
||||||
wxString word;
|
wxString word;
|
||||||
ReadWord(word, TRUE);
|
ReadWord(word, true);
|
||||||
|
|
||||||
EatWhitespace();
|
EatWhitespace();
|
||||||
|
|
||||||
@@ -239,12 +239,12 @@ wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagHeader()
|
|||||||
|
|
||||||
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagClose()
|
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseTagClose()
|
||||||
{
|
{
|
||||||
Matches(wxT("</"), TRUE);
|
Matches(wxT("</"), true);
|
||||||
|
|
||||||
EatWhitespace();
|
EatWhitespace();
|
||||||
|
|
||||||
wxString word;
|
wxString word;
|
||||||
ReadWord(word, TRUE);
|
ReadWord(word, true);
|
||||||
|
|
||||||
EatWhitespace();
|
EatWhitespace();
|
||||||
m_pos ++;
|
m_pos ++;
|
||||||
@@ -264,19 +264,19 @@ bool wxSimpleHtmlParser::ParseAttributes(wxSimpleHtmlTag* tag)
|
|||||||
|
|
||||||
if (IsString())
|
if (IsString())
|
||||||
{
|
{
|
||||||
ReadString(attrName, TRUE);
|
ReadString(attrName, true);
|
||||||
tag->AppendAttribute(attrName, wxEmptyString);
|
tag->AppendAttribute(attrName, wxEmptyString);
|
||||||
}
|
}
|
||||||
else if (IsNumeric(GetChar(m_pos)))
|
else if (IsNumeric(GetChar(m_pos)))
|
||||||
{
|
{
|
||||||
ReadNumber(attrName, TRUE);
|
ReadNumber(attrName, true);
|
||||||
tag->AppendAttribute(attrName, wxEmptyString);
|
tag->AppendAttribute(attrName, wxEmptyString);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Try to read an attribute name/value pair, or at least a name
|
// Try to read an attribute name/value pair, or at least a name
|
||||||
// without the value
|
// without the value
|
||||||
ReadLiteral(attrName, TRUE);
|
ReadLiteral(attrName, true);
|
||||||
EatWhitespace();
|
EatWhitespace();
|
||||||
|
|
||||||
if (GetChar(m_pos) == wxT('='))
|
if (GetChar(m_pos) == wxT('='))
|
||||||
@@ -285,26 +285,26 @@ bool wxSimpleHtmlParser::ParseAttributes(wxSimpleHtmlTag* tag)
|
|||||||
EatWhitespace();
|
EatWhitespace();
|
||||||
|
|
||||||
if (IsString())
|
if (IsString())
|
||||||
ReadString(attrValue, TRUE);
|
ReadString(attrValue, true);
|
||||||
else if (!Eof() && !IsTagEndBracket(GetChar(m_pos)))
|
else if (!Eof() && !IsTagEndBracket(GetChar(m_pos)))
|
||||||
ReadLiteral(attrValue, TRUE);
|
ReadLiteral(attrValue, true);
|
||||||
}
|
}
|
||||||
if (!attrName.IsEmpty())
|
if (!attrName.IsEmpty())
|
||||||
tag->AppendAttribute(attrName, attrValue);
|
tag->AppendAttribute(attrName, attrValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// e.g. <!DOCTYPE ....>
|
// e.g. <!DOCTYPE ....>
|
||||||
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseDirective()
|
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseDirective()
|
||||||
{
|
{
|
||||||
Matches(wxT("<!"), TRUE);
|
Matches(wxT("<!"), true);
|
||||||
|
|
||||||
EatWhitespace();
|
EatWhitespace();
|
||||||
|
|
||||||
wxString word;
|
wxString word;
|
||||||
ReadWord(word, TRUE);
|
ReadWord(word, true);
|
||||||
|
|
||||||
EatWhitespace();
|
EatWhitespace();
|
||||||
|
|
||||||
@@ -323,12 +323,12 @@ wxSimpleHtmlTag* wxSimpleHtmlParser::ParseDirective()
|
|||||||
// e.g. <?xml .... ?>
|
// e.g. <?xml .... ?>
|
||||||
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseXMLDeclaration()
|
wxSimpleHtmlTag* wxSimpleHtmlParser::ParseXMLDeclaration()
|
||||||
{
|
{
|
||||||
Matches(wxT("<?"), TRUE);
|
Matches(wxT("<?"), true);
|
||||||
|
|
||||||
EatWhitespace();
|
EatWhitespace();
|
||||||
|
|
||||||
wxString word;
|
wxString word;
|
||||||
ReadWord(word, TRUE);
|
ReadWord(word, true);
|
||||||
|
|
||||||
EatWhitespace();
|
EatWhitespace();
|
||||||
|
|
||||||
@@ -347,28 +347,28 @@ wxSimpleHtmlTag* wxSimpleHtmlParser::ParseXMLDeclaration()
|
|||||||
bool wxSimpleHtmlParser::ParseComment()
|
bool wxSimpleHtmlParser::ParseComment()
|
||||||
{
|
{
|
||||||
// Eat the comment tag start
|
// Eat the comment tag start
|
||||||
Matches(wxT("<!--"), TRUE);
|
Matches(wxT("<!--"), true);
|
||||||
|
|
||||||
while (!Eof() && !Matches(wxT("-->"), TRUE))
|
while (!Eof() && !Matches(wxT("-->"), true))
|
||||||
{
|
{
|
||||||
m_pos ++;
|
m_pos ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSimpleHtmlParser::EatWhitespace()
|
bool wxSimpleHtmlParser::EatWhitespace()
|
||||||
{
|
{
|
||||||
while (!Eof() && IsWhitespace(GetChar(m_pos)))
|
while (!Eof() && IsWhitespace(GetChar(m_pos)))
|
||||||
m_pos ++;
|
m_pos ++;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSimpleHtmlParser::EatWhitespace(int& pos)
|
bool wxSimpleHtmlParser::EatWhitespace(int& pos)
|
||||||
{
|
{
|
||||||
while (!Eof(pos) && IsWhitespace(GetChar(pos)))
|
while (!Eof(pos) && IsWhitespace(GetChar(pos)))
|
||||||
pos ++;
|
pos ++;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSimpleHtmlParser::ReadString(wxString& str, bool eatIt)
|
bool wxSimpleHtmlParser::ReadString(wxString& str, bool eatIt)
|
||||||
@@ -388,10 +388,10 @@ bool wxSimpleHtmlParser::ReadString(wxString& str, bool eatIt)
|
|||||||
if (eatIt)
|
if (eatIt)
|
||||||
m_pos = pos;
|
m_pos = pos;
|
||||||
DecodeSpecialChars(str);
|
DecodeSpecialChars(str);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSimpleHtmlParser::ReadWord(wxString& str, bool eatIt)
|
bool wxSimpleHtmlParser::ReadWord(wxString& str, bool eatIt)
|
||||||
@@ -399,7 +399,7 @@ bool wxSimpleHtmlParser::ReadWord(wxString& str, bool eatIt)
|
|||||||
int pos = m_pos;
|
int pos = m_pos;
|
||||||
|
|
||||||
if (!IsAlpha(GetChar(pos)))
|
if (!IsAlpha(GetChar(pos)))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
str += (wxChar) GetChar(pos) ;
|
str += (wxChar) GetChar(pos) ;
|
||||||
pos ++;
|
pos ++;
|
||||||
@@ -412,7 +412,7 @@ bool wxSimpleHtmlParser::ReadWord(wxString& str, bool eatIt)
|
|||||||
if (eatIt)
|
if (eatIt)
|
||||||
m_pos = pos;
|
m_pos = pos;
|
||||||
DecodeSpecialChars(str);
|
DecodeSpecialChars(str);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSimpleHtmlParser::ReadNumber(wxString& str, bool eatIt)
|
bool wxSimpleHtmlParser::ReadNumber(wxString& str, bool eatIt)
|
||||||
@@ -420,7 +420,7 @@ bool wxSimpleHtmlParser::ReadNumber(wxString& str, bool eatIt)
|
|||||||
int pos = m_pos;
|
int pos = m_pos;
|
||||||
|
|
||||||
if (!IsNumeric(GetChar(pos)))
|
if (!IsNumeric(GetChar(pos)))
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
str += (wxChar) GetChar(pos) ;
|
str += (wxChar) GetChar(pos) ;
|
||||||
pos ++;
|
pos ++;
|
||||||
@@ -433,7 +433,7 @@ bool wxSimpleHtmlParser::ReadNumber(wxString& str, bool eatIt)
|
|||||||
if (eatIt)
|
if (eatIt)
|
||||||
m_pos = pos;
|
m_pos = pos;
|
||||||
DecodeSpecialChars(str);
|
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)
|
// Could be number, string, whatever, but read up until whitespace or end of tag (but not a quoted string)
|
||||||
@@ -449,7 +449,7 @@ bool wxSimpleHtmlParser::ReadLiteral(wxString& str, bool eatIt)
|
|||||||
if (eatIt)
|
if (eatIt)
|
||||||
m_pos = pos;
|
m_pos = pos;
|
||||||
DecodeSpecialChars(str);
|
DecodeSpecialChars(str);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSimpleHtmlParser::IsComment()
|
bool wxSimpleHtmlParser::IsComment()
|
||||||
@@ -514,12 +514,12 @@ bool wxSimpleHtmlParser::IsNumeric(int ch)
|
|||||||
|
|
||||||
bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
|
bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
|
||||||
{
|
{
|
||||||
if (name.IsSameAs(wxT("P"), FALSE)) // e.g <P>
|
if (name.IsSameAs(wxT("P"), false)) // e.g <P>
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
// ToDo add more items here.
|
// ToDo add more items here.
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Encode/Decode Special Characters.
|
// Encode/Decode Special Characters.
|
||||||
@@ -527,11 +527,11 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
|
|||||||
/* static */ void wxSimpleHtmlParser::DecodeSpecialChars(wxString &value)
|
/* static */ void wxSimpleHtmlParser::DecodeSpecialChars(wxString &value)
|
||||||
{
|
{
|
||||||
// XML translation
|
// 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);
|
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); // Note: do this as last to prevent replace problems.
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ wxString wxSimpleHtmlParser::EncodeSpecialChars(const wxString &value)
|
/* static */ wxString wxSimpleHtmlParser::EncodeSpecialChars(const wxString &value)
|
||||||
@@ -539,11 +539,11 @@ bool wxSimpleHtmlParser::IsCloseTagNeeded(const wxString &name)
|
|||||||
wxString newvalue = value;
|
wxString newvalue = value;
|
||||||
|
|
||||||
// XML translation
|
// XML translation
|
||||||
newvalue.Replace(wxT("&"), wxT("&"), TRUE); // Note: do this as first to prevent replace problems.
|
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);
|
newvalue.Replace(wxT("\""),wxT("""), true);
|
||||||
newvalue.Replace(wxT("'"), wxT("'"), TRUE);
|
newvalue.Replace(wxT("'"), wxT("'"), true);
|
||||||
|
|
||||||
return newvalue;
|
return newvalue;
|
||||||
}
|
}
|
||||||
@@ -591,10 +591,10 @@ bool wxSimpleHtmlParser::WriteFile(wxString& filename)
|
|||||||
if (fstream.Ok())
|
if (fstream.Ok())
|
||||||
{
|
{
|
||||||
Write(fstream);
|
Write(fstream);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -819,10 +819,10 @@ bool wxSimpleHtmlTag::GetAttributeValue(wxString& value, const wxString& attrNam
|
|||||||
if (attr)
|
if (attr)
|
||||||
{
|
{
|
||||||
value = attr->GetValue();
|
value = attr->GetValue();
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search forward from this tag until we find a tag with this name & attribute
|
// Search forward from this tag until we find a tag with this name & attribute
|
||||||
@@ -845,14 +845,14 @@ bool wxSimpleHtmlTag::FindTextUntilTagClose(wxString& text, const wxString& tagN
|
|||||||
while (tag)
|
while (tag)
|
||||||
{
|
{
|
||||||
if (tag->GetType() == wxSimpleHtmlTag_Close && tag->NameIs(tagName))
|
if (tag->GetType() == wxSimpleHtmlTag_Close && tag->NameIs(tagName))
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
if (tag->GetType() == wxSimpleHtmlTag_Text)
|
if (tag->GetType() == wxSimpleHtmlTag_Text)
|
||||||
text += tag->GetText();
|
text += tag->GetText();
|
||||||
|
|
||||||
tag = tag->m_next;
|
tag = tag->m_next;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -874,7 +874,7 @@ wxSimpleHtmlTag* wxSimpleHtmlTag::GetChild(int i) const
|
|||||||
void wxSimpleHtmlTag::Write(wxOutputStream& stream)
|
void wxSimpleHtmlTag::Write(wxOutputStream& stream)
|
||||||
{
|
{
|
||||||
// Some helpers to layout the open and close tags.
|
// Some helpers to layout the open and close tags.
|
||||||
static bool sbUseTab = TRUE;
|
static bool sbUseTab = true;
|
||||||
static size_t snTabLevel = 0;
|
static size_t snTabLevel = 0;
|
||||||
|
|
||||||
#if 0 // Enable if no tabs should be used to align the tags.
|
#if 0 // Enable if no tabs should be used to align the tags.
|
||||||
@@ -907,13 +907,13 @@ void wxSimpleHtmlTag::Write(wxOutputStream& stream)
|
|||||||
}
|
}
|
||||||
if(!m_children)
|
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
|
// so we don't wan't any tabs
|
||||||
stream << wxT(">");
|
stream << wxT(">");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// sbUseTab = TRUE;
|
// sbUseTab = true;
|
||||||
stream << wxT(">\n");
|
stream << wxT(">\n");
|
||||||
}
|
}
|
||||||
snTabLevel++;
|
snTabLevel++;
|
||||||
@@ -958,7 +958,7 @@ void wxSimpleHtmlTag::Write(wxOutputStream& stream)
|
|||||||
stream << wxT("\t");
|
stream << wxT("\t");
|
||||||
}
|
}
|
||||||
stream << wxT("</") << wxSimpleHtmlParser::EncodeSpecialChars(m_name) << wxT(">\n");
|
stream << wxT("</") << wxSimpleHtmlParser::EncodeSpecialChars(m_name) << wxT(">\n");
|
||||||
sbUseTab = TRUE;
|
sbUseTab = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@@ -172,11 +172,11 @@ public:
|
|||||||
|
|
||||||
bool EatWhitespace(); // Throw away whitespace
|
bool EatWhitespace(); // Throw away whitespace
|
||||||
bool EatWhitespace(int& pos); // Throw away whitespace: using 'pos'
|
bool EatWhitespace(int& pos); // Throw away whitespace: using 'pos'
|
||||||
bool ReadString(wxString& str, bool eatIt = FALSE);
|
bool ReadString(wxString& str, bool eatIt = false);
|
||||||
bool ReadWord(wxString& str, bool eatIt = FALSE);
|
bool ReadWord(wxString& str, bool eatIt = false);
|
||||||
bool ReadNumber(wxString& str, bool eatIt = FALSE);
|
bool ReadNumber(wxString& str, bool eatIt = false);
|
||||||
// Could be number, string, whatever, but read up until whitespace.
|
// 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 IsComment();
|
||||||
bool IsDirective();
|
bool IsDirective();
|
||||||
@@ -190,9 +190,9 @@ public:
|
|||||||
bool IsAlpha(int ch);
|
bool IsAlpha(int ch);
|
||||||
bool IsWordChar(int ch);
|
bool IsWordChar(int ch);
|
||||||
bool IsNumeric(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
|
// 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).
|
// a flat list of all tags (like it used to be previously).
|
||||||
virtual bool IsCloseTagNeeded(const wxString &name);
|
virtual bool IsCloseTagNeeded(const wxString &name);
|
||||||
|
|
||||||
@@ -206,7 +206,7 @@ public:
|
|||||||
static wxString EncodeSpecialChars(const wxString &value);
|
static wxString EncodeSpecialChars(const wxString &value);
|
||||||
|
|
||||||
// Matches this string (case insensitive)
|
// 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() const { return (m_pos >= m_length); }
|
||||||
bool Eof(int pos) const { return (pos >= m_length); }
|
bool Eof(int pos) const { return (pos >= m_length); }
|
||||||
|
|
||||||
|
@@ -90,8 +90,7 @@ BEGIN_EVENT_TABLE(ctMainFrame, wxDocParentFrame)
|
|||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// Define my frame constructor
|
// Define my frame constructor
|
||||||
ctMainFrame::ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size,
|
ctMainFrame::ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
|
||||||
long style):
|
|
||||||
wxDocParentFrame(manager, parent, id, title, pos, size, style)
|
wxDocParentFrame(manager, parent, id, title, pos, size, style)
|
||||||
{
|
{
|
||||||
m_document = NULL;
|
m_document = NULL;
|
||||||
@@ -104,24 +103,24 @@ ctMainFrame::ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id,
|
|||||||
m_mainNotebook = NULL;
|
m_mainNotebook = NULL;
|
||||||
m_findDialog = 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);
|
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);
|
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);
|
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);
|
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);
|
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);
|
wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
|
||||||
|
|
||||||
#ifdef USE_CONFIG_BROWSER_PAGE
|
#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);
|
wxNO_BORDER|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -151,12 +150,12 @@ ctMainFrame::ctMainFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id,
|
|||||||
|
|
||||||
if (wxGetApp().GetSettings().m_showToolBar)
|
if (wxGetApp().GetSettings().m_showToolBar)
|
||||||
{
|
{
|
||||||
menuBar->Check(ctID_SHOW_TOOLBAR, TRUE);
|
menuBar->Check(ctID_SHOW_TOOLBAR, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
menuBar->Check(ctID_SHOW_TOOLBAR, FALSE);
|
menuBar->Check(ctID_SHOW_TOOLBAR, false);
|
||||||
GetToolBar()->Show(FALSE);
|
GetToolBar()->Show(false);
|
||||||
ResizeFrame();
|
ResizeFrame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -178,7 +177,7 @@ void ctMainFrame::OnCloseWindow(wxCloseEvent& event)
|
|||||||
m_findDialog = NULL;
|
m_findDialog = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Show(FALSE);
|
Show(false);
|
||||||
|
|
||||||
if (IsMaximized())
|
if (IsMaximized())
|
||||||
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_MAXIMIZED ;
|
wxGetApp().GetSettings().m_frameStatus = ctSHOW_STATUS_MAXIMIZED ;
|
||||||
@@ -247,22 +246,22 @@ void ctMainFrame::InitToolBar(wxToolBar* toolBar)
|
|||||||
toolBarBitmaps[12] = wxBitmap(help_xpm);
|
toolBarBitmaps[12] = wxBitmap(help_xpm);
|
||||||
toolBarBitmaps[13] = wxBitmap(helpcs_xpm);
|
toolBarBitmaps[13] = wxBitmap(helpcs_xpm);
|
||||||
|
|
||||||
toolBar->AddTool(wxID_NEW, toolBarBitmaps[0], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("New 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, -1, -1, (wxObject *) NULL, wxT("Open 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, -1, -1, (wxObject *) NULL, wxT("Save project"));
|
toolBar->AddTool(wxID_SAVE, toolBarBitmaps[2], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Save project"));
|
||||||
|
|
||||||
toolBar->AddSeparator();
|
toolBar->AddSeparator();
|
||||||
toolBar->AddTool(wxID_CUT, toolBarBitmaps[4], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Cut"));
|
toolBar->AddTool(wxID_CUT, toolBarBitmaps[4], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Cut"));
|
||||||
toolBar->AddTool(wxID_COPY, toolBarBitmaps[3], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Copy"));
|
toolBar->AddTool(wxID_COPY, toolBarBitmaps[3], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Copy"));
|
||||||
toolBar->AddTool(wxID_PASTE, toolBarBitmaps[5], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Paste"));
|
toolBar->AddTool(wxID_PASTE, toolBarBitmaps[5], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Paste"));
|
||||||
toolBar->AddSeparator();
|
toolBar->AddSeparator();
|
||||||
toolBar->AddTool(wxID_UNDO, toolBarBitmaps[10], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Undo"));
|
toolBar->AddTool(wxID_UNDO, toolBarBitmaps[10], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Undo"));
|
||||||
toolBar->AddTool(wxID_REDO, toolBarBitmaps[11], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Redo"));
|
toolBar->AddTool(wxID_REDO, toolBarBitmaps[11], wxNullBitmap, false, wxDefaultPosition.x, wxDefaultPosition.y, (wxObject *) NULL, wxT("Redo"));
|
||||||
toolBar->AddSeparator();
|
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->AddSeparator();
|
||||||
toolBar->AddTool(ctID_ITEM_HELP, toolBarBitmaps[12], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Show help for this option"));
|
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, -1, -1, (wxObject *) NULL, wxT("Show help on the clicked item"));
|
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
|
// after adding the buttons to the toolbar, must call Realize() to reflect
|
||||||
// the changes
|
// the changes
|
||||||
@@ -404,7 +403,7 @@ void ctMainFrame::UpdateFrameTitle()
|
|||||||
// General disabler
|
// General disabler
|
||||||
void ctMainFrame::OnUpdateDisable(wxUpdateUIEvent& event)
|
void ctMainFrame::OnUpdateDisable(wxUpdateUIEvent& event)
|
||||||
{
|
{
|
||||||
event.Enable( FALSE );
|
event.Enable( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -453,7 +452,7 @@ void ctOutputWindow::CreateWindows()
|
|||||||
item5->SetHelpText(_("Regenerates the code."));
|
item5->SetHelpText(_("Regenerates the code."));
|
||||||
|
|
||||||
#if 0
|
#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 );
|
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."));
|
m_filenameCtrl->SetHelpText(_("Shows the filename where the code is being saved."));
|
||||||
#else
|
#else
|
||||||
@@ -461,10 +460,10 @@ void ctOutputWindow::CreateWindows()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The code editor
|
// 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 );
|
item0->Add( m_codeCtrl, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
|
||||||
|
|
||||||
SetAutoLayout( TRUE );
|
SetAutoLayout( true );
|
||||||
SetSizer( item0 );
|
SetSizer( item0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -65,7 +65,7 @@ ctPropertyEditor::~ctPropertyEditor()
|
|||||||
|
|
||||||
void ctPropertyEditor::CreateControls(wxWindow* parent)
|
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);
|
wxBitmap detailsIcon(ellipsis_xpm);
|
||||||
|
|
||||||
wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
|
wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
|
||||||
@@ -75,7 +75,7 @@ void ctPropertyEditor::CreateControls(wxWindow* parent)
|
|||||||
wxTextCtrl *item2 = m_elementTitleTextCtrl;
|
wxTextCtrl *item2 = m_elementTitleTextCtrl;
|
||||||
item1->Add( item2, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
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 );
|
item1->Add( item3a, 0, wxALIGN_CENTRE|wxRIGHT|wxTOP|wxBOTTOM, 5 );
|
||||||
|
|
||||||
item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
|
item0->Add( item1, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5 );
|
||||||
@@ -95,11 +95,11 @@ void ctPropertyEditor::CreateControls(wxWindow* parent)
|
|||||||
|
|
||||||
// TODO: show or hide description window
|
// TODO: show or hide description window
|
||||||
// if (some-setting)
|
// if (some-setting)
|
||||||
// ShowDescriptionWindow(FALSE);
|
// ShowDescriptionWindow(false);
|
||||||
|
|
||||||
item0->Add( m_splitterWindow, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
|
item0->Add( m_splitterWindow, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxBOTTOM, 5 );
|
||||||
|
|
||||||
this->SetAutoLayout( TRUE );
|
this->SetAutoLayout(true);
|
||||||
this->SetSizer( item0 );
|
this->SetSizer( item0 );
|
||||||
|
|
||||||
/// Add help text
|
/// Add help text
|
||||||
@@ -146,7 +146,7 @@ void ctPropertyEditor::ShowDescriptionWindow(bool show)
|
|||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
int pos = 100;
|
int pos = 100;
|
||||||
m_propertyDescriptionWindow->Show(TRUE);
|
m_propertyDescriptionWindow->Show(true);
|
||||||
if (!m_splitterWindow->IsSplit())
|
if (!m_splitterWindow->IsSplit())
|
||||||
{
|
{
|
||||||
m_splitterWindow->SplitHorizontally(m_propertyDescriptionWindow, m_attributeEditorGrid, pos);
|
m_splitterWindow->SplitHorizontally(m_propertyDescriptionWindow, m_attributeEditorGrid, pos);
|
||||||
@@ -182,13 +182,13 @@ void ctPropertyEditor::OnUpdateEditDetails(wxUpdateUIEvent& event)
|
|||||||
bool ctPropertyEditor::CanEditDetails()
|
bool ctPropertyEditor::CanEditDetails()
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
int row;
|
int row;
|
||||||
ctProperty* prop = FindSelectedProperty(row);
|
ctProperty* prop = FindSelectedProperty(row);
|
||||||
if (!prop || prop->GetEditorType().IsEmpty())
|
if (!prop || prop->GetEditorType().IsEmpty())
|
||||||
return FALSE;
|
return false;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Shows the item
|
/// Shows the item
|
||||||
@@ -261,7 +261,7 @@ void ctPropertyEditor::UpdateItem()
|
|||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
ctProperty* prop = (ctProperty*) node->GetData();
|
ctProperty* prop = (ctProperty*) node->GetData();
|
||||||
DisplayProperty(i, prop, TRUE);
|
DisplayProperty(i, prop, true);
|
||||||
|
|
||||||
i ++;
|
i ++;
|
||||||
node = node->GetNext();
|
node = node->GetNext();
|
||||||
@@ -300,7 +300,7 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_attributeEditorGrid->SetReadOnly(row, 1, FALSE);
|
m_attributeEditorGrid->SetReadOnly(row, 1, false);
|
||||||
m_attributeEditorGrid->SetCellTextColour(row, 1, * wxBLACK);
|
m_attributeEditorGrid->SetCellTextColour(row, 1, * wxBLACK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,7 +308,7 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly
|
|||||||
m_attributeEditorGrid->SetCellValue(row, 1, ctConvertToSingleText(prop->GetValue()));
|
m_attributeEditorGrid->SetCellValue(row, 1, ctConvertToSingleText(prop->GetValue()));
|
||||||
|
|
||||||
if (valueOnly)
|
if (valueOnly)
|
||||||
return TRUE;
|
return true;
|
||||||
|
|
||||||
// Set the value type
|
// Set the value type
|
||||||
if (prop->GetEditorType() == _T("choice"))
|
if (prop->GetEditorType() == _T("choice"))
|
||||||
@@ -347,24 +347,24 @@ bool ctPropertyEditor::DisplayProperty(int row, ctProperty* prop, bool valueOnly
|
|||||||
new ctGridCellTextEditor);
|
new ctGridCellTextEditor);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Display attribute value
|
/// Display attribute value
|
||||||
bool ctPropertyEditor::DisplayProperty(ctProperty* prop)
|
bool ctPropertyEditor::DisplayProperty(ctProperty* prop)
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
int index = m_item->GetProperties().GetList().IndexOf(prop);
|
int index = m_item->GetProperties().GetList().IndexOf(prop);
|
||||||
return DisplayProperty(index, prop, TRUE);
|
return DisplayProperty(index, prop, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Display the default property
|
/// Display the default property
|
||||||
bool ctPropertyEditor::DisplayDefaultProperty()
|
bool ctPropertyEditor::DisplayDefaultProperty()
|
||||||
{
|
{
|
||||||
if (!m_item)
|
if (!m_item)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
wxString str = m_item->GetDefaultProperty();
|
wxString str = m_item->GetDefaultProperty();
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ bool ctPropertyEditor::DisplayDefaultProperty()
|
|||||||
this->m_attributeEditorGrid->SelectRow(index);
|
this->m_attributeEditorGrid->SelectRow(index);
|
||||||
this->m_attributeEditorGrid->SetGridCursor(index, 1);
|
this->m_attributeEditorGrid->SetGridCursor(index, 1);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Edit the default property
|
/// Edit the default property
|
||||||
@@ -393,12 +393,12 @@ bool ctPropertyEditor::EditDefaultProperty(ctConfigItem* item)
|
|||||||
this->m_attributeEditorGrid->SelectRow(index);
|
this->m_attributeEditorGrid->SelectRow(index);
|
||||||
this->m_attributeEditorGrid->SetGridCursor(index, 1);
|
this->m_attributeEditorGrid->SetGridCursor(index, 1);
|
||||||
EditDetails(wxTheApp->GetTopWindow());
|
EditDetails(wxTheApp->GetTopWindow());
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Find the selected property
|
/// Find the selected property
|
||||||
@@ -446,7 +446,7 @@ bool ctPropertyEditor::EditDetails(wxWindow* WXUNUSED(parent))
|
|||||||
int row;
|
int row;
|
||||||
ctProperty* prop = FindSelectedProperty(row);
|
ctProperty* prop = FindSelectedProperty(row);
|
||||||
if (!prop)
|
if (!prop)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
wxString type(prop->GetEditorType());
|
wxString type(prop->GetEditorType());
|
||||||
wxString value = m_attributeEditorGrid->GetCellValue(row, 1);
|
wxString value = m_attributeEditorGrid->GetCellValue(row, 1);
|
||||||
@@ -457,16 +457,16 @@ bool ctPropertyEditor::EditDetails(wxWindow* WXUNUSED(parent))
|
|||||||
wxString msg;
|
wxString msg;
|
||||||
msg.Printf(wxT("Edit %s:"), (const wxChar*) prop->GetName());
|
msg.Printf(wxT("Edit %s:"), (const wxChar*) prop->GetName());
|
||||||
ctMultiLineTextEditor dialog(wxTheApp->GetTopWindow(),
|
ctMultiLineTextEditor dialog(wxTheApp->GetTopWindow(),
|
||||||
-1, wxT("Edit Text Property"), msg, value);
|
wxID_ANY, wxT("Edit Text Property"), msg, value);
|
||||||
if (dialog.ShowModal() == wxID_OK)
|
if (dialog.ShowModal() == wxID_OK)
|
||||||
{
|
{
|
||||||
value = ctConvertToSingleText(dialog.GetText());
|
value = ctConvertToSingleText(dialog.GetText());
|
||||||
m_attributeEditorGrid->SetCellValue(row, 1, value);
|
m_attributeEditorGrid->SetCellValue(row, 1, value);
|
||||||
ApplyCellValueToProperty(row, 1);
|
ApplyCellValueToProperty(row, 1);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else if (type == _T("filename"))
|
else if (type == _T("filename"))
|
||||||
{
|
{
|
||||||
@@ -486,10 +486,10 @@ bool ctPropertyEditor::EditDetails(wxWindow* WXUNUSED(parent))
|
|||||||
|
|
||||||
m_attributeEditorGrid->SetCellValue(row, 1, value);
|
m_attributeEditorGrid->SetCellValue(row, 1, value);
|
||||||
ApplyCellValueToProperty(row, 1);
|
ApplyCellValueToProperty(row, 1);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
else if (type == _T("configitems"))
|
else if (type == _T("configitems"))
|
||||||
{
|
{
|
||||||
@@ -497,7 +497,7 @@ bool ctPropertyEditor::EditDetails(wxWindow* WXUNUSED(parent))
|
|||||||
ctConfigItem::StringToArray(value, items);
|
ctConfigItem::StringToArray(value, items);
|
||||||
|
|
||||||
ctConfigItemsSelector dialog(wxTheApp->GetTopWindow(),
|
ctConfigItemsSelector dialog(wxTheApp->GetTopWindow(),
|
||||||
-1, wxT("Select Configuration Items"));
|
wxID_ANY, wxT("Select Configuration Items"));
|
||||||
dialog.SetConfigList(items);
|
dialog.SetConfigList(items);
|
||||||
if (dialog.ShowModal() == wxID_OK)
|
if (dialog.ShowModal() == wxID_OK)
|
||||||
{
|
{
|
||||||
@@ -507,14 +507,14 @@ bool ctPropertyEditor::EditDetails(wxWindow* WXUNUSED(parent))
|
|||||||
|
|
||||||
m_attributeEditorGrid->SetCellValue(row, 1, newValue);
|
m_attributeEditorGrid->SetCellValue(row, 1, newValue);
|
||||||
ApplyCellValueToProperty(row, 1);
|
ApplyCellValueToProperty(row, 1);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Intercept selection event.
|
/// Intercept selection event.
|
||||||
@@ -589,12 +589,12 @@ void ctPropertyEditor::OnDClickCell(wxGridEvent& WXUNUSED(event))
|
|||||||
/// item object.
|
/// item object.
|
||||||
void ctPropertyEditor::ApplyCellValueToProperty(int row, int col)
|
void ctPropertyEditor::ApplyCellValueToProperty(int row, int col)
|
||||||
{
|
{
|
||||||
static bool s_Applying = FALSE;
|
static bool s_Applying = false;
|
||||||
|
|
||||||
if (s_Applying)
|
if (s_Applying)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
s_Applying = TRUE;
|
s_Applying = true;
|
||||||
if (col == 1 && m_item)
|
if (col == 1 && m_item)
|
||||||
{
|
{
|
||||||
ctProperty* prop = m_item->GetProperties().GetNth(row);
|
ctProperty* prop = m_item->GetProperties().GetNth(row);
|
||||||
@@ -608,9 +608,9 @@ void ctPropertyEditor::ApplyCellValueToProperty(int row, int col)
|
|||||||
if (prop->GetVariant().GetType() == _T("bool"))
|
if (prop->GetVariant().GetType() == _T("bool"))
|
||||||
{
|
{
|
||||||
if (value == _T("1"))
|
if (value == _T("1"))
|
||||||
variant = (bool) TRUE;
|
variant = true;
|
||||||
else
|
else
|
||||||
variant = (bool) FALSE;
|
variant = false;
|
||||||
}
|
}
|
||||||
else if (prop->GetVariant().GetType() == _T("long"))
|
else if (prop->GetVariant().GetType() == _T("long"))
|
||||||
{
|
{
|
||||||
@@ -634,19 +634,19 @@ void ctPropertyEditor::ApplyCellValueToProperty(int row, int col)
|
|||||||
if (prop->GetName() == _T("description"))
|
if (prop->GetName() == _T("description"))
|
||||||
UpdateDescription(row);
|
UpdateDescription(row);
|
||||||
}
|
}
|
||||||
s_Applying = FALSE;
|
s_Applying = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Apply the cell value to the property, and notify the
|
/// Apply the cell value to the property, and notify the
|
||||||
/// item object.
|
/// item object.
|
||||||
void ctPropertyEditor::ApplyPropertyValue(ctConfigItem* item, ctProperty* property, const wxVariant& variant)
|
void ctPropertyEditor::ApplyPropertyValue(ctConfigItem* item, ctProperty* property, const wxVariant& variant)
|
||||||
{
|
{
|
||||||
static bool s_Applying = FALSE;
|
static bool s_Applying = false;
|
||||||
|
|
||||||
if (s_Applying)
|
if (s_Applying)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
s_Applying = TRUE;
|
s_Applying = true;
|
||||||
|
|
||||||
// Save the old values
|
// Save the old values
|
||||||
ctProperties* oldProperties = new ctProperties(item->GetProperties());
|
ctProperties* oldProperties = new ctProperties(item->GetProperties());
|
||||||
@@ -667,9 +667,9 @@ void ctPropertyEditor::ApplyPropertyValue(ctConfigItem* item, ctProperty* proper
|
|||||||
// But when we Undo or Redo, the changed properties will be applied.
|
// But when we Undo or Redo, the changed properties will be applied.
|
||||||
item->GetDocument()->GetCommandProcessor()->Submit(
|
item->GetDocument()->GetCommandProcessor()->Submit(
|
||||||
new ctConfigCommand(menuLabel, ctCMD_APPLY_PROPERTY,
|
new ctConfigCommand(menuLabel, ctCMD_APPLY_PROPERTY,
|
||||||
item, oldProperties, TRUE));
|
item, oldProperties, true));
|
||||||
|
|
||||||
s_Applying = FALSE;
|
s_Applying = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -734,7 +734,7 @@ bool ctPropertyEditorGrid::ClearAttributes()
|
|||||||
{
|
{
|
||||||
if (GetNumberRows() > 0)
|
if (GetNumberRows() > 0)
|
||||||
DeleteRows(0, GetNumberRows());
|
DeleteRows(0, GetNumberRows());
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -801,7 +801,7 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
|
|||||||
wxStaticText *item2 = new wxStaticText( parent, wxID_STATIC, msg, wxDefaultPosition, wxDefaultSize, 0 );
|
wxStaticText *item2 = new wxStaticText( parent, wxID_STATIC, msg, wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
item1->Add( item2, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT|wxRIGHT, 5 );
|
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 );
|
item1->Add( item3, 1, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
|
||||||
|
|
||||||
wxBoxSizer *item4 = new wxBoxSizer( wxHORIZONTAL );
|
wxBoxSizer *item4 = new wxBoxSizer( wxHORIZONTAL );
|
||||||
@@ -826,11 +826,11 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
|
|||||||
item3->SetFocus();
|
item3->SetFocus();
|
||||||
((wxButton*) FindWindow(wxID_OK))->SetDefault();
|
((wxButton*) FindWindow(wxID_OK))->SetDefault();
|
||||||
|
|
||||||
parent->SetAutoLayout( TRUE );
|
parent->SetAutoLayout( true );
|
||||||
parent->SetSizer(item0);
|
parent->SetSizer(item0);
|
||||||
item0->Fit(parent);
|
item0->Fit(parent);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -839,14 +839,14 @@ bool ctMultiLineTextEditor::AddControls(wxWindow* parent, const wxString& msg)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(ctSplitterWindow, wxSplitterWindow)
|
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()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
ctSplitterWindow::ctSplitterWindow(wxWindow* parent, wxWindowID id,
|
ctSplitterWindow::ctSplitterWindow(wxWindow* parent, wxWindowID id,
|
||||||
const wxPoint& pos, const wxSize& size, long style):
|
const wxPoint& pos, const wxSize& size, long style):
|
||||||
wxSplitterWindow(parent, id, pos, size, style)
|
wxSplitterWindow(parent, id, pos, size, style)
|
||||||
{
|
{
|
||||||
m_updateSettings = FALSE;
|
m_updateSettings = false;
|
||||||
m_position = 0;
|
m_position = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -75,7 +75,7 @@ class ctPropertyEditor: public wxPanel
|
|||||||
void UpdateItem();
|
void UpdateItem();
|
||||||
|
|
||||||
/// Display attribute at given row
|
/// 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
|
/// Display attribute value
|
||||||
bool DisplayProperty(ctProperty* prop);
|
bool DisplayProperty(ctProperty* prop);
|
||||||
|
@@ -111,9 +111,9 @@ ctProperty* ctProperties::FindOrCreateProperty(const wxString& name)
|
|||||||
|
|
||||||
void ctProperties::Clear()
|
void ctProperties::Clear()
|
||||||
{
|
{
|
||||||
m_list.DeleteContents(TRUE);
|
m_list.DeleteContents(true);
|
||||||
m_list.Clear();
|
m_list.Clear();
|
||||||
m_list.DeleteContents(FALSE);
|
m_list.DeleteContents(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctProperties::Copy(const ctProperties& properties)
|
void ctProperties::Copy(const ctProperties& properties)
|
||||||
@@ -144,7 +144,7 @@ void ctProperties::SetProperty(const wxString& name, long value)
|
|||||||
void ctProperties::SetProperty(const wxString& name, bool value)
|
void ctProperties::SetProperty(const wxString& name, bool value)
|
||||||
{
|
{
|
||||||
ctProperty* prop = FindOrCreateProperty(name);
|
ctProperty* prop = FindOrCreateProperty(name);
|
||||||
prop->GetVariant() = (bool) value;
|
prop->GetVariant() = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ctProperties::SetProperty(const wxString& name, const wxVariant& value)
|
void ctProperties::SetProperty(const wxString& name, const wxVariant& value)
|
||||||
|
@@ -30,30 +30,30 @@ class ctProperty: public wxObject
|
|||||||
public:
|
public:
|
||||||
ctProperty()
|
ctProperty()
|
||||||
{
|
{
|
||||||
m_readOnly = FALSE;
|
m_readOnly = false;
|
||||||
m_custom = FALSE;
|
m_custom = false;
|
||||||
m_show = TRUE;
|
m_show = true;
|
||||||
}
|
}
|
||||||
ctProperty(const ctProperty& property) { Copy(property); }
|
ctProperty(const ctProperty& property) { Copy(property); }
|
||||||
ctProperty(const wxString& descr, const wxVariant& variant,
|
ctProperty(const wxString& descr, const wxVariant& variant,
|
||||||
const wxString& editorType = wxEmptyString,
|
const wxString& editorType = wxEmptyString,
|
||||||
bool readOnly = FALSE)
|
bool readOnly = false)
|
||||||
{
|
{
|
||||||
m_description = descr;
|
m_description = descr;
|
||||||
m_variant = variant;
|
m_variant = variant;
|
||||||
m_editorType = editorType;
|
m_editorType = editorType;
|
||||||
m_show = TRUE;
|
m_show = true;
|
||||||
m_readOnly = readOnly;
|
m_readOnly = readOnly;
|
||||||
m_custom = FALSE;
|
m_custom = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctProperty(const wxString& name, const wxString& value = wxEmptyString)
|
ctProperty(const wxString& name, const wxString& value = wxEmptyString)
|
||||||
{
|
{
|
||||||
m_variant.SetName(name);
|
m_variant.SetName(name);
|
||||||
m_variant = value;
|
m_variant = value;
|
||||||
m_readOnly = FALSE;
|
m_readOnly = false;
|
||||||
m_custom = FALSE;
|
m_custom = false;
|
||||||
m_show = TRUE;
|
m_show = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator= (const ctProperty& property) { Copy(property); }
|
void operator= (const ctProperty& property) { Copy(property); }
|
||||||
|
@@ -76,7 +76,7 @@ void ctSettingsDialog::CreateControls()
|
|||||||
|
|
||||||
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL);
|
||||||
item1->SetSizer(item2);
|
item1->SetSizer(item2);
|
||||||
item1->SetAutoLayout(TRUE);
|
item1->SetAutoLayout(true);
|
||||||
|
|
||||||
wxNotebook* item3 = new wxNotebook(item1, ID_NOTEBOOK, wxDefaultPosition, wxSize(200, 200), wxNB_TOP);
|
wxNotebook* item3 = new wxNotebook(item1, ID_NOTEBOOK, wxDefaultPosition, wxSize(200, 200), wxNB_TOP);
|
||||||
wxNotebookSizer* item3Sizer = new wxNotebookSizer(item3);
|
wxNotebookSizer* item3Sizer = new wxNotebookSizer(item3);
|
||||||
@@ -102,7 +102,7 @@ void ctSettingsDialog::CreateControls()
|
|||||||
item21->Add(item25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
item21->Add(item25, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||||
|
|
||||||
#if defined(__WXGTK__) || defined(__WXMAC__)
|
#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);
|
item21->Add(item26, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ void ctSettingsDialog::OnHelp( wxCommandEvent& WXUNUSED(event) )
|
|||||||
|
|
||||||
bool ctSettingsDialog::ShowToolTips()
|
bool ctSettingsDialog::ShowToolTips()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -211,14 +211,14 @@ void ctGeneralSettingsDialog::CreateControls()
|
|||||||
|
|
||||||
wxBoxSizer* item5 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item5 = new wxBoxSizer(wxVERTICAL);
|
||||||
item4->SetSizer(item5);
|
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);
|
wxStaticBoxSizer* item6 = new wxStaticBoxSizer(item6Static, wxVERTICAL);
|
||||||
item5->Add(item6, 1, wxGROW|wxALL, 5);
|
item5->Add(item6, 1, wxGROW|wxALL, 5);
|
||||||
|
|
||||||
wxCheckBox* item7 = new wxCheckBox(item4, ID_LOAD_LAST_DOCUMENT, _("&Load last document"), wxDefaultPosition, wxDefaultSize, 0);
|
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"));
|
item7->SetHelpText(_("Check to load the last document on startup"));
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
if (ShowToolTips())
|
if (ShowToolTips())
|
||||||
@@ -227,7 +227,7 @@ void ctGeneralSettingsDialog::CreateControls()
|
|||||||
item6->Add(item7, 0, wxALIGN_LEFT|wxALL, 5);
|
item6->Add(item7, 0, wxALIGN_LEFT|wxALL, 5);
|
||||||
|
|
||||||
wxCheckBox* item8 = new wxCheckBox(item4, ID_SHOW_TOOLTIPS, _("&Show tooltips"), wxDefaultPosition, wxDefaultSize, 0);
|
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"));
|
item8->SetHelpText(_("Check to show tooltips"));
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
if (ShowToolTips())
|
if (ShowToolTips())
|
||||||
@@ -242,7 +242,7 @@ void ctGeneralSettingsDialog::CreateControls()
|
|||||||
_("Setup file"),
|
_("Setup file"),
|
||||||
_("Configure script")
|
_("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->SetStringSelection(_("Setup file"));
|
||||||
item10->SetHelpText(_("Select the default kind of file to save using Go"));
|
item10->SetHelpText(_("Select the default kind of file to save using Go"));
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
@@ -265,7 +265,7 @@ void ctGeneralSettingsDialog::CreateControls()
|
|||||||
|
|
||||||
bool ctGeneralSettingsDialog::ShowToolTips()
|
bool ctGeneralSettingsDialog::ShowToolTips()
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -313,9 +313,9 @@ void ctLocationSettingsDialog::CreateControls()
|
|||||||
|
|
||||||
wxBoxSizer* item12 = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer* item12 = new wxBoxSizer(wxVERTICAL);
|
||||||
item11->SetSizer(item12);
|
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);
|
wxStaticBoxSizer* item13 = new wxStaticBoxSizer(item13Static, wxVERTICAL);
|
||||||
item12->Add(item13, 1, wxGROW|wxALL, 5);
|
item12->Add(item13, 1, wxGROW|wxALL, 5);
|
||||||
|
|
||||||
@@ -325,7 +325,7 @@ void ctLocationSettingsDialog::CreateControls()
|
|||||||
wxBoxSizer* item15 = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer* item15 = new wxBoxSizer(wxHORIZONTAL);
|
||||||
item13->Add(item15, 0, wxGROW, 5);
|
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"));
|
item16->SetHelpText(_("Enter the root path of the wxWidgets hierarchy"));
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
if (ShowToolTips())
|
if (ShowToolTips())
|
||||||
@@ -347,7 +347,7 @@ void ctLocationSettingsDialog::CreateControls()
|
|||||||
item18->Add(60, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
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);
|
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"));
|
item20->SetHelpText(_("Check to use the value of WXWIN instead"));
|
||||||
#if wxUSE_TOOLTIPS
|
#if wxUSE_TOOLTIPS
|
||||||
if (ShowToolTips())
|
if (ShowToolTips())
|
||||||
|
@@ -57,7 +57,7 @@ class ctSettingsDialog: public wxDialog
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
ctSettingsDialog( wxWindow* parent, wxWindowID id = -1,
|
ctSettingsDialog( wxWindow* parent, wxWindowID id = wxID_ANY,
|
||||||
const wxString& caption = _("Configuration Settings"),
|
const wxString& caption = _("Configuration Settings"),
|
||||||
const wxPoint& pos = wxDefaultPosition,
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
const wxSize& size = wxDefaultSize,
|
const wxSize& size = wxDefaultSize,
|
||||||
@@ -98,7 +98,7 @@ class ctGeneralSettingsDialog: public wxPanel
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// 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
|
/// Creates the controls and sizers
|
||||||
void CreateControls();
|
void CreateControls();
|
||||||
@@ -126,7 +126,7 @@ class ctLocationSettingsDialog: public wxPanel
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// 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
|
/// Creates the controls and sizers
|
||||||
void CreateControls();
|
void CreateControls();
|
||||||
|
@@ -182,7 +182,7 @@ void apViewHTMLFile(const wxString& url)
|
|||||||
STARTUPINFO siStartInfo;
|
STARTUPINFO siStartInfo;
|
||||||
memset(&siStartInfo, 0, sizeof(STARTUPINFO));
|
memset(&siStartInfo, 0, sizeof(STARTUPINFO));
|
||||||
siStartInfo.cb = 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 );
|
NULL, &siStartInfo, &piProcInfo );
|
||||||
}
|
}
|
||||||
if(lRes == ERROR_SUCCESS)
|
if(lRes == ERROR_SUCCESS)
|
||||||
@@ -208,7 +208,7 @@ void apViewHTMLFile(const wxString& url)
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
ok = (wxExecute(cmd, FALSE) != 0);
|
ok = (wxExecute(cmd, false) != 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,14 +251,14 @@ bool apInvokeAppForFile(const wxString& filename)
|
|||||||
msg.Printf(wxT("Sorry, could not determine what application to invoke for extension %s\nYou may need to edit your MIME types."),
|
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());
|
ext.c_str());
|
||||||
wxMessageBox(msg, wxT("Application Invocation"), wxICON_EXCLAMATION|wxOK);
|
wxMessageBox(msg, wxT("Application Invocation"), wxICON_EXCLAMATION|wxOK);
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString cmd;
|
wxString cmd;
|
||||||
ft->GetOpenCommand(&cmd, wxFileType::MessageParameters(filename, _T("")));
|
ft->GetOpenCommand(&cmd, wxFileType::MessageParameters(filename, _T("")));
|
||||||
delete ft;
|
delete ft;
|
||||||
|
|
||||||
return (wxExecute(cmd, FALSE) != 0);
|
return (wxExecute(cmd, false) != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the absolute path where this application has been run from.
|
// Find the absolute path where this application has been run from.
|
||||||
@@ -337,7 +337,7 @@ void apAddContextHelpButton(wxWindow*
|
|||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
wxSize buttonSize(20, 20);
|
wxSize buttonSize(20, 20);
|
||||||
#else
|
#else
|
||||||
wxSize buttonSize(-1, -1);
|
wxSize buttonSize = wxDefaultSize;
|
||||||
#endif
|
#endif
|
||||||
wxButton *contextButton = new wxContextHelpButton( parent, wxID_CONTEXT_HELP,
|
wxButton *contextButton = new wxContextHelpButton( parent, wxID_CONTEXT_HELP,
|
||||||
wxDefaultPosition, buttonSize);
|
wxDefaultPosition, buttonSize);
|
||||||
@@ -408,7 +408,7 @@ void wxIconInfo::SetIconId(int state, bool enabled, int iconId)
|
|||||||
wxIconTable::wxIconTable(wxImageList* imageList)
|
wxIconTable::wxIconTable(wxImageList* imageList)
|
||||||
{
|
{
|
||||||
m_imageList = imageList;
|
m_imageList = imageList;
|
||||||
DeleteContents(TRUE);
|
DeleteContents(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxIconTable::AppendInfo(wxIconInfo* info)
|
void wxIconTable::AppendInfo(wxIconInfo* info)
|
||||||
@@ -429,7 +429,7 @@ bool wxIconTable::AddInfo(const wxString& name, const wxIcon& icon, int state, b
|
|||||||
Append(info);
|
Append(info);
|
||||||
}
|
}
|
||||||
info->SetIconId(state, enabled, m_imageList->Add(icon));
|
info->SetIconId(state, enabled, m_imageList->Add(icon));
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxIconInfo* wxIconTable::FindInfo(const wxString& name) const
|
wxIconInfo* wxIconTable::FindInfo(const wxString& name) const
|
||||||
@@ -457,9 +457,9 @@ bool wxIconTable::SetIconId(const wxString& name, int state, bool enabled, int i
|
|||||||
{
|
{
|
||||||
wxIconInfo* info = FindInfo(name);
|
wxIconInfo* info = FindInfo(name);
|
||||||
if (!info)
|
if (!info)
|
||||||
return FALSE;
|
return false;
|
||||||
info->SetIconId(state, enabled, iconId);
|
info->SetIconId(state, enabled, iconId);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Output stream operators
|
// Output stream operators
|
||||||
@@ -511,27 +511,27 @@ bool ctMatchString(const wxString& matchAgainst, const wxString& matchText, bool
|
|||||||
{
|
{
|
||||||
// Fast operation if not matching against whole words only
|
// Fast operation if not matching against whole words only
|
||||||
if (!wholeWordOnly)
|
if (!wholeWordOnly)
|
||||||
return (matchAgainst.Find(matchText) != -1);
|
return (matchAgainst.Find(matchText) != wxNOT_FOUND);
|
||||||
|
|
||||||
wxString left(matchAgainst);
|
wxString left(matchAgainst);
|
||||||
bool success = FALSE;
|
bool success = false;
|
||||||
int matchTextLen = (int) matchText.Length();
|
int matchTextLen = (int) matchText.Length();
|
||||||
while (!success && !matchAgainst.IsEmpty())
|
while (!success && !matchAgainst.IsEmpty())
|
||||||
{
|
{
|
||||||
int pos = left.Find(matchText);
|
int pos = left.Find(matchText);
|
||||||
if (pos == -1)
|
if (pos == wxNOT_FOUND)
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
bool firstCharOK = FALSE;
|
bool firstCharOK = false;
|
||||||
bool lastCharOK = FALSE;
|
bool lastCharOK = false;
|
||||||
if (pos == 0 || !wxIsalnum(left[(size_t) (pos-1)]))
|
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)]))
|
if (((pos + matchTextLen) == (int) left.Length()) || !wxIsalnum(left[(size_t) (pos + matchTextLen)]))
|
||||||
lastCharOK = TRUE;
|
lastCharOK = true;
|
||||||
|
|
||||||
if (firstCharOK && lastCharOK)
|
if (firstCharOK && lastCharOK)
|
||||||
success = TRUE;
|
success = true;
|
||||||
|
|
||||||
left = left.Mid(pos+1);
|
left = left.Mid(pos+1);
|
||||||
}
|
}
|
||||||
|
@@ -113,15 +113,15 @@ and has a convenient API. For example, the following adds
|
|||||||
icons for a checkbox item that can be: on/enabled, off/enabled,
|
icons for a checkbox item that can be: on/enabled, off/enabled,
|
||||||
on/disabled,off/disabled.
|
on/disabled,off/disabled.
|
||||||
|
|
||||||
m_iconTable.AddInfo("Checkbox", wxICON(checked), 0, TRUE);
|
m_iconTable.AddInfo("Checkbox", wxICON(checked), 0, true);
|
||||||
m_iconTable.AddInfo("Checkbox", wxICON(checked_dis), 0, FALSE);
|
m_iconTable.AddInfo("Checkbox", wxICON(checked_dis), 0, false);
|
||||||
m_iconTable.AddInfo("Checkbox", wxICON(unchecked), 1, TRUE);
|
m_iconTable.AddInfo("Checkbox", wxICON(unchecked), 1, true);
|
||||||
m_iconTable.AddInfo("Checkbox", wxICON(unchecked_dis), 1, FALSE);
|
m_iconTable.AddInfo("Checkbox", wxICON(unchecked_dis), 1, false);
|
||||||
|
|
||||||
When you update the item image in response to (e.g.) user interaction,
|
When you update the item image in response to (e.g.) user interaction,
|
||||||
you can say something like this:
|
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_Normal);
|
||||||
treeCtrl.SetItemImage(itemId, iconId, wxTreeItemIcon_Selected);
|
treeCtrl.SetItemImage(itemId, iconId, wxTreeItemIcon_Selected);
|
||||||
@@ -145,7 +145,7 @@ public:
|
|||||||
int GetStateCount() const { return m_maxStates; };
|
int GetStateCount() const { return m_maxStates; };
|
||||||
|
|
||||||
void SetStateCount(int count) { m_maxStates = count; }
|
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);
|
void SetIconId(int state, bool enabled, int iconId);
|
||||||
|
|
||||||
const wxString& GetName() const { return m_name; }
|
const wxString& GetName() const { return m_name; }
|
||||||
@@ -178,7 +178,7 @@ public:
|
|||||||
|
|
||||||
wxIconInfo* FindInfo(const wxString& name) const;
|
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) ;
|
bool SetIconId(const wxString& name, int state, bool enabled, int iconId) ;
|
||||||
|
|
||||||
void SetImageList(wxImageList* imageList) { m_imageList = imageList; }
|
void SetImageList(wxImageList* imageList) { m_imageList = imageList; }
|
||||||
|
@@ -121,7 +121,7 @@ bool ctApp::OnInit(void)
|
|||||||
wxString helpFilePath(GetFullAppPath(_("configtool")));
|
wxString helpFilePath(GetFullAppPath(_("configtool")));
|
||||||
m_helpController->Initialize(helpFilePath);
|
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(),
|
GetSettings().m_frameSize.GetPosition(), GetSettings().m_frameSize.GetSize(),
|
||||||
wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
|
wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE|wxCLIP_CHILDREN);
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
@@ -130,12 +130,12 @@ bool ctApp::OnInit(void)
|
|||||||
{
|
{
|
||||||
case ctSHOW_STATUS_MAXIMIZED:
|
case ctSHOW_STATUS_MAXIMIZED:
|
||||||
{
|
{
|
||||||
frame->Maximize(TRUE);
|
frame->Maximize(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ctSHOW_STATUS_MINIMIZED:
|
case ctSHOW_STATUS_MINIMIZED:
|
||||||
{
|
{
|
||||||
frame->Iconize(TRUE);
|
frame->Iconize(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@@ -172,7 +172,7 @@ bool ctApp::OnInit(void)
|
|||||||
// Load the file
|
// Load the file
|
||||||
wxDocument* doc = m_docManager->CreateDocument(arg, wxDOC_SILENT);
|
wxDocument* doc = m_docManager->CreateDocument(arg, wxDOC_SILENT);
|
||||||
if (doc)
|
if (doc)
|
||||||
doc->SetDocumentSaved(TRUE);
|
doc->SetDocumentSaved(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -181,13 +181,13 @@ bool ctApp::OnInit(void)
|
|||||||
// Load the file that was last loaded
|
// Load the file that was last loaded
|
||||||
wxDocument* doc = m_docManager->CreateDocument(GetSettings().m_lastFilename, wxDOC_SILENT);
|
wxDocument* doc = m_docManager->CreateDocument(GetSettings().m_lastFilename, wxDOC_SILENT);
|
||||||
if (doc)
|
if (doc)
|
||||||
doc->SetDocumentSaved(TRUE);
|
doc->SetDocumentSaved(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GetTopWindow()->Show(TRUE);
|
GetTopWindow()->Show(true);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ctApp::OnExit(void)
|
int ctApp::OnExit(void)
|
||||||
|
@@ -62,7 +62,7 @@ public:
|
|||||||
/// Returns the notebook window.
|
/// Returns the notebook window.
|
||||||
wxNotebook* GetNotebookWindow() { return m_notebookWindow; }
|
wxNotebook* GetNotebookWindow() { return m_notebookWindow; }
|
||||||
|
|
||||||
/// Returns TRUE if the application should show tooltips.
|
/// Returns true if the application should show tooltips.
|
||||||
virtual bool UsingTooltips();
|
virtual bool UsingTooltips();
|
||||||
|
|
||||||
/// Returns the help controller object for the manual.
|
/// Returns the help controller object for the manual.
|
||||||
|
@@ -133,9 +133,9 @@ bool MyApp::OnInit()
|
|||||||
|
|
||||||
// Create the main frame window
|
// Create the main frame window
|
||||||
MyFrame* frame = new MyFrame(NULL, "Help Client");
|
MyFrame* frame = new MyFrame(NULL, "Help Client");
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int MyApp::OnExit()
|
int MyApp::OnExit()
|
||||||
@@ -147,7 +147,7 @@ int MyApp::OnExit()
|
|||||||
|
|
||||||
// Define my frame constructor
|
// Define my frame constructor
|
||||||
MyFrame::MyFrame(wxFrame *frame, const wxString& title)
|
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;
|
m_panel = NULL;
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title)
|
|||||||
m_panel = new wxPanel(this );
|
m_panel = new wxPanel(this );
|
||||||
|
|
||||||
m_modalbutton = new wxButton( this, BUTTON_MODAL, "Modal Dialog",
|
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)
|
void MyFrame::OnHelp_Book1(wxCommandEvent& event)
|
||||||
@@ -247,7 +247,7 @@ void MyFrame::ModalDlg(wxCommandEvent& WXUNUSED(event))
|
|||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyModalDialog, wxDialog)
|
BEGIN_EVENT_TABLE(MyModalDialog, wxDialog)
|
||||||
EVT_BUTTON(-1, MyModalDialog::OnButton)
|
EVT_BUTTON(wxID_ANY, MyModalDialog::OnButton)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -255,18 +255,18 @@ END_EVENT_TABLE()
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
MyModalDialog::MyModalDialog(wxWindow *parent)
|
MyModalDialog::MyModalDialog(wxWindow *parent)
|
||||||
: wxDialog(parent, -1, wxString("Modal dialog"))
|
: wxDialog(parent, wxID_ANY, wxString("Modal dialog"))
|
||||||
{
|
{
|
||||||
wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
m_main = new wxButton(this, -1, "Main");
|
m_main = new wxButton(this, wxID_ANY, "Main");
|
||||||
m_book1 = new wxButton(this, -1, "Book1");
|
m_book1 = new wxButton(this, wxID_ANY, "Book1");
|
||||||
m_book2 = new wxButton(this, -1, "Book2");
|
m_book2 = new wxButton(this, wxID_ANY, "Book2");
|
||||||
sizerTop->Add(m_main, 0, wxALIGN_CENTER | wxALL, 5);
|
sizerTop->Add(m_main, 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
sizerTop->Add(m_book1, 0, wxALIGN_CENTER | wxALL, 5);
|
sizerTop->Add(m_book1, 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
sizerTop->Add(m_book2, 0, wxALIGN_CENTER | wxALL, 5);
|
sizerTop->Add(m_book2, 0, wxALIGN_CENTER | wxALL, 5);
|
||||||
|
|
||||||
SetAutoLayout(TRUE);
|
SetAutoLayout(true);
|
||||||
SetSizer(sizerTop);
|
SetSizer(sizerTop);
|
||||||
|
|
||||||
sizerTop->SetSizeHints(this);
|
sizerTop->SetSizeHints(this);
|
||||||
|
@@ -33,7 +33,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void OnExit(wxCommandEvent& event);
|
void OnExit(wxCommandEvent& event);
|
||||||
|
|
||||||
void OnHelp_Main(wxCommandEvent& event);
|
void OnHelp_Main(wxCommandEvent& event);
|
||||||
void OnHelp_Book1(wxCommandEvent& event);
|
void OnHelp_Book1(wxCommandEvent& event);
|
||||||
void OnHelp_Book2(wxCommandEvent& event);
|
void OnHelp_Book2(wxCommandEvent& event);
|
||||||
|
@@ -64,22 +64,22 @@ rhhcConnection::rhhcConnection( bool *isconn_a )
|
|||||||
: wxConnection()
|
: wxConnection()
|
||||||
{
|
{
|
||||||
isconn_3 = isconn_a;
|
isconn_3 = isconn_a;
|
||||||
*isconn_3 = TRUE;
|
*isconn_3 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
rhhcConnection::~rhhcConnection()
|
rhhcConnection::~rhhcConnection()
|
||||||
{
|
{
|
||||||
*isconn_3 = FALSE;
|
*isconn_3 = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rhhcConnection::OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format)
|
bool rhhcConnection::OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format)
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool rhhcConnection::OnDisconnect()
|
bool rhhcConnection::OnDisconnect()
|
||||||
{
|
{
|
||||||
*isconn_3 = FALSE;
|
*isconn_3 = false;
|
||||||
|
|
||||||
return wxConnection::OnDisconnect();
|
return wxConnection::OnDisconnect();
|
||||||
}
|
}
|
||||||
@@ -97,7 +97,7 @@ wxRemoteHtmlHelpController::wxRemoteHtmlHelpController(int style )
|
|||||||
m_connection = NULL;
|
m_connection = NULL;
|
||||||
m_client = NULL;
|
m_client = NULL;
|
||||||
m_pid = 0;
|
m_pid = 0;
|
||||||
isconn_1 = FALSE;
|
isconn_1 = false;
|
||||||
m_process = NULL;
|
m_process = NULL;
|
||||||
|
|
||||||
// defaults
|
// defaults
|
||||||
@@ -146,7 +146,7 @@ wxRemoteHtmlHelpController::~wxRemoteHtmlHelpController()
|
|||||||
{
|
{
|
||||||
if ( isconn_1 )
|
if ( isconn_1 )
|
||||||
{
|
{
|
||||||
//if (!m_connection->Poke( wxT("--YouAreDead"), wxT("") ) )
|
// if (!m_connection->Poke( wxT("--YouAreDead"), wxT("") ) )
|
||||||
// wxLogError(wxT("wxRemoteHtmlHelpController - YouAreDead Failed"));
|
// wxLogError(wxT("wxRemoteHtmlHelpController - YouAreDead Failed"));
|
||||||
|
|
||||||
// Kill the server. This could be an option.
|
// Kill the server. This could be an option.
|
||||||
@@ -195,12 +195,12 @@ bool wxRemoteHtmlHelpController::DoConnection()
|
|||||||
cmd = m_appname + blank + m_service + blank + m_windowname + blank + m_book + blank + stylestr;
|
cmd = m_appname + blank + m_service + blank + m_windowname + blank + m_book + blank + stylestr;
|
||||||
|
|
||||||
m_process = new wxProcess(NULL);
|
m_process = new wxProcess(NULL);
|
||||||
m_pid = wxExecute( cmd, FALSE, m_process );
|
m_pid = wxExecute( cmd, false, m_process );
|
||||||
// leaks - wxExecute itself (if not deleted) and in wxExecute at
|
// leaks - wxExecute itself (if not deleted) and in wxExecute at
|
||||||
// wxExecuteData *data = new wxExecuteData;
|
// wxExecuteData *data = new wxExecuteData;
|
||||||
if( m_pid <= 0 ) {
|
if( m_pid <= 0 ) {
|
||||||
wxLogError( wxT("wxRemoteHtmlHelpController - Failed to start Help server") );
|
wxLogError( wxT("wxRemoteHtmlHelpController - Failed to start Help server") );
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +214,7 @@ bool wxRemoteHtmlHelpController::DoConnection()
|
|||||||
wxICON_ERROR | wxYES_NO | wxCANCEL ) != wxYES )
|
wxICON_ERROR | wxYES_NO | wxCANCEL ) != wxYES )
|
||||||
{
|
{
|
||||||
// no server
|
// no server
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nsleep++;
|
nsleep++;
|
||||||
@@ -225,20 +225,20 @@ bool wxRemoteHtmlHelpController::DoConnection()
|
|||||||
|
|
||||||
if (!m_connection->StartAdvise(wxT("Item"))) {
|
if (!m_connection->StartAdvise(wxT("Item"))) {
|
||||||
wxLogError(wxT("wxRemoteHtmlHelpController - StartAdvise failed") );
|
wxLogError(wxT("wxRemoteHtmlHelpController - StartAdvise failed") );
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxRemoteHtmlHelpController::LoadFile(const wxString& WXUNUSED(file))
|
bool wxRemoteHtmlHelpController::LoadFile(const wxString& WXUNUSED(file))
|
||||||
{
|
{
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
bool wxRemoteHtmlHelpController::DisplaySection(int sectionNo)
|
bool wxRemoteHtmlHelpController::DisplaySection(int sectionNo)
|
||||||
{
|
{
|
||||||
Display(sectionNo);
|
Display(sectionNo);
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
bool wxRemoteHtmlHelpController::DisplayBlock(long blockNo)
|
bool wxRemoteHtmlHelpController::DisplayBlock(long blockNo)
|
||||||
{
|
{
|
||||||
@@ -252,7 +252,7 @@ bool wxRemoteHtmlHelpController::Quit()
|
|||||||
// but give error message on MSW - timout?
|
// but give error message on MSW - timout?
|
||||||
int sig = 15; //3 = quit; 6 = abort; 9 = kill; 15 = terminate
|
int sig = 15; //3 = quit; 6 = abort; 9 = kill; 15 = terminate
|
||||||
|
|
||||||
/*
|
/*
|
||||||
switch ( sig )
|
switch ( sig )
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
@@ -261,7 +261,7 @@ bool wxRemoteHtmlHelpController::Quit()
|
|||||||
|
|
||||||
case -1:
|
case -1:
|
||||||
// cancelled
|
// cancelled
|
||||||
return FALSE;
|
return false;
|
||||||
|
|
||||||
case wxSIGNONE:
|
case wxSIGNONE:
|
||||||
case wxSIGHUP:
|
case wxSIGHUP:
|
||||||
@@ -281,7 +281,7 @@ bool wxRemoteHtmlHelpController::Quit()
|
|||||||
case wxSIGTERM:
|
case wxSIGTERM:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( sig == 0 )
|
if ( sig == 0 )
|
||||||
{
|
{
|
||||||
@@ -317,7 +317,7 @@ bool wxRemoteHtmlHelpController::Quit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRemoteHtmlHelpController::Display(const wxString& helpfile)
|
void wxRemoteHtmlHelpController::Display(const wxString& helpfile)
|
||||||
@@ -348,16 +348,16 @@ void wxRemoteHtmlHelpController::Display(const int id)
|
|||||||
bool wxRemoteHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg)
|
bool wxRemoteHtmlHelpController::AddBook(const wxString& book, bool show_wait_msg)
|
||||||
{
|
{
|
||||||
//ignore show_wait_msg - there shouldn't be a delay in this step
|
//ignore show_wait_msg - there shouldn't be a delay in this step
|
||||||
//show_wait_msg = TRUE could be transmitted with ++AddBook
|
//show_wait_msg = true could be transmitted with ++AddBook
|
||||||
m_book = book;
|
m_book = book;
|
||||||
|
|
||||||
if( isconn_1 ) {
|
if( isconn_1 ) {
|
||||||
if (!m_connection->Poke( wxT("--AddBook"), (char*)book.c_str() ) )
|
if (!m_connection->Poke( wxT("--AddBook"), (char*)book.c_str() ) )
|
||||||
wxLogError(wxT("wxRemoteHtmlHelpController - AddBook Failed"));
|
wxLogError(wxT("wxRemoteHtmlHelpController - AddBook Failed"));
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxRemoteHtmlHelpController::DisplayContents()
|
bool wxRemoteHtmlHelpController::DisplayContents()
|
||||||
@@ -365,10 +365,10 @@ bool wxRemoteHtmlHelpController::DisplayContents()
|
|||||||
if( isconn_1 ) {
|
if( isconn_1 ) {
|
||||||
if (!m_connection->Poke( wxT("--DisplayContents"), wxT("") ) ) {
|
if (!m_connection->Poke( wxT("--DisplayContents"), wxT("") ) ) {
|
||||||
wxLogError(wxT("wxRemoteHtmlHelpController - DisplayContents Failed"));
|
wxLogError(wxT("wxRemoteHtmlHelpController - DisplayContents Failed"));
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
void wxRemoteHtmlHelpController::DisplayIndex()
|
void wxRemoteHtmlHelpController::DisplayIndex()
|
||||||
{
|
{
|
||||||
@@ -382,10 +382,10 @@ bool wxRemoteHtmlHelpController::KeywordSearch(const wxString& keyword)
|
|||||||
if( isconn_1 ) {
|
if( isconn_1 ) {
|
||||||
if (!m_connection->Poke( wxT("--KeywordSearch"), (char*)keyword.c_str() ) ) {
|
if (!m_connection->Poke( wxT("--KeywordSearch"), (char*)keyword.c_str() ) ) {
|
||||||
wxLogError(wxT("wxRemoteHtmlHelpController - KeywordSearch Failed"));
|
wxLogError(wxT("wxRemoteHtmlHelpController - KeywordSearch Failed"));
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxRemoteHtmlHelpController::SetTitleFormat(const wxString& format)
|
void wxRemoteHtmlHelpController::SetTitleFormat(const wxString& format)
|
||||||
|
@@ -55,7 +55,7 @@ public:
|
|||||||
void SetServer(wxString& a_appname); //could be wxHelpController::SetViewer
|
void SetServer(wxString& a_appname); //could be wxHelpController::SetViewer
|
||||||
|
|
||||||
//standard wxHtmlHelpController functions
|
//standard wxHtmlHelpController functions
|
||||||
bool AddBook(const wxString& book, bool show_wait_msg = FALSE);
|
bool AddBook(const wxString& book, bool show_wait_msg = false);
|
||||||
void Display(const wxString& x);
|
void Display(const wxString& x);
|
||||||
void Display(const int id);
|
void Display(const int id);
|
||||||
bool DisplayContents();
|
bool DisplayContents();
|
||||||
|
@@ -38,5 +38,5 @@ bool MyApp::OnInit()
|
|||||||
data.AddBook(argv[i]);
|
data.AddBook(argv[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
@@ -2195,12 +2195,16 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
|
|||||||
{
|
{
|
||||||
if ( start ) {
|
if ( start ) {
|
||||||
// DHS
|
// DHS
|
||||||
if (TwoColWidthA > -1) {
|
if (TwoColWidthA > -1)
|
||||||
|
{
|
||||||
wxChar buf[100];
|
wxChar buf[100];
|
||||||
wxSnprintf(buf, sizeof(buf), _T("\n<TR><TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthA);
|
wxSnprintf(buf, sizeof(buf), _T("\n<TR><TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthA);
|
||||||
TexOutput(buf);
|
TexOutput(buf);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
TexOutput(_T("\n<TR><TD VALIGN=TOP>\n"));
|
TexOutput(_T("\n<TR><TD VALIGN=TOP>\n"));
|
||||||
|
}
|
||||||
OutputFont();
|
OutputFont();
|
||||||
} else
|
} else
|
||||||
TexOutput(_T("\n</FONT></TD>\n"));
|
TexOutput(_T("\n</FONT></TD>\n"));
|
||||||
@@ -2208,13 +2212,18 @@ bool HTMLOnArgument(int macroId, int arg_no, bool start)
|
|||||||
if (arg_no == 2)
|
if (arg_no == 2)
|
||||||
{
|
{
|
||||||
// DHS
|
// DHS
|
||||||
if ( start ) {
|
if ( start )
|
||||||
if (TwoColWidthB > -1) {
|
{
|
||||||
|
if (TwoColWidthB > -1)
|
||||||
|
{
|
||||||
wxChar buf[100];
|
wxChar buf[100];
|
||||||
wxSnprintf(buf, sizeof(buf), _T("\n<TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthB);
|
wxSnprintf(buf, sizeof(buf), _T("\n<TD VALIGN=TOP WIDTH=%d>\n"),TwoColWidthB);
|
||||||
TexOutput(buf);
|
TexOutput(buf);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
TexOutput(_T("\n<TD VALIGN=TOP>\n"));
|
TexOutput(_T("\n<TD VALIGN=TOP>\n"));
|
||||||
|
}
|
||||||
OutputFont();
|
OutputFont();
|
||||||
} else
|
} else
|
||||||
TexOutput(_T("\n</FONT></TD></TR>\n"));
|
TexOutput(_T("\n</FONT></TD></TR>\n"));
|
||||||
|
@@ -21,7 +21,7 @@ struct ColumnData
|
|||||||
int spacing; // Space between columns in twips
|
int spacing; // Space between columns in twips
|
||||||
bool leftBorder;
|
bool leftBorder;
|
||||||
bool rightBorder;
|
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[];
|
extern ColumnData TableData[];
|
||||||
|
@@ -109,7 +109,7 @@ int subsectionFont = 12; // largeFont1;
|
|||||||
int titleFont = LARGEFont3;
|
int titleFont = LARGEFont3;
|
||||||
int authorFont = LargeFont2;
|
int authorFont = LargeFont2;
|
||||||
int mirrorMargins = true;
|
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 isInteractive = false;
|
||||||
bool runTwice = false;
|
bool runTwice = false;
|
||||||
int convertMode = TEX_RTF;
|
int convertMode = TEX_RTF;
|
||||||
@@ -117,7 +117,7 @@ bool checkCurleyBraces = false;
|
|||||||
bool checkSyntax = false;
|
bool checkSyntax = false;
|
||||||
bool headerRule = false;
|
bool headerRule = false;
|
||||||
bool footerRule = 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)
|
// (Quality of RTF generation deteriorate)
|
||||||
bool generateHPJ; // Generate WinHelp Help Project file
|
bool generateHPJ; // Generate WinHelp Help Project file
|
||||||
wxChar *winHelpTitle = NULL; // Windows Help title
|
wxChar *winHelpTitle = NULL; // Windows Help title
|
||||||
@@ -204,12 +204,12 @@ int CurrentInputIndex = 0;
|
|||||||
wxChar *TexFileRoot = NULL;
|
wxChar *TexFileRoot = NULL;
|
||||||
wxChar *TexBibName = NULL; // Bibliography output file name
|
wxChar *TexBibName = NULL; // Bibliography output file name
|
||||||
wxChar *TexTmpBibName = NULL; // Temporary bibliography output file name
|
wxChar *TexTmpBibName = NULL; // Temporary bibliography output file name
|
||||||
bool isSync = false; // If TRUE, should not yield to other processes.
|
bool isSync = false; // If true, should not yield to other processes.
|
||||||
bool stopRunning = false; // If TRUE, should abort.
|
bool stopRunning = false; // If true, should abort.
|
||||||
|
|
||||||
static int currentColumn = 0;
|
static int currentColumn = 0;
|
||||||
wxChar *currentArgData = NULL;
|
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 *currentArgument = NULL;
|
||||||
TexChunk *nextChunk = NULL;
|
TexChunk *nextChunk = NULL;
|
||||||
bool isArgOptional = false;
|
bool isArgOptional = false;
|
||||||
@@ -967,7 +967,7 @@ void MacroError(wxChar *buffer)
|
|||||||
* Parse an argument.
|
* Parse an argument.
|
||||||
* 'environment' specifies the name of the macro IFF if we're looking for the end
|
* '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.
|
* 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
|
* e.g. in {\bf an argument} as opposed to \vskip 30pt
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@@ -217,7 +217,7 @@ extern int sectionFont;
|
|||||||
extern int subsectionFont;
|
extern int subsectionFont;
|
||||||
extern int titleFont;
|
extern int titleFont;
|
||||||
extern int authorFont;
|
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 isInteractive;
|
||||||
extern bool runTwice;
|
extern bool runTwice;
|
||||||
extern int convertMode;
|
extern int convertMode;
|
||||||
@@ -332,7 +332,7 @@ extern void FakeCurrentSection(wxChar *fakeSection, bool addToContents = true);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
extern wxChar *currentArgData;
|
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 StartSimulateArgument(wxChar *data);
|
||||||
void EndSimulateArgument(void);
|
void EndSimulateArgument(void);
|
||||||
|
|
||||||
@@ -345,7 +345,7 @@ void EndSimulateArgument(void);
|
|||||||
void OnMacro(int macroId, int no_args, bool start);
|
void OnMacro(int macroId, int no_args, bool start);
|
||||||
|
|
||||||
// Called on start/end of argument examination.
|
// 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.
|
// (output) the argument.
|
||||||
bool OnArgument(int macroId, int arg_no, bool start);
|
bool OnArgument(int macroId, int arg_no, bool start);
|
||||||
|
|
||||||
|
@@ -1713,7 +1713,7 @@ wxChar *ConvertCase(wxChar *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !WXWIN_COMPATIBILITY_2
|
#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 StringMatch(const wxChar *str1, const wxChar *str2, bool subString,
|
||||||
bool exact)
|
bool exact)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user