Changeset 174
- Timestamp:
- 03/09/07 01:23:50 (2 years ago)
- Files:
-
- TeachingSoftware/Backend/MethodComposite.cs (modified) (1 diff)
- TeachingSoftware/GUI/Method_Builder.xaml (modified) (3 diffs)
- TeachingSoftware/GUI/Method_Builder.xaml.cs (modified) (6 diffs)
- TeachingSoftware/JavaInitializer.cs (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
TeachingSoftware/Backend/MethodComposite.cs
r152 r174 105 105 foreach (String element in parameterList) 106 106 { 107 if ( !element.Equals(parameterList[parameterList.Count - 1]))107 if (element.Equals(parameterList[parameterList.Count - 1])) 108 108 returnString += element; 109 109 else 110 returnString += ", " + element;110 returnString += element + ", "; 111 111 } 112 112 TeachingSoftware/GUI/Method_Builder.xaml
r144 r174 16 16 <Label HorizontalAlignment="Left" Margin="250,150,0,0" x:Name="Label_AddParamaters" VerticalAlignment="Top" Height="26.936" Content="Add parameters:
" FontFamily="Tahoma" FontSize="13"/> 17 17 <TextBox HorizontalAlignment="Left" Margin="150,50,0,0" x:Name="Text_Name" VerticalAlignment="Top" Width="200" Text="" TextWrapping="Wrap"/> 18 <TextBox HorizontalAlignment="Left" Margin="150,75,0,0" x:Name="Text_ReturnType" VerticalAlignment="Top" Width="200" Text="" TextWrapping="Wrap"/>19 18 <TextBox HorizontalAlignment="Left" Margin="325,200,50,0" x:Name="Text_ParameterName" VerticalAlignment="Top" Width="150" Text="" TextWrapping="Wrap"/> 20 19 <ListBox HorizontalAlignment="Left" Margin="25,175,0,100" x:Name="List_Parameters" VerticalAlignment="Top" Width="200" Height="112.222" IsSynchronizedWithCurrentItem="True"/> … … 23 22 <Button HorizontalAlignment="Left" Margin="175,300,0,0" x:Name="Button_Cancel" VerticalAlignment="Top" Content="Cancel" Click="Cancel_Clicked"/> 24 23 <Button RenderTransformOrigin="10.083,10.87" d:LayoutOverrides="Width, Height" HorizontalAlignment="Left" Margin="275,225,275,125" x:Name="Button_Add" VerticalAlignment="Top" Content="Add" Click="Add_Parameter"/> 25 <Label HorizontalAlignment="Left" Margin="25,100,0,0" x:Name="Label_Scope" VerticalAlignment="Top" Content=" Scope:"/>24 <Label HorizontalAlignment="Left" Margin="25,100,0,0" x:Name="Label_Scope" VerticalAlignment="Top" Content="Permission:"/> 26 25 <ComboBox HorizontalAlignment="Left" Margin="150,100,0,0" x:Name="Combo_Scope" VerticalAlignment="Top" Width="100" IsSynchronizedWithCurrentItem="True"> 27 26 <ListBoxItem Content="Private"/> … … 33 32 <Label HorizontalAlignment="Left" Margin="275,200,0,0" x:Name="Label_ParamName" VerticalAlignment="Top" Content="Name:"/> 34 33 <Label HorizontalAlignment="Left" Margin="275,175,0,0" x:Name="Label_ParamType" VerticalAlignment="Top" Content="Type:"/> 34 <ComboBox HorizontalAlignment="Left" Margin="150,75,0,0" x:Name="Combo_Type" VerticalAlignment="Top" Width="100" ItemsSource = "{Binding}" IsSynchronizedWithCurrentItem="True"/> 35 35 </Grid> 36 36 </Grid> TeachingSoftware/GUI/Method_Builder.xaml.cs
r144 r174 8 8 using System.Windows.Media.Animation; 9 9 using System.Windows.Navigation; 10 using System.Collections; 11 using System.Collections.Generic; 10 12 11 13 namespace TeachingSoftware … … 13 15 public partial class Method_Builder 14 16 { 15 16 17 private BodyOfCode myContext; 17 18 … … 21 22 22 23 this.Combo_ParameterTypes.DataContext = Project.getProgramClasses(); 24 this.Combo_Type.DataContext = Project.getProgramClasses(); 23 25 } 24 26 … … 30 32 this.myContext = theContext; 31 33 this.Combo_ParameterTypes.DataContext = Project.getProgramClasses(); 34 this.Combo_Type.DataContext = Project.getProgramClasses(); 32 35 } 33 36 … … 44 47 private void Submit_Clicked(object sender, RoutedEventArgs e) 45 48 { 46 if ( (Text_Name.Text == "") || ( Text_ParameterName.Text == "") || (Text_ReturnType.Text == "") )49 if ( (Text_Name.Text == "") || (Combo_Type.SelectedIndex == -1) || (Combo_Scope.SelectedIndex == -1) ) 47 50 { 48 51 MessageBox.Show("Please enter all information"); … … 50 53 else 51 54 { 55 List<String> theList = new List<string>(); 56 string test = Combo_Scope.SelectedItem.ToString(); 57 for (int i = 0; i < List_Parameters.Items.Count; i++) 58 { 59 //MessageBox.Show(Combo_ParameterTypes.Items.GetItemAt(i).ToString()); 60 theList.Add(List_Parameters.Items.GetItemAt(i).ToString()); 61 //test += Combo_ParameterTypes.Items.GetItemAt(i).ToString(); 62 } 63 64 String[] array = Combo_Scope.SelectedItem.ToString().Split(' '); 65 String permission = (string)array.GetValue(1); 66 67 String type = Combo_Type.SelectedItem.ToString(); 68 //String[] array2 = Combo_Type.SelectedItem.ToString().Split(' '); 69 //String type = (string)array2.GetValue(1); 70 71 MethodComposite theNewMethodComposite 72 = new MethodComposite(permission, type, Text_Name.Text, theList); 73 74 //MessageBox.Show(test); 75 MessageBox.Show(theNewMethodComposite.generateCode(0)); 76 77 Project.MainClass.addMethodDeclarations(theNewMethodComposite); 78 52 79 this.Close(); 53 80 } TeachingSoftware/JavaInitializer.cs
r165 r174 49 49 50 50 ClassComposite defaultClass = new ClassComposite("Default", "public static", true); 51 51 Project.MainClass = defaultClass; 52 52 53 return defaultClass; 53 54
