A canvas that can be used as a blackboard in which objects are drawn over the image set in BackgroundCanvas.Background.
Inheritance: BackgroundCanvas
Example #1
0
        public PlayerView()
        {
            this.Build ();

            closebuttonimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-cancel-rec",
                StyleConf.PlayerCapturerIconSize);
            drawbuttonimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-control-draw",
                StyleConf.PlayerCapturerIconSize);
            playbuttonimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-control-play",
                StyleConf.PlayerCapturerIconSize);
            pausebuttonimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-control-pause",
                StyleConf.PlayerCapturerIconSize);
            prevbuttonimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-control-rw",
                StyleConf.PlayerCapturerIconSize);
            nextbuttonimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-control-ff",
                StyleConf.PlayerCapturerIconSize);
            volumebuttonimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-control-volume-hi",
                StyleConf.PlayerCapturerIconSize);
            detachbuttonimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-control-detach",
                StyleConf.PlayerCapturerIconSize);

            // Force tooltips to be translatable as there seems to be a bug in stetic
            // code generation for translatable tooltips.
            ratescale.TooltipMarkup = Catalog.GetString ("Playback speed");
            closebutton.TooltipMarkup = Catalog.GetString ("Close loaded event");
            drawbutton.TooltipMarkup = Catalog.GetString ("Draw frame");
            playbutton.TooltipMarkup = Catalog.GetString ("Play");
            pausebutton.TooltipMarkup = Catalog.GetString ("Pause");
            prevbutton.TooltipMarkup = Catalog.GetString ("Previous");
            nextbutton.TooltipMarkup = Catalog.GetString ("Next");
            jumpspinbutton.TooltipMarkup = Catalog.GetString ("Jump in seconds. Hold the Shift key with the direction keys to activate it.");
            volumebutton.TooltipMarkup = Catalog.GetString ("Volume");
            detachbutton.TooltipMarkup = Catalog.GetString ("Detach window");

            vwin = new VolumeWindow ();
            ConnectSignals ();
            blackboard = new Blackboard (new WidgetWrapper (blackboarddrawingarea));
            vbox3.NoShowAll = true;
            timescale.Adjustment.PageIncrement = 0.01;
            timescale.Adjustment.StepIncrement = 0.0001;
            LongoMatch.Gui.Helpers.Misc.SetFocus (vbox3, false);
            videowindow.CanFocus = true;
            detachbutton.Clicked += (sender, e) => Config.EventsBroker.EmitDetach ();
            ratescale.ModifyFont (FontDescription.FromString (Config.Style.Font + " 8"));
            controlsbox.HeightRequest = StyleConf.PlayerCapturerControlsHeight;

            Player = new PlayerController ();
            Player.CamerasConfig = new List<CameraConfig> { new CameraConfig (0) };
            Player.Step = new Time { TotalSeconds = jumpspinbutton.ValueAsInt };
            Mode = PlayerViewOperationMode.Analysis;
            CreateWindows ();
            ResetGui ();
        }
