Changeset 193
- Timestamp:
- 03/09/07 03:35:44 (2 years ago)
- Files:
-
- TeachingSoftware/GUI/Method_Builder.xaml (modified) (2 diffs)
- TeachingSoftware/GUI/Method_Builder.xaml.cs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
TeachingSoftware/GUI/Method_Builder.xaml
r184 r193 21 21 <Label HorizontalAlignment="Left" Margin="25,75,0,0" x:Name="Label_ReturnType" VerticalAlignment="Top" Content="Return Type: " FontFamily="Tahoma" FontSize="13"/> 22 22 <Label HorizontalAlignment="Left" Margin="250,150,0,0" x:Name="Label_AddParamaters" VerticalAlignment="Top" Height="26.936" Content="Add parameters:
" FontFamily="Tahoma" FontSize="13"/> 23 <TextBox HorizontalAlignment="Left" Margin="150,50,0,0" x:Name="Text_Name" VerticalAlignment="Top" Width="200" Text="" TextWrapping="Wrap" Background="#FFEEEAEA" TabIndex="1"/> 24 <TextBox HorizontalAlignment="Left" Margin="150,75,0,0" x:Name="Text_ReturnType" VerticalAlignment="Top" Width="200" Text="" TextWrapping="Wrap" Background="#FFEEEAEA" TabIndex="3"/> 23 <TextBox HorizontalAlignment="Left" Margin="150,50,0,0" x:Name="Text_Name" VerticalAlignment="Top" Width="200" Text="" TextWrapping="Wrap" Background="#FFEEEAEA" TabIndex="1" AllowDrop="False"/> 25 24 <TextBox HorizontalAlignment="Left" Margin="325,200,50,0" x:Name="Text_ParameterName" VerticalAlignment="Top" Width="150" Text="" TextWrapping="Wrap" Background="#FFEEEAEA" TabIndex="6"/> 26 25 <ListBox HorizontalAlignment="Left" Margin="25,175,0,100" x:Name="List_Parameters" VerticalAlignment="Top" Width="200" Height="112.222" IsSynchronizedWithCurrentItem="True" Background="#FFEEEAEA" TabIndex="11"/> … … 54 53 </ComboBox> 55 54 <Button HorizontalAlignment="Left" Margin="275,250,0,0" x:Name="Button_Remove" VerticalAlignment="Top" Content="Remove" Click="Remove_Click" TabIndex="8"/> 56 <ComboBox HorizontalAlignment="Left" Margin="325,175,0,0" x:Name="Combo_ParameterTypes" VerticalAlignment="Top" Width="100" ItemsSource="{Binding}" IsSynchronizedWithCurrentItem=" True" TabIndex="5"/>55 <ComboBox HorizontalAlignment="Left" Margin="325,175,0,0" x:Name="Combo_ParameterTypes" VerticalAlignment="Top" Width="100" ItemsSource="{Binding}" IsSynchronizedWithCurrentItem="False" TabIndex="5"/> 57 56 <Label HorizontalAlignment="Left" Margin="275,200,0,0" x:Name="Label_ParamName" VerticalAlignment="Top" Content="Name:"/> 58 57 <Label HorizontalAlignment="Left" Margin="275,175,0,0" x:Name="Label_ParamType" VerticalAlignment="Top" Content="Type:"/> 59 <ComboBox HorizontalAlignment="Left" Margin="150,75,0,0" x:Name="Combo_Type" VerticalAlignment="Top" Width="100" ItemsSource = "{Binding}" IsSynchronizedWithCurrentItem=" True" TabIndex="2"/>58 <ComboBox HorizontalAlignment="Left" Margin="150,75,0,0" x:Name="Combo_Type" VerticalAlignment="Top" Width="100" ItemsSource = "{Binding}" IsSynchronizedWithCurrentItem="False" TabIndex="2"/> 60 59 </Grid> 61 60 </Grid> TeachingSoftware/GUI/Method_Builder.xaml.cs
r174 r193 10 10 using System.Collections; 11 11 using System.Collections.Generic; 12 using System.Collections.ObjectModel; 12 13 13 14 namespace TeachingSoftware … … 20 21 { 21 22 this.InitializeComponent(); 23 24 //ObservableCollection<String> VariableTypeList1 = Project.getProgramClasses(); 25 //ObservableCollection<String> VariableTypeList2 = Project.getProgramClasses(); 26 27 // Bind the listboxes for Types and parameter types to the list of Variables 22 28 23 29 this.Combo_ParameterTypes.DataContext = Project.getProgramClasses(); … … 31 37 // Insert code required on object creation below this point. 32 38 this.myContext = theContext; 39 40 // Bind the listboxes for Types and parameter types to the list of Variables 41 33 42 this.Combo_ParameterTypes.DataContext = Project.getProgramClasses(); 34 43 this.Combo_Type.DataContext = Project.getProgramClasses(); … … 57 66 for (int i = 0; i < List_Parameters.Items.Count; i++) 58 67 { 59 //MessageBox.Show(Combo_ParameterTypes.Items.GetItemAt(i).ToString());60 68 theList.Add(List_Parameters.Items.GetItemAt(i).ToString()); 61 //test += Combo_ParameterTypes.Items.GetItemAt(i).ToString();62 69 } 63 70 71 // String permission is the permission of the method - got from a ComboBox Combo_Scope 64 72 String[] array = Combo_Scope.SelectedItem.ToString().Split(' '); 65 73 String permission = (string)array.GetValue(1); 66 74 75 // String type is the return type of the method - got from Combo_Type 67 76 String type = Combo_Type.SelectedItem.ToString(); 68 //String[] array2 = Combo_Type.SelectedItem.ToString().Split(' ');69 //String type = (string)array2.GetValue(1);70 77 78 // Create the MethodComposite object 71 79 MethodComposite theNewMethodComposite 72 80 = new MethodComposite(permission, type, Text_Name.Text, theList); 73 81 74 //MessageBox.Show(test);75 82 MessageBox.Show(theNewMethodComposite.generateCode(0)); 76 83 84 // Add method to the project MainClass 77 85 Project.MainClass.addMethodDeclarations(theNewMethodComposite); 78 86
