Inheritance: EditorWindow
Exemple #1
0
        public override void Present(FrameworkElement frameworkElement)
        {
            //grab the attribute off of the view
            var attribute = frameworkElement
                            .GetType()
                            .GetCustomAttributes(typeof(RegionAttribute), true)
                            .FirstOrDefault() as RegionAttribute;

            var regionName = null == attribute ? Region.Unknown : attribute.Region;

            //based on region decide where we are going to show it
            switch (regionName)
            {
            case Region.FullScreen:
                mainWindow.Content = frameworkElement;
                break;

            case Region.ModalWindow:
                //set the base tab
                modalWindow = new ModalWindow();

                modalWindow.Content = frameworkElement;
                modalWindow.Left    = ((Window)mainWindow).Left + ((Window)mainWindow).Width;
                modalWindow.Top     = ((Window)mainWindow).Top;
                modalWindow.Title   = ((BaseView)frameworkElement).WindowTitle;
                modalWindow.Height  = ((BaseView)frameworkElement).Height;
                modalWindow.Width   = ((BaseView)frameworkElement).Width;
                //xxx confirm this is going to work for other operations in the system
                modalWindow.ShowDialog();
                break;
            }
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ModalBase"/> class.
        /// </summary>
        public ModalBase()
        {
            mDialogWindow = new ModalWindow();

            // Create the default close command by marking the modal as confirmed
            CloseCommand = new RelayCommand(p => mDialogWindow.DialogResult = true);
        }
    /// <summary>
    /// Ouvre une popup en instantiant une nouvelle fenêtre
    /// </summary>
    public void Open()
    {
        ModalWindow l_ModalWindow = Instantiate(m_Prefab_WindowModel).GetComponent <ModalWindow>();

        m_List_OpenedWindows.Add(l_ModalWindow);
        l_ModalWindow.Init();
    }
Exemple #4
0
        /// <summary>
        /// Отображает модальное диалоговое окно с указанным представлением.
        /// </summary>
        /// <param name="viewModel">Указывает на представление, которое необходимо отобразить в модальном окне.</param>
        public bool ShowModalWindow(BaseVM viewModel, string caption = "", ModalWindowButtons buttonType = ModalWindowButtons.OnlyOkButton,
                                    string btnOkText         = "Ок", string btnCancelText = "Отмена",
                                    Action <BaseVM> okResult = null, Action <BaseVM> cancelResult = null)
        {
            var result = false;

            if (viewModelToViewMap.TryGetValue(viewModel.GetType(), out Type viewType))
            {
                var view = Activator.CreateInstance(viewType) as BaseView;
                view.ViewModel = viewModel;

                var modalWindow = new ModalWindow(view)
                {
                    Owner = mainWindow
                };
                modalWindow.DataContext = new ModalWindowVM(this, caption, buttonType, btnOkText, btnCancelText);

                result = modalWindow.ShowDialog() ?? false;

                if (result)
                {
                    okResult?.Invoke(viewModel);
                }
                else
                {
                    cancelResult?.Invoke(viewModel);
                }
            }

            return(result);
        }
        private void InitializeListView()
        {
            try
            {
                lvVariables.ItemsSource = _variables;

                GridView view = (GridView)lvVariables.View;

                //TODO: Set Headers from resource file
                //view.Columns[0].Header = SourceCode.Extenders.WindowsDesigner.Resources.Resource.lblGridPage_lvSampleItemsName;
                //view.Columns[1].Header = SourceCode.Extenders.WindowsDesigner.Resources.Resource.lblGridPage_lvSampleItemsValue;


                FrameworkElementFactory fe = new FrameworkElementFactory(typeof(FieldPartRenderer));
                fe.SetValue(FieldPartRenderer.K2FieldProperty, new Binding("VariableValue"));

                DataTemplate dt = new DataTemplate(typeof(FieldPartRenderer));
                dt.VisualTree = fe;

                view.Columns[1].CellTemplate = dt;



                if (lvVariables.ItemContainerStyle == null)
                {
                    lvVariables.ItemContainerStyle = new Style(typeof(ListViewItem));
                }
            }
            catch (Exception Ex)
            {
                ModalWindow.ShowMessage(base.Wizard.Host.WindowHandle, ModalWindowIconTypes.Error, "K2", Ex.Message.ToString(), new ModalWindowButtonTypes[] { ModalWindowButtonTypes.OK });
            }
        }
 public void CloseModal()
 {
     if (ModalActivation)
     {
         ModalWindow.SetVisibility(false);
     }
 }
    // Use this for initialization
    void Start()
    {
        modalWindow = ModalWindow.Instance();

        myconfirmAction = new UnityAction(ConfirmAction);

        startMessage      = Resources.Load("Story/Mission 1/Message1.1") as TextAsset;
        startLog          = Resources.Load("QuestLogs/StartLog") as TextAsset;
        objective1Message = Resources.Load("Story/Mission 1/Message1.2") as TextAsset;
        objective1Log     = Resources.Load("QuestLogs/QuestLog1") as TextAsset;
        objective2Message = Resources.Load("Story/Mission 1/Message1.3") as TextAsset;
        objective2Log     = Resources.Load("QuestLogs/QuestLog2") as TextAsset;
        objective3Message = Resources.Load("Story/Mission 1/Message1.4") as TextAsset;
        objective3Log     = Resources.Load("QuestLogs/QuestLog3") as TextAsset;
        objective4Message = Resources.Load("Story/Mission 1/Message1.5") as TextAsset;
        objective4Log     = Resources.Load("QuestLogs/QuestLog4") as TextAsset;
        objective5Message = Resources.Load("Story/Mission 1/Message1.6") as TextAsset;
        objective5Log     = Resources.Load("QuestLogs/QuestLog5") as TextAsset;
        objective6Message = Resources.Load("Story/Mission 1/Message1.7") as TextAsset;
        objective6Log     = Resources.Load("QuestLogs/QuestLog6") as TextAsset;


        modalWindow.Confirm(startMessage.text, "Mission Update: ", myconfirmAction);
        InfoManager.q = startLog;
    }
        public void TearOff(ViewModelBase vm)
        {
            if (!vm.IsTearOff)
            {
                var modalWindow = new ModalWindow {
                    DataContext = vm,
                };

                modalWindow.Show();
                vm.IsTearOff = true;
                TearOffViewModels.Add(vm, modalWindow);

                foreach (var region in regionManager.Regions)
                {
                    IRegion containingRegion = null;
                    if (region.ActiveViews.Contains(vm))
                    {
                        containingRegion = region;
                        region.Remove(vm);
                    }
                    if (containingRegion != null)
                    {
                        var view = containingRegion.Views.LastOrDefault();
                        if (view != null)
                        {
                            containingRegion.Activate(view);
                        }
                    }
                }
            }
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var window = new ModalWindow(OutputConsole);

            window.Show();
            consolecc.Content = new Frame();
            outputtab.Height  = 25;
        }
        public bool ShowParameters()
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new SettingsViewModel();

            modalWindow.DataContext = vm;
            return(modalWindow.ShowDialog().Value);
        }
