/// <summary> /// Creates list box control /// </summary> /// <param name="window">window it belongs to</param> /// <param name="creationFlags">creation flags</param> public ListBox(Window window, CreationFlag creationFlags) : base(window, creationFlags) { this.BackColor = Colors.White; this.Border = BorderStyle.BorderLoweredDouble; this.Type = TypeName; }
/// <summary> /// Constructs tab control. /// </summary> /// <param name="window">window it belongs to</param> /// <param name="creationFlags">creation flags</param> public TabControl(Window window, CreationFlag creationFlags) : base(window, creationFlags) { this.Skinned = false; this.Border = BorderStyle.BorderRaisedDouble; this.Type = TypeName; }
/// <summary> /// Creates tab page object. /// </summary> /// <param name="window">window it belong to.</param> /// <param name="creationFlags">creation flags.</param> public TabPage(Window window, CreationFlag creationFlags) : base(window, creationFlags) { this.Type = TypeName; this.Border = BorderStyle.None; this.BackColor = Colors.None; }
/// <summary> /// Creates checkbox control. /// </summary> /// <param name="window">window it belongs to</param> /// <param name="creationFlags">creation flags</param> public CheckBox(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.Border = BorderStyle.BorderLoweredDouble; this.TextAlignment = ContentAlignment.MiddleLeft; this.BackColor = Colors.None; }
internal Window NewWindow(Desktop desktop, String type, CreationFlag creationFlags, String fileName) { if (type.Length > 0) { WindowCreator creator = null; this.windowCreators.TryGetValue(type, out creator); if (null != creator) { Window window = creator(desktop); //window.SetType(type); return(window); } else { return(null); } } else { CreationFlag flags = creationFlags; if (fileName.Length > 0) { flags |= CreationFlag.NeedLoading; } return(new Window(desktop, creationFlags, fileName)); } }
/// <summary> /// Creates label control. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public Label(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.BackColor = Colors.None; this.TextAlignment = ContentAlignment.MiddleLeft; this.Border = BorderStyle.None; }
/// <summary> /// Creates registered control by its type. Uses registered cotnrol createor. /// If creator is not found null is returned. /// </summary> /// <typeparam name="ControlType">control type.</typeparam> /// <param name="window">window the control belongs to. PAssed to control creation cosntructor.</param> /// <param name="creationFlags">creations flags.</param> /// <returns>created control.</returns> internal ControlType CreateControl <ControlType>(Window window, CreationFlag creationFlags) { IControlsCreator creator = null; String controlType = null; foreach (KeyValuePair <String, KeyValuePair <Type, IControlsCreator> > c in this.controlCreators) { if (c.Value.Key == typeof(ControlType)) { creator = c.Value.Value; controlType = c.Key; break; } } if (null == creator) { return(default(ControlType)); } Control control = creator.CreateControl(window, creationFlags); if ((null != control) && (control is ControlType)) { control.Type = controlType; control.SetEngine(this); return((ControlType)(Object)control); } else { return(default(ControlType)); } }
/// <summary> /// Constructs property grid object. /// </summary> /// <param name="window">parent window</param> /// <param name="creationFlags">creation flags</param> public PropertyGrid(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.RowSeparatorColor = window.Desktop.Theme.Colors.Control; this.KeyValueSeparatorColor = window.Desktop.Theme.Colors.Control; this.Border = BorderStyle.Flat; this.BackColor = Colors.White; this.ShowSideBar = true; }
/// <summary> /// Creates radio button object. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public RadioButton(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.Selected = false; this.TextAlignment = ContentAlignment.MiddleLeft; this.IconAlignment = ContentAlignment.MiddleLeft; this.TextOffset.X = 16; this.TextOffset.Y = 0; this.BackColor = Colors.None; }
/// <summary> /// Constructs button /// </summary> /// <param name="window">window it belongs to</param> /// <param name="creationFlags">creation flags</param> public Button(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.Bounds.X = 100; this.Bounds.Y = 100; this.Bounds.Width = 100; this.Bounds.Height = 23; this.Border = BorderStyle.BorderRaisedDouble; this.TabStop = true; }
/// <summary> /// Constructs text box object. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public TextBox(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.Border = BorderStyle.BorderLoweredDouble; this.Cursor = MousePointers.PointerText; this.NeedTranslation = false; this.TextOffset.X = 3; this.TextOffset.Y = 1; this.HintTextColor = window.Desktop.Theme.Colors.TextLight; }
/// <summary> /// Creates control specified by typeName. For example "button". /// Created control has to be added using AddControl to the parent control (ex.: panel). /// </summary> /// <param name="controlTypeName">control type.</param> /// <param name="creationFlags">creation flags.</param> /// <returns>created control.</returns> public override Control CreateControl(String controlTypeName, CreationFlag creationFlags) { Control control = this.Engine.CreateControl(this, controlTypeName, creationFlags); if (null != control) { this.createdControls.Add(control); } return(control); }
/// <summary> /// Creates window loading it from file. If file not found, default empty window is created. /// </summary> public Window NewWindow(CreationFlag creationFlags, String fileName) { Window window = this.engine.NewWindow(this, "", creationFlags, fileName); lock (this) { this.windows.Insert(0, window); } return(window); }
/// <summary> /// Creates control and and to the window. /// </summary> /// <typeparam name="ControlType">control type</typeparam> /// <param name="creationFlags">creation flags</param> /// <returns>created control</returns> public override ControlType CreateControl <ControlType>(CreationFlag creationFlags) { ControlType controlType = this.Engine.CreateControl <ControlType>(this, creationFlags); Control control = (Control)(Object)controlType; if (null != control) { this.createdControls.Add(control); } return(controlType); }
public static extern bool CreateProcess ( [MarshalAs(UnmanagedType.LPStr)] string lpApplicationName, [MarshalAs(UnmanagedType.LPStr)] string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool bInheritHandles, CreationFlag dwCreationFlags, IntPtr lpEnvironment, [MarshalAs(UnmanagedType.LPStr)] string lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation );
public ScrollPanel(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.verticalScrollBar = CreateControl <ScrollBar>(CreationFlag.InternalControl); this.horizontalScrollBar = CreateControl <ScrollBar>(CreationFlag.InternalControl); this.internalPanel = CreateControl <ScrollPanelInternal>(CreationFlag.InternalControl); this.horizontalScrollBar.Vertical = false; this.internalPanel.BackColor = Colors.None; base.AddControl(this.verticalScrollBar); base.AddControl(this.horizontalScrollBar); base.AddControl(this.internalPanel); }
public AnchorPicker(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.selectionButton = CreateControl <Button>(CreationFlag.InternalControl); this.Border = BorderStyle.Lowered; this.NeedTranslation = false; this.selectionButton.NeedTranslation = false; this.selectionButton.Text = ".."; this.selectionButton.Clicked += this.SelectButtonClicked; this.BackColor = window.Desktop.Theme.Colors.Window; this.TextAlignment = ContentAlignment.MiddleLeft; AddControl(this.selectionButton); }
public ScrollPanel(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.verticalScrollBar = CreateControl<ScrollBar>(CreationFlag.InternalControl); this.horizontalScrollBar = CreateControl<ScrollBar>(CreationFlag.InternalControl); this.internalPanel = CreateControl<ScrollPanelInternal>(CreationFlag.InternalControl); this.horizontalScrollBar.Vertical = false; this.internalPanel.BackColor = Colors.None; base.AddControl(this.verticalScrollBar); base.AddControl(this.horizontalScrollBar); base.AddControl(this.internalPanel); }
/// <summary> /// Creates track bar control. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public TrackBar(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.backPanel = CreateControl <Panel>(CreationFlag.InternalControl); this.sliderButton = CreateControl <Button>(CreationFlag.InternalControl); this.sliderButton.MousePress += (x, y) => { this.trackerDragging = true; }; this.sliderButton.MouseRelease += (x, y) => { this.trackerDragging = false; }; this.sliderButton.MouseMoved += this.SliderButtonMouseMoved; this.backPanel.Border = BorderStyle.Lowered; this.BackColor = Colors.None; AddControl(this.backPanel); AddControl(this.sliderButton); }
public FilePicker(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.selectButton = CreateControl<Button>(CreationFlag.InternalControl); this.Border = BorderStyle.Lowered; this.NeedTranslation = false; this.selectButton.NeedTranslation = false; this.selectButton.Text = ".."; this.selectButton.Clicked += this.ButtonClicked; this.BackColor = window.Desktop.Theme.Colors.Window; this.TextAlignment = ContentAlignment.MiddleLeft; AddControl(this.selectButton); }
/// <summary> /// Creates track bar control. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public TrackBar(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.backPanel = CreateControl<Panel>(CreationFlag.InternalControl); this.sliderButton = CreateControl<Button>(CreationFlag.InternalControl); this.sliderButton.MousePress += (x, y) => { this.trackerDragging = true; }; this.sliderButton.MouseRelease += (x, y) => { this.trackerDragging = false; }; this.sliderButton.MouseMoved += this.SliderButtonMouseMoved; this.backPanel.Border = BorderStyle.Lowered; this.BackColor = Colors.None; AddControl(this.backPanel); AddControl(this.sliderButton); }
/// <summary> /// Creates scrollbar control. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation falgs.</param> public ScrollBar(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.increaseButton = CreateControl <Button>(CreationFlag.InternalControl); this.decreaseButton = CreateControl <Button>(CreationFlag.InternalControl); this.sliderButton = CreateControl <Button>(CreationFlag.InternalControl); AddControl(this.increaseButton); AddControl(this.decreaseButton); AddControl(this.sliderButton); this.increaseButton.Clicked += (x, Y) => { this.Position += this.stepSize; }; this.decreaseButton.Clicked += (x, y) => { this.Position -= this.stepSize; }; this.sliderButton.MouseMoved += new UIEventHandler <Button>(SliderMouseMoved); this.sliderButton.MousePress += (x, y) => { this.sliderDragging = true; }; this.sliderButton.MouseRelease += (x, y) => { this.sliderDragging = false; }; this.Vertical = true; }
/// <summary> /// Creates combo box control /// </summary> /// <param name="window">window it belongs to</param> /// <param name="creationFlags">creation flags</param> public ComboBox(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.button = CreateControl <Button>(CreationFlag.InternalControl); this.TextAlignment = ContentAlignment.MiddleLeft; this.IconAlignment = ContentAlignment.MiddleLeft; this.IconSize = IconSize.IconSmall; this.IconImageOffset.X = 2; this.IconImageOffset.Y = 3; this.Border = BorderStyle.BorderLoweredDouble; this.button.IconAlignment = ContentAlignment.MiddleCenter; this.button.Icon = this.Window.Desktop.Theme.ThemeFolder + "/images/combobox_icon_down"; this.button.Clicked += this.ButtonClicked; this.AddControl(this.button); }
/// <summary> /// Creates scrollbar control. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation falgs.</param> public ScrollBar(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.increaseButton = CreateControl<Button>(CreationFlag.InternalControl); this.decreaseButton = CreateControl<Button>(CreationFlag.InternalControl); this.sliderButton = CreateControl<Button>(CreationFlag.InternalControl); AddControl(this.increaseButton); AddControl(this.decreaseButton); AddControl(this.sliderButton); this.increaseButton.Clicked += (x, Y) => { this.Position += this.stepSize; }; this.decreaseButton.Clicked += (x, y) => { this.Position -= this.stepSize; }; this.sliderButton.MouseMoved += new UIEventHandler<Button>(SliderMouseMoved); this.sliderButton.MousePress += (x, y) => { this.sliderDragging = true; }; this.sliderButton.MouseRelease += (x, y) => { this.sliderDragging = false; }; this.Vertical = true; }
/// <summary> /// Creates combo box control /// </summary> /// <param name="window">window it belongs to</param> /// <param name="creationFlags">creation flags</param> public ComboBox(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.button = CreateControl<Button>(CreationFlag.InternalControl); this.TextAlignment = ContentAlignment.MiddleLeft; this.IconAlignment = ContentAlignment.MiddleLeft; this.IconSize = IconSize.IconSmall; this.IconImageOffset.X = 2; this.IconImageOffset.Y = 3; this.Border = BorderStyle.BorderLoweredDouble; this.button.IconAlignment = ContentAlignment.MiddleCenter; this.button.Icon = this.Window.Desktop.Theme.ThemeFolder + "/images/combobox_icon_down"; this.button.Clicked += this.ButtonClicked; this.AddControl(this.button); }
public MenuRibbon(Window window, CreationFlag creationFlags) : base(window, creationFlags) { this.Type = TypeName; this.menuButton = CreateControl <Button>(); this.menuButton.Height = 28; this.menuButton.Text = "Menu"; this.menuButton.FontInfo.Name = "Calibri"; this.menuButton.FontInfo.Bold = true; this.menuButton.FontInfo.Size = 20; this.menuButton.TextColor = Colors.White; this.menuButton.BackColor = Colors.None; this.menuButton.Border = BorderStyle.None; this.menuButton.Clicked += (x, y) => { this.Active = !this.Active; }; AddControl(this.menuButton); this.BackColor = Colors.None; }
/// <summary> /// Creates registered control by its name. Uses registered cotnrol createor. /// If creator is not found null is returned. /// </summary> /// <param name="window">window the control belongs to. PAssed to control creation cosntructor.</param> /// <param name="controlTypeName">control name.</param> /// <param name="creationFlags">creations flags.</param> /// <returns>created control.</returns> internal Control CreateControl(Window window, String controlTypeName, CreationFlag creationFlags) { KeyValuePair <Type, IControlsCreator> creator; this.controlCreators.TryGetValue(controlTypeName, out creator); if (null == creator.Value) { return(null); } Control control = creator.Value.CreateControl(window, creationFlags); if (null != control) { control.Type = controlTypeName; control.SetEngine(this); } return(control); }
public MenuRibbon(Window window, CreationFlag creationFlags) : base(window, creationFlags) { this.Type = TypeName; this.menuButton = CreateControl<Button>(); this.menuButton.Height = 28; this.menuButton.Text = "Menu"; this.menuButton.FontInfo.Name = "Calibri"; this.menuButton.FontInfo.Bold = true; this.menuButton.FontInfo.Size = 20; this.menuButton.TextColor = Colors.White; this.menuButton.BackColor = Colors.None; this.menuButton.Border = BorderStyle.None; this.menuButton.Clicked += (x, y) => { this.Active = !this.Active; }; AddControl(this.menuButton); this.BackColor = Colors.None; }
/// <summary> /// Creates window. /// </summary> /// <param name="desktop">desktop it belongs to.</param> /// <param name="creationFlags">creation flags.</param> /// <param name="fileName">xml file name to load window from. if empty default window is created.</param> public Window(Desktop desktop, CreationFlag creationFlags, String fileName) : base(desktop, null, creationFlags, "window") { this.desktop = desktop; if (null == this.desktop) { throw new Exception("Desktop can not be null"); } this.leftBorderColor = this.Desktop.Theme.Colors.WindowTitleStart; this.rightBorderColor = this.Desktop.Theme.Colors.WindowTitleEnd; ControlSettings settings = this.Desktop.Theme.GetControlSettings(this.Type); this.Icon = this.Desktop.Theme.ThemeFolder + "/images/window_icon"; this.BackImageLayout = ImageLayout.ImageLayoutTile; this.IconImageOffset.X = 1; this.IconImageOffset.Y = 1; this.Moveable = true; this.Sizeable = true; this.TextColor = Colors.White; this.TopOffset = 20; this.Border = BorderStyle.BorderRaisedDouble; this.Bounds = new Rectangle(10, 10, 300, 300); if ((null != fileName) && (0 != fileName.Length)) { using (IXmlReader reader = this.Engine.OpenXmlFile(fileName)) { if (null != reader) { Load(reader); } } } }
/// <summary> /// Creates info panel control. /// </summary> /// <param name="window">window it belongs to</param> /// <param name="creationFlags">creation flags</param> public InfoPanel(Window window, CreationFlag creationFlags) : base(window, creationFlags) { this.Type = TypeName; this.imageBorder = CreateControl<Button>(); this.image = CreateControl<Button>(); this.titleLabel = CreateControl<Button>(); this.subTitleLabel = CreateControl<Button>(); this.commentLabel = CreateControl<Button>(); this.imageBorder.Bounds = new Rectangle(0, 0, 200, 120); this.imageBorder.BackColor = Colors.Black; this.imageBorder.Border = BorderStyle.None; this.imageBorder.BackImage = ""; this.image.Bounds = new Rectangle(10, 10, 180, 100); this.image.BackImageLayout = ImageLayout.ImageLayoutStretch; this.image.Border = BorderStyle.None; this.titleLabel.FontInfo.SetFontInfo("Arial", 12, true, false); this.titleLabel.Bounds = new Rectangle(220, 0, 230, 20); this.titleLabel.TextAlignment = ContentAlignment.MiddleLeft; this.titleLabel.BackColor = Colors.None; this.titleLabel.Anchor = AnchorStyle.AnchorLeft | AnchorStyle.AnchorRight | AnchorStyle.AnchorTop; this.titleLabel.TextColor = this.TextColor; this.titleLabel.Border = BorderStyle.None; this.titleLabel.BackImage = ""; this.subTitleLabel.FontInfo.SetFontInfo("Arial", 12, false, false); this.subTitleLabel.Bounds = new Rectangle(220, 20, 230, 20); this.subTitleLabel.TextAlignment = ContentAlignment.MiddleLeft; this.subTitleLabel.BackColor = Colors.None; this.subTitleLabel.Anchor = AnchorStyle.AnchorLeft | AnchorStyle.AnchorRight | AnchorStyle.AnchorTop; this.subTitleLabel.TextColor = this.TextColor; this.subTitleLabel.Border = BorderStyle.None; this.subTitleLabel.BackImage = ""; this.commentLabel.FontInfo.SetFontInfo("Arial", 12, false, false); this.commentLabel.Bounds = new Rectangle(220, 40, 230, 20); this.commentLabel.TextAlignment = ContentAlignment.MiddleLeft; this.commentLabel.BackColor = Colors.None; this.commentLabel.Anchor = AnchorStyle.AnchorLeft | AnchorStyle.AnchorRight | AnchorStyle.AnchorTop; this.commentLabel.TextColor = this.TextColor; this.commentLabel.Border = BorderStyle.None; this.commentLabel.BackImage = ""; this.MinSize = new Size2d(200, 100); this.Bounds = new Rectangle(0, 0, 470, 120); this.Border = BorderStyle.None; this.BackImage = ""; this.AddControl(this.imageBorder); this.AddControl(this.titleLabel); this.AddControl(this.subTitleLabel); this.AddControl(this.commentLabel); this.imageBorder.AddControl(this.image); this.imageBorder.Clicked += this.ChildControlClicked; this.titleLabel.Clicked += this.ChildControlClicked; this.subTitleLabel.Clicked += this.ChildControlClicked; this.commentLabel.Clicked += this.ChildControlClicked; this.image.Clicked += this.ChildControlClicked; }
public virtual Control CreateControl(Window window, CreationFlag creationFlags) { return(this.creator(window, creationFlags)); }
/// <summary> /// Creates iternal scoll panel object. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public ScrollPanelInternal(Window window, CreationFlag creationFlags) : base(window, creationFlags) { this.Type = TypeName; }
public PropertyRow(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.BackColor = Colors.White; this.IconAlignment = ContentAlignment.MiddleLeft; }
/// <summary> /// Constructs poperty group obejct /// </summary> /// <param name="window">parent window</param> /// <param name="creationFlags">creation flags</param> public PropertyGroup(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { }
public Control CreateControl(Window window, CreationFlag creationFlags) { return new BindKeyInput(this.game, window, creationFlags); }
public ProgressBar(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.Border = BorderStyle.Lowered; this.ProgressBarColor = window.Desktop.Theme.Colors.Highlight; }
/// <summary> /// Creates list box item. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public ListItem(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.BackColor = Colors.None; this.ListStyle = this.ListStyle; }
public BindKeyInput(X360ControllerGame game, Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.game = game; }
/// <summary> /// Creates toolbar control. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public ToolBar(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { }
/// <summary> /// Creates status bar object. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public StatusBar(Window window, CreationFlag creationFlags) : base(window, creationFlags) { this.Type = TypeName; }
protected Control(Desktop desktop, Window window, CreationFlag creationFlags, String type) : base(type) { if (null != desktop) { this.uiEngine = desktop.Engine; } if (null != window) { this.uiEngine = window.Engine; } Theme theme = null; if (null != desktop) { theme = desktop.Theme; } else if (null != window) { theme = window.Desktop.Theme; } else { theme = this.Window.Desktop.Theme; } this.window = window; this.creationFlags = creationFlags; this.borderColor = theme.Colors.Window; ControlSettings settings = theme.GetControlSettings(this.Type); this.backColor = settings.ColorBack; this.borderColorDark1 = settings.ColorBorderDark1; this.borderColorDark2 = settings.ColorBorderDark2; this.borderColorLight1 = settings.ColorBorderLight1; this.borderColorLight2 = settings.ColorBorderLight2; this.skinned = settings.Skinned; if (settings.BackImage.Length > 0) { BackImage = theme.ThemeFolder + "/" + settings.BackImage; } this.font = new FontInfo(this.uiEngine, this.Window, settings, theme.DefaultFontName, theme.DefaultFontSize); this.uiEngine.Language.LanguageChanged += this.OnLanguageChanged; OnLanguageChanged(); }
public Panel(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { }
protected Control(Window window, CreationFlag creationFlags, String type) : this(null, window, creationFlags, type) { }
private VerticalShooterShip VerticalCreationLogic(Vector2 position, CreationFlag flag) { VerticalShooterShip creature = RetrieveCreatureFromEnum(enemyType); if (flag != CreationFlag.VECTOR_POSITION) { if (!(creature is AllianceHangar)) { position.Y -= 50; // Setting a startup marginal to not "pop" on the screen } else { position.Y -= 150; } } if (Game1.ScreenSize.Y > 600) { position.Y += (Game1.ScreenSize.Y - 600) / 2; } switch (flag) { case CreationFlag.WITHOUT_POSITION: { xPos = level.RelativeOrigin + (float)(random.NextDouble() * level.LevelWidth); break; } case CreationFlag.X_POSITION: { xPos = level.RelativeOrigin + position.X; break; } case CreationFlag.VECTOR_POSITION: { xPos = level.RelativeOrigin + position.X; break; } default: { throw new ArgumentException("New unhandled flag-variant is probably present"); } } creature.PositionX = xPos; if (creature is AlliedShip) { creature.PositionY = 600; } else { creature.PositionY = position.Y; } creature = StandardCreatureSetup(creature); creature.SetLevelWidth(level.LevelWidth); creature.MovementSetup(); return(creature); }
/// <summary> /// Creates split panel. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public SplitPanel(Window window, CreationFlag creationFlags) : base(window, creationFlags) { this.Type = TypeName; }
public static extern bool CreateProcess ( [MarshalAs( UnmanagedType.LPStr )] string lpApplicationName, [MarshalAs( UnmanagedType.LPStr )] string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool bInheritHandles, CreationFlag dwCreationFlags, IntPtr lpEnvironment, [MarshalAs( UnmanagedType.LPStr )] string lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation );
/// <summary> /// Creates menu object. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public Menu(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { this.BackImageLayout = ImageLayout.ImageLayoutTile; }
/// <summary> /// Creates picture control. /// </summary> /// <param name="window">window it belongs to.</param> /// <param name="creationFlags">creation flags.</param> public Picture(Window window, CreationFlag creationFlags) : base(window, creationFlags, TypeName) { }