コード例 #1
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;
        }
コード例 #2
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();
            }
コード例 #3
0
        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);
        }
コード例 #4
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;
        }
コード例 #5
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);
        }
コード例 #6
0
 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);
 }
コード例 #7
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);
        }
コード例 #8
0
        protected override void InitializeGrid()
        {
            base.InitializeGrid();

            ColumnController cc = new ColumnController
            {
                new Column(Translator.GetString("Code"), "Code", 0.1, "Code")
                {
                    MinWidth = 70
                },
                new Column(Translator.GetString("Item"), "Name", 1, "Name")
                {
                    MinWidth = 70
                },
                new Column(Translator.GetString("Measure"), "MUnit", 0.1, "MUnit")
                {
                    MinWidth = 70
                }
            };

            CellTextItemQuantity ctq = new CellTextItemQuantity("Quantity");

            colQtty = new Column(Translator.GetString("Qtty"), ctq, 0.1, "Quantity")
            {
                MinWidth = 70, Visible = !BusinessDomain.LoggedUser.HideItemsAvailability
            };
            cc.Add(colQtty);

            CellTextCurrency ctc;

            if (!BusinessDomain.LoggedUser.HideItemsPurchasePrice)
            {
                ctc = new CellTextCurrency("TradeInPrice", PriceType.Purchase);
                cc.Add(new Column(Translator.GetString("Purchase price"), ctc, 0.1, "TradeInPrice")
                {
                    MinWidth = 70
                });
            }

            string partnerPriceColumn = Item.GetPriceGroupProperty(priceGroup);

            ctc = new CellTextCurrency(partnerPriceColumn);
            cc.Add(new Column(Translator.GetString("Sale price"), ctc, 0.1, partnerPriceColumn)
            {
                MinWidth = 70
            });

            grid.ColumnController = cc;

            btnGroups.Active   = BusinessDomain.AppConfiguration.ShowItemsGroups;
            btnGroups.Toggled += btnGroups_Toggled;
            groupsPanel.GroupsTree.Selection.Changed += GroupsTreeSelection_Changed;
        }
コード例 #9
0
 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);
 }
コード例 #10
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;
        }
コード例 #11
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;
        }
コード例 #12
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;
        }
コード例 #13
0
        private ColumnController BuildDisplayColumnController(string localizedTitle)
        {
            var result = new ColumnController();

            result.Add(new Column(new ColumnDescription("DisplayName", localizedTitle, 100)));
            return(result);
        }
コード例 #14
0
 protected override void AddPartnerColumn(ColumnController cc)
 {
     cc.Add(new Column(Translator.GetString("Partner"), "PartnerName", 0.2, "PartnerName")
     {
         MinWidth = 70
     });
 }
コード例 #15
0
        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;
        }
コード例 #16
0
 public ColumnCellArtistText()
     : base("DisplayName", true)
 {
     column_controller = new ColumnController ();
     var current_layout = new Column ("Artist", this, 1.0);
     column_controller.Add (current_layout);
 }
コード例 #17
0
        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;
        }
コード例 #18
0
        public ColumnCellArtistText() : base("DisplayName", true)
        {
            column_controller = new ColumnController();
            var current_layout = new Column("Artist", this, 1.0);

            column_controller.Add(current_layout);
        }
コード例 #19
0
        private void InitializeDocumentNumbersGrid()
        {
            ColumnController columnController = new ColumnController();

            CellTextLookup <OperationType> cellOperationType = new CellTextLookup <OperationType> ("OperationType")
            {
                Lookup = Enum.GetValues(typeof(OperationType))
                         .Cast <OperationType> ()
                         .Where(operationType => operationType > 0)
                         .ToDictionary(k => k, Translator.GetOperationTypeGlobalName)
            };

            columnController.Add(new Column(Translator.GetString("Operation"), cellOperationType, 1));

            CellTextNumber cellNum = new CellTextNumber("StartNumber")
            {
                IsEditable  = true,
                FixedDigits = BusinessDomain.AppConfiguration.DocumentNumberLength
            };
            Column colStart = new Column(Translator.GetString("Start number"), cellNum, 0.1)
            {
                MinWidth = 110
            };

            colStart.ButtonPressEvent += ColumnDocumentNumber_ButtonPressEvent;
            colStart.KeyPressEvent    += ColumnDocumentNumber_KeyPressEvent;
            columnController.Add(colStart);

            columnController.Add(new Column(Translator.GetString("Used numbers"), new CellProgress("UsageDescription", "Usage"), 0.1)
            {
                MinWidth = 180
            });

            gridDocumentNumbers = new ListView
            {
                Name                = "gridDocumentNumbers",
                ColumnController    = columnController,
                WidthRequest        = 400,
                AllowMultipleSelect = false,
                CellsFucusable      = true,
                RulesHint           = true
            };

            scwDocumentNumbers.Add(gridDocumentNumbers);
            gridDocumentNumbers.Show();
        }
