Exemple #1
0
        /////////////////////////////////////////

        public PackagesWindow()
        {
            InitializeComponent();

            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            if (EditorAPI.DarkTheme)
            {
                EditorThemeUtility.ApplyDarkThemeToForm(kryptonSplitContainer1.Panel1);
                EditorThemeUtility.ApplyDarkThemeToForm(kryptonSplitContainer1.Panel2);

                EditorThemeUtility.ApplyDarkThemeToToolTip(toolTip1);
            }

            double distance = 22.0 * EditorAPI.DPIScale;

            kryptonSplitContainer2.Panel1MinSize    = (int)distance;
            kryptonSplitContainer2.SplitterDistance = (int)distance;

            if (EditorAPI.DPIScale >= 2)
            {
                this.buttonUpdateList.Values.Image = global::NeoAxis.Properties.Resources.Refresh_32;
            }

            WindowTitle = EditorLocalization.Translate("PackagesWindow", WindowTitle);
        }
Exemple #2
0
        //

        public SettingsHeader_ObjectInfo()
        {
            InitializeComponent();

            buttonTypeSettings.Values.Image = EditorResourcesCache.Type;

            toolTip1.SetToolTip(buttonTypeSettings, EditorLocalization.Translate("SettingsWindow", "Type Settings"));
            toolTip1.SetToolTip(buttonTypeSettingsDefaultValue, EditorLocalization.Translate("SettingsWindow", "Reset Type Settings to default."));
            EditorThemeUtility.ApplyDarkThemeToToolTip(toolTip1);
        }
        //

        public EngineToolStrip()
            : base()
        {
            ShowItemToolTips = false;
            timer            = new Timer();
            timer.Enabled    = false;
            timer.Interval   = SystemInformation.MouseHoverTime;
            timer.Tick      += new EventHandler(timer_Tick);
            Tooltip          = new ToolTip();
            EditorThemeUtility.ApplyDarkThemeToToolTip(Tooltip);
        }
