예제 #1
0
        public static void AddIntoThis(SpellVM Spell, StackPanel item_line)
        {
            var row1 = MyGrids.GetRowItem(new List <int>()
            {
                4, 4, 2, 2, 2, 2, 2, 3, 1, 1, 1
            }, item_line);

            var row3 = new StackPanel();

            row3.Margin = new Thickness(1, 2, 1, 2);
            item_line.Children.Add(row3);

            var wpf = new SpellWpfItem();

            MyTxts.Get(wpf.Words, 0, 0, row1, Spell.Text);
            wpf.Words.ToolTip = "Id " + Spell.Id;
            MyCbBxs.Importance(wpf.Imp, 0, 1, row1, Spell.Importance, false);

            MyLbls.AvgScore(wpf.Avg_w, 0, 2, row1, Spell, 7);
            MyLbls.AvgScore(wpf.Avg_m, 0, 3, row1, Spell, 30);
            MyLbls.AvgScore(wpf.Avg_all, 0, 4, row1, Spell, 2000);
            MyLbls.Tries(wpf.Tries, 0, 5, row1, Spell);
            MyLbls.LastTry(wpf.Last_try, 0, 6, row1, Spell);
            MyLbls.Chance(wpf.Chance, 0, 7, row1, Spell);

            MyBtns.Is_active(wpf.IsActive, 0, 8, row1, Spell.IsActive);
            MyBtns.Quest_Edit(wpf.Edit, 0, 9, row1, Spell, wpf, item_line);
            MyBtns.Remove_quest(wpf.Remove, 0, 10, row1, Spell, item_line);
        }
        private void CreateFrame()
        {
            var stk_btns = MyStacks.Get(new StackPanel(), 4, 0, userControlGrid);

            stk_btns.HorizontalAlignment = HorizontalAlignment.Right;

            var btn_next   = new Button();
            var btn_verify = new Button();

            MyBtns.Chal_verify(btn_verify, stk_btns, btn_next);
            btn_verify.Click += (source, e) => lines.ForEach(x => ChalWPFControl.Verify(x, btn_verify, btn_next));

            MyBtns.Chal_next(btn_next, stk_btns, btn_verify, userControlGrid, lines, Model.Spell);
        }
        public static ChalLine CreateChalLine(IQuest quest, int row, Grid userControlGrid, Microsoft.Office.Interop.Word.Application wordApp = null)
        {
            var line = new ChalLine();

            line.Quest = quest;

            line.Chal.Grid_chal = MyGrids.GetChallenge(row, userControlGrid);

            MyStacks.Get(line.Chal.Row_1, 0, 0, line.Chal.Grid_chal);
            line.Chal.Row_1.Visibility = Visibility.Collapsed;

            MyLbls.Chal_answer(line.Chal.Answer, line.Chal.Row_1, quest.Text);

            if (quest is VocModel voc)
            {
                MyLbls.Get(line.Chal.PtBr, line.Chal.Row_1, voc.PtBr);
                line.Chal.PtBr.Foreground = Brushes.DarkBlue;
                MyLbls.Get(line.Chal.Definition, line.Chal.Row_1, voc.Definition);
            }

            var stk_2 = BuildSenChal(line, wordApp);

            UtilWPF.SetGridPosition(stk_2, 1, 0, line.Chal.Grid_chal);

            MyGrids.GetRow(line.Chal.Row_3, 2, 0, line.Chal.Grid_chal, new List <int>()
            {
                1, 1, 1, 1, 1, 1
            });
            line.Chal.Row_3.Visibility = Visibility.Collapsed;
            MyLbls.AvgScore(line.Chal.Avg_w, 0, 0, line.Chal.Row_3, line.Quest, 7, false);
            MyLbls.AvgScore(line.Chal.Avg_m, 0, 1, line.Chal.Row_3, line.Quest, 30, false);
            MyLbls.AvgScore(line.Chal.Avg_all, 0, 2, line.Chal.Row_3, line.Quest, 2000, false);
            MyLbls.Tries(line.Chal.Tries, 0, 3, line.Chal.Row_3, line.Quest);
            MyLbls.Get(line.Chal.Importante, 0, 4, line.Chal.Row_3, line.Quest.Importance.ToDesc());
            MyLbls.Chance(line.Chal.Chance, 0, 5, line.Chal.Row_3, line.Quest);
            line.Chal.Chance.Content.ToString().Insert(0, "was ");

            MyGrids.GetRow(line.Chal.Row_4, 3, 0, line.Chal.Grid_chal, new List <int>()
            {
                2, 1, 2, 1, 2
            });
            line.Chal.Row_4.Visibility = Visibility.Collapsed;

            MyBtns.Chal_remove_att(line);
            MyLbls.Chal_quest_id(line, 2);
            MyBtns.Chal_disable_quest(line);

            return(line);
        }
