当前位置: 首页>>代码示例>>C#>>正文


C# Gtk.Move方法代码示例

本文整理汇总了C#中Gtk.Move方法的典型用法代码示例。如果您正苦于以下问题:C# Gtk.Move方法的具体用法?C# Gtk.Move怎么用?C# Gtk.Move使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gtk的用法示例。


在下文中一共展示了Gtk.Move方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CenterChildToParent

        public static void CenterChildToParent(Gtk.Window parent,Gtk.Window child)
        {
            if (parent==null || child == null)
                return;

            int parentX = 0;
            int parentY = 0;
            int parentW = 0;
            int parentH = 0;

            parent.GetPosition(out parentX,out parentY);
            parent.GetSize(out parentW,out parentH);

            int w = 0;
            int h = 0;
            child.GetSize(out w,out h);

            var x = parentX + Convert.ToInt32( (parentW-w) / 2);
            var y = parentY + Convert.ToInt32( (parentH-h) / 2);

            if (x<=0) x =0;
            if (y<=0) y =0;

            child.Move(x,y);
            child.KeepAbove = true;
        }
开发者ID:petrj,项目名称:MP3Tagger,代码行数:26,代码来源:Dialogs.cs

示例2: MoveBy

        public static void MoveBy(Gtk.Window window, int x, int y)
        {
            int winX, winY;

            window.GetPosition(out winX, out winY);
            window.Move(winX + x, winY + y);
        }
开发者ID:BackupTheBerlios,项目名称:niry-sharp-svn,代码行数:7,代码来源:WindowUtils.cs

示例3: ShowTooltipWindow

		public virtual Gtk.Window ShowTooltipWindow (MonoTextEditor editor, Gtk.Window tipWindow, int offset, Gdk.ModifierType modifierState, int mouseX, int mouseY, TooltipItem item)
		{
			int ox = 0, oy = 0;
			if (editor.GdkWindow != null)
				editor.GdkWindow.GetOrigin (out ox, out oy);
			
			int w;
			double xalign;
			GetRequiredPosition (editor, tipWindow, out w, out xalign);
			w += 10;

			int x = mouseX + ox + editor.Allocation.X;
			int y = mouseY + oy + editor.Allocation.Y;
			Gdk.Rectangle geometry = editor.Screen.GetUsableMonitorGeometry (editor.Screen.GetMonitorAtPoint (x, y));
			
			x -= (int) ((double) w * xalign);
			y += 10;
			
			if (x + w >= geometry.X + geometry.Width)
				x = geometry.X + geometry.Width - w;
			if (x < geometry.Left)
				x = geometry.Left;
			
			int h = tipWindow.SizeRequest ().Height;
			if (y + h >= geometry.Y + geometry.Height)
				y = geometry.Y + geometry.Height - h;
			if (y < geometry.Top)
				y = geometry.Top;
			
			tipWindow.Move (x, y);
			
			tipWindow.ShowAll ();

			return tipWindow;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:35,代码来源:TooltipProvider.cs

示例4: FadeOut

        public static void FadeOut(Gtk.Window window, uint millisecondsTimeout)
        {
            int screenHeight = window.Screen.Height + 10;
            int winX, winY;

            do {
                window.GetPosition(out winX, out winY);
                window.Move(winX, winY + 1);
                //System.Threading.Thread.Sleep(millisecondsTimeout);
                TimeUtils.Sleep(millisecondsTimeout);
            } while (winY <= screenHeight);
        }
开发者ID:BackupTheBerlios,项目名称:niry-sharp-svn,代码行数:12,代码来源:WindowUtils.cs

示例5: FadeIn

        public static void FadeIn(Gtk.Window window, uint millisecondsTimeout)
        {
            int screenHeight = window.Screen.Height;
            int winWidth, winHeight;
            int winX, winY;

            // Hide Window At Bottom of The Screen
            window.GetPosition(out winX, out winY);
            //int firstWinY = winY;
            window.GetSize(out winWidth, out winHeight);
            window.Move(winX, screenHeight);

            // Rise Window
            do {
                window.GetPosition(out winX, out winY);
                window.Move(winX, winY - 1);
                //System.Threading.Thread.Sleep(millisecondsTimeout);
                TimeUtils.Sleep(millisecondsTimeout);
            //} while (winY >= firstWinY);
            } while (winY > (screenHeight - winHeight));
        }
开发者ID:BackupTheBerlios,项目名称:niry-sharp-svn,代码行数:21,代码来源:WindowUtils.cs

示例6: Shake

        public static void Shake(Gtk.Window window, int times)
        {
            int winX, winY;

            Gtk.Application.Invoke(delegate {
                window.GetPosition(out winX, out winY);

                for (int i=10; i > 0; i--) {
                    for (int j=times; j > 0; j--) {
                        MoveBy(window, 0, i);
                        TimeUtils.Sleep(5);

                        MoveBy(window, i, 0);
                        TimeUtils.Sleep(5);

                        MoveBy(window, 0, -i);
                        TimeUtils.Sleep(5);

                        MoveBy(window, -i, 0);
                        TimeUtils.Sleep(5);
                    }
                }

                window.Move(winX, winY);
            });
        }
开发者ID:BackupTheBerlios,项目名称:niry-sharp-svn,代码行数:26,代码来源:WindowUtils.cs

示例7: CenterWindow

 /// <summary>Centers a window relative to its parent.</summary>
 static void CenterWindow(Gtk.Window child, Gtk.Window parent)
 {
     child.Child.Show ();
     int w, h, winw, winh, x, y, winx, winy;
     if (child.Visible)
         child.GetSize (out w, out h);
     else {
         w = child.DefaultSize.Width;
         h = child.DefaultSize.Height;
     }
     parent.GetSize (out winw, out winh);
     parent.GetPosition (out winx, out winy);
     x = Math.Max (0, (winw - w) /2) + winx;
     y = Math.Max (0, (winh - h) /2) + winy;
     child.Move (x, y);
 }
开发者ID:Michael--,项目名称:DockingFramework,代码行数:17,代码来源:MessageService.cs

示例8: PlaceWindow

		internal virtual void PlaceWindow (Gtk.Window window, int x, int y, int width, int height)
		{
			window.Move (x, y);
			window.Resize (width, height);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:5,代码来源:PlatformService.cs

示例9: PlaceWindow

 // Pinta TODO: This may need to be overridden for Mac?
 private void PlaceWindow (Gtk.Window window, int x, int y, int width, int height)
 {
     window.Move (x, y);
     window.Resize (width, height);
 }
开发者ID:msiyer,项目名称:Pinta,代码行数:6,代码来源:DockFrameTopLevel.cs

示例10: CenterWindow

 /// <summary>Centers a window relative to its parent.</summary>
 static void CenterWindow(Gtk.Window child, Gtk.Window parent)
 {
     child.Child.Show ();
     int w, h, winw, winh, x, y, winx, winy;
     child.GetSize (out w, out h);
     parent.GetSize (out winw, out winh);
     parent.GetPosition (out winx, out winy);
     x = Math.Max (0, (winw - w) /2) + winx;
     y = Math.Max (0, (winh - h) /2) + winy;
     child.Move (x, y);
 }
开发者ID:RevolutionSmythe,项目名称:xwt,代码行数:12,代码来源:MessageService.cs


注:本文中的Gtk.Move方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。