Esempio n. 1
0
        void GenerateTabs()
        {
            _notebookDistricts?.Destroy();
            _notebookDistricts = new Notebook();

            foreach (WageDistrictLevelRateViewModel vm in ViewModel.ObservableWageDistrictLevelRateViewModels)
            {
                var  view = new WageDistrictLevelRateView(vm, true);
                VBox vbx  = new VBox
                {
                    view
                };
                Box.BoxChild viewBox = (Box.BoxChild)vbx[view];
                viewBox.Fill   = true;
                viewBox.Expand = true;
                var scrolledWindow = new ScrolledWindow
                {
                    vbx
                };

                Label tabLabel = new Label
                {
                    UseMarkup = true,
                    Markup    = $"{vm.Entity.CarTypeOfUse.GetEnumTitle()} {vm.Entity.WageDistrict.Name}"
                };

                _notebookDistricts.AppendPage(scrolledWindow, tabLabel);
            }

            hbxNotebooksWithDistricts.Add(_notebookDistricts);
            hbxNotebooksWithDistricts.ShowAll();
        }
        void GenerateTabs()
        {
            if (nbDistricts != null)
            {
                nbDistricts.Destroy();
            }
            nbDistricts = new Notebook();

            foreach (WageDistrictLevelRateViewModel vm in ViewModel.ObservableWageDistrictLevelRateViewModels)
            {
                var  view = new WageDistrictLevelRateView(vm, true);
                VBox vbx  = new VBox {
                    view
                };
                Box.BoxChild viewBox = (Box.BoxChild)vbx[view];
                viewBox.Fill   = true;
                viewBox.Expand = true;
                var scrolledWindow = new ScrolledWindow {
                    vbx
                };

                Label tabLabel = new Label {
                    UseMarkup = true,
                    Markup    = vm.Entity.WageDistrict.Name
                };

                nbDistricts.AppendPage(scrolledWindow, tabLabel);
            }

            hbxNotebooksWithDistricts.Add(nbDistricts);
            hbxNotebooksWithDistricts.ShowAll();
        }
        private void UpdateWageParameterView()
        {
            _notebook?.Destroy();
            _notebook = new Notebook();

            var defaultRatesWidget = GetWidget(ViewModel.WageParameterItemViewModel);

            if (defaultRatesWidget != null)
            {
                _notebook.InsertPage(defaultRatesWidget, GetNotebookHeaderLabel(ViewModel.WageParameterItemType, CarOwnType.Driver), 0);
            }

            var compayCarWidget = GetWidget(ViewModel.DriverWithCompanyCarWageParameterItemViewModel);

            if (compayCarWidget != null)
            {
                _notebook.InsertPage(compayCarWidget, GetNotebookHeaderLabel(ViewModel.WageParameterItemType, CarOwnType.Company), 1);
            }
            var raskatCarWidget = GetWidget(ViewModel.RaskatCarWageParameterItemViewModel);

            if (raskatCarWidget != null)
            {
                _notebook.InsertPage(raskatCarWidget, GetNotebookHeaderLabel(ViewModel.WageParameterItemType, CarOwnType.Raskat), 2);
            }

            vboxDialog.Add(_notebook);
            _notebook.ShowAll();
        }
Esempio n. 4
0
        Notebook CreateNewWindow(Notebook source, Widget page, int x, int y)
        {
            Helpers.ExternalWindow window;
            EventBox box;
            Notebook notebook;

            window = new Helpers.ExternalWindow();
            if (page == timeline)
            {
                window.Title = Catalog.GetString("Timeline");
            }
            else if (page == dashboardhpaned)
            {
                window.Title = Catalog.GetString("Analysis dashboard");
            }
            else if (page == playspositionviewer1)
            {
                window.Title = Catalog.GetString("Zonal tags viewer");
            }

            notebook          = new Notebook();
            notebook.ShowTabs = false;
            notebook.CanFocus = false;
            //notebook.Group = source.Group;

            window.Add(notebook);
            window.SetDefaultSize(page.Allocation.Width, page.Allocation.Height);
            window.Move(x, y);
            window.ShowAll();
            activeWindows.Add(window);
            window.DeleteEvent += (o, args) => {
                Widget pa = notebook.CurrentPageWidget;
                activeWindows.Remove(window);
                notebook.Remove(pa);
                Visible = true;
                source.AppendPage(pa, null);
                notebookHelper.UpdateTabs();
                notebook.Destroy();
            };

            /* If we are remove the last visible page, hide the widget to
             * free the empty space for the rest of widgets */
            int visiblePages = 0;

            for (int i = 0; i < source.NPages; i++)
            {
                if (source.GetNthPage(i).Visible)
                {
                    visiblePages++;
                }
            }
            if (visiblePages == 1)
            {
                Visible = false;
            }
            return(notebook);
        }
