Ejemplo n.º 1
0
 public TextTool()
 {
     cursor_hand       = new Gdk.Cursor(PintaCore.Chrome.Canvas.Display, PintaCore.Resources.GetIcon("Cursor.Pan.png"), 8, 8);
     imContext         = new Gtk.IMMulticontext();
     imContext.Commit += OnIMCommit;
     layout            = new TextLayout();
 }
Ejemplo n.º 2
0
 public TextTool(IServiceManager services) : base(services)
 {
     cursor_hand       = new Gdk.Cursor(Gdk.Display.Default, PintaCore.Resources.GetIcon("Cursor.Pan.png"), 8, 8);
     imContext         = new Gtk.IMMulticontext();
     imContext.Commit += OnIMCommit;
     layout            = new Pinta.Core.TextLayout();
 }
 static CustomCursorFactory() 
 {
     Gdk.Pixbuf cursorGrabbingPix = Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.cursor_grabbing.png");
     Gdk.Pixbuf cursorGrabOpenPix = Gdk.Pixbuf.LoadFromResource("TraceLab.UI.GTK.Resources.cursor-grab-open.png");
     
     s_cursorGrabbingHand = new Cursor(Display.Default, cursorGrabbingPix, 0, 0);
     s_cursorOpenHandGrab = new Cursor(Display.Default, cursorGrabOpenPix, 0, 0);
 }
Ejemplo n.º 4
0
        public void SetCursor(Gdk.Cursor cursor)
        {
            CurrentCursor = cursor;

            if (PintaCore.Workspace.HasOpenDocuments && PintaCore.Workspace.ActiveWorkspace.Canvas.GdkWindow != null)
            {
                PintaCore.Workspace.ActiveWorkspace.Canvas.GdkWindow.Cursor = cursor;
            }
        }
Ejemplo n.º 5
0
 protected override void OnDestroyed()
 {
     base.OnDestroyed();
     if (resizeCursor != null)
     {
         resizeCursor.Dispose();
         resizeCursor = null;
     }
 }
Ejemplo n.º 6
0
        private bool HideCursor()
        {
            if (empty_cursor == null)
            {
                empty_cursor = GdkUtils.CreateEmptyCursor(GdkWindow.Display);
            }

            this.GdkWindow.Cursor = empty_cursor;
            view.GdkWindow.Cursor = empty_cursor;
            return(false);
        }
Ejemplo n.º 7
0
        static Resources()
        {
            IconCurveDelete = Gdk.Pixbuf.LoadFromResource("chart_curve_delete.png");
            IconCurveBezier = Gdk.Pixbuf.LoadFromResource("chart_curve.png");
            IconCurveLinear = Gdk.Pixbuf.LoadFromResource("chart_line.png");
            IconColorWheel  = Gdk.Pixbuf.LoadFromResource("color_wheel.png");
            IconCancel      = Gdk.Pixbuf.LoadFromResource("cancel.png");
            IconDelete      = Gdk.Pixbuf.LoadFromResource("delete.png");

            HandCursor = new Cursor(CursorType.Hand1);
        }
Ejemplo n.º 8
0
 protected override void OnKeyDown(Gtk.DrawingArea canvas, Gtk.KeyPressEventArgs args)
 {
     base.OnKeyDown(canvas, args);
     //note that this WONT work if user presses control key and THEN selects the tool!
     if (args.Event.Key == Key.Control_L || args.Event.Key == Key.Control_R)
     {
         Gdk.Pixbuf icon            = PintaCore.Resources.GetIcon("Cursor.CloneStampSetSource.png");
         Gdk.Cursor setSourceCursor = new Gdk.Cursor(PintaCore.Chrome.Canvas.Display, icon, 6, 11);
         SetCursor(setSourceCursor);
     }
 }
Ejemplo n.º 9
0
        public PropertyGridTable(EditorManager editorManager, PropertyGrid parentGrid)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.parentGrid    = parentGrid;
            this.editorManager = editorManager;
            WidgetFlags       |= Gtk.WidgetFlags.AppPaintable;
            Events            |= Gdk.EventMask.PointerMotionMask;
            CanFocus           = true;
            resizeCursor       = new Cursor(CursorType.SbHDoubleArrow);
            handCursor         = new Cursor(CursorType.Hand1);
        }
Ejemplo n.º 10
0
        protected override void OnDestroyed()
        {
            view.MotionNotifyEvent -= HandleImageViewMotion;
            view.Item.Changed      -= HandleItemChanged;
            view.ZoomChanged       -= HandleViewZoomChanged;

            opened_hand_cursor.Dispose();
            closed_hand_cursor.Dispose();
            opened_hand_cursor = null;
            closed_hand_cursor = null;

            base.OnDestroyed();
        }
