public void CloseWait()
 {
     if (_wait != null)
     {
         _wait.Close();
     }
 }
예제 #2
0
        private static async Task Remap()
        {
            var gui = new MessageBox("Window Docker", "Press any keyboard key to remap window docker to Win + [that key]");
            await gui.LaunchAndWait();

            gui.Window.SetAlwaysOnTop(true);
            gui.Window.MoveTop();

            key = (await KeyHandler.WaitKey(Filter)).Result.Key;
            gui.Close();
            File.WriteAllText(keyfile, ((int)key).ToString());

            h.Remove();
            CreateMainHotkey();

            GuiTool.Message("Remap succesful");

            bool Filter(Key k, bool state)
            {
                if (!state)
                {
                    return(false);
                }
                if (k.IsKeyboard())
                {
                    return(true);
                }
                return(false);
            }
        }
예제 #3
0
 void OnGUI()
 {
     if (GUILayout.Button("Message show"))
     {
         box.Create(messageBoxBack);
         //box.Show();
         box.Show(Vector3.zero);
         box.MoveTo(Vector3.zero, 0.5f);
     }
     if (GUILayout.Button("Message Close"))
     {
         box.Close();
     }
 }
예제 #4
0
 static int Close(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         MessageBox obj = (MessageBox)ToLua.CheckObject <MessageBox>(L, 1);
         obj.Close();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #5
0
        public async Task Sync()
        {
            if (!_playlist.HasSyncFolders)
            {
                Toast.ShowMessage(App.ResourceLoader.GetString("Message_NoFoldersToSync"));
                return;
            }

            var msgBox = new MessageBox
            {
                Title             = App.ResourceLoader.GetString("MessageBox_Title_SyncPlaylist"),
                Message           = App.ResourceLoader.GetString("MessageBox_Message_SyncPlaylist"),
                ButtonsVisibility = Visibility.Collapsed,
            };

            msgBox.Show();

            FlatSongs = null;
            var songsCount = _playlist.Songs.Count;
            await _playlist.Sync();

            var newGroups = AlphaKeyGroup <Song> .CreateGroups(_playlist.Songs, s => s.Title);

            foreach (var group in Songs)
            {
                group.Clear();
                var newGroup = newGroups.FirstOrDefault(g => g.Key == group.Key);
                if (newGroup == null || newGroup.Count == 0)
                {
                    continue;
                }

                foreach (var item in newGroup)
                {
                    group.Add(item);
                }
            }

            if (PlayerViewModel.PlaylistTitle == Title && songsCount != _playlist.Songs.Count)
            {
                ResetPlayerViewModel();
            }

            msgBox.Close();
        }
 private void ShowMessageBox(string message)
 {
     msgboxErrorIPAddr =
         new MessageBox(
             new Vector2(300, 200),
             new Vector2(200, 250),
             "Error!",
             message,
             MessageBox.Type.MB_OK);
     msgboxErrorIPAddr.OnOk +=
         delegate
     {
         //((Textbox)Game.FormCollection["form1"]["textbox1"]).Text = String.Empty;
         msgboxErrorIPAddr.Close();
         msgboxErrorIPAddr = null;
     };
     msgboxErrorIPAddr.Show();
 }
예제 #7
0
        public override IEnumerator Update()
        {
            var layer = new ScalingLayer2D();

            layer.IsFixAspectRatio    = true;
            layer.IsUpdateScalingAuto = true;
            asd.Engine.CurrentScene.AddLayer(layer);
            layer.DrawingPriority = 3;

            var messageBox = new MessageBox();

            layer.AddObject(messageBox);
            foreach (var item in CharacterImages)
            {
                item.Position = new asd.Vector2DF(-800 - item.Texture.Size.X, 0);
                layer.AddObject(item);
            }
            yield return(0);

            var messageIterator = messageBox.Open();

            while (messageIterator.MoveNext())
            {
                CharacterImages.ForEach(obj => obj.Color = new asd.Color(255, 255, 255, (int)messageBox.Color.A));
                yield return(0);
            }
            foreach (var item in TalkElements)
            {
                var updateIterator = item.Update(this, messageBox);
                while (updateIterator.MoveNext())
                {
                    yield return(0);
                }
            }
            messageIterator = messageBox.Close();
            while (messageIterator.MoveNext())
            {
                CharacterImages.ForEach(obj => obj.Color = new asd.Color(255, 255, 255, (int)messageBox.Color.A));
                yield return(0);
            }

            layer.Dispose();
            yield return(0);
        }
        protected override void OnPreRender(EventArgs e)
        {
            MessageBox.Close();
            PreDeleteConfirmDialog.Close();
            if (IsShown)
            {
                if (WorkQueue != null)
                {
                    PreDeleteConfirmDialog.Show();
                }
                else
                {
                    MessageBox.Show();
                }
            }


            base.OnPreRender(e);
        }
예제 #9
0
 public void CloseMessageBox()
 {
     if (_messageBox != null)
     {
         if (_messageBox.GetSelectedOption() != -1)
         {
             ClientCommand command = new ClientCommand(ClientCommand.CommandType.SelectOption);
             command.SetParameter("Option", _messageBox.GetSelectedOption());
             this.AddClientCommand(command);
         }
         else
         {
             ClientCommand command = new ClientCommand(ClientCommand.CommandType.CloseMessage);
             this.AddClientCommand(command);
         }
         _messageBox.Close();
         _messageBox = null;
     }
 }
예제 #10
0
        private static async Task <EdgeType> GetInput()
        {
            Notification("Press arrow key to set hide direction");
            var gui = new MessageBox("Window Docker", "Press WASD or arrow keys to set direction");
            await gui.LaunchAndWait();

            gui.Window.SetAlwaysOnTop(true);
            gui.Window.MoveTop();

            var key = await KeyHandler.WaitKeyDown(new Key[9] {
                Key.Left, Key.Right, Key.Up, Key.Down, Key.W, Key.A, Key.S, Key.D, Key.Escape
            }, block : true);

            var dir = GetDirection(key);

            gui.Close();
            if (dir.IsNone())
            {
                Notification("Window hiding cancelled");
            }
            return(dir);
        }
 /// <summary>
 /// Closes the dialog box
 /// </summary>
 public void Hide()
 {
     PreResetConfirmDialog.Close();
     MessageBox.Close();
 }
예제 #12
0
        public static StackPanel GenerateMessageBox(string title, string text, MessageBox box)
        {
            StackPanel panel = new();

            // create title block
            TextBlock titleBlock = new();

            titleBlock.Text = title;
            Style titleBlockStyle = new Style();

            titleBlockStyle.Setters.Add(new Setter {
                Property = TextBlock.FontSizeProperty, Value = 25.0
            });
            titleBlockStyle.Setters.Add(new Setter {
                Property = TextBlock.FontWeightProperty, Value = FontWeight.Bold
            });
            titleBlockStyle.Setters.Add(new Setter {
                Property = TextBlock.TextAlignmentProperty, Value = TextAlignment.Center
            });
            titleBlock.Styles.Add(titleBlockStyle);

            // text block
            TextBlock textBlock = new();

            textBlock.Text = text;
            Style textBlockStyle = new();

            textBlockStyle.Setters.Add(new Setter {
                Property = TextBlock.FontSizeProperty, Value = 20.0
            });
            textBlockStyle.Setters.Add(new Setter {
                Property = TextBlock.TextAlignmentProperty, Value = TextAlignment.Center
            });
            textBlockStyle.Setters.Add(new Setter {
                Property = TextBlock.TextWrappingProperty, Value = TextWrapping.Wrap
            });
            textBlock.Styles.Add(textBlockStyle);

            // close button
            Button close       = new Button();
            Style  buttonStyle = new();

            buttonStyle.Setters.Add(new Setter {
                Property = Button.HorizontalAlignmentProperty, Value = HorizontalAlignment.Center
            });
            buttonStyle.Setters.Add(new Setter {
                Property = Button.FontSizeProperty, Value = 16.0
            });
            close.Styles.Add(buttonStyle);
            close.Content = "Close";
            close.Click  += (sender, args) =>
            {
                box.Close();
            };

            // add to panel
            panel.Children.Add(titleBlock);
            panel.Children.Add(textBlock);
            panel.Children.Add(close);
            return(panel);
        }
예제 #13
0
        private static void AddButtonsToForm(MessageBox msgBoxFrm, MessageBoxButtons buttons)
        {
            // Rectangle screenRectangle = msgBoxFrm.RectangleToScreen(msgBoxFrm.ClientRectangle);
            int titleHeight = 0;// screenRectangle.Top - msgBoxFrm.Top;

               // var t = Type.GetType("Mono.Runtime");
               // if ((t != null))
               //     titleHeight = 25;

            switch (buttons)
            {
                case MessageBoxButtons.OK:

                    var but = new Button("OK");

                    but.MousePressedEvent += delegate { _state = DialogResult.OK; msgBoxFrm.Close(); };
                    msgBoxFrm.Add(but);
                    break;

                case MessageBoxButtons.YesNo:
                    var butyes = new Button("Yes");

                    butyes.MousePressedEvent += delegate { _state = DialogResult.Yes; msgBoxFrm.Close(); };
                    msgBoxFrm.Add(butyes);

                    var butno = new Button("No");

                    butno.MousePressedEvent += delegate { _state = DialogResult.No; msgBoxFrm.Close(); };
                    msgBoxFrm.Add(butno);
                    break;

                default:
                    throw new NotImplementedException("Only MessageBoxButtons.OK and YesNo supported at this time");
            }
        }