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


C# Base.SetPosition方法代码示例

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


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

示例1: CenterVertically

        /// <summary>
        /// Centers the control vertically inside its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void CenterVertically(Base control)
        {
            Base parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(control.X, (parent.Height - control.Height) / 2);
        }
开发者ID:AreonDev,项目名称:NoWayOut,代码行数:11,代码来源:Align.cs

示例2: ScrollControl

        /// <summary>
        /// Initializes a new instance of the <see cref="ScrollControl"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public ScrollControl(Base parent)
            : base(parent)
        {
            MouseInputEnabled = false;

            m_VerticalScrollBar = new VerticalScrollBar(this);
            m_VerticalScrollBar.Dock = Pos.Right;
            m_VerticalScrollBar.BarMoved += VBarMoved;
            m_CanScrollV = true;
            m_VerticalScrollBar.NudgeAmount = 30;

            m_HorizontalScrollBar = new HorizontalScrollBar(this);
            m_HorizontalScrollBar.Dock = Pos.Bottom;
            m_HorizontalScrollBar.BarMoved += HBarMoved;
            m_CanScrollH = true;
            m_HorizontalScrollBar.NudgeAmount = 30;

            m_InnerPanel = new Base(this);
            m_InnerPanel.SetPosition(0, 0);
            m_InnerPanel.Margin = Margin.Five;
            m_InnerPanel.SendToBack();
            m_InnerPanel.MouseInputEnabled = false;

            m_AutoHideBars = false;
        }
开发者ID:BreyerW,项目名称:Sharp.Engine,代码行数:29,代码来源:ScrollControl.cs

示例3: AlignRight

        /// <summary>
        /// Moves the control to the right of its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void AlignRight(Base control)
        {
            Base parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(parent.Width - control.Width - parent.Padding.Right, control.Y);
        }
开发者ID:Sprunth,项目名称:gwen-dotnet,代码行数:11,代码来源:Align.cs

示例4: AlignLeft

        /// <summary>
        /// Moves the control to the left of its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void AlignLeft(Base control)
        {
            Base parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(parent.Padding.Left, control.Y);
        }
开发者ID:AreonDev,项目名称:NoWayOut,代码行数:11,代码来源:Align.cs

示例5: AlignBottom

        /// <summary>
        /// Moves the control to the bottom of its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void AlignBottom(Base control)
        {
            Base parent = control.Parent;
            if (null == parent) return;

            control.SetPosition(control.X, parent.Height - control.Height);
        }
开发者ID:Sprunth,项目名称:gwen-dotnet,代码行数:11,代码来源:Align.cs

示例6: CenterHorizontally

        /// <summary>
        /// Centers the control horizontally inside its parent.
        /// </summary>
        /// <param name="control"></param>
        public static void CenterHorizontally(Base control)
        {
            Base parent = control.Parent;
            if (null == parent) return;


            control.SetPosition(parent.Padding.Left + (((parent.Width - parent.Padding.Left - parent.Padding.Right) - control.Width) / 2), control.Y);
        }
开发者ID:AreonDev,项目名称:NoWayOut,代码行数:12,代码来源:Align.cs

示例7: Center

 /// <summary>
 /// Centers the control inside its parent.
 /// </summary>
 /// <param name="control">Control to center.</param>
 public static void Center(Base control)
 {
     Base parent = control.Parent;
     if (parent == null) 
         return;
     control.SetPosition(
         parent.Padding.Left + (((parent.Width - parent.Padding.Left - parent.Padding.Right) - control.Width)/2),
         (parent.Height - control.Height)/2);
 }
开发者ID:AreonDev,项目名称:NoWayOut,代码行数:13,代码来源:Align.cs

示例8: AlignTop

 /// <summary>
 /// Moves the control to the top of its parent.
 /// </summary>
 /// <param name="control"></param>
 public static void AlignTop(Base control)
 {
     control.SetPosition(control.X, 0);
 }
开发者ID:AreonDev,项目名称:NoWayOut,代码行数:8,代码来源:Align.cs

示例9: PlaceRightBottom

 /// <summary>
 /// Places the control to the right of other control (bottom aligned), taking margins into account.
 /// </summary>
 /// <param name="control">Control to place.</param>
 /// <param name="anchor">Anchor control.</param>
 /// <param name="spacing">Optional spacing.</param>
 public static void PlaceRightBottom(Base control, Base anchor, int spacing = 0)
 {
     control.SetPosition(anchor.Right + spacing, anchor.Y - control.Height + anchor.Height);
 }
开发者ID:AreonDev,项目名称:NoWayOut,代码行数:10,代码来源:Align.cs

