Пример #1
0
        protected void RefreshGridColumns()
        {
            ColumnController cc = new ColumnController();

            AddNumberColumn(cc);

            AddPartnerColumn(cc);

            cc.Add(new Column(Translator.GetString("Location"), "Location", 0.2, "Location")
            {
                MinWidth = 70
            });

            CellTextDate ctd = new CellTextDate("Date");

            cc.Add(new Column(Translator.GetString("Date"), ctd, 0.1, "Date")
            {
                MinWidth = 80
            });

            if (highlightEntities)
            {
                highlight = new PangoStyle {
                    Color = Colors.Red
                };

                grid.CellStyleProvider = grid_CellStyleProvider;
            }

            grid.ColumnController = cc;
            grid.CellFocusIn     += grid_CellFocusIn;
        }
Пример #2
0
 protected override void AddPartnerColumn(ColumnController cc)
 {
     cc.Add(new Column(Translator.GetString("Partner"), "PartnerName", 0.2, "PartnerName")
     {
         MinWidth = 70
     });
 }
Пример #3
0
    void AddTileColumn(GameObject tile, int column, int times, int side)
    {
        //Debug.Log(Time.frameCount + "AddTile: " + tile.name + ", column = " + column + ", " + times + " times" + " side = " + side);
        SideController currentSide = currentBoard.GetSide(side);

        //Debug.Log("Current side = " + currentSide.name);

        if (column >= currentSide.NumColumns())
        {
            //Debug.Log("Adding a new column");
            currentSide.AddColumn();
        }

        ColumnController currentColumn = currentSide.GetCurrentColumn();

        //Debug.Log(Time.frameCount + "AddTile: currentColumn = " + currentColumn);
        CardController currentCard = currentColumn.GetCard();

        for (int i = 0; i < times; i++)
        {
            if (i != 0)
            {
                tile = Instantiate(tile);
            }
            tile.name = tile.GetComponent <TileController>().number + " " + Random.Range(0.1f, 100f);
            //Debug.Log(Time.frameCount + "AddTile: adding tile " + tile + " " + tile.transform.lossyScale);
            currentCard.AddTile(tile.GetComponent <TileController>());
        }
    }
Пример #4
0
 public ColumnCellArtistText()
     : base("DisplayName", true)
 {
     column_controller = new ColumnController ();
     var current_layout = new Column ("Artist", this, 1.0);
     column_controller.Add (current_layout);
 }
        private void InitializeAccessLevelsGrid()
        {
            gridAccessLevels = new ListView();

            scwAccessLevels.Add(gridAccessLevels);
            gridAccessLevels.Show();

            ColumnController cc = new ColumnController();

            Column col = new Column(Translator.GetString("Access level"), "Value", 0.2, "Value");

            col.MinWidth            = 70;
            col.ListCell.IsEditable = false;
            cc.Add(col);

            gridAccessLevels.ColumnController = cc;
            gridAccessLevels.Model            = new BindingListModel(User.GetAllAccessLevels().Where(
                                                                         k => k.Key < (int)BusinessDomain.LoggedUser.UserLevel ||
                                                                         (BusinessDomain.LoggedUser.UserLevel == UserAccessLevel.Owner && k.Key == (int)UserAccessLevel.Owner)));
            if (gridAccessLevels.Model.Count == 0)
            {
                scwAccessLevels.Visible = false;
                return;
            }
            gridAccessLevels.AllowMultipleSelect = false;
            gridAccessLevels.CellsFucusable      = true;
            gridAccessLevels.RulesHint           = true;
            gridAccessLevels.SortColumnsHint     = true;
            gridAccessLevels.Selection.Changed  += gridAccessLevels_SelectionChanged;
        }
