Changeset 193

Show
Ignore:
Timestamp:
03/09/07 03:35:44 (2 years ago)
Author:
ssamara2
Message:

Updated Method_Builder.xaml so that listboxes were not synchronised with the data source anymore.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • TeachingSoftware/GUI/Method_Builder.xaml

    r184 r193  
    2121                        <Label HorizontalAlignment="Left" Margin="25,75,0,0" x:Name="Label_ReturnType" VerticalAlignment="Top" Content="Return Type: " FontFamily="Tahoma" FontSize="13"/> 
    2222                        <Label HorizontalAlignment="Left" Margin="250,150,0,0" x:Name="Label_AddParamaters" VerticalAlignment="Top" Height="26.936" Content="Add parameters:&#xd;&#xa;" 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"/> 
    2524                        <TextBox HorizontalAlignment="Left" Margin="325,200,50,0" x:Name="Text_ParameterName" VerticalAlignment="Top" Width="150" Text="" TextWrapping="Wrap" Background="#FFEEEAEA" TabIndex="6"/> 
    2625                        <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"/> 
     
    5453                        </ComboBox> 
    5554                        <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"/> 
    5756                        <Label HorizontalAlignment="Left" Margin="275,200,0,0" x:Name="Label_ParamName" VerticalAlignment="Top" Content="Name:"/> 
    5857                        <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"/> 
    6059                </Grid> 
    6160        </Grid> 
  • TeachingSoftware/GUI/Method_Builder.xaml.cs

    r174 r193  
    1010using System.Collections; 
    1111using System.Collections.Generic; 
     12using System.Collections.ObjectModel; 
    1213 
    1314namespace TeachingSoftware 
     
    2021        { 
    2122            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 
    2228 
    2329            this.Combo_ParameterTypes.DataContext = Project.getProgramClasses(); 
     
    3137            // Insert code required on object creation below this point. 
    3238            this.myContext = theContext; 
     39 
     40            // Bind the listboxes for Types and parameter types to the list of Variables 
     41 
    3342            this.Combo_ParameterTypes.DataContext = Project.getProgramClasses(); 
    3443            this.Combo_Type.DataContext = Project.getProgramClasses(); 
     
    5766                for (int i = 0; i < List_Parameters.Items.Count; i++) 
    5867                { 
    59                     //MessageBox.Show(Combo_ParameterTypes.Items.GetItemAt(i).ToString()); 
    6068                    theList.Add(List_Parameters.Items.GetItemAt(i).ToString()); 
    61                     //test += Combo_ParameterTypes.Items.GetItemAt(i).ToString(); 
    6269                } 
    6370 
     71                // String permission is the permission of the method - got from a ComboBox Combo_Scope 
    6472                String[] array = Combo_Scope.SelectedItem.ToString().Split(' '); 
    6573                String permission = (string)array.GetValue(1); 
    6674 
     75                // String type is the return type of the method - got from Combo_Type 
    6776                String type = Combo_Type.SelectedItem.ToString(); 
    68                 //String[] array2 = Combo_Type.SelectedItem.ToString().Split(' '); 
    69                 //String type = (string)array2.GetValue(1); 
    7077 
     78                // Create the MethodComposite object 
    7179                MethodComposite theNewMethodComposite 
    7280                    = new MethodComposite(permission, type, Text_Name.Text, theList); 
    7381 
    74                 //MessageBox.Show(test); 
    7582                MessageBox.Show(theNewMethodComposite.generateCode(0)); 
    7683 
     84                // Add method to the project MainClass 
    7785                Project.MainClass.addMethodDeclarations(theNewMethodComposite); 
    7886