示例#1
0
        /// <summary>
        /// Open a file
        /// </summary>
        /// <param name="fullPath">absolute path</param>
        public static bool Open(string fullPath)
        {
            if (System.IO.Path.GetFullPath(fullPath) != fullPath)
            {
                throw new Exception(Resources.GetString("NotAbsolutePathError"));
            }

            var dialog = new Dialog.SaveOnDisposing(
                () =>
            {
                try
                {
                    if (Core.LoadFrom(fullPath))
                    {
                        RecentFiles.AddRecentFile(fullPath);
                    }
                }
                catch (Exception e)
                {
                    var messageBox = new Dialog.MessageBox();
                    messageBox.Show("Error", e.Message);
                }

                System.IO.Directory.SetCurrentDirectory(System.IO.Path.GetDirectoryName(fullPath));
            });

            return(true);
        }
示例#2
0
        public void Update()
        {
            if (GUI.Manager.NativeManager.Begin("DebugMenu", opened))
            {
                if (GUI.Manager.NativeManager.Button("About"))
                {
                    var messageBox = new GUI.Dialog.About();
                    messageBox.Show();
                }

                if (GUI.Manager.NativeManager.Button("MessageBox"))
                {
                    var messageBox = new GUI.Dialog.MessageBox();
                    messageBox.Show("Title", "Message");
                }

                if (GUI.Manager.NativeManager.Button("NodeTreeView"))
                {
                    var nodeTreeView = new GUI.Dock.NodeTreeView();
                    nodeTreeView.Renew();
                    GUI.Manager.AddControl(nodeTreeView);
                }
            }

            GUI.Manager.NativeManager.End();
        }
示例#3
0
        public static void ShowErrorByNodeLayerLimit()
        {
            var mb = new GUI.Dialog.MessageBox();

            if (Core.Option.GuiLanguage.Value == Language.Japanese)
            {
                mb.Show("Error", "ノードツリーはルートを含めて" + Constant.NodeLayerLimit + "レイヤーまでに制限されています。");
            }
            else
            {
                mb.Show("Error", "The node tree is limited to " + Constant.NodeLayerLimit + " layers, including the root.");
            }
        }
示例#4
0
        public void Update()
        {
            var mgr = GUI.Manager.NativeManager;

            if (mgr.Begin("ViewerController", ref opened))
            {
                mgr.SliderInt("Timeline", currentTime, currentMin[0], currentMax[0]);
                mgr.Separator();
                mgr.PushItemWidth(200);
                mgr.DragIntRange2("Range", currentMin, currentMax, 1.0f, 0, 1200);
                mgr.PopItemWidth();
                mgr.SameLine();
                mgr.Button("Back_");
                mgr.SameLine();
                mgr.Button("Next");
                mgr.SameLine();

                //mgr.Image(img, 48, 21);

                if (isButton)
                {
                    if (mgr.Button("Back"))
                    {
                        var messageBox = new GUI.Dialog.About();
                        messageBox.Show();
                    }
                }
                else
                {
                    mgr.Text("Back");
                }

                if (mgr.BeginPopupContextItem("aaaaaaa"))
                {
                    if (mgr.Button("Change"))
                    {
                        isButton = !isButton;
                    }
                    mgr.EndPopup();
                }

                mgr.SameLine();

                if (mgr.Button("Play"))
                {
                    var messageBox = new GUI.Dialog.MessageBox();
                    messageBox.Show("TestTitle", "TestMessage");
                    //mgr.OpenPopup("###AA");
                }

                if (mgr.TreeNode("AAA"))
                {
                    mgr.Text("aa");

                    if (mgr.TreeNode("BBB"))
                    {
                        mgr.Text("bb");
                        mgr.Button("cc");
                        mgr.TreePop();
                    }

                    mgr.TreePop();
                }


                //if (mgr.BeginPopupModal("Message###AA", null, swig.WindowFlags.AlwaysAutoResize))
                //{
                //    mgr.Text("testaaaaaaa");
                //    mgr.EndPopup();
                //}
            }
            mgr.End();
        }
示例#5
0
        public static void ShowErrorByNodeLayerLimit()
        {
            var mb = new GUI.Dialog.MessageBox();

            mb.Show("Error", String.Format(Resources.GetString("LayerLimitError"), Constant.NodeLayerLimit));
        }