Пример #6
0
        public ColumnCellArtistText() : base("DisplayName", true)
        {
            column_controller = new ColumnController();
            var current_layout = new Column("Artist", this, 1.0);

            column_controller.Add(current_layout);
        }
        protected override void InitializeGrid()
        {
            base.InitializeGrid();

            ColumnController cc = new ColumnController();

            Column col = new Column(Translator.GetString("Name"), "Name", 0.2, "Name")
            {
                MinWidth = 100
            };

            cc.Add(col);

            CellTextLookup <int> cellPaymentType = new CellTextLookup <int> ("BaseType")
                                                   .Load(PaymentType.GetAllBaseTypePairs());

            col = new Column(Translator.GetString("Type"), cellPaymentType, 0.1, "BaseType")
            {
                MinWidth = 100
            };
            cc.Add(col);

            grid.ColumnController = cc;

            btnGroups.Visible = false;
            btnGroups.Active  = false;
            btnGroups_Toggled(null, null);
        }
        private void InitializeUsersGrid()
        {
            users     = User.GetAll(BusinessDomain.LoggedUser.UserLevel);
            gridUsers = new ListView();

            scwUsers.Add(gridUsers);
            gridUsers.Show();

            ColumnController cc = new ColumnController();

            Column col = new Column(Translator.GetString("User"), "Name", 0.2, "Name");

            col.MinWidth            = 70;
            col.ListCell.IsEditable = false;
            cc.Add(col);

            gridUsers.ColumnController    = cc;
            gridUsers.Model               = users;
            gridUsers.AllowMultipleSelect = false;
            gridUsers.CellsFucusable      = true;
            gridUsers.RulesHint           = true;
            gridUsers.SortColumnsHint     = true;
            gridUsers.Realized           += grid_Realized;
            gridUsers.Selection.Changed  += gridUsers_SelectionChanged;
        }
Пример #9
0
    public void InsertCardAfter(ColumnController leftColumn, CardController newCard)
    {
        int index = columns.IndexOf(leftColumn);

        //Debug.Log("index = " + index + " while columns are " + columns.Count);
        if (((index + 1) >= columns.Count) ||
            ((index + 1) < columns.Count &&
             columns[index + 1].card))
        {
            //Debug.Log("Need to add a column");
            ColumnController newColumn = Instantiate(columnPrefab);
            columns.Insert(index + 1, newColumn);
            newColumn.transform.parent = transform;
            newColumn.SetSide(this);
            newColumn.transform.localPosition = Vector3.zero;
            Destroy(columns[index + 1].card.gameObject);
            columns[index + 1].SetCard(newCard);
            newCard.SetColumn(columns[index + 1]);
            newCard.transform.localPosition             = Vector3.zero;
            newCard.GetComponent <Collider2D>().enabled = true;
        }
        else if ((index + 1) < columns.Count)
        {
            //Debug.Log("Don't need to add column");
            columns[index + 1].SetCard(newCard);
            newCard.transform.localPosition             = Vector3.zero;
            newCard.GetComponent <Collider2D>().enabled = true;
        }
        else
        {
            //Debug.Log("Neither");
        }
    }
Пример #10
0
 public ColumnControllerTests(ScrumToolDBFixture p_ScrumToolDBFixture)
 {
     m_ScrumToolDBFixture = p_ScrumToolDBFixture;
     m_ParentBoardID      = m_ScrumToolDBFixture.FirstBoardID;
     m_ScrumToolDBContext = m_ScrumToolDBFixture.ScrumToolDB;
     m_ColumnController   = new ColumnController(m_ScrumToolDBContext);
 }
Пример #11
0
        protected override void InitializeGrid()
        {
            base.InitializeGrid();

            ColumnController cc = new ColumnController();

            CellTextNumber ctn = new CellTextNumber("Id")
            {
                FixedDigits = BusinessDomain.AppConfiguration.DocumentNumberLength
            };

            cc.Add(new Column(Translator.GetString("Number"), ctn, 0.1, "Id")
            {
                MinWidth = 90
            });
            cc.Add(new Column(Translator.GetString("Name"), "Name", 1, "Name")
            {
                MinWidth = 100
            });

            grid.ColumnController = cc;

            btnGroups.Visible = false;
            btnGroups.Active  = false;
            btnGroups_Toggled(null, null);
        }