Ejemplo n.º 11
0
 private void SetCursor(CursorType type)
 {
     Gdk.Cursor cursor = GetCursor(type);
     if (cursor == null)
     {
         ResetCursor();
     }
     else
     {
         default_cursor       = false;
         window.Window.Cursor = cursor;
     }
 }
Ejemplo n.º 12
0
        public PropertyGridTable(EditorManager editorManager, PropertyGrid parentGrid)
        {
            Mono.TextEditor.GtkWorkarounds.FixContainerLeak(this);

            this.editorManager = editorManager;
            WidgetFlags       |= Gtk.WidgetFlags.AppPaintable;
            Events            |= Gdk.EventMask.PointerMotionMask;
            CanFocus           = true;
            resizeCursor       = new Cursor(CursorType.SbHDoubleArrow);
            handCursor         = new Cursor(CursorType.Hand1);
            discloseDown       = Gdk.Pixbuf.LoadFromResource("disclose-arrow-down.png");
            discloseUp         = Gdk.Pixbuf.LoadFromResource("disclose-arrow-up.png");
        }
Ejemplo n.º 13
0
 public LinkTextView(string linkText)
     : base()
 {
     currentCursor = -1;
        handCursor = new Gdk.Cursor (Gdk.CursorType.Hand2);
        hoveringOverLink = false;
        string xmlLinkText = "<message>" + linkText + "</message>";
        XmlDocument linkTextDom = new XmlDocument();
        linkTextDom.LoadXml(xmlLinkText);
        TextTagTable textTagTable = CreateTextTagTable(linkTextDom);
        TextBuffer textBuffer = new TextBuffer(textTagTable);
        FormatTextBuffer(textBuffer, linkTextDom.DocumentElement);
        this.Buffer = textBuffer;
 }
Ejemplo n.º 14
0
        public PropertyGridTable(EditorManager editorManager, PropertyGrid parentGrid)
        {
            GtkWorkarounds.FixContainerLeak(this);

            this.parentGrid    = parentGrid;
            this.editorManager = editorManager;
            WidgetFlags       |= Gtk.WidgetFlags.AppPaintable;
            Events            |= Gdk.EventMask.PointerMotionMask;
            CanFocus           = true;
            resizeCursor       = new Cursor(CursorType.SbHDoubleArrow);
            handCursor         = new Cursor(CursorType.Hand1);
            discloseDown       = Xwt.Drawing.Image.FromResource("disclose-arrow-down-16.png");
            discloseUp         = Xwt.Drawing.Image.FromResource("disclose-arrow-up-16.png");
        }
Ejemplo n.º 15
0
 public ToolboxWidget()
 {
     this.Events = EventMask.ExposureMask |
                   EventMask.EnterNotifyMask |
                   EventMask.LeaveNotifyMask |
                   EventMask.ButtonPressMask |
                   EventMask.ButtonReleaseMask |
                   EventMask.KeyPressMask |
                   EventMask.PointerMotionMask;
     this.CanFocus = true;
     discloseDown  = ImageService.GetIcon("md-disclose-arrow-down", Gtk.IconSize.Menu);
     discloseUp    = ImageService.GetIcon("md-disclose-arrow-up", Gtk.IconSize.Menu);
     handCursor    = new Cursor(CursorType.Hand1);
 }
Ejemplo n.º 16
0
        public Gdk.Cursor Empty()
        {
            Gdk.Cursor cempty = null;

            try {
                Gdk.Pixbuf empty = new Gdk.Pixbuf(Gdk.Colorspace.Rgb, true, 8, 1, 1);
                empty.Fill(0x00000000);
                cempty = new Gdk.Cursor(GdkWindow.Display, empty, 0, 0);
            } catch (System.Exception e) {
                System.Console.WriteLine(e.ToString());
                return(null);
            }

            return(cempty);
        }
Ejemplo n.º 17
0
        bool HideCursor()
        {
            if (View.InPanMotion)
            {
                return(false);
            }

            if (empty_cursor == null)
            {
                empty_cursor = GdkUtils.CreateEmptyCursor(GdkWindow.Display);
            }

            this.GdkWindow.Cursor = empty_cursor;
            View.GdkWindow.Cursor = empty_cursor;

            return(false);
        }
