コード例 #1
0
        public RasterControl()
        {
            InitializeComponent();

            if (DesignMode)
            {
                return;
            }

            disablerPanel = new Panel()
            {
                Dock = DockStyle.Fill, BackColor = Color.Transparent, Visible = false, Cursor = Cursors.No
            };
            toolTip1.SetToolTip(disablerPanel, "Overlay out of sync. WYSIWYG editing is disabled");
            //toolTip1.SetToolTip(this, "The WYSIWYG area");
            //toolTip1.Popup += new PopupEventHandler(toolTip1_Popup);
            //toolTip1.ReshowDelay = 50;
            //toolTip1.InitialDelay = 100;
            //toolTip1.ShowAlways = true;
            toolTip1.Active = true;

            this.MouseHover += new EventHandler(RasterControl_MouseHover);

            this.Controls.Add(disablerPanel);

            CreateContextMenu();

            //this.CanFocus = true;
            this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.Selectable, true);

            TheRasterModel = new RasterControlModel(this);

            IPdfToBmp <Bitmap> Pdf2Bmp;

            if (CompilerSettings.Instance.UseExternalRenderer)
            {
                Pdf2Bmp = new PdfToBmpExtWinForms();
            }
            else
            {
                Pdf2Bmp = new PdfToBmp();
            }
            TheDisplayModel = new TikzDisplayModel <Bitmap>(this, Pdf2Bmp);

            TheOverlayModel = new PdfOverlayModel(this, this);
            TheOverlayModel.DisplayTree.DisplayTreeChanged += new EventHandler <TikzDisplayTree.DisplayTreeChangedEventArgs>(DisplayTree_DisplayTreeChanged);

            MarkObject_Timer.Interval = 500;
            MarkObject_Timer.Tick    += new EventHandler(MarkObject_Timer_Tick);

            // listen to Bitmap changes
            MyBindings.Add(BindingFactory.CreateBinding(TheDisplayModel, "Bmp", (o) => this.Invalidate(), null));
        }
コード例 #2
0
ファイル: RasterControl.cs プロジェクト: wilsoc5/tikzedt
        public RasterControl(EventBox parent)
        {
            ParentBox = parent;

            disablerPanel             = new DrawingArea();//{ Opacit = Color.Transparent, Visible = false, Curso = Cursors.No };
            disablerPanel.TooltipText = "Overlay out of sync. WYSIWYG editing is disabled";
            //toolTip1.SetToolTip(disablerPanel, "Overlay out of sync. WYSIWYG editing is disabled");
            //        this.PackStart(disablerPanel, true, true,0);


            //toolTip1.SetToolTip(this, "The WYSIWYG area");
            //toolTip1.Popup += new PopupEventHandler(toolTip1_Popup);
            //toolTip1.ReshowDelay = 50;
            //toolTip1.InitialDelay = 100;
            //toolTip1.ShowAlways = true;
            toolTip1.Active = true;

            //todo this.MouseHover += new EventHandler(RasterControl_MouseHover);



            CreateContextMenu();

            //this.CanFocus = true;
            //this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.Selectable, true);
            DoubleBuffered = true;

            TheRasterModel = new RasterControlModel(this);

            TheDisplayModel = new TikzDisplayModel <Cairo.ImageSurface>(this, new PdfToBmpExtGTK());

            TheOverlayModel = new PdfOverlayModel(this, this);

            MarkObject_Timer.Interval = 500;
            MarkObject_Timer.Tick    += new EventHandler(MarkObject_Timer_Tick);

            // listen to Bitmap changes
            MyBindings.Add(BindingFactory.CreateBinding(TheDisplayModel, "Bmp", (o) => this.Invalidate(), null));

            parent.ButtonPressEvent   += OnButtonPress;
            parent.ButtonReleaseEvent += OnButtonRelease;
            parent.MotionNotifyEvent  += OnMotionNotify;
            parent.KeyPressEvent      += OnKeyPress;
            parent.KeyReleaseEvent    += OnKeyRelease;
        }