示例#1
0
        public NewObjectWindow()
        {
            InitializeComponent();

            //KryptonSplitContainer childs layout broken. see comments in kryptonsplitcontainer.cs. Also Anchors works strange in .NET Core.
            panelName.Width = panelName.Parent.Width - DpiHelper.Default.ScaleValue(9);

            //options
            if (sharedOptions != null)
            {
                contentBrowser1.Options = sharedOptions;
            }
            else
            {
                if (!Config_Load())
                {
                    ////var data = new ContentBrowser.ResourcesModeDataClass();
                    ////data.selectionMode = ResourceSelectionMode.None;
                    //contentBrowser1.Init( null, null, /*data, */null );
                    contentBrowser1.Options.PanelMode        = ContentBrowser.PanelModeEnum.TwoPanelsSplitHorizontally;
                    contentBrowser1.Options.SplitterPosition = 3.0 / 5.0;
                }

                sharedOptions = contentBrowser1.Options;
            }

            CloseByEscape = true;

            WindowTitle = EditorLocalization.Translate("NewObjectWindow", WindowTitle);
            EditorLocalization.TranslateForm("NewObjectWindow", eUserControl1);

            EditorThemeUtility.ApplyDarkThemeToForm(eUserControl1);
            EditorThemeUtility.ApplyDarkThemeToForm(panelName);
        }
示例#2
0
        protected override void OnCreatePanelControl(PanelData panel)
        {
            base.OnCreatePanelControl(panel);

            var component = panel.documentWindow.Document.ResultComponent;

            //var component = panel.documentWindow.ObjectOfWindow as Component;
            //if( panel.documentWindow.LoadedResource != null )
            //	component = panel.documentWindow.GetDocumentObject() as Component;

            if (component != null)
            {
                var browser = new ContentBrowser();                // documentObject as Component );

                if (sharedOptions != null)
                {
                    browser.Options = sharedOptions;
                }
                else
                {
                    Config_Load(browser);
                    sharedOptions = browser.Options;
                }

                browser.Mode = ContentBrowser.ModeEnum.Objects;
                browser.CanSelectObjectSettings              = true;
                browser.Options.FilteringModeButton          = false;
                browser.Options.DisplayPropertiesSortFilesBy = false;
                browser.Options.DisplayPropertiesOpenButton  = false;
                browser.TreeViewBorderDraw = BorderSides.Top;
                browser.ListViewBorderDraw = BorderSides.Top;
                browser.MultiSelect        = true;
                //!!!!было до redesign
                //browser.ItemAfterSelect += ContentBrowser_ItemAfterSelect;
                //browser.ItemAfterChoose += ContentBrowser_ItemAfterChoose;

                browser.Init(panel.documentWindow, component, /*null,*/ null);
                panel.control      = browser;
                panel.control.Dock = DockStyle.Fill;
                Controls.Add(panel.control);
                browser.ItemAfterSelect += Browser_ItemAfterSelect;

                SelectItemsOfSelectedObjects(panel.documentWindow);
            }
            else
            {
                panel.control      = new UserControl();
                panel.control.Dock = DockStyle.Fill;
                Controls.Add(panel.control);
            }
        }