Example #2
0
        public DrawingTool(Window parent)
        {
            TransientFor = parent;
            this.Build ();
            savebutton.Clicked += OnSavebuttonClicked;
            savetoprojectbutton.Clicked += OnSavetoprojectbuttonClicked;
            blackboard = new Blackboard (new WidgetWrapper (drawingarea));
            blackboard.ConfigureObjectEvent += HandleConfigureObjectEvent;
            blackboard.ShowMenuEvent += HandleShowMenuEvent;
            blackboard.DrawableChangedEvent += HandleDrawableChangedEvent;
            blackboard.RegionOfInterestChanged += HandleRegionOfInterestChanged;

            selectbutton.Active = true;

            selectbuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-select", 20);
            eraserbuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-eraser", 20);
            penbuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-pencil", 20);
            textbuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-text", 20);
            linebuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-arrow", 20);
            crossbuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-mark", 20);
            rectanglebuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-square", 20);
            ellipsebuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-circle", 20);
            rectanglefilledbuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-square-fill", 20);
            ellipsefilledbuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-circle-fill", 20);
            playerbuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-person", 20);
            numberbuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-counter", 20);
            anglebuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-angle", 20);
            zoombuttonimage.Pixbuf = Misc.LoadIcon ("longomatch-search", 20);
            zoomoutimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-zoom-out", 14);
            zoominimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-zoom-in", 14);

            selectbutton.Toggled += HandleToolClicked;
            eraserbutton.Toggled += HandleToolClicked;
            penbutton.Toggled += HandleToolClicked;
            textbutton.Toggled += HandleToolClicked;
            linebutton.Toggled += HandleToolClicked;
            crossbutton.Toggled += HandleToolClicked;
            rectanglebutton.Toggled += HandleToolClicked;
            ellipsebutton.Toggled += HandleToolClicked;
            rectanglefilledbutton.Toggled += HandleToolClicked;
            ellipsefilledbutton.Toggled += HandleToolClicked;
            playerbutton.Toggled += HandleToolClicked;
            anglebutton.Toggled += HandleToolClicked;
            numberbutton.Toggled += HandleToolClicked;
            zoombutton.Toggled += HandleToolClicked;

            // Force tooltips to be translatable as there seems to be a bug in stetic
            // code generation for translatable tooltips.
            selectbutton.TooltipMarkup = Catalog.GetString ("Selection tool");
            eraserbutton.TooltipMarkup = Catalog.GetString ("Rubber tool");
            penbutton.TooltipMarkup = Catalog.GetString ("Pencil tool");
            textbutton.TooltipMarkup = Catalog.GetString ("Text tool");
            linebutton.TooltipMarkup = Catalog.GetString ("Line tool");
            crossbutton.TooltipMarkup = Catalog.GetString ("Cross tool");
            rectanglebutton.TooltipMarkup = Catalog.GetString ("Rectangle tool");
            ellipsebutton.TooltipMarkup = Catalog.GetString ("Ellipse tool");
            rectanglefilledbutton.TooltipMarkup = Catalog.GetString ("Filled rectangle tool");
            ellipsefilledbutton.TooltipMarkup = Catalog.GetString ("Filled ellipse tool");
            playerbutton.TooltipMarkup = Catalog.GetString ("Player tool");
            numberbutton.TooltipMarkup = Catalog.GetString ("Index tool");
            anglebutton.TooltipMarkup = Catalog.GetString ("Angle tool");
            stylecombobox.TooltipMarkup = Catalog.GetString ("Change the line style");
            typecombobox.TooltipMarkup = Catalog.GetString ("Change the line style");
            clearbutton.TooltipMarkup = Catalog.GetString ("Clear all drawings");
            zoombutton.TooltipMarkup = Catalog.GetString ("Zoom tool. Click to zoom in, Alt+Shift to zoom out");

            FillLineStyle ();
            FillLineType ();

            colorbutton.ColorSet += HandleColorSet;
            colorbutton.Color = Misc.ToGdkColor (Color.Red1);
            blackboard.Color = Color.Red1;
            textcolorbutton.ColorSet += HandleTextColorSet;
            textcolorbutton.Color = Misc.ToGdkColor (Color.White);
            blackboard.TextColor = Color.White;
            backgroundcolorbutton.UseAlpha = true;
            backgroundcolorbutton.Alpha = (ushort)(ushort.MaxValue * 0.8);
            backgroundcolorbutton.ColorSet += HandleBackgroundColorSet;
            backgroundcolorbutton.Color = Misc.ToGdkColor (Color.Green1);
            blackboard.TextBackgroundColor = Misc.ToLgmColor (backgroundcolorbutton.Color,
                backgroundcolorbutton.Alpha);
            textspinbutton.Value = 12;
            textspinbutton.ValueChanged += (sender, e) => UpdateTextSize ();
            linesizespinbutton.ValueChanged += (sender, e) => UpdateLineWidth ();
            linesizespinbutton.Value = 4;

            clearbutton.Clicked += HandleClearClicked;
            zoomscale.CanFocus = false;
            zoomscale.SetRange (1, 4);
            zoomscale.SetIncrements (0.2, 0.2);
            zoomscale.ValueChanged += HandleZoomValueChanged;
            hscrollbar.ValueChanged += HandleScrollValueChanged;
            wscrollbar.ValueChanged += HandleScrollValueChanged;
            hscrollbar.Visible = wscrollbar.Visible = false;
            zoomscale.Value = 1;

            if (!Config.SupportsZoom) {
                zoombox.Visible = false;
                zoombutton.Visible = false;
                hscrollbar.Visible = false;
                wscrollbar.Visible = false;
            }
        }