Esempio n. 5
0
        private void GenerateDiscussionViews()
        {
            if (notebookDiscussions != null)
            {
                notebookDiscussions.Destroy();
            }
            notebookDiscussions = new Notebook();

            foreach (ComplaintDiscussionViewModel vm in ViewModel.ObservableComplaintDiscussionViewModels)
            {
                var  view = new ComplaintDiscussionView(vm);
                VBox complaintDiscussionViewsBox = new VBox();
                complaintDiscussionViewsBox.Add(view);
                Box.BoxChild viewBox = (Box.BoxChild)complaintDiscussionViewsBox[view];
                viewBox.Fill   = true;
                viewBox.Expand = true;
                var scrolledWindow = new ScrolledWindow();
                scrolledWindow.Add(complaintDiscussionViewsBox);

                Label tabLabel = new Label()
                {
                    UseMarkup = true,
                    Markup    = GetTabName(vm)
                };

                vm.Entity.PropertyChanged -= Vm_PropertyChanged;
                vm.Entity.PropertyChanged += Vm_PropertyChanged;

                void Vm_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
                {
                    if (e.PropertyName == nameof(vm.Entity.Status))
                    {
                        if (tabLabel == null)
                        {
                            vm.Entity.PropertyChanged += Vm_PropertyChanged;
                            return;
                        }

                        tabLabel.Markup = GetTabName(vm);
                    }
                }

                notebookDiscussions.AppendPage(scrolledWindow, tabLabel);
            }

            vboxSubdivisionItems.Add(notebookDiscussions);
            vboxSubdivisionItems.ShowAll();
        }
Esempio n. 6
0
        private void UpdateWageParameterView()
        {
            notebook?.Destroy();
            notebook = new Notebook();


            notebook.InsertPage(GetWidget(ViewModel.WageParameterItemViewModel), new Label(ViewModel.WageParameterItemType.GetEnumTitle()), 0);
            var ourCarWidget = GetWidget(ViewModel.DriverWithCompanyCarWageParameterItemViewModel);

            if (ourCarWidget != null)
            {
                notebook.InsertPage(ourCarWidget, new Label(ViewModel.WageParameterItemType.GetEnumTitle() + "(Для авто компании)"), 1);
            }

            vboxDialog.Add(notebook);
            notebook.ShowAll();
        }
Esempio n. 7
0
        Notebook CreateNewWindow(Notebook source, Widget page, int x, int y)
        {
            ExternalWindow window;
            EventBox       box;
            Notebook       notebook;

            window = new ExternalWindow();
            if (page == timeline)
            {
                window.Title = Catalog.GetString("Timeline");
            }
            else if (page == dashboardhpaned)
            {
                window.Title = Catalog.GetString("Analysis dashboard");
            }
            else if (page == playspositionviewer1)
            {
                window.Title = Catalog.GetString("Zonal tags viewer");
            }

            notebook          = new Notebook();
            notebook.ShowTabs = false;
            notebook.CanFocus = false;
            //notebook.Group = source.Group;

            window.Add(notebook);
            window.SetDefaultSize(page.Allocation.Width, page.Allocation.Height);
            window.Move(x, y);
            window.ShowAll();
            activeWindows.Add(window);
            window.DeleteEvent += (o, args) => {
                Widget pa = notebook.CurrentPageWidget;
                activeWindows.Remove(window);
                notebook.Remove(pa);
                source.AppendPage(pa, null);
                SetTabProps(pa, source.NPages == 0);
                notebook.Destroy();
            };
            return(notebook);
        }
        void GenerateTabs()
        {
            if (nbDistricts != null)
            {
                nbDistricts.Destroy();
            }
            nbDistricts = new Notebook();

            if (ViewModel.Entity.WageDistrictLevelRates?.LevelRates == null)
            {
                return;
            }

            foreach (var levelRate in ViewModel.Entity.WageDistrictLevelRates.LevelRates)
            {
                yTreeView yTreeRatesInfo = new yTreeView {
                    CanFocus      = true,
                    Name          = nameof(yTreeRatesInfo),
                    ColumnsConfig = FluentColumnsConfig <IWageHierarchyNode> .Create()
                                    .AddColumn("Название ставки")
                                    .HeaderAlignment(0.5f)
                                    .AddTextRenderer(x => x.Name)
                                    .AddColumn("Водитель с\nэкспедитором")
                                    .AddNumericRenderer(r => r.ForDriverWithForwarder)
                                    .Digits(2)
                                    .XAlign(1f)
                                    .Adjustment(new Adjustment(0, 0, 1000000, 1, 100, 0))
                                    .AddTextRenderer(r => r.GetUnitName, false)
                                    .AddColumn("Водитель без\nэкспедитора")
                                    .AddNumericRenderer(r => r.ForDriverWithoutForwarder)
                                    .Digits(2)
                                    .XAlign(1f)
                                    .Adjustment(new Adjustment(0, 0, 1000000, 1, 100, 0))
                                    .AddTextRenderer(r => r.GetUnitName, false)
                                    .AddColumn("Экспедитор")
                                    .AddNumericRenderer(r => r.ForForwarder)
                                    .Digits(2)
                                    .XAlign(1f)
                                    .Adjustment(new Adjustment(0, 0, 1000000, 1, 100, 0))
                                    .AddTextRenderer(r => r.GetUnitName, false)
                                    .AddColumn("")
                                    .Finish()
                };
                yTreeRatesInfo.YTreeModel = new RecursiveTreeConfig <IWageHierarchyNode>
                                                (x => x.Parent, x => x.Children)
                                            .CreateModel(levelRate.ObservableWageRates);
                yTreeRatesInfo.ExpandAll();
                VBox vbx = new VBox {
                    yTreeRatesInfo
                };
                Box.BoxChild viewBox = (Box.BoxChild)vbx[yTreeRatesInfo];
                viewBox.Fill   = true;
                viewBox.Expand = true;
                var scrolledWindow = new ScrolledWindow {
                    vbx
                };

                Label tabLabel = new Label {
                    UseMarkup = true,
                    Markup    = levelRate.WageDistrict.Name
                };

                nbDistricts.AppendPage(scrolledWindow, tabLabel);
            }
            hbxNotebooksWithDistricts.Add(nbDistricts);
            hbxNotebooksWithDistricts.ShowAll();
        }