public TextFieldWithAccept(string label, string initialValue, string buttonText, Action onPressed)
        {
            _editLine  = new HorizontalSequenceDrawer();
            _textField = new TextField(label, initialValue);
            _button    = new Button.Button(buttonText, onPressed);
            var returnChecker = new ReturnChecker(_textField);

            returnChecker.ReturnPressed += onPressed;
            _editLine.AddDrawer(returnChecker);
            _editLine.AddDrawer(_button);
        }
Пример #2
0
        public static ListDrawer <T> CreateButtonedLabelList(IEnumerable <T> list, Func <T, string> labelDlg, Func <T, string> tooltipDlg = null, List <ButtonInfo <T> > buttons = null)
        {
            return(new ListDrawer <T>(list, item =>
            {
                var sequence = new HorizontalSequenceDrawer();
                sequence.AddDrawer(new DelegatedLabel <T>(item, labelDlg, tooltipDlg).EnableRichText());

                if (buttons != null)
                {
                    foreach (var buttonInfo in buttons)
                    {
                        sequence.AddDrawer(buttonInfo.CreateButton(item));
                    }
                }
                return sequence;
            }));
        }