Exemple #1
0
        void OnEnable()
        {
            var root            = rootVisualElement;
            var visualTreeAsset = Resources.Load <VisualTreeAsset>(INI_WINDOW_UXML);
            var visualTree      = visualTreeAsset.CloneTree();

            visualTree.SetWidth(100, LengthUnit.Percent);
            visualTree.SetHeight(100, LengthUnit.Percent);
            root.Add(visualTree);

            visualTree.AssignQueryResults(this);

            toolbarCreateBtn.clicked += () =>
            {
                var x = root.layout.x + toolbarCreateBtn.layout.x;
                var y = root.layout.y + toolbarCreateBtn.layout.y;

                x += Input.mousePosition.x + position.x;
                y += Input.mousePosition.y + position.y;

                x = toolbarCreateBtn.worldBound.x;
                y = toolbarCreateBtn.worldBound.y;

                CustomPopupWindow.OpenWindow(new Rect(x, y, 400, 300), null, true, false);
            };
            toolbarOpenBtn.clicked += () =>
            {
            };
            toolbarSaveBtn.clicked += () =>
            {
            };
            toolbarSaveAsBtn.clicked += () =>
            {
            };

            m_SectionListView = new IniSectionListView();
            m_SectionView     = new IniSectionView();

            TwoPaneSplitView splitView = new TwoPaneSplitView(0, 200, TwoPaneSplitViewOrientation.Horizontal);

            splitView.Add(m_SectionListView);
            splitView.Add(m_SectionView);
            m_ContentContainer.Add(splitView);
        }