コード例 #20
0
ファイル: ObjectListView.cs プロジェクト: f-spot/f-spot-xplat
 protected override void OnModelReloaded()
 {
     ColumnController.Clear();
     foreach (var column_description in Model.ColumnDescriptions)
     {
         ColumnController.Add(new Column(column_description));
     }
 }
コード例 #21
0
        protected override void InitializeQuantityColumn(ColumnController cc)
        {
            CellTextQuantity ctq = new CellTextQuantity("ExpectedQuantity");
            Column           col = new Column(Translator.GetString("Available"), ctq, 0.1)
            {
                MinWidth = 70
            };

            cc.Add(col);

            ctq         = new CellTextQuantity("EnteredQuantity");
            colQuantity = new Column(Translator.GetString("Qtty"), ctq, 0.1)
            {
                MinWidth = 70
            };
            cc.Add(colQuantity);
        }
コード例 #22
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);
 }
コード例 #23
0
        protected virtual void InitializeItemColumn(ColumnController cc)
        {
            CellText ct = new CellText("ItemName");

            colItem = new Column(Translator.GetString("Item"), ct, 1)
            {
                MinWidth = 70
            };
            cc.Add(colItem);
        }
コード例 #24
0
        protected virtual void InitializeQuantityColumn(ColumnController cc)
        {
            CellTextQuantity ctf = new CellTextQuantity("Quantity");

            colQuantity = new Column(Translator.GetString("Qtty"), ctf, 0.1)
            {
                MinWidth = 70
            };
            cc.Add(colQuantity);
        }
コード例 #25
0
        protected virtual void InitializePurchasePriceColumn(ColumnController cc)
        {
            CellTextCurrency ctf = new CellTextCurrency("PriceIn", PriceType.Purchase);

            colPurchaseValue = new Column(Translator.GetString("Purchase price"), ctf, 0.1)
            {
                MinWidth = 70
            };
            cc.Add(colPurchaseValue);
        }
コード例 #26
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);
        }
コード例 #27
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);
        }
コード例 #28
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);
        }
コード例 #29
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);
        }
コード例 #30
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);
        }
コード例 #31
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;
        }
コード例 #32
0
        protected override void InitializeGrid()
        {
            base.InitializeGrid();

            grid.HeightRequest = 300;
            grid.WidthRequest  = 500;

            GetEntities();

            grid.Model = entities;

            ColumnController columnController = new ColumnController();

            CellTextNumber cellTextNumber = new CellTextNumber("Id")
            {
                FixedDigits = BusinessDomain.AppConfiguration.DocumentNumberLength
            };
            string documentNumber = Translator.GetString("Payment No.");

            columnController.Add(new Column(documentNumber, cellTextNumber, 1, cellTextNumber.PropertyName)
            {
                MinWidth = 70
            });

            string partner = Translator.GetString("Partner");

            columnController.Add(new Column(partner, "PartnerName", 2, "PartnerName")
            {
                MinWidth = 100
            });

            CellTextCurrency cellTextDouble = new CellTextCurrency("Quantity");
            string           balance        = Translator.GetString("Balance");

            columnController.Add(new Column(balance, cellTextDouble, 1, cellTextDouble.PropertyName)
            {
                MinWidth = 70
            });

            grid.ColumnController = columnController;
        }
コード例 #33
0
        protected virtual void AddNumberColumn(ColumnController cc)
        {
            CellTextNumber ctn = new CellTextNumber("Id")
            {
                FixedDigits = BusinessDomain.AppConfiguration.DocumentNumberLength
            };

            cc.Add(new Column(Translator.GetString("Number"), ctn, 0.1, "Id")
            {
                MinWidth = 90
            });
        }
コード例 #34
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;
        }
コード例 #35
0
        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;
        }