Exemple #4
0
        //

        public HCGridEvent()
        {
            InitializeComponent();

            buttonEditEventHandlers.Values.Image = EditorResourcesCache.Edit;
            buttonAddEventHandler.Values.Image   = EditorResourcesCache.New;

            EditorThemeUtility.ApplyDarkThemeToForm(this);
            EditorThemeUtility.ApplyDarkThemeToToolTip(eventToolTip);

            eventToolTip.SetToolTip(buttonAddEventHandler, EditorLocalization.Translate("SettingsWindow", "Add event handler."));
            eventToolTip.SetToolTip(buttonEditEventHandlers, EditorLocalization.Translate("SettingsWindow", "Edit event handlers."));
        }
        //

        public HCGridProperty()
        {
            InitializeComponent();

            //DoubleBuffered = true;
            ResizeRedraw = true;

            EditorThemeUtility.ApplyDarkThemeToForm(this);
            EditorThemeUtility.ApplyDarkThemeToToolTip(propertyToolTip);

            //!!!!
            //BackColor = Random.Generate(ColorValue.Zero, ColorValue.One).ToColor();
        }
        void timer_Tick(object sender, EventArgs e)
        {
            timer.Stop();
            try
            {
                Point currentMouseOverPoint;
                if (ToolTipShowUp)
                {
                    currentMouseOverPoint = this.PointToClient(new Point(Control.MousePosition.X, Control.MousePosition.Y - Cursor.Current.Size.Height + Cursor.Current.HotSpot.Y));
                }
                else
                {
                    currentMouseOverPoint = this.PointToClient(new Point(Control.MousePosition.X, Control.MousePosition.Y + Cursor.Current.Size.Height - Cursor.Current.HotSpot.Y));
                }

                if (mouseOverItem == null)
                {
                    if (ToolTipText != null && ToolTipText.Length > 0)
                    {
                        if (Tooltip == null)
                        {
                            Tooltip = new ToolTip();
                            EditorThemeUtility.ApplyDarkThemeToToolTip(Tooltip);
                        }
                        Tooltip.Show(ToolTipText, this, currentMouseOverPoint, ToolTipInterval);
                    }
                }
                else if ((!(mouseOverItem is ToolStripDropDownButton) && !(mouseOverItem is ToolStripSplitButton)) ||
                         ((mouseOverItem is ToolStripDropDownButton) && !((ToolStripDropDownButton)mouseOverItem).DropDown.Visible) ||
                         (((mouseOverItem is ToolStripSplitButton) && !((ToolStripSplitButton)mouseOverItem).DropDown.Visible)))
                {
                    if (mouseOverItem.ToolTipText != null && mouseOverItem.ToolTipText.Length > 0 && Tooltip != null)
                    {
                        if (Tooltip == null)
                        {
                            Tooltip = new ToolTip();
                            EditorThemeUtility.ApplyDarkThemeToToolTip(Tooltip);
                        }
                        Tooltip.Show(mouseOverItem.ToolTipText, this, currentMouseOverPoint, ToolTipInterval);
                    }
                }
            }
            catch
            { }
        }
        //

        public StartPageWindow()
        {
            InitializeComponent();

            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            if (EditorAPI.DarkTheme)
            {
                BackColor = Color.FromArgb(40, 40, 40);
                EditorThemeUtility.ApplyDarkThemeToToolTip(toolTip1);
            }

            contentBrowserNewScene.Options.PanelMode = ContentBrowser.PanelModeEnum.List;
            contentBrowserNewScene.Options.ListMode  = ContentBrowser.ListModeEnum.Tiles;
            contentBrowserNewScene.UseSelectedTreeNodeAsRootForList = false;
            contentBrowserNewScene.Options.Breadcrumb    = false;
            contentBrowserNewScene.Options.TileImageSize = 100;
            //contentBrowserNewScene.Options.TileImageSize = 128;

            //add items
            try
            {
                var items = new List <ContentBrowser.Item>();

                //scenes
                foreach (var template in Component_Scene.NewObjectSettingsScene.GetTemplates())
                {
                    contentBrowserNewScene.AddImageKey(template.Name, template.Preview);

                    var item = new ContentBrowserItem_Virtual(contentBrowserNewScene, null, template.ToString() + " scene");
                    item.Tag      = template;
                    item.imageKey = template.Name;

                    items.Add(item);
                }

                //UI Control
                {
                    var path = VirtualPathUtility.GetRealPathByVirtual(@"Base\Tools\NewResourceTemplates\UIControl.ui");
                    if (File.Exists(path))
                    {
                        var name = Path.GetFileNameWithoutExtension(path);

                        if (previewImageNewUIControl == null)
                        {
                            var previewPath = Path.Combine(Path.GetDirectoryName(path), name + ".png");
                            previewImageNewUIControl = File.Exists(previewPath) ? Image.FromFile(previewPath) : null;
                        }

                        if (previewImageNewUIControl != null)
                        {
                            contentBrowserNewScene.AddImageKey(name, previewImageNewUIControl);
                        }

                        var item = new ContentBrowserItem_Virtual(contentBrowserNewScene, null, "UI Control");
                        item.Tag = "UIControl";
                        if (previewImageNewUIControl != null)
                        {
                            item.imageKey = name;
                        }

                        items.Add(item);
                    }
                }

                //Select resource
                {
                    var name = "SelectResource";

                    if (previewImageNewResource == null)
                    {
                        var previewPath = VirtualPathUtility.GetRealPathByVirtual(@"Base\Tools\NewResourceTemplates\Resource.png");
                        previewImageNewResource = File.Exists(previewPath) ? Image.FromFile(previewPath) : null;
                    }

                    if (previewImageNewResource != null)
                    {
                        contentBrowserNewScene.AddImageKey(name, previewImageNewResource);
                    }

                    var item = new ContentBrowserItem_Virtual(contentBrowserNewScene, null, "Select type");
                    item.Tag = "Resource";
                    if (previewImageNewResource != null)
                    {
                        item.imageKey = name;
                    }

                    items.Add(item);
                }

                ////!!!!
                //{
                //	var item = new ContentBrowserItem_Virtual( contentBrowserNewScene, null, "C# Class Library" );
                //	//!!!!
                //	//item.Tag = template;
                //	item.imageKey = "";//template.Name;

                //	item.ShowDisabled = true;

                //	items.Add( item );
                //}

                ////!!!!
                //{
                //	var item = new ContentBrowserItem_Virtual( contentBrowserNewScene, null, "Executable App" );
                //	//!!!!
                //	//item.Tag = template;
                //	item.imageKey = "";//template.Name;

                //	item.ShowDisabled = true;

                //	items.Add( item );
                //}

                if (items.Count != 0)
                {
                    contentBrowserNewScene.SetData(items, false);
                    contentBrowserNewScene.SelectItems(new ContentBrowser.Item[] { items[0] });
                }
            }
            catch (Exception exc)
            {
                Log.Warning(exc.Message);
                //contentBrowserNewScene.SetError( "Error: " + exc.Message );
            }

            contentBrowserNewScene.ItemAfterChoose += ContentBrowserNewScene_ItemAfterChoose;


            contentBrowserOpenScene.Options.PanelMode = ContentBrowser.PanelModeEnum.List;
            contentBrowserOpenScene.Options.ListMode  = ContentBrowser.ListModeEnum.List;
            contentBrowserOpenScene.UseSelectedTreeNodeAsRootForList = false;
            contentBrowserOpenScene.Options.Breadcrumb = false;

            var imageSize = EditorAPI.DPIScale >= 1.25f ? 13 : 16;

            contentBrowserOpenScene.Options.ListImageSize   = imageSize;
            contentBrowserOpenScene.Options.ListColumnWidth = 10000;
            contentBrowserOpenScene.ListViewModeOverride    = new EngineListView.DefaultListMode(contentBrowserOpenScene.GetListView(), imageSize);

            contentBrowserOpenScene.PreloadResourceOnSelection = false;

            UpdateOpenScenes();

            WindowTitle = EditorLocalization.Translate("StartPageWindow", WindowTitle);
        }