Пример #12
0
        private ColumnController BuildDisplayColumnController(string localizedTitle)
        {
            var result = new ColumnController();

            result.Add(new Column(new ColumnDescription("DisplayName", localizedTitle, 100)));
            return(result);
        }
Пример #13
0
        protected override void InitializeGrid()
        {
            base.InitializeGrid();

            grid.CellStyleProvider = grid_CellStyleProvider;

            grid.WidthRequest  = 600;
            grid.HeightRequest = 250;

            ColumnController columnController = new ColumnController();

            Dictionary <bool, string> lookup = new Dictionary <bool, string> {
                { false, Translator.GetString("No") }, { true, Translator.GetString("Yes") }
            };
            CellTextLookup <bool> cellTextLookup = new CellTextLookup <bool> ("Enabled")
            {
                Lookup = lookup, Alignment = Alignment.Center
            };

            columnController.Add(new Column(Translator.GetString("Active"), cellTextLookup, 0.1, null)
            {
                MinWidth = 70
            });
            columnController.Add(new Column(Translator.GetString("Rule Name"), "Name", 1, null)
            {
                MinWidth = 70
            });
            columnController.Add(new Column(Translator.GetString("Priority"), "Priority", 0.1, null)
            {
                MinWidth = 90
            });

            grid.ColumnController   = columnController;
            grid.Selection.Changed += Selection_Changed;
        }
Пример #14
0
        async void PostComment_InvalidModel_DisplaysColumnPost(string commentText, string commentUsername)
        {
            var articlesRepoMock = new Mock <IColumnRepository>();

            articlesRepoMock.Setup(x => x.ColumnPosts).Returns(new ColumnPost[] { new ColumnPost {
                                                                                      Id = 1
                                                                                  } }.AsQueryable);
            var columnController = new ColumnController(articlesRepoMock.Object, new RecaptchaMock());
            var viewModel        = new ColumnRespondViewModel
            {
                ColumnId = 1,
                Comment  = new Comment
                {
                    Text     = commentText,
                    Username = commentUsername
                }
            };

            TestHelper.SimulateValidation(columnController, viewModel);
            TestHelper.SimulateValidation(columnController, viewModel.Comment);
            var result = (ViewResult)await columnController.PostComment(viewModel);

            Assert.Equal("ColumnPost", result.ViewName);
            articlesRepoMock.Verify(x => x.AddCommentToColumn(viewModel.Comment, viewModel.ColumnId), Times.Never);
        }
Пример #15
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();
            }
Пример #16
0
        private void InitializeGrid()
        {
            gridBarcodes = new ListView();

            ColumnController columnController = new ColumnController();
            Column           column           = new Column(string.Empty, new CellText(string.Empty)
            {
                IsEditable = true
            }, 1);

            column.ButtonPressEvent += Column_ButtonPressEvent;
            column.KeyPressEvent    += Column_KeyPressEvent;
            columnController.Add(column);

            scwGrid.Add(gridBarcodes);
            gridBarcodes.HeaderVisible = false;
            gridBarcodes.Show();

            BindingListModel <string> bindingListModel = new BindingListModel <string> (barcodes);

            gridBarcodes.ColumnController   = columnController;
            gridBarcodes.Model              = bindingListModel;
            gridBarcodes.AllowSelect        = false;
            gridBarcodes.CellsFucusable     = true;
            gridBarcodes.ManualFucusChange  = true;
            gridBarcodes.RulesHint          = true;
            gridBarcodes.CellKeyPressEvent += GridBarcodes_CellKeyPressEvent;
            gridBarcodes.CellFocusIn       += GridBarcodes_CellFocusIn;
        }
Пример #17
0
 ///<summary>Registers a column controller for a column in a Singularity schema.</summary>
 ///<param name="column">The column that should use the controller.</param>
 ///<param name="controller">A ColumnController instance, or null to use no controller (suppressing any existing registrations matching the column).</param>
 public static void RegisterColumn(Column column, ColumnController controller)
 {
     if (column == null)
     {
         throw new ArgumentNullException("column");
     }
     RegisterColumn(gc => gc.FieldName == column.Name && gc.View.GetSourceSchema() == column.Schema, controller);
 }
