Patch #1176 2006-06-30 10:03
dermeister
Feature Request #2308: Multiline Program Parameters- Download
- 1176-Feature_Reques.patch (2.2 KB)
Index: src/sdk/selecttargetdlg.cpp
===================================================================
--- src/sdk/selecttargetdlg.cpp (revision 2639)
+++ src/sdk/selecttargetdlg.cpp (working copy)
@@ -117,7 +117,17 @@
ProjectBuildTarget* target = m_pProject->GetBuildTarget(m_Selected);
if (target)
{
- target->SetExecutionParameters(XRCCTRL(*this, "txtParams", wxTextCtrl)->GetValue());
+ /* Search all '\n' in the program-parameters and replace them by
+ ' '. This is necessary because a multiline text control may add
+ '\n' to the text but these characters must not be part of the
+ parameters when executing the program. */
+ wxString execution_parameters = XRCCTRL(*this, "txtParams", wxTextCtrl)->GetValue();
+ wxString::size_type pos = 0;
+
+ while ((pos = execution_parameters.find('\n', pos)) != wxString::npos)
+ execution_parameters[pos] = ' ';
+
+ target->SetExecutionParameters(execution_parameters);
target->SetHostApplication(XRCCTRL(*this, "txtHostApp", wxTextCtrl)->GetValue());
}
}
Index: src/sdk/resources/select_target.xrc
===================================================================
--- src/sdk/resources/select_target.xrc (revision 2639)
+++ src/sdk/resources/select_target.xrc (working copy)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resource>
<object class="wxDialog" name="dlgSelectTarget">
- <title>Select target</title>
+ <title>Select target</title>
<centered>1</centered>
<style>wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxRESIZE_BOX</style>
<object class="wxBoxSizer">
@@ -30,9 +30,12 @@
<border>8</border>
</object>
<object class="sizeritem">
- <object class="wxTextCtrl" name="txtParams"/>
+ <object class="wxTextCtrl" name="txtParams">
+ <style>wxTE_MULTILINE</style>
+ </object>
<flag>wxLEFT|wxRIGHT|wxEXPAND</flag>
<border>8</border>
+ <minsize>240,70</minsize>
</object>
<object class="sizeritem">
<object class="wxStaticText">
History
dermeister 2006-06-30 10:04
This patch implements feature reqtest #2308: Multiline Program Parameters
https://developer.berlios.de/feature/?func=detailfeature&feature_id=2308&group_id=5358
killerbot 2006-06-30 11:23
applied thx, rev 2645