Esempio n. 1
0
            public ProblemListView(ProblemModel model)
            {
                this.model = model;
                SetModel(model);
                ColumnController = new ColumnController();

                var selected = new ColumnCellCheckBox("SavedSelected", true);

                selected.Toggled += (o, a) => model.Reload();
                ColumnController.Add(new Column(Catalog.GetString("Fix?"), selected, 0));

                var summary     = new ColumnCellSolutionOptions();
                var summary_col = new Column("", summary, 1.0);

                ColumnController.Add(summary_col);

                var track_details_col = new Column(Catalog.GetString("Track details"),
                                                   new ColumnCellText("TrackDetails", true), 0);

                ColumnController.Add(track_details_col);

                model.Reloaded += (o, a) => {
                    track_details_col.Visible = model.Solver.HasTrackDetails;
                    summary_col.Title         = model.Solver.Name;
                };

                RowOpaquePropertyName = "Selected";
                RulesHint             = true;
                RowActivated         += (o, e) => model.ToggleSelection();
            }
            protected override bool OnKeyPressEvent(Gdk.EventKey press)
            {
                switch (press.Key)
                {
                case Gdk.Key.space:
                case Gdk.Key.Return:
                case Gdk.Key.KP_Enter:
                    model.ToggleSelection();
                    return(true);
                }

                return(base.OnKeyPressEvent(press));
            }