Esempio n. 1
0
        public static StackPanel GetHeaderInsertFilter(StackPanel stk, int row, int Column, Grid parent)
        {
            stk.Background = UtilWPF.Vocour_header;
            UtilWPF.SetGridPosition(stk, row, Column, parent);

            return(stk);
        }
Esempio n. 2
0
        public static Button Quest_Edit(Button reference, int row, int Column, Grid parent, IQuest quest, QuestWpfItem wpf_item, StackPanel item_line)
        {
            var btn = Get(reference, row, Column, parent, UtilWPF.GetIconButton("save_black"));

            btn.Click += async(source, e) =>
            {
                btn.Content = UtilWPF.GetIconButton("save");
                await System.Threading.Tasks.Task.Delay(2000);

                btn.Content = UtilWPF.GetIconButton("save_black");

                if (quest is VocVM)
                {
                    QuestWpfUtil.EditClick(quest as VocVM, wpf_item as VocWpfItem, item_line);
                }
                else if (quest is PronVM)
                {
                    QuestWpfUtil.EditClick(quest as PronVM, wpf_item as PronWpfItem, item_line);
                }
                else if (quest is SpellVM)
                {
                    QuestWpfUtil.EditClick(quest as SpellVM, wpf_item as SpellWpfItem, item_line);
                }
            };

            return(btn);
        }
Esempio n. 3
0
        public static StackPanel Get(StackPanel reference, int row, int Column, Grid parent)
        {
            reference.Orientation = Orientation.Horizontal;
            UtilWPF.SetGridPosition(reference, row, Column, parent);

            return(reference);
        }
Esempio n. 4
0
        public static TextBox Get(TextBox reference, int row, int Column, Grid parent, string content)
        {
            var txt = Get(reference, content);

            UtilWPF.SetGridPosition(txt, row, Column, parent);

            return(txt);
        }
Esempio n. 5
0
        public static ButtonActive Is_active(ButtonActive reference, int row, int Column, Grid parent, bool isActive)
        {
            UtilWPF.SetGridPosition(reference, row, Column, parent);

            CreateBtnActive(reference, isActive);

            return(reference);
        }
Esempio n. 6
0
        public static Grid Get(int row, int Column, Grid parent, List <int> ColumnSizes, int rowQuantity)
        {
            var grid = Get(ColumnSizes, rowQuantity);

            UtilWPF.SetGridPosition(grid, row, Column, parent);

            return(grid);
        }
Esempio n. 7
0
        public static Grid GetRow(Grid reference, int row, int Column, Grid parent, List <int> ColumnSizes)
        {
            SetColumns(reference, ColumnSizes);
            UtilWPF.SetGridPosition(reference, row, Column, parent);
            reference.RowDefinitions.Add(new RowDefinition());

            return(reference);
        }
Esempio n. 8
0
        public static Button Definition(Button reference, int row, int Column, Grid parent, string def, TextBox txt_def)
        {
            var btn = Get(reference, row, Column, parent, UtilWPF.GetIconButton("definition"));

            CreateBtnLineBehavior(def, txt_def, btn);

            return(btn);
        }
Esempio n. 9
0
        public static CheckBox Get(CheckBox reference, int row, int Column, Grid parent, string content, bool isChecked)
        {
            var cb = Get(reference, content, isChecked);

            UtilWPF.SetGridPosition(cb, row, Column, parent);

            return(cb);
        }
Esempio n. 10
0
        public static Button Get(Button reference, int row, int Column, Grid parent, object content)
        {
            var btn = Get(reference, content);

            UtilWPF.SetGridPosition(btn, row, Column, parent);

            return(btn);
        }
Esempio n. 11
0
        public static Label Get(Label reference, int row, int Column, Grid parent, string content)
        {
            var lbl = Get(reference, content);

            UtilWPF.SetGridPosition(reference, row, Column, parent);

            return(reference);
        }
Esempio n. 12
0
        public static ComboBox Get(ComboBox reference, int row, int Column, Grid parent)
        {
            var cb = Get(reference);

            UtilWPF.SetGridPosition(cb, row, Column, parent);

            return(cb);
        }
Esempio n. 13
0
        public static TextBox PtBr(TextBox reference, string ptBr, StackPanel parent)
        {
            var txt = Get(reference, ptBr, parent);

            txt.Visibility = Visibility.Collapsed;
            txt.Background = UtilWPF.GetBrushFromHTMLColor("#edfaeb");
            txt.ToolTip    = "PtBr";

            return(txt);
        }
Esempio n. 14
0
        public static TextBox Bulk_Insert(TextBox reference, Grid parent)
        {
            reference.Text          = "// format:  words;answer";
            reference.TextWrapping  = TextWrapping.Wrap;
            reference.AcceptsReturn = true;
            UtilWPF.SetGridPosition(reference, 0, 0, parent);
            Grid.SetRowSpan(reference, 3);

            return(reference);
        }
Esempio n. 15
0
        public static Button PtBr(Button reference, int row, int Column, Grid parent, string ptBr, TextBox txt_ptBr)
        {
            var content = ptBr.IsEmpty() ? UtilWPF.GetIconButton("br_gray") : UtilWPF.GetIconButton("br");

            var btn = Get(reference, row, Column, parent, content);

            CreateBtnLineBehavior(ptBr, txt_ptBr, btn);

            return(btn);
        }
