public static void SetTicketsStatusColor(Screening screening, CGContext context) { var status = screening.TicketStatus; NSColor color = ColorByTicketStatus[status]; context.SetStrokeColor(color.CGColor); }
public static void SetScreeningColor(Screening screening, NSTextField label) { var status = screening.Status; label.BackgroundColor = BgColorByScreeningStatus[status]; label.TextColor = TextColorByScreeningStatus[status]; }
public static void ScrollScreeningToVisible(Screening screening, NSScrollView scrollView) { if (_labelByfilmScreening.ContainsKey(screening)) { scrollView.ContentView.ScrollRectToVisible(_labelByfilmScreening[screening].Frame); } }
public static void SetScreeningColor(Screening screening, CGContext context) { var status = screening.Status; context.SetFillColor(BgColorByScreeningStatus[status].CGColor); context.SetStrokeColor(TextColorByScreeningStatus[status].CGColor); }
public void SetEndTime(Screening screening) { if (EndTime == StartTime) { _duration = screening.Duration; EndTime = StartTime + _duration; } }
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; } } }
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; }
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); } }
internal void NavigateFilmScreening(Screening screening) { if (FilmsDialogController != null) { FilmsDialogController.CloseDialog(); } if (FilmInfoController != null) { FilmInfoController.CloseDialog(); } if (AnalyserDialogController != null) { AnalyserDialogController.CloseDialog(); } Controller.GoToScreening(screening); }
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; }
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); }
private void GoToScreening(Screening screening) { Presentor.GoToScreening(screening); CloseDialog(); }
public ScreeningOutlinable(Screening screening, Level level) { Screening = screening; OutlineLevel = level; GoToScreening = Screening.GoToScreening; }
public ScreeningButton(CGRect frame, Screening screening) : base(frame) { Initialize(); _screening = screening; NeedsDisplay = true; }
public abstract void GoToScreening(Screening screening);
public static bool ScreeningIsSelected(Screening screening) { AppDelegate app = (AppDelegate)NSApplication.SharedApplication.Delegate; return(app.Controller.CurrentScreening == screening); }
public void ForceRepopulateFilmMenuItems() { _film = null; Screening = null; }
private string ItemTitle(DateTime day) { return(Screening.LongDayString(day)); }
public void DrawCurrDay(ScreeningsPlan plan) { _screensColumn.Title = Screening.DayString(plan.CurrDay); }