Exemple #11
0
    public void OpenPistaDialogEditor(PistaItem pista)
    {
        pista.speech           = (SpeechManager)EditorGUILayout.ObjectField("Speech Canvas", pista.speech, typeof(SpeechManager), true);
        pista.data.displayName = EditorGUILayout.TextField("Nome Display", pista.data.displayName);
        pista.data.itemId      = EditorGUILayout.TextField("ID do item", pista.data.itemId);

        EditorGUILayout.LabelField("Descrição do item");
        pista.data.itemDescription = EditorGUILayout.TextArea(pista.data.itemDescription, GUILayout.Height(50));

        string[] pistaKeys = pista.manager.textureManager.getPistaKeys();
        string[] posesKeys = pista.manager.textureManager.getPoseKeys();

        int imageValue = EditorGUILayout.Popup("Ícone pista", pista.manager.textureManager.getIndexByKeyPista(pista.data.image), pistaKeys);

        pista.data.image = pistaKeys[imageValue];
        GUI.DrawTexture(new Rect(10, 160, 100, 100), pista.manager.textureManager.pistas[imageValue].sprite.texture);
        GUILayout.Space(120);

        if (GUILayout.Button("Editar diálogo"))
        {
            //Modal para criar o diálogo
            var win = new ModalWindow(new Rect(30, 30, position.width - 60, position.height - 60), "CreateDialog", (w) =>
            {
                pista.data.dialogo.enabled = EditorGUILayout.Toggle("Destravado", pista.data.dialogo.enabled);
                if (GUILayout.Button("Adicionar Texto"))
                {
                    pista.data.dialogo.texts.Add(new TextData());
                }

                for (int j = 0; j < pista.data.dialogo.texts.Count; j++)
                {
                    GUILayout.Label("Texto " + j, EditorStyles.boldLabel);
                    pista.data.dialogo.texts[j].texto = EditorGUILayout.TextArea(pista.data.dialogo.texts[j].texto);
                    GUILayout.BeginHorizontal("box");
                    pista.data.dialogo.texts[j].owner = EditorGUILayout.TextField("Quem tá falando", pista.data.dialogo.texts[j].owner);

                    int index = pista.manager.textureManager.getIndexByKeyPose(pista.data.dialogo.texts[j].image);
                    if (index == -1)
                    {
                        index = 0;
                    }
                    int digValue = EditorGUILayout.Popup("Imagem", index, posesKeys);
                    pista.data.dialogo.texts[j].image = posesKeys[digValue];

                    GUILayout.EndHorizontal();
                    GUILayout.Space(10);
                }

                if (GUILayout.Button("Fechar"))
                {
                    w.Close();
                }

                GUI.DragWindow();
            });
            modalWindows.Add(win);
        }
    }
        private void OpenEditCustomerWindow()
        {
            ModalWindow modalWindow = new ModalWindow();
            AddOrEditCustomerViewModel editCustomerViewModel = new EditCustomerViewModel(SelectedCustomer);

            editCustomerViewModel.ClosedWindow += modalWindow.OnWindowClosed;
            editCustomerViewModel.CustomerSend += this.OnCustomerSend;
            modalWindow.ShowWindow(editCustomerViewModel, Lang.EditCustomer);
        }
        private void OpenAddCustomerWindow()
        {
            ModalWindow modalWindow = new ModalWindow();
            AddOrEditCustomerViewModel addCustomerViewModel = new AddCustomerViewModel();

            addCustomerViewModel.ClosedWindow += modalWindow.OnWindowClosed;
            addCustomerViewModel.CustomerSend += this.OnCustomerSend;
            modalWindow.ShowWindow(addCustomerViewModel, Lang.AddCustomer);
        }
        private void AjouterTaches(object o)
        {
            LogicielCourant = (Logiciel)CollectionViewSource.GetDefaultView(Logiciels).CurrentItem;
            VersionCourante = (Entity.Version)CollectionViewSource.GetDefaultView(LogicielCourant.Versions).CurrentItem;
            var dlg = new ModalWindow(new VMSaisieTache(LogicielCourant.CodeLogiciel, VersionCourante.NumVersion));

            dlg.Title = "Saisie des tâches de production";
            bool?res = dlg.ShowDialog();
        }
