Exemple #1
0
 private void roboFunctClick(object sender, RoutedEventArgs e)
 {
     if (!loadLibrary)
     {
         loadLibrary         = true;
         roboLoadBtn.Content = "UPDATE";
         lessonPick          = new PopupInterface(Color.FromArgb(255, 185, 172, 252), 0, 0);
         roboGrid.Children.Add(lessonPick);
         Grid.SetColumn(lessonPick, 2);
         lessonPick.OkAddBtn.AddHandler(MouseLeftButtonDownEvent, new MouseButtonEventHandler(LoadOk_Click), true);
     }
     else
     {
         if (xmlDoc == null)
         {
             string           message = "Code is currently loading from server.\n\nPlease allow a few seconds and try again."; //message (code) displayed
             string           caption = "Loading From Server";                                                                 //header
             MessageBoxButton buttons = MessageBoxButton.OK;                                                                   //only allow OK and X buttons
             MessageBoxResult result  = MessageBox.Show(message, caption, buttons);                                            //display message window
         }
         else
         {
             loadLibrary         = false;
             roboLoadBtn.Content = "LOAD";
             programStructureList.Clear(); //clear program list
             robotFunctionsList.Clear();   //clear robot list
             readBlockAPI(true, xmlDoc);
             xmlDoc = null;
         }
     }
 }
Exemple #2
0
 //used to create
 private void createMethodBtn_Click(object sender, RoutedEventArgs e)
 {
     methodPop = new PopupInterface(Color.FromArgb(255, 153, 207, 126), etrMethodName, 8, -90, "METHOD");
     //methodPop.PopupComboBox.Items.Add((new ComboBoxItem().Content = ((new TextBlock()).Text = "VOID")));
     methodGrid.Children.Add(methodPop);
     Grid.SetColumn(methodPop, 2);
     methodPop.OkAddBtn.Click += new RoutedEventHandler(methodAdd_Click);
     methodPop.CreatePopup();
 }
Exemple #3
0
 //used to create
 private void createVariableBtn_Click(object sender, RoutedEventArgs e)
 {
     varPop = new PopupInterface(Color.FromArgb(255, 255, 174, 201), etrVarName, 8, -90, "VARIABLE");
     varPop.PopupComboBox.Items.RemoveAt(3);
     variableGrid.Children.Add(varPop);
     Grid.SetColumn(varPop, 2);
     varPop.OkAddBtn.Click += new RoutedEventHandler(variableAdd_Click);
     varPop.CreatePopup();
 }
 private void addParamBtn_Click(object sender, RoutedEventArgs e)
 {
     pop = new PopupInterface(Color.FromArgb(255, 153, 207, 126), etrParaName, 8, 20, "PARAMETER");
     pop.PopupComboBox.Items.RemoveAt(3);
     LayoutRoot.Children.Add(pop);
     Grid.SetColumn(pop, 0);
     Grid.SetRow(pop, 1);
     pop.OkAddBtn.Click += new RoutedEventHandler(parameterAdd_Click);
     pop.CreatePopup();
 }
 private void addParamBtn_Click(object sender, RoutedEventArgs e)
 {
     pop = new PopupInterface(Color.FromArgb(255, 153, 207, 126), etrParaName, 8, 20, "PARAMETER");
     pop.PopupComboBox.Items.RemoveAt(3);
     LayoutRoot.Children.Add(pop);
     Grid.SetColumn(pop, 0);
     Grid.SetRow(pop, 1);
     pop.OkAddBtn.Click += new RoutedEventHandler(parameterAdd_Click);
     pop.CreatePopup();
 }
Exemple #6
0
 //used to edit
 private void deleteMethodBtn_Click(object sender, RoutedEventArgs e)
 {
     methodPop = new PopupInterface(Color.FromArgb(255, 153, 207, 126), etrMethodName, 8, -90, "METHOD");
     methodGrid.Children.Add(methodPop);
     Grid.SetColumn(methodPop, 2);
     if (draggedItem != null)
     {
         methodPalette.ItemsSource = methodPop.DeletePopup(methodList, methodList[methodList.IndexOf(draggedItem)]); //remove from methodList
     }
     else
     {
         methodGrid.Children.Remove(methodPop);
     }
 }