Пример #18
0
 protected override void OnModelReloaded()
 {
     ColumnController.Clear();
     foreach (var column_description in Model.ColumnDescriptions)
     {
         ColumnController.Add(new Column(column_description));
     }
 }
Пример #19
0
        public override void SetModel(IListModel <TrackInfo> value, double vpos)
        {
            //Console.WriteLine ("TrackListView.SetModel for {0} with vpos {1}", value, vpos);

            if (value != null)
            {
                Source           active_source = ServiceManager.SourceManager.ActiveSource;
                Source           source        = active_source;
                ColumnController controller    = null;

                // Get the controller from this source, or its parent(s) if it doesn't have one
                while (source != null && controller == null)
                {
                    controller = source.Properties.Get <ColumnController> ("TrackView.ColumnController");
                    if (controller == null)
                    {
                        string controller_xml = source.Properties.Get <string> ("TrackView.ColumnControllerXml");
                        if (controller_xml != null)
                        {
                            controller = new XmlColumnController(controller_xml);
                            source.Properties.Remove("TrackView.ColumnControllerXml");
                            source.Properties.Set <ColumnController> ("TrackView.ColumnController", controller);
                        }
                    }
                    source = source.Parent;
                }

                controller = controller ?? default_column_controller;

                PersistentColumnController persistent_controller = controller as PersistentColumnController;
                if (persistent_controller != null)
                {
                    //Hyena.Log.InformationFormat ("Setting controller source to {0}", ServiceManager.SourceManager.ActiveSource.Name);
                    persistent_controller.Source = active_source;
                }

                var sort_field = active_source.Properties.Get <string> ("TrackListSortField");
                if (sort_field != null)
                {
                    var column = controller.FirstOrDefault(c => {
                        var s = c as SortableColumn;
                        return(s != null && s.Field.Name == sort_field);
                    }) as SortableColumn;

                    if (column != null)
                    {
                        column.Visible  = true;
                        column.SortType = active_source.Properties.Get <bool> ("TrackListSortAscending") ? Hyena.Data.SortType.Ascending : Hyena.Data.SortType.Descending;
                        controller.DefaultSortColumn = column;
                    }
                }

                ColumnController = controller;
            }

            base.SetModel(value, vpos);
        }
 public DoubleColumnRenderer()
 {
     column_controller = new ColumnController ();
     artist_name_column = new Column ("Artist", new ColumnCellText ("DisplayName", true), 0.65);
     image_column_cell = new ArtistColumnCell () { RenderNameWhenNoImage = false };
     image_column = new Column ("Artist Image", image_column_cell, 0.35);
     column_controller.Add (artist_name_column);
     column_controller.Add (image_column);
 }
Пример #21
0
 protected override void InitializePurchasePriceColumn(ColumnController cc)
 {
     base.InitializePurchasePriceColumn(cc);
     colPurchasePrice.ListCell.IsEditable = !editMode;
     if (BusinessDomain.AppConfiguration.ItemsManagementUseLots)
     {
         colPurchasePrice.ListCell.CellEditBegin += CellEditBeginOnEmptyLot;
     }
 }
Пример #22
0
        public TrackFilterListView() : base()
        {
            column_controller = new ColumnController();

            ForceDragSourceSet = true;
            HeaderVisible      = false;

            RowActivated += OnRowActivated;
        }
Пример #23
0
        public ColumnView(Activity context, ColumnController controller) : this()
        {
            this.context    = context;
            this.controller = controller;

            column_view = new EditText(context);

            controller.HookView(this);
        }
Пример #24
0
 public SingleColumnRenderer()
 {
     column_controller = new ColumnController();
     image_column_cell = new ArtistColumnCell {
         RenderNameWhenNoImage = true
     };
     image_column = new Column("Artist Image", image_column_cell, 1.0);
     column_controller.Add(image_column);
 }
