Ejemplo n.º 1
0
        private void TbSearch_TextChanged(NStack.ustring obj)
        {
            // everything they have ticked so far
            var ticked = Result;
            var search = _tbSearch.Text?.ToString();

            // plus everything else that matches on search text
            var matchingFilter = _original.Except(ticked)
                                 .Where(o => string.IsNullOrWhiteSpace(search) || o.ToString().Contains(search, StringComparison.CurrentCultureIgnoreCase))
                                 .ToArray();

            // make a list of all marked followed by unmarked but matching filter
            var all = ticked.ToList();

            all.AddRange(matchingFilter);

            // update the available list in the list view (destructive recreate)
            _available = all.ToArray();
            lv.SetSource(all);

            // since we changed the source we need to remark the originally ticked ones
            for (int i = 0; i < ticked.Length; i++)
            {
                lv.Source.SetMark(i, true);
            }
            SetNeedsDisplay();
        }
Ejemplo n.º 2
0
        private void CallsignEntry_Changed(object sender, NStack.ustring e)
        {
            var callsignData = locationLookup.GetCallsingComponents(callsignEntry.Text.ToString().ToUpper());

            if (callsignData != null)
            {
                ITUEntry = new TextField(20, 3, 12, callsignData.ITU);
                CQEntry  = new TextField(20, 5, 12, callsignData.CQ);
                window.Add(ITUEntry, CQEntry);
            }
        }
Ejemplo n.º 3
0
 private void TbTimeout_TextChanged(NStack.ustring value)
 {
     if (int.TryParse(value.ToString(), out int newTimeout))
     {
         _timeout = newTimeout < 0 ? DefaultTimeout : newTimeout;
     }
     else
     {
         _timeout = DefaultTimeout;
     }
 }
Ejemplo n.º 4
0
        private void Tbcontains_TextChanged(NStack.ustring obj)
        {
            _treeView.ClearObjects();

            if (string.IsNullOrWhiteSpace(_tbcontains.Text?.ToString()))
            {
                _treeView.AddObjects(_archivalDataLoadInfos);
            }
            else
            {
                _treeView.AddObjects(_archivalDataLoadInfos.Where(a => a.Description?.Contains(_tbcontains.Text.ToString()) ?? false));
            }

            _treeView.RebuildTree();
            _treeView.SetNeedsDisplay();
        }
Ejemplo n.º 5
0
        private static void SetupChampionSearch()
        {
            var summonerSearchInfoWindow = new FrameView("Item search and filtering")
            {
                X = Pos.Percent(0),
                Y = 1, // Leave place for top level menu and Summoner search

                // By using Dim.Fill(), it will automatically resize without manual intervention
                Width  = Dim.Fill(),
                Height = Dim.Percent(10)
            };

            ItemName = new TextField("")
            {
                X      = Pos.Left(summonerSearchInfoWindow),
                Y      = Pos.Percent(3),
                Width  = 30,
                Height = 1
            };

            ItemName.TextChanged += ItemName_TextChanged;
            summonerSearchInfoWindow.Add(ItemName);

            NStack.ustring[] elo  = new NStack.ustring[] { "All   ", "Armor   ", "Damage   ", "SpellDamage   ", "AttackSpeed   ", "Health   ", "Mana   " };
            RadioGroup       test = new RadioGroup(elo)
            {
                X      = Pos.Right(ItemName) + 5,
                Y      = Pos.Percent(3),
                Width  = 40,
                Height = 1
            };

            SelectedFiltering         = 0;
            test.DisplayMode          = DisplayModeLayout.Horizontal;
            test.SelectedItemChanged += FilterItemList;
            TagsRadio = test;
            summonerSearchInfoWindow.Add(test);
            SummonerSearchView = summonerSearchInfoWindow;
        }