Exemple #15
0
 public PointOfInterest(int id, int x, int y, int floorNumber)
     : base(id, x, y, floorNumber)
 {
     detected = false;
     contents = new List<ExhibitionContent>();
     descriptionList = new List<Description>();
     observers = new List<Observer>();
     popUpWindow = PopUpWindow.Instance();
     modalWindow = ModalWindow.Instance();
 }
Exemple #16
0
    public static ModalWindow Instance()
    {
        if (!modalPanel) {
            modalPanel = FindObjectOfType (typeof(ModalWindow)) as ModalWindow;
            if (!modalPanel)
                Debug.LogError ("There needs to be one active ModalPanel script on a GameObject in your scene.");
        }

        return modalPanel;
    }
        void EntitySetupBase.LoadData()
        {
            ph.AddControlsReturnThis(
                new Paragraph("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed quis semper dui. Aenean egestas dolor ac elementum lacinia. Vestibulum eget."));

            one = new ModalWindow(this, new Paragraph("Test!"));
            two = new ModalWindow(
                this,
                new EwfImage(new ExternalResourceInfo("http://i3.microsoft.com/en/shared/templates/components/cspMscomHeader/m_head_blend.png")));
        }
Exemple #18
0
    public void ShowMyDialog()
    {
        // create the modal dialog
        ModalWindow window = new ModalWindow();

        // bind the event
        window.OnCallMyMethod += MyMethod;
        // show dialog
        window.ShowDialog();
    }
        public static IntPtr GetModalWindow(
            IntPtr owner)
        {
            var window = new ModalWindow();

            WindowNative.EnumThreadWindows(
                WindowNative.GetCurrentThreadId(),
                window.EnumChildren, owner);

            return(window.MaxOwnershipHandle);
        }
        public GameRom ShowGameDetail(GameRom game)
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new GameDetailViewModel(game);

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.GameCurrent);
            }
            return(null);
        }
        public string CreateJsonSys()
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new AddSystemeViewModel();

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.ResultJson);
            }
            return(null);
        }
        public string OpenDetailEmu(Emulator emu)
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new CreateEmulateurModalViewModel(emu);

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.ResultJson);
            }
            return(null);
        }
        public string showImgPickerForPlateformeDialog(Systeme title, string themename, ScraperType scraperType)
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new GetPictureForSystemViewModel(title, themename, scraperType);

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.ResultPath);
            }
            return(null);
        }
        public string SearchVideo(GameRom game, ScraperType type, ScraperSource source)
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new VideoFinderSearchViewModel(game, source, type);

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.ResultPath);
            }
            return(null);
        }
        public Search SearchSteamGridDBByName(string name, ScraperSource source)
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new SteamGridDBGameFinderViewModel(name, source);

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.Resultgame);
            }
            return(null);
        }
        public List <GameRom> AddGamesToCollection(string collecName, IEnumerable <GameRom> foundedgame)
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new AddGamesToCollectionViewModel(collecName, foundedgame);

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.Resultgame);
            }
            return(null);
        }
        public List <GameRom> ShowSteamGamesFounded(List <GameRom> foundedgame)
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new SteamGamesFoundedViewModel(foundedgame);

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.Resultgame);
            }
            return(null);
        }
        public Systeme ShowSystemeDetail(Systeme sys)
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new SystemeDetailViewModel(sys);

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.Sys);
            }
            return(null);
        }
        public string CreateRetroarchCore()
        {
            ModalWindow modalWindow = new ModalWindow();
            var         vm          = new AddRetroArchCoreViewModel();

            modalWindow.DataContext = vm;
            if (modalWindow.ShowDialog().Value)
            {
                return(vm.ResultJson);
            }
            return(null);
        }
