コード例 #1
0
        void CreateScrollView()
        {
            _yCurr -= _scrollerFrame.Height + _separateHeight;

            _screeningsView = new NSView(_screeningsFrame);

            var scrollView = ControlsFactory.NewStandardScrollView(_scrollerFrame, _screeningsView);

            View.AddSubview(scrollView);
        }
コード例 #2
0
        private void CreateTitlesScrollView()
        {
            // Create the scroll view to display the title radio buttons.
            nfloat yScrollView      = 2 * _yXcodeControlsMargin + _bottomControlsHeight;
            nfloat scrollViewHeight = View.Frame.Height - _yXcodeControlsMargin - 2 * (_topLabelsHeigh + _yToplabelsDistance) - yScrollView;
            CGRect scrollViewFrame  = new CGRect(_xMargin, yScrollView, _scrollViewWidth, scrollViewHeight);
            var    titlesScrollView = ControlsFactory.NewStandardScrollView(scrollViewFrame, _titlesDocumentView);

            View.AddSubview(titlesScrollView);

            // Create labels with the film titles.
            PopulateTitlesDocumentView();

            // Set sample view used to disable resizing.
            _sampleView = titlesScrollView;
        }
コード例 #3
0
        private void CreatePerDayCheckboxes()
        {
            // Create the document view.
            var n              = FestivalDays.Count;
            var documentWidth  = View.Frame.Width - 2 * _xMargin;
            var documentHeight = n * _labelHeight + (n - 1) * _yBetweenLabels;
            var documentFrame  = new CGRect(0, 0, documentWidth, documentHeight);
            var documentView   = new NSView(documentFrame);

            // Create the scroll view.
            var scrollerHeight = _yCurr - _yControlsMargin - _controlHeight - _yBetweenControls;

            _yCurr -= scrollerHeight;
            var scrollerFrame = new CGRect(_xMargin, _yCurr, documentWidth, scrollerHeight);
            var scrollerView  = ControlsFactory.NewStandardScrollView(scrollerFrame, documentView, true);

            View.AddSubview(scrollerView);

            // Populate the document view.
            var yCurr     = documentView.Frame.Height - _labelHeight;
            var labelRect = new CGRect(0, yCurr, _labelWidth, _labelHeight);

            foreach (var day in FestivalDays)
            {
                // Create the day label.
                var label = ControlsFactory.NewStandardLabel(labelRect, true);
                label.StringValue = Screening.LongDayString(day);
                documentView.AddSubview(label);

                // Create the film fan checkboxes.
                var xCurr        = _labelWidth + _xBetweenControls;
                var daySingleton = new List <DateTime> {
                    day
                };
                CreateFilmFanCheckboxes(documentView, new CGPoint(xCurr, yCurr), daySingleton);

                // Update the vertical position.
                yCurr      -= _labelHeight + _yBetweenLabels;
                labelRect.Y = yCurr;
            }

            // Set sample view used to disable resizing.
            _sampleView = scrollerView;
        }
コード例 #4
0
        private void CreateFilmSummaryBox(float boxHeight)
        {
            // Create a text box to contain the film info.
            var docRect = new CGRect(0, 0, _contentWidth, _summaryBoxHeight);

            _summaryField = new NSTextField(docRect);
            InitiateSummaryFieldText();
            var fit = _summaryField.SizeThatFits(_summaryField.Frame.Size);

            _summaryField.SetFrameSize(fit);

            // Create a scroll view to display the film info.
            _yCurr -= boxHeight;
            var rect = new CGRect(_xMargin, _yCurr, _contentWidth, boxHeight);

            _summaryScrollView = ControlsFactory.NewStandardScrollView(rect, _summaryField);
            _summaryScrollView.ContentView.ScrollToPoint(new CGPoint(0, 0));
            View.AddSubview(_summaryScrollView);
        }
コード例 #5
0
        private void CreateScrollView()
        {
            // Create the document view displaying information on unplanned films.
            var docRect = new CGRect(0, 0, _scrollViewWidth, _scrollViewHeight);

            _filmsDocumentView             = ControlsFactory.NewStandardLabel(docRect, true);
            _filmsDocumentView.StringValue = InstructionsString();

            // Create the scroll view.
            var scrollViewFrame = new CGRect(_xMargin, _yScrollView, _scrollViewWidth, _scrollViewHeight);

            _filmsScrollView = ControlsFactory.NewStandardScrollView(scrollViewFrame, _filmsDocumentView, true);
            View.AddSubview(_filmsScrollView);

            // Scroll to the instruction text.
            var yScroll = _filmsDocumentView.Frame.Height - _filmsScrollView.Frame.Height;

            _filmsScrollView.ContentView.ScrollToPoint(new CGPoint(0, yScroll));
        }
コード例 #6
0
        private void CreateScreeningsScrollView()
        {
            // Get the screenings of the selected film.
            var screenings = _film.FilmScreenings;

            // Create the screenings view.
            var yScreenings         = screenings.Count * (_labelHeight + _yBetweenLabels);
            var screeningsViewFrame = new CGRect(0, 0, _contentWidth, yScreenings);
            var screeningsView      = new NSView(screeningsViewFrame);

            // Create the scroll view.
            _yCurr -= _scrollViewHeight;
            var scrollViewFrame = new CGRect(_xMargin, _yCurr, _contentWidth, _scrollViewHeight);
            var scrollView      = ControlsFactory.NewStandardScrollView(scrollViewFrame, screeningsView);

            View.AddSubview(scrollView);

            // Display the screenings.
            GoToScreeningDialog.DisplayScreeningControls(screenings, screeningsView, GoToScreening, ref _currentScreeningControl);

            // Scroll to the selected screening.
            GoToScreeningDialog.ScrollScreeningToVisible(App.Controller.CurrentScreening, scrollView);
        }