/// <summary> /// Creates an RCMapEditorPanel instance. /// </summary> /// <param name="isoTileSpriteGroup">Reference to the sprites of the isometric tile types.</param> /// <param name="terrainObjectSpriteGroup">Reference to the sprites of the terrain object types.</param> /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param> /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param> /// <param name="backgroundSprite"> /// Name of the sprite resource that will be the background of this panel or null if there is no background. /// </param> public RCMapEditorPanel(ISpriteGroup isoTileSpriteGroup, ISpriteGroup terrainObjectSpriteGroup, RCIntRectangle backgroundRect, RCIntRectangle contentRect, ShowMode showMode, HideMode hideMode, int appearDuration, int disappearDuration, string backgroundSprite) : base(backgroundRect, contentRect, showMode, hideMode, appearDuration, disappearDuration, backgroundSprite) { this.tilesetView = ComponentManager.GetInterface <IViewService>().CreateView <ITileSetView>(); /// Create the controls. this.editModeSelector = new RCDropdownSelector(new RCIntVector(6, 6), 85, new string[4] { "Draw terrain", "Place terrain object", "Place start location", "Place resource" }); this.paletteListbox = new RCListBox(new RCIntVector(6, 24), 85, 11, 100); this.saveButton = new RCMenuButton("Save", new RCIntRectangle(6, 180, 41, 15)); this.exitButton = new RCMenuButton("Exit", new RCIntRectangle(50, 180, 41, 15)); this.minimapDisplay = new RCMinimapDisplay(isoTileSpriteGroup, terrainObjectSpriteGroup, new RCIntVector(16, 209), new RCIntVector(64, 64)); this.editModeSelector.SelectedIndexChanged += this.OnEditModeSelectionChanged; this.paletteListbox.SelectedIndexChanged += this.OnPaletteListboxSelectionChanged; this.AddControl(this.editModeSelector); this.AddControl(this.paletteListbox); this.AddControl(this.saveButton); this.AddControl(this.exitButton); this.AddControl(this.minimapDisplay); this.ResetControls(); }
public void StartTray() { // Tray setup tray = new NotifyIcon(); tray.Text = "Window Hide"; tray.Icon = new System.Drawing.Icon(WindowHide.Properties.Resources.Tray, 40, 40); trayMenu = new ContextMenu(); MenuItem mode = new MenuItem("Window Mode"); minimize = new MenuItem("Minimize Windows", new EventHandler(this.minimizewindows_click)); hide = new MenuItem("Hide Windows", new EventHandler(this.hidewindows_click)); show = new MenuItem("Show Windows", new EventHandler(this.showwindows_click)); mode.MenuItems.Add(hide); mode.MenuItems.Add(show); mode.MenuItems.Add(minimize); minimize.Checked = true; hidemode = HideMode.MINIMIZED; trayMenu.MenuItems.Add(mode); trayMenu.MenuItems.Add("Toggle Main Window", new EventHandler(this.togglehide_click)); trayMenu.MenuItems.Add("Exit", new EventHandler(this.exit_click)); tray.ContextMenu = trayMenu; tray.Visible = true; Application.Run(this); }
/// <summary> /// Creates an RCGameInfoPanel instance. /// </summary> /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param> /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param> /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param> /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param> /// <param name="appearDuration"> /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case /// of ShowMode.Appear. /// </param> /// <param name="disappearDuration"> /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case /// of HideMode.Disappear. /// </param> /// <param name="backgroundSprite"> /// Name of the sprite resource that will be the background of this panel or null if there is no background. /// </param> public RCGameInfoPanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect, ShowMode showMode, HideMode hideMode, int appearDuration, int disappearDuration, string backgroundSprite) : base(backgroundRect, contentRect, showMode, hideMode, appearDuration, disappearDuration, backgroundSprite) { }
/// <summary> /// 启动插件 /// </summary> /// <param name="tmpDataSet">物品数据列表</param> /// <param name="hideMode">隐藏模式</param> protected virtual void OnStart(List <T> tmpDataSet = null, HideMode hideMode = HideMode.Active) { _firstRun = true; lockRefresh = _sProperty.initItems >= _dataSet.Count; if (tmpDataSet != null) { switch (_sProperty.scrollSort) { case ScrollSort.BackDir: case ScrollSort.BackZDir: tmpDataSet.Reverse(); break; } _dataSet.AddRange(tmpDataSet); } BaseItem <T> baseItem; for (int i = 0; i < _sProperty.initItems; ++i) { baseItem = InitItem(i); switch (hideMode) { case HideMode.Active: baseItem.gameObject.SetActive(false); break; case HideMode.Scale: baseItem.transform.localScale = Vector3.zero; break; } } }
private EnabledIfAttribute(SwitcherType switcherType, string switcherFieldName, int enableIfValueIs, HideMode hideMode) { this.switcherType = switcherType; this.hideMode = hideMode; this.switcherFieldName = switcherFieldName; this.enableIfValueIs = enableIfValueIs; }
/// <summary> /// Creates an RCSelectMapPanel instance. /// </summary> /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param> /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param> /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param> /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param> /// <param name="appearDuration"> /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case /// of ShowMode.Appear. /// </param> /// <param name="disappearDuration"> /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case /// of HideMode.Disappear. /// </param> /// <param name="backgroundSprite"> /// Name of the sprite resource that will be the background of this panel or null if there is no background. /// </param> public RCSelectMapPanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect, ShowMode showMode, HideMode hideMode, int appearDuration, int disappearDuration, string backgroundSprite) : base(backgroundRect, contentRect, showMode, hideMode, appearDuration, disappearDuration, backgroundSprite) { this.selectMapTitle = new UIString(SELECT_MAP_TITLE, UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font9B"), UIWorkspace.Instance.PixelScaling, RCColor.LightBlue); }
/// <summary> /// Creates an RCAppPanel instance. /// </summary> /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param> /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param> /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param> /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param> /// <param name="appearDuration"> /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case /// of ShowMode.Appear. /// </param> /// <param name="disappearDuration"> /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case /// of HideMode.Disappear. /// </param> /// <param name="backgroundSprite"> /// Name of the sprite resource that will be the background of this panel or null if there is no background. /// </param> /// <remarks> /// The backgroundRect shall entirely contain the contentRect. /// The origin of the panel's coordinate system will be the top-left corner of contentRect. /// The range rectangle of the panel will be backgroundRect relative to contentRect. /// The clip rectangle of the panel will be contentRect in the panel's coordinate system. /// </remarks> public RCAppPanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect, ShowMode showMode, HideMode hideMode, int appearDuration, int disappearDuration, string backgroundSprite) : base(backgroundRect, contentRect, showMode, hideMode, appearDuration, disappearDuration) { this.StatusChanged += this.OnPanelStatusChanged; this.background = backgroundSprite != null?UIResourceManager.GetResource <UISprite>(backgroundSprite) : null; }
/// <summary> /// Creates an RCNavButtonPanel instance. /// </summary> /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param> /// <param name="buttonRect">The area of the button on the panel relative to the background rectangle.</param> /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param> /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param> /// <param name="appearDuration"> /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case /// of ShowMode.Appear. /// </param> /// <param name="disappearDuration"> /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case /// of HideMode.Disappear. /// </param> /// <param name="backgroundSprite"> /// Name of the sprite resource that will be the background of this panel or null if there is no background. /// </param> /// <param name="buttonText">The text that should be displayed on the navigation button.</param> public RCNavButtonPanel(RCIntRectangle backgroundRect, RCIntRectangle buttonRect, ShowMode showMode, HideMode hideMode, int appearDuration, int disappearDuration, string backgroundSprite, string buttonText) : base(backgroundRect, buttonRect, showMode, hideMode, appearDuration, disappearDuration, backgroundSprite) { this.navigationButton = new RCMenuButton(buttonText, this.Clip); this.AddControl(this.navigationButton); }
public Window(WindowType type, HideMode hideMode, string uiPath, bool isRoot = false) { this.type = type; this.hideMode = hideMode; this.uiPath = uiPath; this.windowName = this.GetType().ToString(); this.isActive = false; this.isRoot = isRoot; this.isSaved = true; }
/// <summary> /// Creates an RCSelectGamePanel instance. /// </summary> /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param> /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param> /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param> /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param> /// <param name="appearDuration"> /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case /// of ShowMode.Appear. /// </param> /// <param name="disappearDuration"> /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case /// of HideMode.Disappear. /// </param> /// <param name="backgroundSprite"> /// Name of the sprite resource that will be the background of this panel or null if there is no background. /// </param> public RCSelectGamePanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect, ShowMode showMode, HideMode hideMode, int appearDuration, int disappearDuration, string backgroundSprite) : base(backgroundRect, contentRect, showMode, hideMode, appearDuration, disappearDuration, backgroundSprite) { this.selectGameTitle = new UIString(SELECT_GAME_TITLE, UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font9B"), UIWorkspace.Instance.PixelScaling, RCColor.LightBlue); this.createGameButton = new RCMenuButton(CREATE_GAME_BUTTON, new RCIntRectangle(0, 99, 85, 15)); this.AddControl(this.createGameButton); }
/// <summary> /// Creates an RCRegistryPanel instance. /// </summary> /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param> /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param> /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param> /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param> /// <param name="appearDuration"> /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case /// of ShowMode.Appear. /// </param> /// <param name="disappearDuration"> /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case /// of HideMode.Disappear. /// </param> /// <param name="backgroundSprite"> /// Name of the sprite resource that will be the background of this panel or null if there is no background. /// </param> public RCRegistryPanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect, ShowMode showMode, HideMode hideMode, int appearDuration, int disappearDuration, string backgroundSprite) : base(backgroundRect, contentRect, showMode, hideMode, appearDuration, disappearDuration, backgroundSprite) { this.registryTitle = new UIString(REGISTRY_TITLE, UIResourceManager.GetResource <UIFont>("RC.App.Fonts.Font9B"), UIWorkspace.Instance.PixelScaling, RCColor.LightBlue); this.newIdButton = new RCMenuButton(NEW_ID_BUTTON, new RCIntRectangle(0, 99, 85, 15)); this.deleteButton = new RCMenuButton(DELETE_BUTTON, new RCIntRectangle(88, 99, 66, 15)); this.AddControl(this.newIdButton); this.AddControl(this.deleteButton); }
public static string GetName(HideMode type) { string result = String.Empty; switch (type) { case HideMode.Visibility: result = "visibility"; break; case HideMode.Offsets: result = "offsets"; break; case HideMode.Display: result = "display"; break; } return result; }
/// <summary> /// Constructs a UIPanel object. /// </summary> /// <param name="backgroundRect">The area of the background of the panel in workspace coordinates.</param> /// <param name="contentRect">The area of the content of the panel relative to the background rectangle.</param> /// <param name="showMode">The mode how the panel will appear on a page when being shown.</param> /// <param name="hideMode">The mode how the panel will disappear from a page when being hidden.</param> /// <param name="appearDuration"> /// The duration of showing this UIPanel in milliseconds. This parameter will be ignored in case /// of ShowMode.Appear. /// </param> /// <param name="disappearDuration"> /// The duration of hiding this UIPanel in milliseconds. This parameter will be ignored in case /// of HideMode.Disappear. /// </param> /// <remarks> /// The backgroundRect shall entirely contain the contentRect. /// The origin of the panel's coordinate system will be the top-left corner of contentRect. /// The range rectangle of the panel will be backgroundRect relative to contentRect. /// The clip rectangle of the panel will be contentRect in the panel's coordinate system. /// </remarks> public UIPanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect, ShowMode showMode, HideMode hideMode, int appearDuration, int disappearDuration) : base(backgroundRect.Location + contentRect.Location, new RCIntRectangle(contentRect.Location * (-1), backgroundRect.Size)) { /// Set the contentRect as the clip. This line will crash if the backgroundRect doesn't entirely /// contain the contentRect. this.Clip = new RCIntRectangle(0, 0, contentRect.Width, contentRect.Height); this.currentStatus = Status.Hidden; this.showMode = showMode; this.hideMode = hideMode; this.showDuration = appearDuration; this.hideDuration = disappearDuration; this.normalPosition = this.Position; /// Compute the paths of showing/hiding the panel this.ComputeShowPath(); this.ComputeHidePath(); }
public static string GetName(HideMode type) { string result = String.Empty; switch (type) { case HideMode.Visibility: result = "visibility"; break; case HideMode.Offsets: result = "offsets"; break; case HideMode.Display: result = "display"; break; } return(result); }
/// <summary> /// How this component should be hidden. Supported values are 'visibility' (css visibility), 'offsets' (negative offset position) and 'display' (css display) - defaults to 'display'. /// </summary> public virtual GridCommand.Builder HideMode(HideMode hideMode) { this.ToComponent().HideMode = hideMode; return(this as GridCommand.Builder); }
/// <summary> /// How this component should be hidden. Supported values are 'visibility' (css visibility), 'offsets' (negative offset position) and 'display' (css display) - defaults to 'display'. /// </summary> public virtual TBuilder HideMode(HideMode hideMode) { this.ToComponent().HideMode = hideMode; return(this as TBuilder); }
private void hidewindows_click(System.Object sender, System.EventArgs e) { remove_checks(); hide.Checked = true; hidemode = HideMode.HIDDEN; }
public MyPanel(RCIntRectangle backgroundRect, RCIntRectangle contentRect, ShowMode showMode, HideMode hideMode) : base(backgroundRect, contentRect, showMode, hideMode, 300, 300) { this.backgroundSprite = UIRoot.Instance.GraphicsPlatform.SpriteManager.CreateSprite(RCColor.Green, this.Range.Size, UIWorkspace.Instance.PixelScaling); this.backgroundSprite.Upload(); }
public EnabledIfAttribute(string switcherFieldName, int enableIfValueIs, HideMode hideMode = HideMode.Disabled) { _hideMode = hideMode; _switcherFieldName = switcherFieldName; _enableIfValueIs = enableIfValueIs; }
public EnabledIfAttribute(string switcherFieldName, bool enableIfValueIs, HideMode hideMode = HideMode.Disabled) : this(switcherFieldName, enableIfValueIs ? 1 : 0, hideMode) { }
private void showwindows_click(System.Object sender, System.EventArgs e) { remove_checks(); show.Checked = true; hidemode = HideMode.VISIBLE; }
private void minimizewindows_click(System.Object sender, System.EventArgs e) { remove_checks(); minimize.Checked = true; hidemode = HideMode.MINIMIZED; }
public EnabledIfAttribute(string switcherFieldName, int enableIfValueIs, HideMode hideMode = HideMode.Disabled) : this(SwitcherType.Enum, switcherFieldName, enableIfValueIs, hideMode) { }