Ejemplo n.º 18
0
        private Gdk.Cursor GetCursor(object desc)
        {
            Gdk.Cursor rv;
            var name = desc as string;
            if (name != null)
            {
                var theme = Gtk.IconTheme.Default;
                var icon = theme.LoadIcon(name, 32, default(Gtk.IconLookupFlags));
                rv = icon == null ? new Gdk.Cursor(CursorType.XCursor) : new Gdk.Cursor(Display.Default, icon, 0, 0);
            }
            else
            {
                rv = new Gdk.Cursor((CursorType)desc);
            }

            rv.Owned = false;
            return rv;
        }
Ejemplo n.º 19
0
        public PropertyGridTable(EditorManager editorManager, PropertyGrid parentGrid)
        {
            // TODO: ???
            //Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);

            this.editorManager = editorManager;
            WidgetFlags       |= Gtk.WidgetFlags.AppPaintable;
            Events            |= Gdk.EventMask.PointerMotionMask;
            CanFocus           = true;
            resizeCursor       = new Cursor(CursorType.SbHDoubleArrow);
            handCursor         = new Cursor(CursorType.Hand1);
            discloseDown       = Gdk.Pixbuf.LoadFromResource("disclose-arrow-down.png");
            discloseUp         = Gdk.Pixbuf.LoadFromResource("disclose-arrow-up.png");
            arrowLeft          = Gdk.Pixbuf.LoadFromResource("arrow-left.png");
            arrowRight         = Gdk.Pixbuf.LoadFromResource("arrow-right.png");

            PropertyContentRightPadding = MG.Framework.Utility.Platform.IsMac ? 10 : 0;
        }
Ejemplo n.º 20
0
        private Gdk.Cursor GetCursor(object desc)
        {
            Gdk.Cursor rv;
            var        name = desc as string;

            if (name != null)
            {
                var theme = Gtk.IconTheme.Default;
                var icon  = theme.LoadIcon(name, 32, default(Gtk.IconLookupFlags));
                rv = icon == null ? new Gdk.Cursor(CursorType.XCursor) : new Gdk.Cursor(Display.Default, icon, 0, 0);
            }
            else
            {
                rv = new Gdk.Cursor((CursorType)desc);
            }

            rv.Owned = false;
            return(rv);
        }
Ejemplo n.º 21
0
        public LinkTextView(string linkText) : base()
        {
            currentCursor = -1;

            handCursor = new Gdk.Cursor(Gdk.CursorType.Hand2);

            hoveringOverLink = false;

            string xmlLinkText = "<message>" + linkText + "</message>";

            XmlDocument linkTextDom = new XmlDocument();

            linkTextDom.LoadXml(xmlLinkText);

            TextTagTable textTagTable = CreateTextTagTable(linkTextDom);
            TextBuffer   textBuffer   = new TextBuffer(textTagTable);

            FormatTextBuffer(textBuffer, linkTextDom.DocumentElement);

            this.Buffer = textBuffer;
        }
Ejemplo n.º 22
0
        public FullSlide(Gtk.Window parent, IBrowsableItem [] items) : base("Slideshow")
        {
            screenshot = PixbufUtils.LoadFromScreen(parent.GdkWindow);

            this.Destroyed += HandleDestroyed;

            this.TransientFor = parent;

            this.ButtonPressEvent += HandleSlideViewButtonPressEvent;
            this.KeyPressEvent    += HandleSlideViewKeyPressEvent;
            this.AddEvents((int)(EventMask.ButtonPressMask | EventMask.KeyPressMask | EventMask.PointerMotionMask));
            slideview = new SlideView(screenshot, items);
            this.Add(slideview);
            this.Decorated = false;
            this.Fullscreen();
            this.Realize();

            busy = new Gdk.Cursor(Gdk.CursorType.Watch);
            this.GdkWindow.Cursor = busy;
            none = GdkUtils.CreateEmptyCursor(GdkWindow.Display);

            hide = new Delay(2000, new GLib.IdleHandler(HideCursor));
        }
Ejemplo n.º 23
0
		public FullSlide (Gtk.Window parent, IBrowsableItem [] items) : base ("Slideshow")
		{
			screenshot =  PixbufUtils.LoadFromScreen (parent.GdkWindow);
			
			this.Destroyed += HandleDestroyed;

			this.TransientFor = parent;

			this.ButtonPressEvent += HandleSlideViewButtonPressEvent;
			this.KeyPressEvent += HandleSlideViewKeyPressEvent;
			this.AddEvents ((int) (EventMask.ButtonPressMask | EventMask.KeyPressMask | EventMask.PointerMotionMask));
			slideview = new SlideView (screenshot, items);
			this.Add (slideview);
			this.Decorated = false;
			this.Fullscreen();
			this.Realize ();

			busy = new Gdk.Cursor (Gdk.CursorType.Watch);
			this.GdkWindow.Cursor = busy;
			none = Empty ();

			hide = new Delay (2000, new GLib.IdleHandler (HideCursor));
		}