예제 #4
0
        private void BuildHeader()
        {
            var wpf = new SpellWpfHeader();

            var stk_insert = MyStacks.GetHeaderInsertFilter(wpf.Stk_insert, 0, 0, userControlGrid);

            wpf.Stk_items = stk_insert;

            MyGrids.Bulk_Insert(wpf.Grid_bulk_insert, userControlGrid);
            MyTxts.Bulk_Insert(wpf.Txt_bulk_insert, wpf.Grid_bulk_insert);
            var bulk_imp = MyCbBxs.Importance(wpf.Cob_bulk_imp, 0, 1, wpf.Grid_bulk_insert, Importance.My_own_relevant, false);

            bulk_imp.Height = 28;
            MyBtns.Insert_Bulk(wpf.Grid_bulk_insert, wpf);
            MyBtns.Bulk_back(wpf.Grid_bulk_insert, wpf);

            var stk_items = MyStacks.GetListItems(1, 0, userControlGrid);

            var grid_insert = MyGrids.Get(new List <int>()
            {
                4, 2, 2, 2, 2, 2, 2, 2, 2
            }, 2, stk_insert);

            grid_insert.Margin = new Thickness(2, 0, 2, 0);

            var filter = new SpellFilter();

            MyLbls.Header(wpf.Lbl_words, 0, 0, grid_insert, SortLbl.Words, wpf.Txt_words, filter, stk_items);
            MyLbls.Header(wpf.Lbl_imp, 0, 1, grid_insert, SortLbl.Imp, wpf.Cob_imp, filter, stk_items);
            MyLbls.Header(wpf.Lbl_avg_w, 0, 2, grid_insert, SortLbl.Score_w, wpf.Txt_avg_w, filter, stk_items);
            MyLbls.Header(wpf.Lbl_avg_m, 0, 3, grid_insert, SortLbl.Score_m, wpf.Txt_avg_m, filter, stk_items);
            MyLbls.Header(wpf.Lbl_avg_all, 0, 4, grid_insert, SortLbl.Score_all, wpf.Txt_avg_all, filter, stk_items);
            MyLbls.Header(wpf.Lbl_tries, 0, 5, grid_insert, SortLbl.Tries, wpf.Txt_tries, filter, stk_items);
            MyLbls.Header(wpf.Lbl_chance, 0, 6, grid_insert, SortLbl.Chance, wpf.Txt_chance, filter, stk_items);
            MyBtns.Is_active(wpf.Btn_isActive, 0, 7, grid_insert, true);
            MyBtns.Show_bulk_insert(0, 8, grid_insert, wpf);

            MyTxts.Get(wpf.Txt_words, 1, 0, grid_insert);
            MyCbBxs.Importance(wpf.Cob_imp, 1, 1, grid_insert, Importance.Any, true);
            MyTxts.Get(wpf.Txt_avg_w, 1, 2, grid_insert);
            MyTxts.Get(wpf.Txt_avg_m, 1, 3, grid_insert);
            MyTxts.Get(wpf.Txt_avg_all, 1, 4, grid_insert);
            MyTxts.Get(wpf.Txt_tries, 1, 5, grid_insert);
            MyTxts.Get(wpf.Txt_chance, 1, 6, grid_insert);
            MyBtns.Quest_Filter(wpf.Btn_filter, 1, 7, grid_insert, wpf, filter);
            MyBtns.Quest_Insert(wpf.Btn_insert, 1, 8, grid_insert, stk_items, wpf);

            filter.BuildStack(stk_items);
        }
