private void Init(Rect activatorRect, PopupWindowContent windowContent, PopupLocationHelper.PopupLocation[] locationPriorityOrder, ShowMode showMode) { base.hideFlags = HideFlags.DontSave; base.wantsMouseMove = true; this.m_WindowContent = windowContent; this.m_WindowContent.editorWindow = this; this.m_WindowContent.OnOpen(); this.m_ActivatorRect = GUIUtility.GUIToScreenRect(activatorRect); base.ShowAsDropDown(this.m_ActivatorRect, this.m_WindowContent.GetWindowSize(), locationPriorityOrder, showMode); }
void _SwitchShowCollider(ShowMode meshShowMode) { switch (meshShowMode) { case ShowMode.All: cldPool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE }); break; case ShowMode.Horizon: cldPool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE, (uint)PlaneOrientation.HORIZONTAL }); break; case ShowMode.LargestHorizon: cldPool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE, (uint)PlaneOrientation.HORIZONTAL }, ColliderCondition.LARGEST); break; case ShowMode.AllVertical: cldPool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE, (uint)PlaneOrientation.VERTICAL }); break; case ShowMode.LargestVertical: cldPool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE, (uint)PlaneOrientation.VERTICAL }, ColliderCondition.LARGEST); break; case ShowMode.NearestHorizon: cldPool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE, (uint)PlaneOrientation.HORIZONTAL }, ColliderCondition.CLOSEST); break; case ShowMode.FurthestHorizon: cldPool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE, (uint)PlaneOrientation.HORIZONTAL }, ColliderCondition.FURTHEST); break; case ShowMode.NearestVertical: cldPool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE, (uint)PlaneOrientation.VERTICAL }, ColliderCondition.CLOSEST); break; case ShowMode.FurthestVertical: cldPool.ShowAllColliderWithPropsAndCondition(new uint[] { (uint)ColliderShapeType.MESH_SHAPE, (uint)PlaneOrientation.VERTICAL }, ColliderCondition.FURTHEST); break; case ShowMode.None: cldPool.HideAllColliderRenderers(); break; } }
private GameObject GetModeRoot(ShowMode mode) { switch (mode) { case ShowMode.Normal: return(GameObject.Find("Canvas/normal")); case ShowMode.Main: return(GameObject.Find("Canvas/main")); case ShowMode.Fixed: return(GameObject.Find("Canvas/fixed")); case ShowMode.Popup: return(GameObject.Find("Canvas/popup")); } return(null); }
// Used for popup style windows. internal void ShowPopupWithMode(ShowMode mode, bool giveFocus) { if (m_Parent == null) { ContainerWindow cw = ScriptableObject.CreateInstance <ContainerWindow>(); cw.title = titleContent.text; HostView host = ScriptableObject.CreateInstance <HostView>(); host.actualView = this; // Among other things, this sets m_Parent to host Rect r = m_Parent.borderSize.Add(new Rect(position.x, position.y, position.width, position.height)); // Order is important here: first set rect of container, then assign main view, then apply various settings, then show. // Otherwise the rect won't be set until first resize happens. cw.position = r; cw.rootView = host; MakeParentsSettingsMatchMe(); cw.ShowPopupWithMode(mode, giveFocus); } }
internal void ShowPopupWithMode(ShowMode mode, bool giveFocus) { m_ShowMode = (int)mode; Internal_Show(m_PixelRect, m_ShowMode, m_MinSize, m_MaxSize); if (m_RootView) { m_RootView.SetWindowRecurse(this); } Internal_SetTitle(m_Title); Save(); // only set focus if mode is a popupMenu. Internal_BringLiveAfterCreation(true, giveFocus, false); // Fit window to screen - needs to be done after bringing the window live position = FitWindowRectToScreen(m_PixelRect, true, false); rootView.position = new Rect(0, 0, Mathf.Ceil(m_PixelRect.width), Mathf.Ceil(m_PixelRect.height)); rootView.Reflow(); }
protected internal virtual void show(ShowMode mode) { int size = mActionButtons.Count; if (mPrevLayoutDir != mParent.LayoutDirection && mActionButtonsLayout.ChildCount > 1) { createActionButtons(); mPrevLayoutDir = mParent.LayoutDirection; checkInvisibles(); } int level = calculateLevel(); foreach (View v in mActionButtons) { if (v.Background != null) { v.Background.Level = level; } // This is a hack, not really a good design. It's a hack for bad design of // FloatingController. The hack sets alpha to 0 to all ordinary device layouts // when they got shown on the controller bar. The reason is to make alpha animation // (fade in) to work. APPEAR animation is run after the CHANGING_APPEAR. The latter one // is displayed by default with alpha 1, so we need to set it to 0, so the APPEAR // animation will animate it from 0 to 1. // if (!(this is MainDeviceLayout) && mode != ShowMode.DISABLED_TRANSITION) { v.Alpha = 0f; } else { v.Alpha = 1f; } } mParent.addSubViews(mActionButtons.subList(0, 1), this); if (mActionButtons.Count > 1) { mParent.addSubViews(mActionButtons.subList(1, size), mActionButtons[0]); } }
/// <summary> /// first param for plot name /// second for current mode /// </summary> /// <param name="values"></param> /// <param name="targetType"></param> /// <param name="parameter"></param> /// <param name="culture"></param> /// <returns></returns> public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { var plotName = values[0].ToString(); var currentModeStr = values[1].ToString(); if (Enum.TryParse(typeof(ShowMode), currentModeStr, out var showModeObj)) { ShowMode showMode = (ShowMode)showModeObj; if (plotName.StartsWith('C')) { return(showMode == ShowMode.Consumptions ? Visibility.Visible : Visibility.Hidden); } if (plotName.StartsWith('P')) { return(showMode == ShowMode.Pressures ? Visibility.Visible : Visibility.Hidden); } } return(Visibility.Collapsed); }
public static string FormatTextWithFilter(string input, ShowMode showMode) { if (showMode == ShowMode.ShowFull) { return(input); } else if (showMode == ShowMode.ShowFirstFour) { if (input.Length < 5) { return(input); } else { return(input.Substring(0, 4)); } } else if (showMode == ShowMode.ShowFirst) { if (input.Length < 2) { return(input); } else { return(input.Substring(0, 1)); } } else if (showMode == ShowMode.HiddenCorrectLength) { return(new string(passwordChar, input.Length)); } else if (showMode == ShowMode.HiddenConstantLenght) { return(new string(passwordChar, 8)); } else if (showMode == ShowMode.HiddenRandomLength) { return(new string(passwordChar, rng.Next(1, 16))); } throw new NotImplementedException("Missing ShowMode"); }
internal void ShowWithMode(ShowMode mode) { if (!((UnityEngine.Object) this.m_Parent == (UnityEngine.Object)null)) { return; } SavedGUIState savedGuiState = SavedGUIState.Create(); ContainerWindow instance1 = ScriptableObject.CreateInstance <ContainerWindow>(); instance1.title = this.titleContent.text; HostView instance2 = ScriptableObject.CreateInstance <HostView>(); instance2.actualView = this; Rect rect = this.m_Parent.borderSize.Add(new Rect(this.position.x, this.position.y, this.position.width, this.position.height)); instance1.position = rect; instance1.mainView = (View)instance2; this.MakeParentsSettingsMatchMe(); instance1.Show(mode, true, false); savedGuiState.ApplyAndForget(); }
/// <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(); }
private void deleteButton_Click(object sender, EventArgs e) { Button button = sender as Button; int index = panel2.Controls.IndexOf(button), buttonRowCount = 8, deleteValueCounter = 0; if (index != -1) { for (int i = index; deleteValueCounter < buttonRowCount; i--) { panel2.Controls.RemoveAt(i); deleteValueCounter++; } buttons.RemoveAt(index / buttonRowCount); paths.RemoveAt(index / buttonRowCount); currentButtonCount--; } else { ShowMode.Error(Manage_Beatmap.language.LanguageContent[Language.buttonNotFound]); } }
public void LoadConfiguration(IObjectStorageReader reader) { SuspendUpdate(); var recentReader = reader.TryGetChildStorage("RecentImageDirectories"); if (recentReader != null) { var items = recentReader.GetChildStorages().Select(sr => sr.ReadAttribute <string>("Value")).ToArray(); _cmbImagesDirectory.Items.Clear(); _cmbImagesDirectory.Items.AddRange(items); _cmbImagesDirectory.Items.Add(SelectDirectoryTemplate); } var imageDirectory = reader.TryReadParameter <string>("ImagesDirectory", () => string.Empty); if (!string.IsNullOrEmpty(imageDirectory)) { SelectImageDirectory(imageDirectory); } ResumeUpdate(); //_selectedDirectoryNode = reader.TryReadParameter<string>("SelectedNode", () => string.Empty); var layout = reader.TryGetChildStorage("Layout"); if (layout != null) { var x = layout.TryReadParameter("X", Location.X); var y = layout.TryReadParameter("Y", Location.Y); var width = layout.TryReadParameter("Width", Size.Width); var height = layout.TryReadParameter("Height", Size.Height); SetBounds(x, y, width, height); _sptImage.SplitterDistance = layout.TryReadParameter("ImageSpliter", _sptImage.SplitterDistance); _sptTree.SplitterDistance = layout.TryReadParameter("TreeSpliter", _sptTree.SplitterDistance); _showMode = layout.TryReadParameter("ShowMode", _showMode); } }
/// ----------------------------------------------------------------------------- /// <summary> /// Page_Load runs when the control is loaded /// </summary> /// ----------------------------------------------------------------------------- private void Page_Load(object sender, EventArgs e) { try { _baseController = new XmlBaseController(this); _currentMode = _baseController.CheckShowMode(Request.QueryString["ShowMode"].DefaultIfNullOrEmpty()); var downloadLink = ResolveUrl("~" + Definition.PathOfModule + "download.ashx") + "?tabid=" + TabId + "&mid=" + ModuleId; switch (_currentMode) { case ShowMode.Response: Response.Redirect(downloadLink); break; case ShowMode.Link: lnkShowContent.NavigateUrl = downloadLink; break; default: using (var writer = new StringWriter()) { _baseController.Render(writer); Controls.Clear(); Controls.Add(new LiteralControl(writer.ToString())); } break; } } catch (SecurityException exc) { UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("CAS.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); Exceptions.LogException(exc); } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
private void Check() { if (string.IsNullOrWhiteSpace(textBox1.Text)) { ShowMode.Error(MainForm.language.LanguageContent[Language.oneOrMoreValuesEmpty]); return; } else if (textBox1.Text.Any(char.IsLetter)) { ShowMode.Error(MainForm.language.LanguageContent[Language.onlyNumbersAndComma]); return; } else if (!comboBox1.IsDisposed && comboBox1.SelectedIndex == -1) { ShowMode.Error(MainForm.language.LanguageContent[Language.comboBoxSelectedIndex]); return; } DialogResult res = MessageBox.Show(MainForm.language.LanguageContent[Language.areYouSure], "Status", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); if (res == DialogResult.Yes) { value = Convert.ToDouble(textBox1.Text); formStatus = true; ComboBoxSelectedIndex = comboBox1.SelectedIndex; InvokeAction(); } else if (res == DialogResult.Cancel) { value = 0; } else { value = 0; formStatus = true; InvokeAction(); } }
private void button1_Click(object sender, EventArgs e) { if (panel2.Controls.Count < 5) { ShowMode.Error(Manage_Beatmap.language.LanguageContent[Language.noHitsounds]); return; } if (ShowMode.QuestionWithYesNo(Manage_Beatmap.language.LanguageContent[Language.areYouSureToSaveHitsounds]) == DialogResult.Yes) { if (beatmapPath != string.Empty) { DialogResult res = ShowMode.QuestionWithYesNoCancel(Manage_Beatmap.language.LanguageContent[Language.saveSongFolder]); if (res == DialogResult.Yes) { SaveHitSounds(beatmapPath); } else if (res == DialogResult.No) { ShowMode.Information(Manage_Beatmap.language.LanguageContent[Language.selectTheFolder]); FolderBrowserDialog dialog = new FolderBrowserDialog(); if (dialog.ShowDialog() == DialogResult.OK) { SaveHitSounds(dialog.SelectedPath); } } } else { ShowMode.Information(Manage_Beatmap.language.LanguageContent[Language.selectTheFolder]); FolderBrowserDialog dialog = new FolderBrowserDialog(); if (dialog.ShowDialog() == DialogResult.OK) { SaveHitSounds(dialog.SelectedPath); } } } }
private bool validate() { double startOffset, endOffset; if (!wholeMapCheckBox.Checked) { if (!startOffsetTextBox.IsValidOffsetInput()) { ShowMode.Error("Start offset: " + MainForm.language.LanguageContent[Language.timeExpressionDoesNotMatch]); Values.Reset(); return(false); } else if (!endOffsetTextBox.IsValidOffsetInput()) { ShowMode.Error("End offset: " + MainForm.language.LanguageContent[Language.timeExpressionDoesNotMatch]); Values.Reset(); return(false); } else { startOffset = startOffsetTextBox.GetOffsetMillis(); endOffset = endOffsetTextBox.GetOffsetMillis(); } } else { startOffset = 0; endOffset = 0; } Values.StartOffset = startOffset; Values.EndOffset = endOffset; Values.IsAllTaikoDiffs = allTaikoDiffsCheckBox.Checked; Values.IsWholeMap = wholeMapCheckBox.Checked; Values.IsSnapGreenLines = snapGreenLinesCheckBox.Checked; return(true); }
/// ----------------------------------------------------------------------------- /// <summary> /// Page_Load runs when the control is loaded /// </summary> /// ----------------------------------------------------------------------------- private void Page_Load(object sender, EventArgs e) { try { _baseController = new XmlBaseController(this); _currentMode = _baseController.CheckShowMode(Request.QueryString["ShowMode"].DefaultIfNullOrEmpty()); var downloadLink = ResolveUrl("~" + Definition.PathOfModule + "download.ashx") + "?tabid=" + TabId + "&mid=" + ModuleId; switch (_currentMode) { case ShowMode.Response: Response.Redirect(downloadLink); break; case ShowMode.Link: lnkShowContent.NavigateUrl = downloadLink; break; default: using (var writer = new StringWriter()) { _baseController.Render(writer); Controls.Clear(); Controls.Add(new LiteralControl(writer.ToString())); } break; } } catch (SecurityException exc) { UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("CAS.ErrorMessage", LocalResourceFile), ModuleMessage.ModuleMessageType.YellowWarning); Exceptions.LogException(exc); } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
/// <summary> /// Construct /// </summary> /// <param name="imagePath">path of images' folder</param> public Images(string imagePath, ShowMode showMode) { if (showMode == ShowMode.Thumbnail) { ImagePath = imagePath; GetImagesFileNames(); beginIndex = 0; currentIndex = 0; LeftPage = RightPage = false; } if (showMode == ShowMode.SingleWindow) { ImagePath = Path.GetDirectoryName(imagePath); GetImagesFileNames(); for (int i = 0; i < fileNames.Count; i++) { if (imagePath == fileNames[i]) { currentIndex = i; break; } } beginIndex = currentIndex - 6 > 0 ? currentIndex - 6 : 0; } //watch filesystem changed fileWatcher = new FileSystemWatcher(ImagePath, "*.jpg"); fileWatcher.Created += new FileSystemEventHandler(OnCreate); //fileWatcher.Deleted += new FileSystemEventHandler(OnDelete); fileWatcher.Renamed += new RenamedEventHandler(OnRenamed); fileWatcher.EnableRaisingEvents = true; fileWatcher.NotifyFilter = NotifyFilters.Attributes | NotifyFilters.CreationTime | NotifyFilters.DirectoryName | NotifyFilters.FileName | NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.Security | NotifyFilters.Size; fileWatcher.IncludeSubdirectories = true; endIndex = beginIndex + 13 <= fileNames.Count ? beginIndex + 13 : fileNames.Count; this.showMode = showMode; }
internal void ShowWithMode(ShowMode mode) { if (m_Parent == null) { SavedGUIState oldState = SavedGUIState.Create(); ContainerWindow cw = ScriptableObject.CreateInstance <ContainerWindow>(); cw.title = titleContent.text; HostView host = ScriptableObject.CreateInstance <HostView>(); host.actualView = this; // Among other things, this sets m_Parent to host Rect r = m_Parent.borderSize.Add(new Rect(position.x, position.y, position.width, position.height)); // Order is important here: first set rect of container, then assign main view, then apply various settings, then show. // Otherwise the rect won't be set until first resize happens. cw.position = r; cw.rootView = host; MakeParentsSettingsMatchMe(); cw.Show(mode, loadPosition: true, displayImmediately: false, setFocus: true); // set min/max size now that native window is not null so that it will e.g., use proper styleMask on macOS cw.SetMinMaxSizes(minSize, maxSize); oldState.ApplyAndForget(); } }
internal static bool IsPopup(ShowMode mode) { return(ShowMode.PopupMenu == mode || ShowMode.PopupMenuWithKeyboardFocus == mode); }
void OnGUI() { if (titleStyle == null) { titleStyle = new GUIStyle(); titleStyle.normal.textColor = Color.green; titleStyle.fontSize = 25; } if (textStyle == null) { textStyle = new GUIStyle(); textStyle.normal.textColor = Color.yellow; textStyle.fontSize = 16; } GUILayout.Space(15); EditorGUILayout.LabelField("----> 引用查询器", titleStyle); GUILayout.Space(30); _target = EditorGUILayout.ObjectField("当前查询物体:", _target, typeof(Object), false); if (_target) { recursive = EditorGUILayout.ToggleLeft("递归查找", recursive); _mode = (ShowMode)EditorGUILayout.EnumPopup("查找模式", (System.Enum)_mode); _displayMode = (LayoutDisplay)EditorGUILayout.EnumPopup("显示模式", (System.Enum)_displayMode); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("->"); if (GUILayout.Button("重新寻找引用", GUILayout.Height(25))) { BeginFindReference(); } EditorGUILayout.EndHorizontal(); } GUILayout.Space(10); EditorGUILayout.BeginVertical(GUI.skin.box); //if (_referenceList != null) // for (int i = 0; i < _referenceList.Length; i++) // { // EditorGUILayout.TextField(_referenceList[i]); // } _scroll = EditorGUILayout.BeginScrollView(_scroll); switch (_mode) { case ShowMode.FolderMode: if (_refFolderItem != null) { ShowRefFolderItems(_refFolderItem); } break; case ShowMode.ReferenceMode: if (_refItem != null) { switch (_displayMode) { case LayoutDisplay.NestMode: ShowRefItemsNest(_refItem); break; case LayoutDisplay.DirectMode: ShowRefItemsDirect(_refItem); break; } } break; } EditorGUILayout.EndScrollView(); EditorGUILayout.EndVertical(); }
private void downloadingBtn_Click(object sender, EventArgs e) { this.showMode = ShowMode.Running; this.showRunningTasks(); }
internal void ShowAsDropDown(Rect buttonRect, Vector2 windowSize, PopupLocationHelper.PopupLocation[] locationPriorityOrder, ShowMode mode) { this.position = this.ShowAsDropDownFitToScreen(buttonRect, windowSize, locationPriorityOrder); this.ShowWithMode(mode); this.position = this.ShowAsDropDownFitToScreen(buttonRect, windowSize, locationPriorityOrder); this.minSize = new Vector2(this.position.width, this.position.height); this.maxSize = new Vector2(this.position.width, this.position.height); if (EditorWindow.focusedWindow != this) { this.Focus(); } this.m_Parent.AddToAuxWindowList(); this.m_Parent.window.m_DontSaveToLayout = true; }
internal void Init(Rect activatorRect, PopupWindowContent windowContent, PopupLocation[] locationPriorityOrder, ShowMode showMode, bool giveFocus) { hideFlags = HideFlags.DontSave; wantsMouseMove = true; m_WindowContent = windowContent; m_WindowContent.editorWindow = this; m_WindowContent.OnOpen(); m_ActivatorRect = GUIUtility.GUIToScreenRect(activatorRect); m_LastWantedSize = Vector2.zero; m_LocationPriorityOrder = locationPriorityOrder; ShowAsDropDown(m_ActivatorRect, m_WindowContent.GetWindowSize(), locationPriorityOrder, showMode, giveFocus); }
internal void ShowAsDropDown(Rect buttonRect, Vector2 windowSize, PopupLocation[] locationPriorityOrder, ShowMode mode) { ShowAsDropDown(buttonRect, windowSize, locationPriorityOrder, mode, true); }
private Rect ComputeBottomLayoutAreaViaSurface(ShowMode mode, Rect surfaceArea) { Rect rect = surfaceArea; View bottomView = GetCurrentBottomView(); int bl = rect.Left, bt = rect.Top, br = rect.Right, bb = rect.Bottom; if (mode == ShowMode.PullOut) { if (mCurrentDragEdge == DragEdge.Left) bl = rect.Left - mDragDistance; else if (mCurrentDragEdge == DragEdge.Right) bl = rect.Right; else if (mCurrentDragEdge == DragEdge.Top) bt = rect.Top - mDragDistance; else bt = rect.Bottom; if (mCurrentDragEdge == DragEdge.Left || mCurrentDragEdge == DragEdge.Right) { bb = rect.Bottom; br = bl + (bottomView == null ? 0 : bottomView.MeasuredWidth); } else { bb = bt + (bottomView == null ? 0 : bottomView.MeasuredHeight); br = rect.Right; } } else if (mode == ShowMode.LayDown) { if (mCurrentDragEdge == DragEdge.Left) br = bl + mDragDistance; else if (mCurrentDragEdge == DragEdge.Right) bl = br - mDragDistance; else if (mCurrentDragEdge == DragEdge.Top) bb = bt + mDragDistance; else bt = bb - mDragDistance; } return new Rect(bl, bt, br, bb); }
internal static bool IsPopup(ShowMode mode) { return ((mode == ShowMode.PopupMenu) || (ShowMode.PopupMenuWithKeyboardFocus == mode)); }
public void Show(ShowMode sm) { if (sm == ShowMode.Present) { Console.WriteLine("Present cars:\n"); foreach (Car c in parking) if (c != null && c.IsOnThePlace) Console.WriteLine(c); } else if (sm == ShowMode.Absent) { Console.WriteLine("Absent cars:\n"); foreach (Car c in parking) if (c != null && !c.IsOnThePlace) Console.WriteLine(c); } else { throw new ArgumentException("Wrong mode!"); } }
private void allTaskBtn_Click(object sender, EventArgs e) { this.showMode = ShowMode.All; this.showAllTasks(); }
private void buttonShowModeDeleted_Click(object sender, EventArgs e) { _showMode = ShowMode.Deleted; UpdateUI(); }
public void Show(ShowMode showMode, bool loadPosition, bool displayImmediately) { if (showMode == ShowMode.AuxWindow) { showMode = ShowMode.Utility; } if (showMode == ShowMode.Utility || showMode == ShowMode.PopupMenu) { this.m_DontSaveToLayout = true; } this.m_ShowMode = (int)showMode; if (showMode != ShowMode.PopupMenu) { this.Load(loadPosition); } this.Internal_Show(this.m_PixelRect, this.m_ShowMode, this.m_MinSize, this.m_MaxSize); if (this.m_MainView) { this.m_MainView.SetWindowRecurse(this); } this.Internal_SetTitle(this.m_Title); this.Internal_BringLiveAfterCreation(displayImmediately, true); if (this == null) { return; } this.position = this.FitWindowRectToScreen(this.m_PixelRect, false, false); this.mainView.position = new Rect(0f, 0f, this.m_PixelRect.width, this.m_PixelRect.height); this.mainView.Reflow(); this.Save(); }
private void buttonShowModeFavourite_Click(object sender, EventArgs e) { _showMode = ShowMode.Favourite; UpdateUI(); }
internal static void Show(Rect activatorRect, PopupWindowContent windowContent, PopupLocationHelper.PopupLocation[] locationPriorityOrder, ShowMode showMode) { if (PopupWindow.ShouldShowWindow(activatorRect)) { PopupWindow popupWindow = ScriptableObject.CreateInstance <PopupWindow>(); if (popupWindow != null) { popupWindow.Init(activatorRect, windowContent, locationPriorityOrder, showMode); } GUIUtility.ExitGUI(); } }
private void Init(Rect activatorRect, PopupWindowContent windowContent, PopupLocationHelper.PopupLocation[] locationPriorityOrder, ShowMode showMode) { base.hideFlags = HideFlags.DontSave; base.wantsMouseMove = true; this.m_WindowContent = windowContent; this.m_WindowContent.editorWindow = this; this.m_WindowContent.OnOpen(); this.m_ActivatorRect = GUIUtility.GUIToScreenRect(activatorRect); base.ShowAsDropDown(this.m_ActivatorRect, this.m_WindowContent.GetWindowSize(), locationPriorityOrder, showMode); }
public void Show(ShowMode showMode, bool loadPosition, bool displayImmediately) { if (showMode == ShowMode.AuxWindow) { showMode = ShowMode.Utility; } if ((showMode == ShowMode.Utility) || IsPopup(showMode)) { this.m_DontSaveToLayout = true; } this.m_ShowMode = (int) showMode; if (!this.isPopup) { this.Load(loadPosition); } this.Internal_Show(this.m_PixelRect, this.m_ShowMode, this.m_MinSize, this.m_MaxSize); if (this.m_RootView != null) { this.m_RootView.SetWindowRecurse(this); } this.Internal_SetTitle(this.m_Title); this.SetBackgroundColor(skinBackgroundColor); this.Internal_BringLiveAfterCreation(displayImmediately, true); if (this != null) { this.position = this.FitWindowRectToScreen(this.m_PixelRect, true, false); this.rootView.position = new Rect(0f, 0f, this.m_PixelRect.width, this.m_PixelRect.height); this.rootView.Reflow(); this.Save(); } }
internal static void Show(Rect activatorRect, PopupWindowContent windowContent, PopupLocationHelper.PopupLocation[] locationPriorityOrder, ShowMode showMode) { if (ShouldShowWindow(activatorRect)) { PopupWindow window = ScriptableObject.CreateInstance<PopupWindow>(); if (window != null) { window.Init(activatorRect, windowContent, locationPriorityOrder, showMode); } GUIUtility.ExitGUI(); } }
public SwipeLayout(Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { IsSwipeEnabled = true; gestureDetector = new GestureDetector (Context, new SwipeDetector (this)); mDragHelperCallback = new SwipeLayoutDragHelperCallback (this); mDragHelper = ViewDragHelper.Create(this, mDragHelperCallback); mTouchSlop = ViewConfiguration.Get(context).ScaledTouchSlop; TypedArray a = context.ObtainStyledAttributes(attrs, Resource.Styleable.SwipeLayout); int dragEdgeChoices = a.GetInt(Resource.Styleable.SwipeLayout_drag_edge, DRAG_RIGHT); mEdgeSwipesOffset[(int)DragEdge.Left] = a.GetDimension(Resource.Styleable.SwipeLayout_leftEdgeSwipeOffset, 0); mEdgeSwipesOffset[(int)DragEdge.Right] = a.GetDimension(Resource.Styleable.SwipeLayout_rightEdgeSwipeOffset, 0); mEdgeSwipesOffset[(int)DragEdge.Top] = a.GetDimension(Resource.Styleable.SwipeLayout_topEdgeSwipeOffset, 0); mEdgeSwipesOffset[(int)DragEdge.Bottom] = a.GetDimension(Resource.Styleable.SwipeLayout_bottomEdgeSwipeOffset, 0); ClickToClose = a.GetBoolean(Resource.Styleable.SwipeLayout_clickToClose, ClickToClose); if ((dragEdgeChoices & DRAG_LEFT) == DRAG_LEFT) { mDragEdges.Add(DragEdge.Left, null); } if ((dragEdgeChoices & DRAG_TOP) == DRAG_TOP) { mDragEdges.Add(DragEdge.Top, null); } if ((dragEdgeChoices & DRAG_RIGHT) == DRAG_RIGHT) { mDragEdges.Add(DragEdge.Right, null); } if ((dragEdgeChoices & DRAG_BOTTOM) == DRAG_BOTTOM) { mDragEdges.Add(DragEdge.Bottom, null); } int ordinal = a.GetInt(Resource.Styleable.SwipeLayout_show_mode, (int)ShowMode.PullOut); mShowMode = (ShowMode)System.Enum.ToObject(typeof(ShowMode), ordinal); a.Recycle(); }
// Show as drop down list with custom fit to screen callback // 'buttonRect' is used for displaying the dropdown below that rect if possible otherwise above // 'windowSize' is used for setting up initial size // 'locationPriorityOrder' is for manual popup direction, if null it uses default order: down, up, left or right // 'giveFocus' is for whether the window should immediately be given focus (default true) internal void ShowAsDropDown(Rect buttonRect, Vector2 windowSize, PopupLocation[] locationPriorityOrder, ShowMode mode, bool giveFocus) { // Setup position before bringing window live (otherwise the dropshadow on Windows will be placed in 0,0 first frame) position = ShowAsDropDownFitToScreen(buttonRect, windowSize, locationPriorityOrder); // ShowWithMode() always grabs window focus so we use ShowPopup() for popup windows so PopupWindowWithoutFocus // will work correctly (no focus when opened). if (ContainerWindow.IsPopup(mode)) { ShowPopupWithMode(mode, giveFocus); } else { ShowWithMode(mode); } // Fit to screen again now that we have a container window position = ShowAsDropDownFitToScreen(buttonRect, windowSize, locationPriorityOrder); // Default to none resizable window minSize = new Vector2(position.width, position.height); maxSize = new Vector2(position.width, position.height); // Focus window if (giveFocus && focusedWindow != this) { Focus(); } else { Repaint(); } // Add after unfreezing display because AuxWindowManager.cpp assumes that aux windows are added after we got/lost- focus calls. m_Parent.AddToAuxWindowList(); // Dropdown windows should not be saved to layout m_Parent.window.m_DontSaveToLayout = true; }
private void buttonShowModeUnread_Click(object sender, EventArgs e) { _showMode = ShowMode.UnRead; UpdateUI(); }
// Shown on top of any previous windows internal static void Show(Rect activatorRect, PopupWindowContent windowContent, PopupLocation[] locationPriorityOrder, ShowMode showMode) { // If we already have a popup window showing this type of content, then just close // the existing one. var existingWindows = Resources.FindObjectsOfTypeAll(typeof(PopupWindow)); if (existingWindows != null && existingWindows.Length > 0) { var existingPopup = existingWindows[0] as PopupWindow; if (existingPopup != null && existingPopup.m_WindowContent != null && windowContent != null) { if (existingPopup.m_WindowContent.GetType() == windowContent.GetType()) { existingPopup.CloseWindow(); return; } } } if (ShouldShowWindow(activatorRect)) { PopupWindow win = CreateInstance <PopupWindow>(); if (win != null) { win.Init(activatorRect, windowContent, locationPriorityOrder, showMode, true); } if (Event.current != null) { EditorGUIUtility.ExitGUI(); // Needed to prevent GUILayout errors on OSX } } }
public MainWindow() { InitializeComponent(); LoadDB(); ApplyFilters(); PopulateList(); lvApartments.SelectionChanged += OnSelectionChanged; btnImgPrev.Click += delegate { ChangeImage(-1); }; btnImgNext.Click += delegate { ChangeImage(1); }; imgLarge.MouseDown += delegate { gridFullScreen.Visibility = Visibility.Visible; imgFullScreen.Source = imgLarge.Source; }; imgFullScreen.MouseDown += delegate { gridFullScreen.Visibility = Visibility.Collapsed; }; btnOpen.Click += delegate { var li = lvApartments.SelectedItem as ListItem; if (li == null) { return; } Process.Start($"https://www.immobilienscout24.de/expose/{li.App.Id}"); }; btnOpenMap.Click += delegate { var li = lvApartments.SelectedItem as ListItem; if (li == null) { return; } var q = li.App.Street.Replace(" ", "+"); if (!string.IsNullOrWhiteSpace(q)) { q += "+"; } q += li.App.Region.Replace(" ", "+"); Process.Start($"https://www.google.de/maps/search/{q}"); }; // https://www.google.de/maps/search/maronenring+1b+borkheide/ btnHide.Click += delegate { var li = lvApartments.SelectedItem as ListItem; if (li == null) { return; } var index = lvApartments.SelectedIndex; li.App.IsHidden = true; SaveDB(); ApplyFilters(); PopulateList(); // Select next item if (index < lvApartments.Items.Count) { lvApartments.SelectedIndex = index; } }; btnFavorite.Checked += OnBtnFavoriteCheckChanged; btnFavorite.Unchecked += OnBtnFavoriteCheckChanged; btnShowNew.Click += delegate { showMode = ShowMode.New; ApplyFilters(); PopulateList(); }; btnShowFavorite.Click += delegate { showMode = ShowMode.Favorites; ApplyFilters(); PopulateList(); }; btnShowAll.Click += delegate { showMode = ShowMode.All; ApplyFilters(); PopulateList(); }; btnShowHidden.Click += delegate { showMode = ShowMode.Hidden; ApplyFilters(); PopulateList(); }; btnShowRented.Click += delegate { showMode = ShowMode.BlackList; ApplyFilters(); PopulateList(); }; btnSortByPrice.Click += delegate { sortBy = SortBy.Price; ApplyFilters(); PopulateList(); }; btnSortByPricePerSqM.Click += delegate { sortBy = SortBy.PricePerSqM; ApplyFilters(); PopulateList(); }; btnSortByDistance.Click += delegate { sortBy = SortBy.Distance; ApplyFilters(); PopulateList(); }; btnSortByRegion.Click += delegate { sortBy = SortBy.Region; ApplyFilters(); PopulateList(); }; btnSortByIncome.Click += delegate { sortBy = SortBy.Income; ApplyFilters(); PopulateList(); }; btnSortByPriceToIncome.Click += delegate { sortBy = SortBy.PriceToIncome; ApplyFilters(); PopulateList(); }; btnUpdate.Click += OnBtnUpdateClicked; btnResetNew.Click += delegate { foreach (var apartment in db) { apartment.IsNew = false; } SaveDB(); ApplyFilters(); PopulateList(); }; }
public UserListForm(ShowMode showMode = ShowMode.List) { InitializeComponent(); this.showMode = showMode; }
private void doneTaskBtn_Click(object sender, EventArgs e) { this.showMode = ShowMode.Finished; this.showFinishedTasks(); }
internal static bool IsPopup(ShowMode mode) { return(ShowMode.PopupMenu == mode); }
/// <summary> /// 设置是否显示roi /// </summary> /// <param name="mode"></param> public void SetDispLevel(ShowMode mode) { showMode = mode; }