Ejemplo n.º 24
0
 protected override void OnKeyDown(Gtk.DrawingArea canvas, Gtk.KeyPressEventArgs args)
 {
     base.OnKeyDown(canvas, args);
     //note that this WONT work if user presses control key and THEN selects the tool!
     if (args.Event.Key == Key.Control_L || args.Event.Key == Key.Control_R) {
         Gdk.Pixbuf icon = PintaCore.Resources.GetIcon ("Cursor.CloneStampSetSource.png");
         Gdk.Cursor setSourceCursor = new Gdk.Cursor(PintaCore.Chrome.Canvas.Display, icon, 6, 11);
         SetCursor(setSourceCursor);
     }
 }
Ejemplo n.º 25
0
		public override void Dispose ()
		{
			if (arrowCursor == null)
				return;
			CancelCodeSegmentTooltip ();
			DisposeHighightBackgroundWorker ();
			DisposeSearchPatternWorker ();
			lock (lockObject) {
				if (caretTimer != null) {
					StopCaretThread ();
					caretTimer.Elapsed -= UpdateCaret; 
					caretTimer.Dispose ();
					caretTimer = null;
				}
			}
			
			textEditor.Document.EndUndo -= UpdateBracketHighlighting;
			Caret.PositionChanged -= UpdateBracketHighlighting;

			textEditor.GetTextEditorData ().SearchChanged -= HandleSearchChanged;
			
			arrowCursor.Dispose ();
			xtermCursor.Dispose ();
			arrowCursor = xtermCursor = null;
			
			DisposeGCs ();
			if (caretGc != null) {
				caretGc.Dispose ();
				caretGc = null;
			}
			
			if (markerLayout != null) {
				markerLayout.Dispose ();
				markerLayout = null;
			}
			
			DisposeLayoutDict ();
			if (tabArray != null) {
				tabArray.Dispose ();
				tabArray = null;
			}
			
			layoutDict = null;
			base.Dispose ();
		}
Ejemplo n.º 26
0
 static CreateFunc()
 {
     _cursor = LoadCursor("cursor-slice.png");
 }
		protected override void OnDestroyed ()
		{
			if (fleurCursor != null) {
				fleurCursor.Dispose ();
				fleurCursor = null;
			}
			base.OnDestroyed ();
		}
Ejemplo n.º 28
0
 static CreateTableFunc()
 {
     _cursor = LoadCursor("cursor-table.png");
 }
Ejemplo n.º 29
0
 public void SetCursor(Gdk.Cursor cursor)
 {
     PintaCore.Chrome.Canvas.GdkWindow.Cursor = cursor;
 }
Ejemplo n.º 30
0
		protected override void OnDestroyed ()
		{
			if (cursorX != null) {
				cursorX.Dispose ();
				cursorXY.Dispose ();
				cursorY.Dispose ();
				cursorX = cursorXY = cursorY = null;
			}
			base.OnDestroyed ();
		}