Exemple #30
0
 public static ModalWindow Instance()
 {
     if (!modalWindow)
     {
         modalWindow = FindObjectOfType(typeof(ModalWindow)) as ModalWindow;
         if (!modalWindow)
         {
             Debug.LogError("There needs to be one active ModalWindow script on a GameObject in your scene");
         }
     }
     return(modalWindow);
 }
Exemple #31
0
    /// <summary>
    /// Coroutine for showing the window.
    /// </summary>
    /// <returns>Coroutine.</returns>
    public IEnumerator ShowInstructionsWindow()
    {
        if (!Instructions.Instance)
        {
            yield return(GameManager.Instance.LoadSceneAdditive("MainMenu.UI.Instructions"));
        }

        if (Instructions.Instance)
        {
            yield return(ModalWindow.Open(Instructions.Instance, this.OpenInstructionsWindow, this.CloseInstructionsWindow));
        }
    }
Exemple #32
0
        public static void Run(Action action, string title, string message)
        {
            var window = ModalWindow.CreateWindow(title, new Vector2(250, 40), new Label.Label(message));

            EditorApplication.delayCall += () =>
            {
                EditorApplication.delayCall += () =>
                {
                    action.InvokeSafe();
                    window.Close();
                };
            };
        }
Exemple #33
0
        void Awake()
        {
            beacon = BeaconGameObject.GetComponent<iBeaconServer>();
            sounds = GetComponents<AudioSource>();
               // popUp = sounds[0];
            //beforeSound = sounds[1];
            observers = new List<Observer>();
            detected = false;

            popUpWindow = PopUpWindow.Instance();
            summaryWindow = SummaryWindow.Instance();
            viewVideoAction = new UnityAction(POIplayVideo);

            modalWindow = ModalWindow.Instance();

            myViewAction = new UnityAction(displaySummary);
            myCloseAction = new UnityAction(popUpWindow.closePanel);
        }
    void Awake()
    {
        modalWindow = ModalWindow.Instance ();

        myConfirmAction = new UnityAction (TestConfirmFunction);
    }