示例10: PlaceDownLeft

 /// <summary>
 /// Places the control below other control (left aligned), taking margins into account.
 /// </summary>
 /// <param name="control">Control to place.</param>
 /// <param name="anchor">Anchor control.</param>
 /// <param name="spacing">Optional spacing.</param>
 public static void PlaceDownLeft(Base control, Base anchor, int spacing = 0)
 {
     control.SetPosition(anchor.X, anchor.Bottom + spacing);
 }
开发者ID:AreonDev,项目名称:NoWayOut,代码行数:10,代码来源:Align.cs

示例11: Main

		public static void Main(string[] args) {
			g_testEntries = AllTests.GetTests();
			testCount = g_testEntries.Count();

			testIndex = Math.Max(0, Math.Min(testIndex, testCount - 1));
			testSelection = testIndex;

			entry = g_testEntries[testIndex];
			test = entry.createFcn();

			GraphicsManager.SetWindowState(OpenTK.WindowState.Maximized);
			string title = String.Format("Box2D Version {0}.{1}.{2}", Settings._version.major, Settings._version.minor, Settings._version.revision);
			GraphicsManager.SetTitle(title);

			camera = new Camera2D();
			camera.OnRender += SimulationLoop;

			camera.SetZoom(12);
			camera.CenterOnTarget(true);
			camera.SetLocation(0, 0);

			GraphicsManager.Update += new GraphicsManager.Updater(GraphicsManager_Update);

			WindowControl glui = new WindowControl(MainCanvas.GetCanvas());
			glui.Dock = Gwen.Pos.Left;

			Label text = new Label(glui);
			text.Text = "Tests";
			text.SetPosition(10, 10);

			testList = new ListBox(glui);
			testList.RowSelected += delegate(Base sender, ItemSelectedEventArgs tlargs) {
				testSelection = testList.SelectedRowIndex;
			};
			foreach (TestEntry e in g_testEntries) {
				testList.AddRow(e.name, "", e);
			}
			testList.SelectedRowIndex = testSelection;
			testList.SetPosition(10, 30);
			testList.SetSize(170, 180);

			//glui.add_separator();
			Base SettingsBox = new Base(glui);
			SettingsBox.SetSize(200, 185);
			SettingsBox.SetPosition(0, 250);
			{
				NumericUpDown spinner = new NumericUpDown(SettingsBox);
				spinner.Text = "Vel Iters";
				spinner.Min = 1;
				spinner.Max = 500;
				spinner.ValueChanged += delegate(Base sender, EventArgs vcargs) {
					settings.velocityIterations = (int)spinner.Value;
				};
				spinner.Value = settings.velocityIterations;
				spinner.SetPosition(10, 10);

				NumericUpDown posSpinner = new NumericUpDown(SettingsBox);
				posSpinner.Min = 0;
				posSpinner.Max = 100;
				posSpinner.Text = "Pos Iters";
				posSpinner.ValueChanged += delegate(Base sender, EventArgs psargs) {
					settings.positionIterations = (int)posSpinner.Value;
				};
				posSpinner.Value = settings.positionIterations;
				posSpinner.SetPosition(10, 35);

				NumericUpDown hertzSpinner = new NumericUpDown(SettingsBox);
				hertzSpinner.Text = "Hertz";
				hertzSpinner.Min = 5;
				hertzSpinner.Max = 200;
				hertzSpinner.ValueChanged += delegate(Base sender, EventArgs hargs) {
					settingsHz = hertzSpinner.Value;
				};
				hertzSpinner.Value = settingsHz;
				hertzSpinner.SetPosition(10, 60);

				LabeledCheckBox scb = new LabeledCheckBox(SettingsBox);
				scb.Text = "Sleep";
				scb.CheckChanged += delegate(Base sender, EventArgs argsscb) {
					settings.enableSleep = scb.IsChecked;
				};
				scb.IsChecked = settings.enableSleep;
				scb.SetPosition(10, 85);

				LabeledCheckBox wsu = new LabeledCheckBox(SettingsBox);
				wsu.Text = "Warm Starting";
				wsu.CheckChanged += delegate(Base sender, EventArgs argsscb) {
					settings.enableWarmStarting = wsu.IsChecked;
				};
				wsu.IsChecked = settings.enableWarmStarting;
				wsu.SetPosition(10, 110);

				LabeledCheckBox toi = new LabeledCheckBox(SettingsBox);
				toi.Text = "Time of Impact";
				toi.CheckChanged += delegate(Base sender, EventArgs argsscb) {
					settings.enableContinuous = toi.IsChecked;
				};
				toi.IsChecked = settings.enableContinuous;
				toi.SetPosition(10, 135);

//.........这里部分代码省略.........
开发者ID:CloneDeath,项目名称:Box2D.Net,代码行数:101,代码来源:Program.cs


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