Ejemplo n.º 31
0
        public BuyDialog(int featureLicenceId, string featureTitle, Gtk.Window parent) : base()
        {
            this.featureTitle     = featureTitle;
            this.featureLicenceId = featureLicenceId;
            this.HasSeparator     = false;
            if (parent != null)
            {
                this.TransientFor = parent;
            }
            this.WidthRequest  = 570;
            this.HeightRequest = 450;

            this.ModifyBg(Gtk.StateType.Normal, Style.White);

            string userLicenceId = "-100";

            if (MainClass.User != null)
            {
                userLicenceId = MainClass.User.LicenseId;
            }

            int iTyp = 0;

            if (!Int32.TryParse(userLicenceId, out iTyp))
            {
                iTyp = -100;
            }

            featureLicence = MainClass.LicencesSystem.GetLicence(this.featureLicenceId.ToString());

            handCursor    = new Gdk.Cursor(Gdk.CursorType.Hand2);
            regularCursor = new Gdk.Cursor(Gdk.CursorType.Xterm);

            viewHeader          = new TextView();
            viewHeader.CanFocus = false;
            TextBuffer buffer = viewHeader.Buffer;

            viewFooter = new TextView();
            TextBuffer buffer2 = viewFooter.Buffer;

            viewFooter.KeyPressEvent     += new KeyPressEventHandler(KeyPress);
            viewFooter.WidgetEventAfter  += new WidgetEventAfterHandler(EventAfter);
            viewFooter.MotionNotifyEvent += new MotionNotifyEventHandler(MotionNotify);
            viewFooter.HeightRequest      = 15;
            viewFooter.CanFocus           = false;

            viewTable          = new TextView();
            viewTable.CanFocus = false;
            TextBuffer buffer3 = viewTable.Buffer;

            ScrolledWindow sw = new ScrolledWindow();

            sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            sw.HeightRequest = 115;
            sw.Add(viewHeader);

            ScrolledWindow sw2 = new ScrolledWindow();

            sw2.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            sw2.HeightRequest = 15;
            sw2.Add(viewFooter);

            ScrolledWindow sw3 = new ScrolledWindow();

            sw3.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            sw3.Add(viewTable);

            CreateTags(buffer);
            CreateTags(buffer2);
            CreateTags(buffer3);
            InsertTextHeader(buffer);
            InsertTextFooter(buffer2);
            InsertTextTable(buffer3);

            Table tbl = new Table(4, 1, false);

            if (MainClass.Platform.IsMac)
            {
                tbl.BorderWidth = 20;
            }
            else
            {
                tbl.BorderWidth = 6;
            }

            BannerButton btnBuy = new BannerButton();

            btnBuy.ModifyBase(StateType.Normal, new Gdk.Color(109, 158, 24));
            btnBuy.ModifyBg(StateType.Normal, new Color(109, 158, 24));
            btnBuy.HeightRequest = 38;
            btnBuy.WidthRequest  = 170;
            string buyPath = System.IO.Path.Combine(MainClass.Paths.ResDir, "btnBuy.png");

            btnBuy.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) {
                string url = "http://moscrif.com/download?t={0}";
                if (MainClass.User != null && (!String.IsNullOrEmpty(MainClass.User.Token)))
                {
                    url = string.Format(url, MainClass.User.Token);
                }

                System.Diagnostics.Process.Start(url);
                this.Respond(Gtk.ResponseType.Ok);
            };

            btnBuy.ImageIcon = new Pixbuf(buyPath);

            BannerButton btnCancel = new BannerButton();

            btnCancel.HeightRequest = 38;
            btnCancel.WidthRequest  = 170;
            string cancelPath = System.IO.Path.Combine(MainClass.Paths.ResDir, "btnCancel.png");

            btnCancel.ImageIcon         = new Pixbuf(cancelPath);
            btnCancel.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) {
                this.Respond(Gtk.ResponseType.Cancel);
            };

            Table tblButton = new Table(1, 4, false);

            tblButton.ColumnSpacing = 12;
            tblButton.BorderWidth   = 6;
            tblButton.Attach(new Label(""), 0, 1, 0, 1, AttachOptions.Expand, AttachOptions.Expand, 0, 0);
            tblButton.Attach(btnCancel, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tblButton.Attach(btnBuy, 2, 3, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tblButton.Attach(new Label(""), 3, 4, 0, 1, AttachOptions.Expand, AttachOptions.Expand, 0, 0);

            tbl.Attach(sw, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            tbl.Attach(sw3, 0, 1, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 0, 0);
            tbl.Attach(tblButton, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            tbl.Attach(sw2, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            tbl.ShowAll();
            this.VBox.Add(tbl);
            this.ShowAll();
        }
Ejemplo n.º 32
0
 public PanTool(IDrawingEditor editor, Cursor defaultCursor): base (editor) 
 {
     m_defaultCursor = defaultCursor;
     Gtk.Widget widget = (Gtk.Widget) editor.View;
     widget.GdkWindow.Cursor = m_defaultCursor;
 }
Ejemplo n.º 33
0
 static extern void gimp_preview_set_default_cursor(IntPtr preview,
     Cursor cursor);
Ejemplo n.º 34
0
 public TextTool()
 {
     cursor_hand = new Gdk.Cursor (Gdk.Display.Default, PintaCore.Resources.GetIcon ("Cursor.Pan.png"), 8, 8);
     imContext = new Gtk.IMMulticontext ();
     imContext.Commit += OnIMCommit;
     layout = new TextLayout ();
 }
Ejemplo n.º 35
0
 static RemoveFunc()
 {
     _cursor = LoadCursor("cursor-eraser.png");
 }
Ejemplo n.º 36
0
        private Cursor GetCursor(CursorType type)
        {
            int index;

            switch (type) {
                case CursorType.TopSide: index = 0; break;
                case CursorType.LeftSide: index = 1; break;
                case CursorType.BottomSide: index = 2; break;
                case CursorType.RightSide: index = 3; break;
                case CursorType.TopLeftCorner: index = 4; break;
                case CursorType.TopRightCorner: index = 5; break;
                case CursorType.BottomLeftCorner: index = 6; break;
                case CursorType.BottomRightCorner: index = 7; break;
                default: return null;
            }

            if (cursors == null) {
                cursors = new Cursor[8];
            }

            if (cursors[index] == null) {
                cursors[index] = new Cursor (type);
            }

            return cursors[index];
        }
Ejemplo n.º 37
0
 public TextTool()
 {
     cursor_hand = new Gdk.Cursor (PintaCore.Chrome.Canvas.Display, PintaCore.Resources.GetIcon ("Tools.Pan.png"), 0, 0);
 }
Ejemplo n.º 38
0
		public Gdk.Cursor Empty () 
		{
			Gdk.Cursor cempty = null;
			
			try {
				Gdk.Pixbuf empty = new Gdk.Pixbuf (Gdk.Colorspace.Rgb, true, 8, 1, 1);
			        empty.Fill (0x00000000);
				cempty = new Gdk.Cursor (GdkWindow.Display, empty, 0, 0);
			} catch (System.Exception e){
				System.Console.WriteLine (e.ToString ());
				return null;
			}

			return cempty;
		}
Ejemplo n.º 39
0
        public BuyDialog(int featureLicenceId,string featureTitle,Gtk.Window parent)
            : base()
        {
            this.featureTitle = featureTitle;
            this.featureLicenceId = featureLicenceId;
            this.HasSeparator = false;
            if(parent!=null)
                this.TransientFor = parent;
            this.WidthRequest = 570;
            this.HeightRequest = 450;

            this.ModifyBg (Gtk.StateType.Normal, Style.White);

            string userLicenceId ="-100";
            if(MainClass.User != null){
                userLicenceId = MainClass.User.LicenseId;
            }

            int iTyp =0;
            if(!Int32.TryParse(userLicenceId,out iTyp)){
                iTyp = -100;
            }

            featureLicence = MainClass.LicencesSystem.GetLicence(this.featureLicenceId.ToString());

            handCursor = new Gdk.Cursor (Gdk.CursorType.Hand2);
            regularCursor = new Gdk.Cursor (Gdk.CursorType.Xterm);

            viewHeader = new TextView ();
            viewHeader.CanFocus = false;
            TextBuffer buffer = viewHeader.Buffer;

            viewFooter = new TextView ();
            TextBuffer buffer2 = viewFooter.Buffer;
            viewFooter.KeyPressEvent += new KeyPressEventHandler (KeyPress);
            viewFooter.WidgetEventAfter += new WidgetEventAfterHandler (EventAfter);
            viewFooter.MotionNotifyEvent += new MotionNotifyEventHandler (MotionNotify);
            viewFooter.HeightRequest = 15;
            viewFooter.CanFocus = false;

            viewTable = new TextView ();
            viewTable.CanFocus = false;
            TextBuffer buffer3 = viewTable.Buffer;

            ScrolledWindow sw = new ScrolledWindow ();
            sw.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
            sw.HeightRequest = 115;
            sw.Add (viewHeader);

            ScrolledWindow sw2 = new ScrolledWindow ();
            sw2.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
            sw2.HeightRequest = 15;
            sw2.Add (viewFooter);

            ScrolledWindow sw3 = new ScrolledWindow ();
            sw3.SetPolicy (PolicyType.Automatic, PolicyType.Automatic);
            sw3.Add (viewTable);

            CreateTags (buffer);
            CreateTags (buffer2);
            CreateTags (buffer3);
            InsertTextHeader (buffer);
            InsertTextFooter (buffer2);
            InsertTextTable (buffer3);

            Table tbl = new Table(4,1,false);
            if(MainClass.Platform.IsMac)
                tbl.BorderWidth=20;
            else
                tbl.BorderWidth=6;

            BannerButton btnBuy = new BannerButton();
            btnBuy.ModifyBase(StateType.Normal,new Gdk.Color(109,158,24));
            btnBuy.ModifyBg(StateType.Normal,new Color(109,158,24));
            btnBuy.HeightRequest = 38;
            btnBuy.WidthRequest = 170;
            string buyPath = System.IO.Path.Combine(MainClass.Paths.ResDir,"btnBuy.png");
            btnBuy.ButtonPressEvent+= delegate(object o, ButtonPressEventArgs args) {
                string url = "http://moscrif.com/download?t={0}";
                if (MainClass.User!=null && (!String.IsNullOrEmpty(MainClass.User.Token))) {
                    url = string.Format(url,MainClass.User.Token);

                }

                System.Diagnostics.Process.Start(url);
                this.Respond( Gtk.ResponseType.Ok );
            };

            btnBuy.ImageIcon = new Pixbuf(buyPath);

            BannerButton btnCancel = new BannerButton();
            btnCancel.HeightRequest = 38;
            btnCancel.WidthRequest = 170;
            string cancelPath = System.IO.Path.Combine(MainClass.Paths.ResDir,"btnCancel.png");

            btnCancel.ImageIcon = new Pixbuf(cancelPath);
            btnCancel.ButtonPressEvent+= delegate(object o, ButtonPressEventArgs args) {
                this.Respond( Gtk.ResponseType.Cancel );
            };

            Table tblButton = new Table (1,4,false);
            tblButton.ColumnSpacing = 12;
            tblButton.BorderWidth = 6;
            tblButton.Attach(new Label(""),0,1,0,1,AttachOptions.Expand,AttachOptions.Expand,0,0);
            tblButton.Attach(btnCancel,1,2,0,1,AttachOptions.Shrink,AttachOptions.Shrink,0,0);
            tblButton.Attach(btnBuy,2,3,0,1,AttachOptions.Shrink,AttachOptions.Shrink,0,0);
            tblButton.Attach(new Label(""),3,4,0,1,AttachOptions.Expand,AttachOptions.Expand,0,0);

            tbl.Attach(sw,0,1,0,1,AttachOptions.Fill,AttachOptions.Fill,0,0);

            tbl.Attach(sw3,0,1,1,2,AttachOptions.Fill|AttachOptions.Expand,AttachOptions.Fill|AttachOptions.Expand,0,0);
            tbl.Attach(tblButton,0,1,2,3,AttachOptions.Fill,AttachOptions.Fill,0,0);
            tbl.Attach(sw2,0,1,3,4,AttachOptions.Fill,AttachOptions.Shrink,0,0);

            tbl.ShowAll();
            this.VBox.Add (tbl);
            this.ShowAll();
        }
Ejemplo n.º 40
0
        public PropertyGridTable(EditorManager editorManager, PropertyGrid parentGrid)
        {
            Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);

            this.editorManager = editorManager;
            WidgetFlags |= Gtk.WidgetFlags.AppPaintable;
            Events |= Gdk.EventMask.PointerMotionMask;
            CanFocus = true;
            resizeCursor = new Cursor (CursorType.SbHDoubleArrow);
            handCursor = new Cursor (CursorType.Hand1);
            discloseDown = Xwt.Drawing.Image.FromResource ("disclose-arrow-down-light-16.png");
            discloseUp = Xwt.Drawing.Image.FromResource ("disclose-arrow-up-light-16.png");
        }
        private bool HideCursor()
        {
            if (view.InPanMotion) {
                return false;
            }

            if (empty_cursor == null)
                empty_cursor = GdkUtils.CreateEmptyCursor (GdkWindow.Display);

            this.GdkWindow.Cursor = empty_cursor;
            view.GdkWindow.Cursor = empty_cursor;
            return false;
        }
Ejemplo n.º 42
0
 public TextTool()
 {
     cursor_hand = new Gdk.Cursor(PintaCore.Chrome.Canvas.Display, PintaCore.Resources.GetIcon("Cursor.Pan.png"), 8, 8);
 }
		protected override void OnDestroyed ()
		{
			if (handCursor != null) {
				handCursor.Dispose ();
				handCursor = null;
			}
			base.OnDestroyed ();
		}
Ejemplo n.º 44
0
        public void SetCursorForTool(DrawTool tool)
        {
            string cursorStr = null;

            Gdk.Cursor cursor = null;

            if (widget.GdkWindow == null)
            {
                return;
            }

            switch (tool)
            {
            case DrawTool.Line:
                cursorStr = "arrow";
                break;

            case DrawTool.Cross:
                cursorStr = "cross";
                break;

            case DrawTool.Text:
                cursorStr = "text";
                break;

            case DrawTool.Counter:
                cursorStr = "number";
                break;

            case DrawTool.Ellipse:
            case DrawTool.CircleArea:
                cursorStr = "ellipse";
                break;

            case DrawTool.Rectangle:
            case DrawTool.RectangleArea:
                cursorStr = "rect";
                break;

            case DrawTool.Angle:
                cursorStr = "angle";
                break;

            case DrawTool.Pen:
                cursorStr = "freehand";
                break;

            case DrawTool.Eraser:
                cursorStr = "eraser";
                break;

            case DrawTool.Player:
                cursorStr = "player";
                break;

            case DrawTool.Zoom:
                cursorStr = "zoom";
                break;

            case DrawTool.CanMove:
                cursorStr = "hand_opened";
                break;

            case DrawTool.Move:
                cursorStr = "hand_closed";
                break;

            case DrawTool.Selection:
                cursorStr = "hand_select";
                break;

            default:
                cursor = null;
                break;
            }
            if (cursorStr == null)
            {
                widget.GdkWindow.Cursor = cursor;
            }
            else
            {
                Image  img = App.Current.ResourcesLocator.LoadImage(Path.Combine("images/cursors", cursorStr));
                Cursor c   = new Cursor(widget.Display, img.Value, 0, 0);
                widget.GdkWindow.Cursor = c;
            }
        }
Ejemplo n.º 45
0
        public void SetCursorForTool(DrawTool tool)
        {
            string cursorStr = null;
            Gdk.Cursor cursor = null;

            switch (tool) {
            case DrawTool.Line:
                cursorStr = "arrow";
                break;
            case DrawTool.Cross:
                cursorStr = "cross";
                break;
            case DrawTool.Text:
                cursorStr = "text";
                break;
            case DrawTool.Counter:
                cursorStr = "number";
                break;
            case DrawTool.Ellipse:
            case DrawTool.CircleArea:
                cursorStr = "ellipse";
                break;
            case DrawTool.Rectangle:
            case DrawTool.RectangleArea:
                cursorStr = "rect";
                break;
            case DrawTool.Angle:
                cursorStr = "angle";
                break;
            case DrawTool.Pen:
                cursorStr = "freehand";
                break;
            case DrawTool.Eraser:
                cursorStr = "eraser";
                break;
            case DrawTool.Player:
                cursorStr = "player";
                break;
            case DrawTool.Zoom:
                cursorStr = "zoom";
                break;
            case DrawTool.CanMove:
                cursorStr = "hand_opened";
                break;
            case DrawTool.Move:
                cursorStr = "hand_closed";
                break;
            case DrawTool.Selection:
                cursorStr = "hand_select";
                break;
            default:
                cursor = null;
                break;
            }
            if (cursorStr == null) {
                widget.GdkWindow.Cursor = cursor;
            } else {
                Image img = Image.LoadFromFile (Path.Combine (Config.ImagesDir, "cursors", cursorStr));
                Cursor c = new Cursor (widget.Display, img.Value, 0, 0);
                widget.GdkWindow.Cursor = c;
            }
        }
Ejemplo n.º 46
0
		protected override void OnDestroyed ()
		{
			allNotebooks.Remove (this);
			if (ActiveNotebook == this)
				ActiveNotebook = null;
			if (fleurCursor != null) {
				fleurCursor.Dispose ();
				fleurCursor = null;
			}
			base.OnDestroyed ();
		}
Ejemplo n.º 47
0
 public TextTool()
 {
     cursor_hand = new Gdk.Cursor (PintaCore.Chrome.DrawingArea.Display, PintaCore.Resources.GetIcon ("Tools.Pan.png"), 0, 0);
     engine = new TextEngine ();
 }
Ejemplo n.º 48
0
 protected override void OnDestroyed()
 {
     base.OnDestroyed ();
     if (resizeCursor != null) {
         resizeCursor.Dispose ();
         resizeCursor = null;
     }
 }
Ejemplo n.º 49
0
 static MouseFunc()
 {
     _defaultCursor = LoadCursor("cursor-select.png");
 }
Ejemplo n.º 50
0
        protected override void OnDestroyed()
        {
            view.MotionNotifyEvent -= HandleImageViewMotion;
            view.Item.Changed -= HandleItemChanged;
            view.ZoomChanged -= HandleViewZoomChanged;

            opened_hand_cursor.Dispose ();
            closed_hand_cursor.Dispose ();
            opened_hand_cursor = null;
            closed_hand_cursor = null;

            base.OnDestroyed ();
        }
Ejemplo n.º 51
0
 public TextTool()
 {
     cursor_hand = new Gdk.Cursor(PintaCore.Chrome.Canvas.Display, PintaCore.Resources.GetIcon("Tools.Pan.png"), 0, 0);
     engine      = new TextEngine();
 }
Ejemplo n.º 52
0
		protected BaseTool ()
		{
            CurrentCursor = DefaultCursor;

            PintaCore.Workspace.ActiveDocumentChanged += Workspace_ActiveDocumentChanged;
		}