Exemple #35
0
 void Awake()
 {
     modalWindow = ModalWindow.Instance();
     yesAction = new UnityAction(iBeaconReceiver.EnableBluetooth);
     noAction = new UnityAction(modalWindow.closePanel);
 }
Exemple #36
0
 void Awake()
 {
     modalWindow = ModalWindow.Instance();
     yesAction = new UnityAction(ApplicationQuit);
     noAction = new UnityAction(modalWindow.closePanel);
 }
    // Use this for initialization
    void Start()
    {
        modalWindow = ModalWindow.Instance ();

        myconfirmAction = new UnityAction (ConfirmAction);

        startMessage = Resources.Load ("Story/Mission 1/Message1.1") as TextAsset;
        startLog = Resources.Load ("QuestLogs/StartLog") as TextAsset;
        objective1Message = Resources.Load ("Story/Mission 1/Message1.2") as TextAsset;
        objective1Log = Resources.Load ("QuestLogs/QuestLog1") as TextAsset;
        objective2Message = Resources.Load ("Story/Mission 1/Message1.3") as TextAsset;
        objective2Log = Resources.Load ("QuestLogs/QuestLog2") as TextAsset;
        objective3Message = Resources.Load ("Story/Mission 1/Message1.4") as TextAsset;
        objective3Log = Resources.Load ("QuestLogs/QuestLog3") as TextAsset;
        objective4Message = Resources.Load ("Story/Mission 1/Message1.5") as TextAsset;
        objective4Log = Resources.Load ("QuestLogs/QuestLog4") as TextAsset;
        objective5Message = Resources.Load ("Story/Mission 1/Message1.6") as TextAsset;
        objective5Log = Resources.Load ("QuestLogs/QuestLog5") as TextAsset;
        objective6Message = Resources.Load ("Story/Mission 1/Message1.7") as TextAsset;
        objective6Log = Resources.Load ("QuestLogs/QuestLog6") as TextAsset;

        modalWindow.Confirm(startMessage.text,"Mission Update: ", myconfirmAction);
        InfoManager.q = startLog;
    }
 void Objective6()
 {
     modalWindow = ModalWindow.Instance();
     modalWindow.Confirm(objective6Message.text,"Mission Update: ", myconfirmAction);
     InfoManager.q = objective6Log;
 }
 public void RegisterWindow(ModalWindow window)
 {
     windowManager.Add(window.id,window);
 }
 public void UnregisterWindow(ModalWindow window)
 {
     windowManager.Remove(window.id);
 }