Пример #25
0
 public void MoveColumn(ColumnController column, int index)
 {
     if (index < columns.Count)
     {
         columns.Remove(column);
         columns.Insert(index, column);
     }
     DistributeColumns();
 }
Пример #26
0
        protected override void InitializeSalePriceColumn(ColumnController cc)
        {
            if (!BusinessDomain.LoggedUser.HideItemsPurchasePrice)
            {
                return;
            }

            base.InitializeSalePriceColumn(cc);
        }
Пример #27
0
        private void InitializeGrid()
        {
            grid = new ListView();
            scwGrid.Add(grid);
            grid.Show();

            grid.WidthRequest  = 500;
            grid.HeightRequest = 200;

            ColumnController cc = new ColumnController();

            CellText ct = new CellText("ItemName")
            {
                IsEditable = true
            };

            colItem = new Column(Translator.GetString("Item"), ct, 1);
            colItem.ButtonPressEvent += ItemColumn_ButtonPressEvent;
            colItem.KeyPressEvent    += ItemColumn_KeyPress;
            cc.Add(colItem);

            CellTextQuantity ctq = new CellTextQuantity("Quantity")
            {
                IsEditable = true
            };

            colQtty = new Column(Translator.GetString("Qtty"), ctq, 0.1)
            {
                MinWidth = 70
            };
            colQtty.ButtonPressEvent += QttyColumn_ButtonPressEvent;
            colQtty.KeyPressEvent    += QtyColumn_KeyPress;
            cc.Add(colQtty);

            CellTextCurrency ctc = new CellTextCurrency("OriginalPriceOut")
            {
                IsEditable = true
            };

            colSalePrice = new Column(Translator.GetString("Price"), ctc, 0.1)
            {
                MinWidth = 70
            };
            colSalePrice.ButtonPressEvent += SalePriceColumn_ButtonPressEvent;
            colSalePrice.KeyPressEvent    += SalePriceColumn_KeyPress;
            cc.Add(colSalePrice);

            grid.ColumnController   = cc;
            grid.Model              = new BindingListModel(selectedDetails);
            grid.AllowSelect        = false;
            grid.CellsFucusable     = true;
            grid.ManualFucusChange  = true;
            grid.RulesHint          = true;
            grid.CellKeyPressEvent += Grid_CellKeyPressEvent;
            grid.Mapped            += (sender, e) => EditGridCell(0, 0);
            gridNavigator           = new GridNavigator(grid, EditGridCell, GridColumnEditOver, GridColumnEditBelow);
        }
Пример #28
0
        protected virtual void InitializeLotLocationColumn(ColumnController cc)
        {
            CellText ct = new CellText("LotLocation");

            colLotLocation = new Column(Translator.GetString("Lot location"), ct, 0.1)
            {
                MinWidth = 70
            };
            cc.Add(colLotLocation);
        }
Пример #29
0
        protected virtual void InitializeManufacturedDateColumn(ColumnController cc)
        {
            CellTextDate ctd = new CellTextDate("ProductionDate");

            colProductionDate = new Column(Translator.GetString("Production date"), ctd, 0.1)
            {
                MinWidth = 70
            };
            cc.Add(colProductionDate);
        }
Пример #30
0
        protected virtual void InitializeSerialNumberColumn(ColumnController cc)
        {
            CellText ct = new CellText("SerialNumber");

            colSerialNo = new Column(Translator.GetString("Serial number"), ct, 0.1)
            {
                MinWidth = 80
            };
            cc.Add(colSerialNo);
        }
Пример #31
0
        protected virtual void InitializeDiscountValueColumn(ColumnController cc)
        {
            CellTextCurrency ctf = new CellTextCurrency("DiscountValue");

            colDiscountValue = new Column(Translator.GetString("Discount value"), ctf, 0.1)
            {
                MinWidth = 70
            };
            cc.Add(colDiscountValue);
        }
Пример #32
0
        protected virtual void InitializeSalePriceColumn(ColumnController cc)
        {
            CellTextCurrency ctf = new CellTextCurrency("PriceOut");

            colSalePrice = new Column(Translator.GetString("Sale price"), ctf, 0.1)
            {
                MinWidth = 70
            };
            cc.Add(colSalePrice);
        }