예제 #5
0
        public static void AddIntoThis(PronVM Pron, StackPanel item_line)
        {
            var row1 = MyGrids.GetRowItem(new List <int>()
            {
                3, 3, 3, 2, 1, 1, 1
            }, item_line);

            var wpf = new PronWpfItem();

            MyTxts.Get(wpf.Words, 0, 0, row1, Pron.Text);
            wpf.Words.ToolTip = "Id " + Pron.Id;
            MyTxts.Get(wpf.Phonemes, 0, 1, row1, Pron.Phonemes);
            MyCbBxs.Importance(wpf.Imp, 0, 2, row1, Pron.Importance, false);
            MyLbls.Chance(wpf.Chance, 0, 3, row1, Pron);
            MyBtns.Is_active(wpf.IsActive, 0, 4, row1, Pron.IsActive);
            MyBtns.Quest_Edit(wpf.Edit, 0, 5, row1, Pron, wpf, item_line);
            MyBtns.Remove_quest(wpf.Remove, 0, 6, row1, Pron, item_line);
        }
예제 #6
0
        public static void AddIntoThis(VocVM Voc, StackPanel item_line)
        {
            var row1 = MyGrids.GetRowItem(new List <int>()
            {
                3, 1, 1
            }, item_line);

            var row2 = MyGrids.GetRowItem(new List <int>()
            {
                3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1
            }, item_line);

            var row3 = new StackPanel();

            row3.Margin = new Thickness(1, 2, 1, 2);
            item_line.Children.Add(row3);

            var wpf = new VocWpfItem();

            MyTxts.Get(wpf.Words, 0, 0, row1, Voc.Text);
            wpf.Words.ToolTip = "Id " + Voc.Id;
            MyTxts.Get(wpf.Answer, 0, 1, row1, Voc.Answer);
            MyCbBxs.Importance(wpf.Imp, 0, 2, row1, Voc.Importance, false);

            MyLbls.AvgScore(wpf.Avg_w, 0, 0, row2, Voc, 7);
            MyLbls.AvgScore(wpf.Avg_m, 0, 1, row2, Voc, 30);
            MyLbls.AvgScore(wpf.Avg_all, 0, 2, row2, Voc, 2000);
            MyLbls.Tries(wpf.Tries, 0, 3, row2, Voc);
            MyLbls.LastTry(wpf.Last_try, 0, 4, row2, Voc);
            MyLbls.Chance(wpf.Chance, 0, 5, row2, Voc);

            MyBtns.Is_active(wpf.IsActive, 0, 6, row2, Voc.IsActive);
            MyBtns.PtBr(wpf.Show_ptbr, 0, 7, row2, Voc.PtBr, wpf.Ptbr);
            MyBtns.Definition(wpf.Show_def, 0, 8, row2, Voc.Definition, wpf.Def);
            MyBtns.Quest_Edit(wpf.Edit, 0, 9, row2, Voc, wpf, item_line);
            MyBtns.Remove_quest(wpf.Remove, 0, 10, row2, Voc, item_line);

            MyTxts.Definition(wpf.Def, Voc.Definition, row3);
            MyTxts.PtBr(wpf.Ptbr, Voc.PtBr, row3);

            MyTxts.Add_sentence(wpf.Add_sen, wpf.Stk_sen);
        }