public UIElementTableConfigPage(ActUIElement Act, PlatformInfoBase Platform) { eBaseWindow = BaseWindow.ActEditPage; mAct = Act; mPlatform = Platform; InitializeComponent(); if (Act.ElementData != null) { if (Act.ElementType == eElementType.EditorPane || Act.ElementType.ToString() == "JEditor") { mAct.ElementType = eElementType.EditorPane; mAct.ElementAction = ActUIElement.eElementAction.JEditorPaneElementAction; mAct.AddOrUpdateInputParamValue(ActUIElement.Fields.SubElementType, ActUIElement.eSubElementType.HTMLTable.ToString()); mAct.AddOrUpdateInputParamValue(ActUIElement.Fields.SubElementAction, ActUIElement.eElementAction.TableCellAction.ToString()); mAct.AddOrUpdateInputParamValue(ActUIElement.Fields.ControlAction, ActUIElement.eElementAction.GetValue.ToString()); } else { mAct.ElementType = eElementType.Table; mAct.ElementAction = ActUIElement.eElementAction.TableCellAction; mAct.AddOrUpdateInputParamValue(ActUIElement.Fields.ControlAction, ActUIElement.eElementAction.GetValue.ToString()); } InitTableInfo(); SetComponents(true); SetDescriptionDetails(); } ShowTableControlActionConfigPage(mPlatform); }
public void HideWindow(BaseWindow window) { _shownWindows.Remove(window); window.transform.parent = null; GameObject.Destroy(window.gameObject); }
public MenuBarWindowTag(BaseWindow parent) { Window = parent; Window.AddTag(this); Window.Flags = Window.Flags | ImGuiNET.ImGuiWindowFlags.MenuBar; Window.OnContent += Update; }
public void ShowWindow(WindowType windowToNavigateTo, object parameter = null) { BaseWindow window = CreateWindow(windowToNavigateTo); window.NavigationParameter = parameter; window.Show(); }
public void Save() { if (!CanSave) { return; } param.CopyStart = FromDate.Value.ToUniversalTime(); param.CopyEnd = ToDate.Value.AddDays(1).ToUniversalTime(); try { Result = ServiceManager.SaveScheduleEntriesRange(param).Cast <ScheduleEntryDTO>().ToList(); } catch (ArgumentException ex) { parent.SynchronizationContext.Send(state => ExceptionHandler.Default.Process(ex, "ErrCopyRangeIsNotValidRequired".TranslateInstructor(), ErrorWindow.MessageBox), null); return; } catch (LicenceException ex) { parent.SynchronizationContext.Send(state => ExceptionHandler.Default.Process(ex, "ErrInstructorAccountRequired".TranslateInstructor(), ErrorWindow.MessageBox), null); return; } catch (AlreadyOccupiedException ex) { parent.SynchronizationContext.Send(state => ExceptionHandler.Default.Process(ex, "AlreadyOccupiedException_SaveScheduleEntriesWindow_Save".TranslateInstructor(), ErrorWindow.MessageBox), null); return; } parent.SynchronizationContext.Send(delegate { BaseWindow wnd = (BaseWindow)parent; wnd.ThreadSafeClose(true); }, null); }
/// <summary> /// 移除Window /// </summary> /// <param name="window"></param> public static void RemoveWindow(BaseWindow window) { if (windowsDic.ContainsKey(window.Type)) { windowsDic.Remove(window.Type); } }
private void PushToStack(BaseWindow baseWindow) { if (baseWindow.Overlay) { if (this.dialogStack.Contains(baseWindow)) { PopFromStack(baseWindow); } int sortingOrder = baseWindow.SortingOrder; if (TopmostDialog.Value != null) { sortingOrder = TopmostDialog.Value.SortingOrder; } baseWindow.SortingOrder = GetNextOverlaySortingOrder(sortingOrder); this.dialogStack.Add(baseWindow); } else { if (this.menuStack.Contains(baseWindow)) { PopFromStack(baseWindow); } baseWindow.SortingOrder = GetNextFrontSortingOrder(); this.menuStack.Add(baseWindow); } }
/// <summary> /// 隐藏窗口 /// tips:判断配置数据是否需要直接删除 /// </summary> /// <param name="name">Name.</param> public void HideWindow(string name) { BaseWindow bw = GetWindow(name); if (!IsWindowVisible(bw)) { Debug.LogFormat("UISystem_HideWindow : {0} don't showed or invisible, don't need hide.", name); return; } // 调用 bw.OnHide(); // 先从显示栈中删了 //未预防在destroy后不知道是否还存在对象,移到前面处理 update at 2016-7-11 PopShowingStack(bw); // 判断配置数据是否直接删除 if (bw.GetConfigData().mHideWithDestroy) { // 删除 bw.Release(); mManagedWindows.Remove(bw); GameObject.Destroy(bw.gameObject); } else { // 隐藏 bw.gameObject.SetActive(false); } Resources.UnloadUnusedAssets(); System.GC.Collect(); }
private bool InitWindow(WindowType type, string message = null, Action noCallBack = null, Action yesCallBack = null) { // UpdateContainer(); BaseWindow windowPrefab = Resources.Load <BaseWindow>(string.Format(PathUtils.windowPath, type.ToString().ToLower())); if (windowPrefab == null) { return(false); } BaseWindow window = Instantiate(windowPrefab, uiMainCanvas); windowList.Add(window.type, window); if (window != null) { window.SetupData(message, noCallBack, yesCallBack); window.transform.SetAsLastSibling(); window.OnShow(); return(true); } return(false); }
/// <summary> /// 淡入淡出窗口 /// </summary> public void FadeOutWindow2(string name) { #if !SERVER BaseWindow bw = GetWindow(name); if (bw == null) { return; } TweenAlpha ta = bw.gameObject.GetComponent <TweenAlpha>(); float a = 1; float time = 0.25f; if (ta == null) { ta = bw.gameObject.AddComponent <TweenAlpha> (); } else { a = ta.value; time *= a; } ta.ResetToBeginning(); ta.from = a; ta.to = 0; ta.duration = time; ta.SetOnFinished(() => { UISystem.Get().HideWindow(name); }); ta.Play(true); #endif }
public void RemoveOneUI(BaseWindow ui) { if (windowList.ContainsKey(ui.name)) { windowList.Remove(ui.name); } }
private void OnCreateShape() { BaseWindow window = null; if (SelectedShapeType == ShapeType.Circle) { var viewModel = new CreateCircleViewModel(); window = new CreateCircleWindow(viewModel); } if (SelectedShapeType == ShapeType.Rectangle) { var viewModel = new CreateRectangleViewModel(); window = new CreateRectangleWindow(viewModel); } if (SelectedShapeType == ShapeType.Trapezium) { var viewModel = new CreateTrapeziumViewModel(); window = new CreateTrapeziumWindow(viewModel); } window.ShowDialog(); var shape = (window.DataContext as BaseViewModel).Shape; if (shape != null) { ShapesFullList.Add(shape); ShapesFullList = new CustomList <Shape>(ShapesFullList); ApplyFilter(); } }
/// <summary> /// 显示栈顶的窗口 /// </summary> public void Show() { if (mWindowStack.Count > 0) { BaseWindow window = mWindowStack.Peek(); if (window && window.isPause) { window.OnResume(); if (window.windowType == WindowType.Pop) { if (mWindowStack.Count >= 2) { window = mWindowStack.Pop(); BaseWindow secondWindow = mWindowStack.Peek(); if (secondWindow && secondWindow.isPause) { secondWindow.OnResume(); } mWindowStack.Push(window); } } } } }
/// <summary> /// 关闭最上面的UI,不会关闭Root窗口 /// </summary> public void Close() { if (mWindowStack == null) { return; } if (mWindowStack.Count > 0) { SetTouchable(false); BaseWindow window = mWindowStack.Pop(); if (window && window.windowType != WindowType.Root) { window.OnExit(); } if (mWindowStack.Count > 0) { window = mWindowStack.Peek(); if (window && window.isPause) { window.OnResume(); } } SetTouchable(true); } }
private void MoveWindowBackInScreen() { MoveIn?.Invoke(this, EventArgs.Empty); double newleft; if (_movedOutSide == Side.Left) { newleft = WpfScreen.MostLeftX; } else { newleft = WpfScreen.MostRightX - BaseWindow.Width; } BaseWindow.Left = _movedOutSide == Side.Left ? newleft + 10 : newleft - 10; var animation = new DoubleAnimation(BaseWindow.Left, newleft, TimeSpan.FromMilliseconds(150), FillBehavior.Stop) { EasingFunction = new CircleEase() }; animation.Completed += (s, e) => { BaseWindow.Topmost = false; BaseWindow.Left = newleft; }; BaseWindow.BeginAnimation(Window.LeftProperty, animation); _movedOut = false; BaseWindow.Topmost = true; BaseWindow.Activate(); BaseWindow.ShowInTaskbar = true; StopMagic(); }
protected void MoveWindowBackInScreen() { if (MoveIn != null) { MoveIn(this, EventArgs.Empty); } double newleft; if (_movedoutside == Side.Left) { newleft = WpfScreen.MostLeftX; } else { newleft = WpfScreen.MostRightX - BaseWindow.Width; } BaseWindow.Left = _movedoutside == Side.Left ? newleft + 10 : newleft - 10; Storyboard moveWindowBackInScreenStoryboard = new Storyboard(); DoubleAnimation inanimation = new DoubleAnimation(BaseWindow.Left, newleft, TimeSpan.FromMilliseconds(150), FillBehavior.Stop); inanimation.Completed += (s, e) => { BaseWindow.Topmost = false; BaseWindow.Left = newleft; }; moveWindowBackInScreenStoryboard.Children.Add(inanimation); Storyboard.SetTargetName(inanimation, BaseWindow.Name); Storyboard.SetTargetProperty(moveWindowBackInScreenStoryboard, new PropertyPath(Window.LeftProperty)); moveWindowBackInScreenStoryboard.Begin(BaseWindow); MovedOut = false; BaseWindow.Topmost = true; BaseWindow.Activate(); BaseWindow.ShowInTaskbar = true; StopMagic(); }
/// <summary> /// 添加window /// </summary> /// <param name="window"></param> public static void AddWindow(BaseWindow window) { if (!windowsDic.ContainsKey(window.Type)) { windowsDic.Add(window.Type, window); } }
/// <summary> /// 从显示栈中清除这个界面 /// tips: 可能界面不是最上层,需要处理 /// </summary> /// <param name="bw">Bw.</param> private void PopShowingStack(BaseWindow bw) { if (bw == null) { return; } // 先判断,如果栈顶层的就是当前的,则直接pop if (mShowingStack.Peek() == bw) { mShowingStack.Pop(); return; } Stack <BaseWindow> temp = new Stack <BaseWindow>(); BaseWindow b = null; for (int i = 0; i < mShowingStack.Count; ++i) { b = mShowingStack.Pop(); if (b != bw) { temp.Push(b); } else { break; } } for (int i = 0; i < temp.Count; ++i) { mShowingStack.Push(temp.Pop()); } temp.Clear(); }
public SfmlApp() { InitGame(); _window = InitGui(); ColoredString.Write("You wake up in an Unknown world."); }
public void WindowIsInListAfterBeingAdded() { BaseWindow window = new BaseWindow(); _windowList.Add(window); Assert.That(_windowList, Has.Member(window)); }
public void ThrowsExceptionWhenIndexingPastListBounds() { BaseWindow window1 = new BaseWindow(); _windowList.Add(window1); Assert.That(() => _windowList[100], Throws.TypeOf <ArgumentOutOfRangeException>()); }
void DealWindowStack(BaseWindow win, bool open) { if (win.Type != WindowType.WINDOW) { return; } if (open) { for (int i = 0; i < mOpenWinStack.Count; i++) { if (mOpenWinStack[i] != win) { mOpenWinStack[i].CacheTransform.gameObject.SetActive(false); } } mOpenWinStack.Add(win); } else { mOpenWinStack.Remove(win); if (mOpenWinStack.Count > 0) { BaseWindow last = mOpenWinStack[mOpenWinStack.Count - 1]; last.CacheTransform.gameObject.SetActive(true); } } }
public void UpdateProgressIndicator(OperationContext context) { bool startLoginOperation = context.State == OperationState.Started; if (!AllowCancel) { BaseWindow baseWindow = ParentWindow as BaseWindow; if (baseWindow != null) { if (startLoginOperation) { baseWindow.DisableCloseButton(); } else { baseWindow.EnableCloseButton(); } } } //btnOK.IsEnabled = !startLoginOperation; btnOK.SetCurrentValue(Button.IsEnabledProperty, !startLoginOperation); btnCancel.SetCurrentValue(Button.IsEnabledProperty, !AllowCancel || !startLoginOperation); //btnCancel.IsEnabled = AllowCancel || !startLoginOperation; progressIndicator1.IsRunning = startLoginOperation; }
private async void ApplyTheme() { await BaseWindow.MoveOut(); ApplicationThemeManager.Instance.Apply(Config.ApplicationDesign); await BaseWindow.ResetAndMoveIn(); }
static int _CreateBaseWindow(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 3) { string arg0 = ToLua.CheckString(L, 1); string arg1 = ToLua.CheckString(L, 2); bool arg2 = LuaDLL.luaL_checkboolean(L, 3); BaseWindow obj = new BaseWindow(arg0, arg1, arg2); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: BaseWindow.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
protected override Window EnsureWindow(object model, object view, bool isDialog) { Window window = view as BaseWindow; if (window == null) { if (isDialog) { window = new BaseDialogWindow { Content = view, SizeToContent = SizeToContent.WidthAndHeight }; } else { window = new BaseWindow { Content = view, SizeToContent = SizeToContent.Manual }; } window.SetValue(View.IsGeneratedProperty, true); } else { Window owner2 = InferOwnerOf(window); if (owner2 != null && isDialog) { window.Owner = owner2; } } return(window); }
public UIElementTableConfigPage(ElementInfo ElementInfo, ObservableList <Act> Actions, Context context) { eBaseWindow = BaseWindow.WindowExplorer; mAct = new ActUIElement(); mAct.Context = context; mAct.Description = "UI Element Table"; string targetApp = context?.BusinessFlow.CurrentActivity.TargetApplication; mPlatform = PlatformInfoBase.GetPlatformImpl((from x in WorkSpace.Instance.Solution.ApplicationPlatforms where x.AppName == targetApp select x.Platform).FirstOrDefault()); if (ElementInfo.ElementType.Contains("JEditor")) { mAct.ElementType = eElementType.EditorPane; mAct.ElementAction = ActUIElement.eElementAction.JEditorPaneElementAction; mAct.AddOrUpdateInputParamValue(ActUIElement.Fields.SubElementType, ActUIElement.eSubElementType.HTMLTable.ToString()); mAct.AddOrUpdateInputParamValue(ActUIElement.Fields.SubElementAction, ActUIElement.eElementAction.TableCellAction.ToString()); } else { mAct.ElementType = eElementType.Table; mAct.ElementAction = ActUIElement.eElementAction.TableCellAction; } mElementInfo = ElementInfo; mActions = Actions; ShowCellActions(); InitializeComponent(); InitTableInfo(); ShowTableControlActionConfigPage(mPlatform); SetComponents(); SetDescriptionDetails(); }
public async Task <bool> ShowMessage(string message, string title, bool cancancel, DialogMode mode) { if (Configuration.ShowFullscreenDialogs) { MessageDialogResult result = await BaseWindow.ShowMessageAsync(title, message, cancancel?MessageDialogStyle.AffirmativeAndNegative : MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = Application.Current.Resources["OK"].ToString(), NegativeButtonText = Application.Current.Resources["Cancel"].ToString(), AnimateHide = ShowHideAnimation(mode), AnimateShow = ShowShowAnimation(mode), ColorScheme = MetroDialogColorScheme.Theme }); return(result == MessageDialogResult.Affirmative); } else { var messageWindow = new MessageWindow(message, title, cancancel) { Owner = BaseWindow }; var result = false; await Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => result = messageWindow.ShowDialog() == true)); return(result); } }
public async Task <ProgressDialog> CreateProgressDialog(string title, bool isindeterminate) { var prg = new ProgressDialog(); if (Configuration.ShowFullscreenDialogs) { var progresscontroller = await BaseWindow.ShowProgressAsync(title, string.Empty); progresscontroller.SetIndeterminate(); prg.MessageChanged = ev => progresscontroller.SetMessage(ev); prg.TitleChanged = ev => progresscontroller.SetTitle(ev); prg.ProgressChanged = ev => progresscontroller.SetProgress(ev); prg.CloseRequest = () => progresscontroller.CloseAsync(); } else { var progressWindow = new ProgressWindow(title, isindeterminate) { Owner = BaseWindow }; prg.MessageChanged = ev => progressWindow.SetText(ev); prg.TitleChanged = ev => progressWindow.SetTitle(ev); prg.ProgressChanged = ev => progressWindow.SetProgress(ev); prg.CloseRequest = () => { progressWindow.Close(); return(null); }; Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => progressWindow.ShowDialog())); } return(prg); }
private GameObject GetUIParent() { switch (GameStateManager.Instance.GetCurState().GetStateType()) { case GameStateType.GS_Login: { BaseWindow pWindow = WindowManager.Instance.GetWindow(EWindowType.EWT_LoginWindow); if (pWindow != null && pWindow.GetRoot()!=null) { return pWindow.GetRoot().gameObject; } return null; } case GameStateType.GS_Play: { BaseWindow pWindow = WindowManager.Instance.GetWindow(EWindowType.EWT_GamePlayWindow); if (pWindow != null && pWindow.GetRoot() != null) { return pWindow.GetRoot().gameObject; } return null; } case GameStateType.GS_Over: { BaseWindow pWindow = WindowManager.Instance.GetWindow(EWindowType.EWT_ScoreWindow); if (pWindow != null && pWindow.GetRoot() != null) { return pWindow.GetRoot().gameObject; } return null; } } return null; }
public AddSmileyWindow(BaseWindow mainWindow) { this.mainWindow = mainWindow; InitializeComponent(); }