コード例 #1
0
        public static void SetTicketsStatusColor(Screening screening, CGContext context)
        {
            var     status = screening.TicketStatus;
            NSColor color  = ColorByTicketStatus[status];

            context.SetStrokeColor(color.CGColor);
        }
コード例 #2
0
        public static void SetScreeningColor(Screening screening, NSTextField label)
        {
            var status = screening.Status;

            label.BackgroundColor = BgColorByScreeningStatus[status];
            label.TextColor       = TextColorByScreeningStatus[status];
        }
コード例 #3
0
 public static void ScrollScreeningToVisible(Screening screening, NSScrollView scrollView)
 {
     if (_labelByfilmScreening.ContainsKey(screening))
     {
         scrollView.ContentView.ScrollRectToVisible(_labelByfilmScreening[screening].Frame);
     }
 }
コード例 #4
0
        public static void SetScreeningColor(Screening screening, CGContext context)
        {
            var status = screening.Status;

            context.SetFillColor(BgColorByScreeningStatus[status].CGColor);
            context.SetStrokeColor(TextColorByScreeningStatus[status].CGColor);
        }
コード例 #5
0
 public void SetEndTime(Screening screening)
 {
     if (EndTime == StartTime)
     {
         _duration = screening.Duration;
         EndTime   = StartTime + _duration;
     }
 }
コード例 #6
0
        public override void NeedsUpdate(NSMenu menu)
        {
            // Get the screening provider.
            _screeningProvider = FilmRatingViewRunning() ? (IScreeningProvider)FilmRatingController
                : AnalyserViewRunning() ? (IScreeningProvider)AnalyserDialogController
                : _controller;

            // Get the current film.
            var currFilm = _screeningProvider.CurrentFilm;

            if (currFilm != _film)
            {
                _film = currFilm;
                PopulateFilmScreeningsMenuItems(menu);
            }

            // Get the current screening.
            var currScreening = _screeningProvider.CurrentScreening;

            if (currScreening != Screening)
            {
                Screening = currScreening;
                PopulateFilmScreeningsMenuItems(menu);
            }

            // Process every item in the menu
            foreach (NSMenuItem item in menu.Items)
            {
                // If one of some specific dialogs is running, all menu items must be inactive.
                if (DialogDisablesAllMenuItems())
                {
                    item.Enabled = false;
                    continue;
                }

                bool itemHandled = false;
                if (!itemHandled)
                {
                    // Take action based on the menu item tag and the film screenings dictionary.
                    itemHandled = FilmScreeningItemIsHandled(item);
                }
                if (!itemHandled)
                {
                    // Take action on the menu item tag and the film fan by tag dictionary.
                    itemHandled = AttendanceItemIsHandled(item);
                }
                if (!itemHandled)
                {
                    // Take action based on the menu item tag.
                    itemHandled = ItemIsHandledByTag(item);
                }
                if (!itemHandled)
                {
                    item.Enabled = false;
                }
            }
        }
コード例 #7
0
 public ScreeningLabel(CGRect frame, Screening screening, bool withDay = false) : base(frame)
 {
     Initialize();
     _screening    = screening;
     Font          = NSFont.BoldSystemFontOfSize(ScreeningControl.FontSize);
     Editable      = false;
     Bordered      = false;
     StringValue   = _screening.ToScreeningLabelString(withDay);
     LineBreakMode = NSLineBreakMode.TruncatingMiddle;
     ColorView.SetScreeningColor(_screening, this);
     NeedsDisplay = true;
 }
コード例 #8
0
        public static void SetScreeningColor(Screening screening, CGContext context, bool textMode)
        {
            var status = screening.Status;

            if (textMode)
            {
                context.SetFillColor(TextColorByScreeningStatus[status].CGColor);
                context.SetStrokeColor(TextColorByScreeningStatus[status].CGColor);
            }
            else
            {
                SetScreeningColor(screening, context);
            }
        }
コード例 #9
0
 internal void NavigateFilmScreening(Screening screening)
 {
     if (FilmsDialogController != null)
     {
         FilmsDialogController.CloseDialog();
     }
     if (FilmInfoController != null)
     {
         FilmInfoController.CloseDialog();
     }
     if (AnalyserDialogController != null)
     {
         AnalyserDialogController.CloseDialog();
     }
     Controller.GoToScreening(screening);
 }
コード例 #10
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;
        }
コード例 #11
0
        public static void DrawTicketAvalabilityFrame(CGContext g, Screening screening, nfloat side)
        {
            g.SetLineWidth(2);
            SetTicketsStatusColor(screening, g);
            var    rectPath = new CGPath();
            nfloat org      = 1;
            nfloat x        = side - 2 * org;
            nfloat y        = side - 2 * org;

            rectPath.AddLines(new CGPoint[] {
                new CGPoint(org, y),
                new CGPoint(x, y),
                new CGPoint(x, org),
                new CGPoint(org, org)
            });
            rectPath.CloseSubpath();
            g.AddPath(rectPath);
            g.DrawPath(CGPathDrawingMode.Stroke);
        }
コード例 #12
0
 private void GoToScreening(Screening screening)
 {
     Presentor.GoToScreening(screening);
     CloseDialog();
 }
コード例 #13
0
 public ScreeningOutlinable(Screening screening, Level level)
 {
     Screening     = screening;
     OutlineLevel  = level;
     GoToScreening = Screening.GoToScreening;
 }
コード例 #14
0
 public ScreeningButton(CGRect frame, Screening screening) : base(frame)
 {
     Initialize();
     _screening   = screening;
     NeedsDisplay = true;
 }
コード例 #15
0
 public abstract void GoToScreening(Screening screening);
コード例 #16
0
        public static bool ScreeningIsSelected(Screening screening)
        {
            AppDelegate app = (AppDelegate)NSApplication.SharedApplication.Delegate;

            return(app.Controller.CurrentScreening == screening);
        }
コード例 #17
0
 public void ForceRepopulateFilmMenuItems()
 {
     _film     = null;
     Screening = null;
 }
コード例 #18
0
 private string ItemTitle(DateTime day)
 {
     return(Screening.LongDayString(day));
 }
コード例 #19
0
 public void DrawCurrDay(ScreeningsPlan plan)
 {
     _screensColumn.Title = Screening.DayString(plan.CurrDay);
 }