Exemple #7
0
 //used to edit
 private void deleteVariableBtn_Click(object sender, RoutedEventArgs e)
 {
     varPop = new PopupInterface(Color.FromArgb(255, 255, 174, 201), etrVarName, 8, -90, "VARIABLE");
     variableGrid.Children.Add(varPop);
     Grid.SetColumn(varPop, 2);
     if (draggedItem != null)
     {
         variablePalette.ItemsSource = varPop.DeletePopup(variableList, variableList[variableList.IndexOf(draggedItem)]);
     }
     else
     {
         variableGrid.Children.Remove(varPop);
     }
 }
 private void deleteParamBtn_Click(object sender, RoutedEventArgs e)
 {
     pop = new PopupInterface(Color.FromArgb(255, 153, 207, 126), etrParaName, 8, 70, "PARAMETER");
     LayoutRoot.Children.Add(pop);
     Grid.SetColumn(pop, 0);
     Grid.SetRow(pop, 1);
     //need to add catch for no value selected
     if (selected != null && parameterList.IndexOf(selected) < parameterList.Count)
     {
         parameterBox.ItemsSource = pop.DeletePopup(parameterList, parameterList[parameterList.IndexOf(selected)]);
     }
     else
     {
         LayoutRoot.Children.Remove(pop);
     }
 }
        private void roboFunctClick(object sender, RoutedEventArgs e)
        {

            if (!loadLibrary)
            {
                loadLibrary = true;
                roboLoadBtn.Content = "UPDATE";
                lessonPick = new PopupInterface(Color.FromArgb(255,185,172,252), 0,0);
                roboGrid.Children.Add(lessonPick);
                Grid.SetColumn(lessonPick, 2);
                lessonPick.OkAddBtn.AddHandler(MouseLeftButtonDownEvent, new MouseButtonEventHandler(LoadOk_Click), true);
                
            }
            else
            {
                if (xmlDoc == null)
                {
                    string message = "Code is currently loading from server.\n\nPlease allow a few seconds and try again."; //message (code) displayed
                    string caption = "Loading From Server"; //header
                    MessageBoxButton buttons = MessageBoxButton.OK; //only allow OK and X buttons
                    MessageBoxResult result = MessageBox.Show(message, caption, buttons); //display message window
                }
                else
                {
                    loadLibrary = false;
                    roboLoadBtn.Content = "LOAD";
                    programStructureList.Clear(); //clear program list
                    robotFunctionsList.Clear(); //clear robot list
                    readBlockAPI(true, xmlDoc);
                    xmlDoc = null;
                }
            }
        }
 //used to edit
 private void deleteMethodBtn_Click(object sender, RoutedEventArgs e)
 {
     methodPop = new PopupInterface(Color.FromArgb(255, 153, 207, 126), etrMethodName, 8, -90, "METHOD");
     methodGrid.Children.Add(methodPop);
     Grid.SetColumn(methodPop, 2);
     if (draggedItem != null)
     {
         methodPalette.ItemsSource = methodPop.DeletePopup(methodList, methodList[methodList.IndexOf(draggedItem)]); //remove from methodList
         
     }
     else
         methodGrid.Children.Remove(methodPop);
 }
 //used to create
 private void createMethodBtn_Click(object sender, RoutedEventArgs e)
 {
     methodPop = new PopupInterface(Color.FromArgb(255, 153, 207, 126), etrMethodName, 8, -90, "METHOD");
     //methodPop.PopupComboBox.Items.Add((new ComboBoxItem().Content = ((new TextBlock()).Text = "VOID"))); 
     methodGrid.Children.Add(methodPop);
     Grid.SetColumn(methodPop, 2);
     methodPop.OkAddBtn.Click += new RoutedEventHandler(methodAdd_Click);
     methodPop.CreatePopup();
 }
 //used to edit
 private void deleteVariableBtn_Click(object sender, RoutedEventArgs e)
 {
     varPop = new PopupInterface(Color.FromArgb(255, 255, 174, 201), etrVarName, 8, -90, "VARIABLE");
     variableGrid.Children.Add(varPop);
     Grid.SetColumn(varPop, 2);
     if (draggedItem != null)
         variablePalette.ItemsSource = varPop.DeletePopup(variableList, variableList[variableList.IndexOf(draggedItem)]);
     else
         variableGrid.Children.Remove(varPop);
 }
 //used to create
 private void createVariableBtn_Click(object sender, RoutedEventArgs e)
 {
     varPop = new PopupInterface(Color.FromArgb(255, 255, 174, 201), etrVarName, 8, -90, "VARIABLE");
     varPop.PopupComboBox.Items.RemoveAt(3);
     variableGrid.Children.Add(varPop);
     Grid.SetColumn(varPop, 2);
     varPop.OkAddBtn.Click += new RoutedEventHandler(variableAdd_Click);
     varPop.CreatePopup();
 }
        private void deleteParamBtn_Click(object sender, RoutedEventArgs e)
        {
            pop = new PopupInterface(Color.FromArgb(255, 153, 207, 126), etrParaName, 8, 70, "PARAMETER");
            LayoutRoot.Children.Add(pop);
            Grid.SetColumn(pop, 0);
            Grid.SetRow(pop, 1);
            //need to add catch for no value selected
            if (selected != null && parameterList.IndexOf(selected) < parameterList.Count)
            {
                parameterBox.ItemsSource = pop.DeletePopup(parameterList, parameterList[parameterList.IndexOf(selected)]);  
            }
            else
                LayoutRoot.Children.Remove(pop);

        }