Ejemplo n.º 6
0
        private static void SetupItemSetBlock()
        {
            var itemsetView = new FrameView("Itemset")
            {
                X = Pos.Percent(50),
                Y = Pos.Bottom(ItemDetailsView), // Leave place for top level menu and Summoner search

                // By using Dim.Fill(), it will automatically resize without manual intervention
                Width  = Dim.Fill(),
                Height = Dim.Fill()
            };

            ItemSetView = itemsetView;

            NStack.ustring[] blocks = new NStack.ustring[] { "1   ", "2   ", "3   ", "4   " };
            var blockRadio          = new RadioGroup(blocks)
            {
                X      = Pos.Percent(40),
                Y      = Pos.Percent(3),
                Width  = Dim.Fill(),
                Height = 1
            };

            blockRadio.DisplayMode = DisplayModeLayout.Horizontal;
            ItemSetView.Add(blockRadio);

            var blockFrameView1 = new FrameView("Block1")
            {
                X = Pos.Percent(0),
                Y = Pos.Bottom(blockRadio),

                Width  = Dim.Percent(50),
                Height = Dim.Percent(45)
            };
            var blockListView1 = new ListView()
            {
                X      = 0,
                Y      = 0,
                Width  = Dim.Fill(),
                Height = Dim.Fill()
            };

            Blocks[0] = blockListView1;
            blockFrameView1.Add(Blocks[0]);


            var blockFrameView2 = new FrameView("Block2")
            {
                X = Pos.Right(blockFrameView1),
                Y = Pos.Bottom(blockRadio),

                Width  = Dim.Fill(),
                Height = Dim.Percent(45)
            };

            var blockListView2 = new ListView()
            {
                X      = 0,
                Y      = 0,
                Width  = Dim.Fill(),
                Height = Dim.Fill()
            };

            Blocks[1] = blockListView2;
            blockFrameView2.Add(Blocks[1]);


            var blockFrameView3 = new FrameView("Block3")
            {
                X = Pos.Percent(0),
                Y = Pos.Bottom(blockFrameView1),

                Width  = Dim.Percent(50),
                Height = Dim.Fill() - 1
            };
            var blockListView3 = new ListView()
            {
                X      = 0,
                Y      = 0,
                Width  = Dim.Fill(),
                Height = Dim.Fill()
            };

            Blocks[2] = blockListView3;
            blockFrameView3.Add(Blocks[2]);


            var blockFrameView4 = new FrameView("Block4")
            {
                X = Pos.Right(blockFrameView3),
                Y = Pos.Bottom(blockFrameView2),

                Width  = Dim.Fill(),
                Height = Dim.Fill() - 1
            };
            var blockListView4 = new ListView()
            {
                X      = 0,
                Y      = 0,
                Width  = Dim.Fill(),
                Height = Dim.Fill()
            };

            Blocks[3] = blockListView4;
            blockFrameView4.Add(Blocks[3]);


            ItemSetView.Add(blockFrameView1);
            ItemSetView.Add(blockFrameView2);
            ItemSetView.Add(blockFrameView3);
            ItemSetView.Add(blockFrameView4);

            SelectedBlockId       = 0;
            Blocks[0].ColorScheme = Colors.Dialog;

            blockRadio.SelectedItemChanged += BlockRadio_SelectedItemChanged;

            Blocks[0].OpenSelectedItem += Block0openSelectedItem;
            Blocks[1].OpenSelectedItem += Block1openSelectedItem;
            Blocks[2].OpenSelectedItem += Block2openSelectedItem;
            Blocks[3].OpenSelectedItem += Block3openSelectedItem;


            var exportButton = new Button("Export")
            {
                X = Pos.Center(),
                Y = Pos.Bottom(blockFrameView3)
            };

            exportButton.Clicked += ExportButton_Clicked;
            ItemSetView.Add(exportButton);
        }
Ejemplo n.º 7
0
 private static void ItemName_TextChanged(NStack.ustring obj)
 {
     ItemListView.SetSource(LeagueUtilities.GetItemListByTagAndName(TagsRadio.RadioLabels[SelectedFiltering].ToString(), ItemName.Text.ToString()));
 }
Ejemplo n.º 8
0
 public KeyPreviewWindow(NStack.ustring title, int padding)
     : base(title, padding)
 {
 }
Ejemplo n.º 9
0
 public KeyPreviewWindow(NStack.ustring title)
     : base(title)
 {
 }