Esempio n. 16
0
        public static Button Remove(Button reference, int row, int Column, Grid parent, StackPanel item_line)
        {
            var btn = Get(reference, row, Column, parent, UtilWPF.GetIconButton("remove_v2"));

            btn.Height = 28;
            btn.Width  = 28;

            btn.Click += (source, e) => item_line.Children.Clear();

            return(btn);
        }
Esempio n. 17
0
        public static StackPanel GetListItems(int row, int Column, Grid parent)
        {
            var stk = new StackPanel();
            //stk.Background = UtilWPF.Vocour_row_off;
            var viewer = new ScrollViewer();

            viewer.Content = stk;
            UtilWPF.SetGridPosition(viewer, row, Column, parent);

            return(stk);
        }
Esempio n. 18
0
        public static Grid Bulk_Insert(Grid reference, Grid parent)
        {
            SetColumns(reference, new List <int>()
            {
                9, 1
            });
            reference.RowDefinitions.Add(new RowDefinition());
            reference.RowDefinitions.Add(new RowDefinition());
            reference.RowDefinitions.Add(new RowDefinition());
            reference.Margin = new Thickness(2, 0, 2, 0);
            UtilWPF.SetGridPosition(reference, 0, 0, parent);
            reference.Visibility = Visibility.Collapsed;
            reference.Background = UtilWPF.Vocour_header;

            return(reference);
        }
Esempio n. 19
0
        public static Button Bulk_back(Grid parent, IQuestWpfHeader header)
        {
            var btn = new Button();

            btn.Content           = "Back";
            btn.VerticalAlignment = VerticalAlignment.Center;
            btn.Margin            = new Thickness(1, 0, 1, 0);
            btn.Height            = 28;
            btn.Click            += (source, e) =>
            {
                header.Grid_bulk_insert.Visibility = Visibility.Collapsed;
                header.Stk_insert.Visibility       = Visibility.Visible;
            };
            UtilWPF.SetGridPosition(btn, 2, 1, parent);

            return(btn);
        }
Esempio n. 20
0
        private static void CreateBtnActive(ButtonActive reference, bool isActive)
        {
            reference.Content           = isActive ? UtilWPF.GetIconButton("switch_on") : UtilWPF.GetIconButton("switch_off");
            reference.VerticalAlignment = VerticalAlignment.Center;
            reference.Margin            = new Thickness(1, 0, 1, 0);
            reference.Background        = Brushes.Transparent;
            reference.BorderBrush       = Brushes.Transparent;
            reference.Width             = 32;
            reference.Height            = 32;

            reference.IsActived = isActive;

            reference.Click += (source, e) =>
            {
                reference.IsActived = !reference.IsActived;
                reference.Content   = reference.IsActived ? UtilWPF.GetIconButton("switch_on") : UtilWPF.GetIconButton("switch_off");;
            };
        }
Esempio n. 21
0
        public static Label AvgScore(Label reference, int row, int Column, Grid parent, IQuest quest, int duration, bool useColours = true)
        {
            var isWeek  = duration <= 7;
            var isMonth = duration <= 30;

            var avg     = isWeek ? quest.Avg_week : (isMonth ? quest.Avg_month : quest.Avg_all);
            var content = avg + "% " + (isWeek ? "(w)" : isMonth ? "(m)" : "");

            var lbl = Get(reference, row, Column, parent, content);

            if (useColours)
            {
                lbl.Foreground = UtilWPF.GetAvgColor(avg);
            }

            lbl.ToolTip = isWeek ? "week" : isMonth ? "month" : "all";

            return(lbl);
        }
Esempio n. 22
0
        public static Button Show_bulk_insert(int row, int Column, Grid parent, IQuestWpfHeader header)
        {
            var btn = new Button();

            btn.Content           = UtilWPF.GetIconButton("bulk_insert_2");
            btn.VerticalAlignment = VerticalAlignment.Center;
            //btn.Margin = new Thickness(1, 0, 1, 0);
            btn.Width       = 32;
            btn.Height      = 32;
            btn.Background  = Brushes.Transparent;
            btn.BorderBrush = Brushes.Transparent;
            btn.Click      += (source, e) =>
            {
                header.Grid_bulk_insert.Visibility = Visibility.Visible;
                header.Stk_insert.Visibility       = Visibility.Collapsed;
            };
            UtilWPF.SetGridPosition(btn, row, Column, parent);

            return(btn);
        }
Esempio n. 23
0
        public static StackPanel GetItemLine(StackPanel parent, bool isGridUpdate)
        {
            var stack = new StackPanel();

            stack.Margin      = new Thickness(0, 2, 2, 2);
            stack.Background  = UtilWPF.GetVocourLine(false, isGridUpdate);
            stack.MouseEnter += new MouseEventHandler((source, e) => stack.Background = UtilWPF.GetVocourLine(true, isGridUpdate));
            stack.MouseLeave += new MouseEventHandler((source, e) => stack.Background = UtilWPF.GetVocourLine(false, isGridUpdate));

            if (isGridUpdate)
            {
                parent.Children.Insert(0, stack);
            }
            else
            {
                parent.Children.Add(stack);
            }

            return(stack);
        }