Пример #33
0
        public TerseTrackListView()
            : base()
        {
            renderer = new ColumnCellTrack ();

            column_controller = new ColumnController ();
            column_controller.Add (new Column ("Track", renderer, 1.0));

            ColumnController = column_controller;

            HeaderVisible = false;
        }
Пример #34
0
        public CubanoTrackTitleView()
            : base()
        {
            column_controller = new ColumnController ();

            CubanoTitleCell renderer = new CubanoTitleCell ();
            column_controller.Add (new Column (null, "indicator", new ColumnCellStatusIndicator (null), 0.05, true, 30, 30));
            column_controller.Add (new Column ("Track", renderer, 1.0));
            column_controller.Add (new Column ("Rating", new ColumnCellRating ("Rating", false), 0.15));

            ColumnController = column_controller;

            //RowHeightProvider = renderer.ComputeRowHeight;
            HeaderVisible = false;
        }
        public ColumnCellArtistCover(bool smallImagesUsed)
            : base(null, true)
        {
            use_small_images = smallImagesUsed;
            artwork_initialized = false;

            image_size = use_small_images ? small_image_size : normal_image_size;

            default_cover_image
                = PixbufImageSurface.Create (IconThemeUtils.LoadIcon (image_size, "media-optical", "browser-album-cover"));

            column_controller = new ColumnController ();
            var current_layout = new Column ("Artist", this, 1.0);
            column_controller.Add (current_layout);

            ServiceManager.SourceManager.ActiveSourceChanged += HandleActiveSourceChanged;
        }
Пример #36
0
        private void BuildWidgets ()
        {
            var hbox = new HBox () { Spacing = 12 };

            // Left box - cover art, title, etc
            var left_box = new VBox () { BorderWidth = 12, Spacing = 12 };

            // Cover art
            cover = new BookCover (this) {
                WidthRequest = 300,
                HeightRequest = 300
            };

            var editable_cover = CoverArtEditor.For (
                cover, (x, y) => true,
                () => library.TrackModel[0],
                UpdateCover
            );

            // Title
            title_label = new WrapLabel ();

            resume_button = new ImageButton ("", null, IconSize.LargeToolbar);
            resume_button.ImageWidget.Stock = Stock.MediaPlay;
            resume_button.LabelWidget.Xalign = 0;
            resume_button.Spacing = 6;

            // FIXME the left padding on this is not right
            rating_entry = new RatingEntry () {
                AlwaysShowEmptyStars = true,
                HasFrame = false
            };
            var rating = new HBox ();
            rating.PackStart (rating_entry, false, false, 0);

            // Packing
            left_box.PackStart (editable_cover, false, false,  0);
            left_box.PackStart (title_label, false, false,  0);
            left_box.PackStart (resume_button, false, false,  0);
            //left_box.PackStart (rating, false, false,  0);

            hbox.PackStart (left_box, false, false, 0);

            // Right box - track list
            track_list = new BaseTrackListView () {
                HeaderVisible = true,
                IsEverReorderable = false
            };

            var columns = new DefaultColumnController ();
            var file_columns = new ColumnController ();
            var disc_column = DefaultColumnController.Create (
                    BansheeQuery.DiscNumberField, 0.02, false, new ColumnCellPositiveInt (null, false, 2, 2));

            file_columns.AddRange (
                columns.IndicatorColumn,
                disc_column,
                columns.TitleColumn,
                columns.DurationColumn
            );
            file_columns.SortColumn = columns.DiscNumberAndCountColumn;

            foreach (var col in file_columns) {
                col.Visible = true;
            }

            var track_sw = new Gtk.ScrolledWindow () {
                Child = track_list,
                ShadowType = ShadowType.None
            };

            track_list.ColumnController = file_columns;

            hbox.PackEnd (track_sw, true, true, 0);

            Child = hbox;
        }
 public TrackListView () : base ()
 {
     default_column_controller = new DefaultColumnController ();
 }