- Timestamp:
- 06/29/13 18:04:06 (11 years ago)
- Location:
- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4
- Files:
-
- 7 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlEditor.Designer.cs
r9519 r9674 28 28 private void InitializeComponent() { 29 29 this.compileButton = new System.Windows.Forms.Button(); 30 this.gpdlTextBox = new System.Windows.Forms.TextBox();31 30 this.splitContainer = new System.Windows.Forms.SplitContainer(); 32 31 this.viewHost = new HeuristicLab.MainForm.WindowsForms.ViewHost(); 32 this.elementHost = new System.Windows.Forms.Integration.ElementHost(); 33 this.codeEditor = new HeuristicLab.Problems.GPDL.Views.CodeEditor(); 33 34 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 34 35 this.splitContainer.Panel1.SuspendLayout(); … … 48 49 this.compileButton.Click += new System.EventHandler(this.compileButton_Click); 49 50 // 50 // gpdlTextBox51 //52 this.gpdlTextBox.AcceptsReturn = true;53 this.gpdlTextBox.AcceptsTab = true;54 this.gpdlTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)55 | System.Windows.Forms.AnchorStyles.Left)56 | System.Windows.Forms.AnchorStyles.Right)));57 this.gpdlTextBox.Font = new System.Drawing.Font("Courier New", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));58 this.gpdlTextBox.Location = new System.Drawing.Point(3, 3);59 this.gpdlTextBox.Multiline = true;60 this.gpdlTextBox.Name = "gpdlTextBox";61 this.gpdlTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both;62 this.gpdlTextBox.Size = new System.Drawing.Size(655, 422);63 this.gpdlTextBox.TabIndex = 1;64 //65 51 // splitContainer 66 52 // … … 77 63 // splitContainer.Panel2 78 64 // 65 this.splitContainer.Panel2.Controls.Add(this.elementHost); 79 66 this.splitContainer.Panel2.Controls.Add(this.compileButton); 80 this.splitContainer.Panel2.Controls.Add(this.gpdlTextBox);81 67 this.splitContainer.Size = new System.Drawing.Size(661, 487); 82 68 this.splitContainer.SplitterDistance = 26; … … 97 83 this.viewHost.ViewType = null; 98 84 // 85 // elementHost 86 // 87 this.elementHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 88 | System.Windows.Forms.AnchorStyles.Left) 89 | System.Windows.Forms.AnchorStyles.Right))); 90 this.elementHost.Location = new System.Drawing.Point(0, 0); 91 this.elementHost.Name = "elementHost"; 92 this.elementHost.Size = new System.Drawing.Size(661, 425); 93 this.elementHost.TabIndex = 2; 94 this.elementHost.Text = "elementHost2"; 95 this.elementHost.Child = this.codeEditor; 96 // 99 97 // GpdlEditor 100 98 // … … 106 104 this.splitContainer.Panel1.ResumeLayout(false); 107 105 this.splitContainer.Panel2.ResumeLayout(false); 108 this.splitContainer.Panel2.PerformLayout();109 106 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 110 107 this.splitContainer.ResumeLayout(false); … … 117 114 private ViewHost viewHost; 118 115 private System.Windows.Forms.Button compileButton; 119 private System.Windows.Forms.TextBox gpdlTextBox;120 116 private System.Windows.Forms.SplitContainer splitContainer; 117 private System.Windows.Forms.Integration.ElementHost elementHost; 118 private CodeEditor codeEditor; 121 119 } 122 120 } -
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlEditor.cs
r9528 r9674 19 19 20 20 private void compileButton_Click(object sender, EventArgs e) { 21 Utils.InstallModule("Utils", new Utils.ModuleMethodDelegate(Utils.UtilsMethod));22 Utils.InstallModule("Sets", new Utils.ModuleMethodDelegate(Sets.SetsMethod));23 Utils.InstallModule("Errors", new Utils.ModuleMethodDelegate(Errors.ErrorsMethod));21 Utils.InstallModule("Utils", Utils.UtilsMethod); 22 Utils.InstallModule("Sets", Sets.SetsMethod); 23 Utils.InstallModule("Errors", Errors.ErrorsMethod); 24 24 25 Utils.InstallModule("GPDefLex", new Utils.ModuleMethodDelegate(GPDefLex.GPDefLexMethod));26 Utils.InstallModule("GPDefSem", new Utils.ModuleMethodDelegate(GPDefSem.GPDefSemMethod));27 Utils.InstallModule("GPDefSyn", new Utils.ModuleMethodDelegate(GPDefSyn.GPDefSynMethod));25 Utils.InstallModule("GPDefLex", GPDefLex.GPDefLexMethod); 26 Utils.InstallModule("GPDefSem", GPDefSem.GPDefSemMethod); 27 Utils.InstallModule("GPDefSyn", GPDefSyn.GPDefSynMethod); 28 28 29 29 // --- initialize modules --- … … 32 32 Errors.PushAbortMethod(new Errors.AbortMethod(Abort)); 33 33 34 using (var src = new StringReader( gpdlTextBox.Text)) {34 using (var src = new StringReader(codeEditor.textEditor.Text)) { 35 35 GPDefLex.src = src; 36 36 GPDefSyn.Parse(); 37 37 } 38 38 39 GPDefLex.InitLex(); 40 GPDefSyn.Interpret(); 39 codeEditor.ClearErrors(); 41 40 42 MainForm.MainFormManager.MainForm.ShowContent(GPDefSem.problem); 41 if (Errors.NumOfErrors() == 0) { 42 GPDefLex.InitLex(); 43 GPDefSyn.Interpret(); 44 45 MainForm.MainFormManager.MainForm.ShowContent(GPDefSem.problem); 46 } else { 47 int nLexErrors = Errors.NumOfLexErrors(); 48 for (int i = 0; i < nLexErrors; i++) { 49 var lexErr = Errors.GetLexError(i == 0); 50 codeEditor.SetLexError(lexErr.msg, lexErr.line, lexErr.col); 51 } 52 int nSynErrors = Errors.NumOfSynErrors(); 53 for (int i = 0; i < nSynErrors; i++) { 54 var synErr = Errors.GetSynError(i == 0); 55 codeEditor.SetLexError(synErr.msg, synErr.line, synErr.col); 56 } 57 } 43 58 } 44 59 … … 48 63 49 64 void IProblemInstanceConsumer<string>.Load(string data) { 50 this.gpdlTextBox.Text = data;65 codeEditor.textEditor.Text = data; 51 66 } 52 53 67 } 54 68 } -
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/HeuristicLab.Problems.GPDL.Views-3.4.csproj
r9528 r9674 143 143 <Private>False</Private> 144 144 </Reference> 145 <Reference Include="ICSharpCode.AvalonEdit, Version=4.3.1.9430, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL"> 146 <SpecificVersion>False</SpecificVersion> 147 <HintPath>.\ICSharpCode.AvalonEdit.dll</HintPath> 148 <Private>False</Private> 149 </Reference> 150 <Reference Include="PresentationCore" /> 151 <Reference Include="PresentationFramework" /> 145 152 <Reference Include="System" /> 146 153 <Reference Include="System.Core"> … … 150 157 <Reference Include="System.Windows.Forms" /> 151 158 <Reference Include="System.Windows.Forms.DataVisualization" /> 159 <Reference Include="System.Xaml" /> 152 160 <Reference Include="System.Xml.Linq"> 153 161 <RequiredTargetFramework>3.5</RequiredTargetFramework> … … 158 166 <Reference Include="System.Data" /> 159 167 <Reference Include="System.Xml" /> 160 </ItemGroup> 161 <ItemGroup> 168 <Reference Include="WindowsBase" /> 169 <Reference Include="WindowsFormsIntegration" /> 170 </ItemGroup> 171 <ItemGroup> 172 <Compile Include="CodeEditor.xaml.cs"> 173 <DependentUpon>CodeEditor.xaml</DependentUpon> 174 </Compile> 175 <Compile Include="ColorizeErrors.cs" /> 176 <Compile Include="GpdlCompletionData.cs" /> 162 177 <Compile Include="GpdlProblemInstanceConsumerView.cs"> 163 178 <SubType>UserControl</SubType> … … 182 197 <None Include="Plugin.cs.frame" /> 183 198 <None Include="Properties\AssemblyInfo.cs.frame" /> 199 <None Include="SyntaxDefinition.xsd"> 200 <SubType>Designer</SubType> 201 </None> 184 202 </ItemGroup> 185 203 <ItemGroup> … … 219 237 </ItemGroup> 220 238 <ItemGroup> 239 <None Include="Resources\GPDL.xshd" /> 221 240 <None Include="Resources\multi-output-multiplier.txt" /> 222 241 </ItemGroup> … … 233 252 <Private>False</Private> 234 253 </ProjectReference> 254 </ItemGroup> 255 <ItemGroup> 256 <Page Include="CodeEditor.xaml"> 257 <SubType>Designer</SubType> 258 <Generator>MSBuild:Compile</Generator> 259 </Page> 260 </ItemGroup> 261 <ItemGroup> 262 <Content Include="ICSharpCode.AvalonEdit.dll"> 263 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 264 </Content> 235 265 </ItemGroup> 236 266 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Plugin.cs.frame
r9430 r9674 28 28 [Plugin("HeuristicLab.Problems.GPDL.Views","Provides views to define genetic programming problems using GPDL.", "3.4.0.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.GPDL.Views-3.4.dll", PluginFileType.Assembly)] 30 [PluginFile("ICSharpCode.AvalonEdit.dll", PluginFileType.Assembly)] 30 31 public class Plugin : PluginBase { 31 32 } -
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/Resources.Designer.cs
r9519 r9674 146 146 147 147 /// <summary> 148 /// Looks up a localized string similar to <!-- Syntax definition of GPDL for Avalonedit syntax highlighting --> 149 ///<SyntaxDefinition name="GPDL" 150 /// xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008"> 151 /// <Color name="Comment" foreground="Green" /> 152 /// <Color name="String" foreground="Blue" /> 153 /// 154 /// <!-- This is the main ruleset. --> 155 /// <RuleSet> 156 /// <Span color="Comment" multiline="true" nested="true" 157 /// begin="/\*" end="\*/" /> 158 /// 159 /// <Span color="SourceCode" multiline="true" 160 /// begin="&lt;&lt;" end="&gt;&gt;" /> 161 /// <K [rest of string was truncated]";. 162 /// </summary> 163 internal static string GPDL { 164 get { 165 return ResourceManager.GetString("GPDL", resourceCulture); 166 } 167 } 168 169 /// <summary> 148 170 /// Looks up a localized string similar to PROBLEM MultiOutputMultiplier 149 171 /// -
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/Properties/Resources.resx
r9519 r9674 128 128 <value>..\Resources\Fib.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value> 129 129 </data> 130 <data name="GPDL" type="System.Resources.ResXFileRef, System.Windows.Forms"> 131 <value>..\Resources\GPDL.xshd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value> 132 </data> 130 133 <data name="multi_output_multiplier" type="System.Resources.ResXFileRef, System.Windows.Forms"> 131 134 <value>..\Resources\multi-output-multiplier.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
Note: See TracChangeset
for help on using the changeset viewer.