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);
        }
Exemple #2
0
        /////////////////////////////////////

        public SpecifyParametersForm(string caption, object optionalObjectProvider, CheckDelegate checkHandler = null, OKDelegate okHandler = null)
        {
            this.checkHandler = checkHandler;
            this.okHandler    = okHandler;

            InitializeComponent();

            if (optionalObjectProvider != null)
            {
                hierarchicalContainer1.SetData(null, new object[] { optionalObjectProvider });
            }
            else
            {
                hierarchicalContainer1.SetData(null, new object[] { objectImpl });
            }

            if (string.IsNullOrEmpty(caption))
            {
                Text = EngineInfo.NameWithVersion;
            }
            else
            {
                Text = caption;
            }

            labelError.Text = "";

            EditorThemeUtility.ApplyDarkThemeToForm(this);
            labelError.ForeColor = Color.Red;
        }
Exemple #3
0
        //

        public OKCancelTextBoxForm(string labelText, string textBoxText, string caption, CheckDelegate checkHandler, OKDelegate okHandler)
        {
            this.checkHandler = checkHandler;
            this.okHandler    = okHandler;

            InitializeComponent();

            this.labelText.Text = labelText;
            textBoxName.Text    = textBoxText;

            if (string.IsNullOrEmpty(caption))
            {
                Text = EngineInfo.NameWithVersion;
            }
            else
            {
                Text = caption;
            }

            labelError.Text = "";

            EditorThemeUtility.ApplyDarkThemeToForm(this);

            buttonOK.Text     = EditorLocalization.Translate("General", buttonOK.Text);
            buttonCancel.Text = EditorLocalization.Translate("General", buttonCancel.Text);
        }
        public RangeDropDownControl(HCItemProperty itemProperty)
        {
            InitializeComponent();

            AddOkCancelButtons(out _, out _);

            this.itemProperty = itemProperty;

            rangeAttr = (RangeAttribute)itemProperty.Property.GetCustomAttributes(typeof(RangeAttribute)).FirstOrDefault();
            if (rangeAttr == null)
            {
                rangeAttr = new RangeAttribute(0, 100);                   // default
            }
            SetupUIApplicableRange();

            minTrackBar.ValueChanged += new EventHandler(anyTrackBar_ValueChanged);
            maxTrackBar.ValueChanged += new EventHandler(anyTrackBar_ValueChanged);

            object obj = ReferenceUtility.GetUnreferencedValue(itemProperty.GetValues()[0]);

            value = RangeConverter.ObjectToRange(obj);

            propertyItemForUndoSupport = itemProperty.GetItemInHierarchyToRestoreValues();
            propertyItemForUndoSupport.SaveValuesToRestore();

            UpdateTrackBarsAndTextBoxes();

            EditorThemeUtility.ApplyDarkThemeToForm(this);
        }
        public ContentBrowserOptionsForm(ContentBrowser browser)
        {
            Browser = browser;

            InitializeComponent();

            EditorThemeUtility.ApplyDarkThemeToForm(this);

            Text = EditorLocalization.Translate("ContentBrowser", Text);
            EditorLocalization.TranslateForm("ContentBrowser", this);

            hierarchicalContainer1.OverridePropertyDisplayName += HierarchicalContainer1_PropertyDisplayNameOverride;
            hierarchicalContainer1.OverridePropertyEnumItem    += HierarchicalContainer1_OverridePropertyEnumItem;

            if (EditorLocalization.WideLanguage)
            {
                hierarchicalContainer1.SplitterRatio = 0.5f;
            }

            if (Browser != null)
            {
                object[] objects = new object[1];
                objects[0] = Browser.Options;
                hierarchicalContainer1.SetData(null, objects);

                //fix delayed update
                hierarchicalContainer1.UpdateItems();
            }
        }
Exemple #6
0
        //

        public StoreDocumentWindow()
        {
            InitializeComponent();

            WindowTitle = EditorLocalization.Translate("StoreDocumentWindow", WindowTitle);
            EditorThemeUtility.ApplyDarkThemeToForm(panelToolbar);
        }
        public ScriptDropDownControl(HCItemProperty itemProperty)
        {
            InitializeComponent();

            Resizable             = true;
            UseFormDropDownHolder = true;
            //DoubleBuffered = true;
            ResizeRedraw = true;
            //MinimumSize = Size;
            //MaximumSize = new Size( Size.Width * 2, Size.Height * 2 );

            AddOkCancelButtons(out _, out _);

            this.itemProperty = itemProperty;

            propertyItemForUndoSupport = itemProperty.GetItemInHierarchyToRestoreValues();
            propertyItemForUndoSupport.SaveValuesToRestore();

            try
            {
                scriptEditorControl.Initialize(new HCItemPropertyScriptAdapter(itemProperty));
            }
            catch (Exception exc)
            {
                Log.Warning("Script editor control init failed: \n\n" + exc.ToString());
                Enabled = false;
            }

            EditorThemeUtility.ApplyDarkThemeToForm(this);
        }
Exemple #8
0
        /////////////////////////////////////////

        public PackagesWindow()
        {
            InitializeComponent();

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

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

            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 #9
0
        //

        public ObjectSettingsHeader_ObjectInfo()
        {
            InitializeComponent();

            buttonTypeSettings.Values.Image = EditorResourcesCache.Type;

            if (IsDesignerHosted)
            {
                return;
            }

            EditorThemeUtility.ApplyDarkThemeToForm(this);

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

            if (kryptonLabel1.Height < kryptonLabel1.PreferredSize.Height)
            {
                kryptonLabel1.Height = kryptonLabel1.PreferredSize.Height;
            }
            if (kryptonLabel2.Height < kryptonLabel2.PreferredSize.Height)
            {
                kryptonLabel2.Height = kryptonLabel2.PreferredSize.Height;
            }
        }
        public ContentBrowserSearchForm()
        {
            InitializeComponent();

            EditorThemeUtility.ApplyDarkThemeToForm(this);
            Text = EditorLocalization.Translate("ContentBrowser.SearchForm", Text);
            EditorLocalization.TranslateForm("ContentBrowser.SearchForm", this);
        }
Exemple #11
0
        //HCItemProperty propertyItemForUndoSupport;

        //

        public ColorValuePoweredSelectForm()
        {
            InitializeComponent();

            Text              = EditorLocalization.Translate("ColorValuePoweredSelectForm", Text);
            buttonOK.Text     = EditorLocalization.Translate("General", buttonOK.Text);
            buttonCancel.Text = EditorLocalization.Translate("General", buttonCancel.Text);

            EditorThemeUtility.ApplyDarkThemeToForm(this);
        }
Exemple #12
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 #14
0
        //

        public KryptonRibbonGroupSliderControl()
        {
            InitializeComponent();

            EditorThemeUtility.ApplyDarkThemeToForm(this);

            if (kryptonLabel1.Height < kryptonLabel1.PreferredSize.Height)
            {
                kryptonLabel1.Height = kryptonLabel1.PreferredSize.Height;
            }
        }
        //

        public SettingsCell_Properties()
        {
            InitializeComponent();

            toolStripButtonEvents.Image     = EditorResourcesCache.Events;
            toolStripButtonProperties.Image = EditorResourcesCache.Properties;

            toolStripButtonProperties.Text = EditorLocalization.Translate("SettingsWindow", toolStripButtonProperties.Text);
            toolStripButtonEvents.Text     = EditorLocalization.Translate("SettingsWindow", toolStripButtonEvents.Text);

            toolStrip1.Renderer = EditorThemeUtility.GetToolbarToolStripRenderer();
        }
Exemple #16
0
        //

        public HCGridEvent()
        {
            InitializeComponent();

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

            EditorThemeUtility.ApplyDarkThemeToForm(this);

            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();
        }
Exemple #18
0
        public HCItemProjectRibbonAndToolbarActionsForm()
        {
            InitializeComponent();

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

            toolStrip1.Renderer = EditorThemeUtility.GetToolbarToolStripRenderer();

            //double distance = 22.0 * EditorAPI.DPIScale;
            //kryptonSplitContainer2.Panel1MinSize = (int)distance;
            //kryptonSplitContainer2.SplitterDistance = (int)distance;
        }
Exemple #19
0
        public RangeDropDownControl()
        {
            InitializeComponent();

            EditorThemeUtility.ApplyDarkThemeToForm(this);

            if (minLabel.Height < minLabel.PreferredSize.Height)
            {
                minLabel.Height = minLabel.PreferredSize.Height;
            }
            if (maxLabel.Height < maxLabel.PreferredSize.Height)
            {
                maxLabel.Height = maxLabel.PreferredSize.Height;
            }
        }
Exemple #20
0
        //!!!!deleted
        //bool closing;

        //!!!!
        //System.Drawing.Font richTextBox1FontOriginal;
        //string richTextBox1FontCurrent = "";

        //

        public DockWindow()
        {
            InitializeComponent();

            if (IsDesignerHosted)
            {
                return;
            }

            EditorThemeUtility.ApplyDarkThemeToForm(this);
            //if( EditorAPI.DarkTheme )
            //{
            //	BackColor = Color.FromArgb( 54, 54, 54 );
            //}
        }
        public MessageLogOptionsForm()
        {
            InitializeComponent();

            EditorThemeUtility.ApplyDarkThemeToForm(this);

            Text = Translate(Text);

            hierarchicalContainer1.OverridePropertyDisplayName += HierarchicalContainer1_PropertyDisplayNameOverride;
            hierarchicalContainer1.OverridePropertyEnumItem    += HierarchicalContainer1_OverridePropertyEnumItem;

            if (EditorLocalization.WideLanguage)
            {
                hierarchicalContainer1.SplitterRatio = 0.5f;
            }
        }
        public MessageLogWindow()
        {
            InitializeComponent();

            //kryptonRichTextBox1
            {
                kryptonRichTextBox1 = EditorAssemblyInterface.Instance.CreateTextEditorControl();
                var control = (Control)this.kryptonRichTextBox1;

                this.kryptonSplitContainer1.Panel2.Controls.Add(control);
                control.Dock     = System.Windows.Forms.DockStyle.Fill;
                control.Location = new System.Drawing.Point(0, 0);
                control.Name     = "kryptonRichTextBox1";
                this.kryptonRichTextBox1.EditorReadOnly = true;
                control.Size = new System.Drawing.Size(363, 165);
                //!!!!
                //this.kryptonRichTextBox1.StateCommon.Content.Font = new System.Drawing.Font( "Courier New", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( (byte)( 204 ) ) );
                control.TabIndex = 2;
                this.kryptonRichTextBox1.EditorText     = "";
                this.kryptonRichTextBox1.EditorWordWrap = true;                //false;

                kryptonRichTextBox1.Border = true;
            }

            toolStripButtonClear.Image   = EditorResourcesCache.Delete;
            toolStripButtonOptions.Image = EditorResourcesCache.Options;

            Log.Handlers.InfoHandler += Handlers_InfoHandler;
            //Log.Handlers.InvisibleInfoHandler += Handlers_InvisibleInfoHandler;
            Log.Handlers.WarningHandler += Handlers_WarningHandler;
            Log.Handlers.ErrorHandler   += Handlers_ErrorHandler;

            //configure list
            contentBrowser1.SetData(new ContentBrowser.Item[0], false);
            contentBrowser1.AddImageKey("Info", Properties.Resources.Info_16, Properties.Resources.Info_32);
            contentBrowser1.AddImageKey("Warning", Properties.Resources.Warning_16, Properties.Resources.Warning_32);
            contentBrowser1.AddImageKey("Error", Properties.Resources.Error_16, Properties.Resources.Error_32);

            Config_Load();
            EngineConfig.SaveEvent += Config_SaveEvent;

            WindowTitle = EditorLocalization.Translate("Windows", WindowTitle);
            toolStripButtonOptions.Text = EditorLocalization.Translate("MessageLogWindow", toolStripButtonOptions.Text);
            toolStripButtonClear.Text   = EditorLocalization.Translate("MessageLogWindow", toolStripButtonClear.Text);

            toolStrip1.Renderer = EditorThemeUtility.GetToolbarToolStripRenderer();
        }
        /////////////////////////////////////////

        public ImportWindow()
        {
            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(8);

            buttonDestinationFolderBrowse.Values.Image = EditorResourcesCache.SelectFolder;

            CloseByEscape = true;

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

            EditorThemeUtility.ApplyDarkThemeToForm(eUserControl1);
            EditorThemeUtility.ApplyDarkThemeToForm(panelName);
        }
        //

        public HCGridProperty()
        {
            InitializeComponent();

            //DoubleBuffered = true;
            ResizeRedraw = true;

            EditorThemeUtility.ApplyDarkThemeToForm(this);

            if (labelName.Height < labelName.PreferredHeight)
            {
                labelName.Height = labelName.PreferredHeight;
            }

            //!!!!
            //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
            { }
        }
Exemple #26
0
        /////////////////////////////////////

        public ComponentTypeSettingsForm(DocumentInstance document, Component component)
        {
            //debug = true;

            this.document  = document;
            this.component = component;

            InitializeComponent();

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

            hierarchicalContainer1.OverrideGroupDisplayName += HierarchicalContainer1_OverrideGroupDisplayName;

            EditorThemeUtility.ApplyDarkThemeToForm(this);

            Text = EditorLocalization.Translate("TypeSettingsForm", Text);
            EditorLocalization.TranslateForm("TypeSettingsForm", this);
        }
        //

        public OutputWindow()
        {
            InitializeComponent();

            {
                kryptonRichTextBox1 = EditorAssemblyInterface.Instance.CreateTextEditorControl();
                var control = (Control)this.kryptonRichTextBox1;

                this.Controls.Add(control);
                //control.Dock = System.Windows.Forms.DockStyle.Fill;
                //control.Location = new System.Drawing.Point( 0, 27 );
                //control.Location = new System.Drawing.Point( 0, 25 );
                control.Name = "kryptonRichTextBox1";
                this.kryptonRichTextBox1.EditorReadOnly = true;
                //control.Size = new System.Drawing.Size( 713, 165 );
                //!!!!
                //this.kryptonRichTextBox1.StateCommon.Content.Font = new System.Drawing.Font( "Courier New", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( (byte)( 204 ) ) );
                control.TabIndex = 2;
                this.kryptonRichTextBox1.EditorText     = "";
                this.kryptonRichTextBox1.EditorWordWrap = true;                //false;

                kryptonRichTextBox1.Border = true;

                UpdateTextEditorBounds();
            }

            toolStripButtonOptions.Image = EditorResourcesCache.Options;
            toolStripButtonClear.Image   = EditorResourcesCache.Delete;

            //Log.Handlers.InfoHandler += Handlers_InfoHandler;
            ////Log.Handlers.InvisibleInfoHandler += Handlers_InvisibleInfoHandler;
            //Log.Handlers.WarningHandler += Handlers_WarningHandler;
            //Log.Handlers.ErrorHandler += Handlers_ErrorHandler;

            WindowTitle = EditorLocalization.Translate("Windows", WindowTitle);
            toolStripButtonOptions.Text = EditorLocalization.Translate("OutputWindow", toolStripButtonOptions.Text);
            toolStripButtonClear.Text   = EditorLocalization.Translate("OutputWindow", toolStripButtonClear.Text);

            toolStrip1.Renderer = EditorThemeUtility.GetToolbarToolStripRenderer();
        }
        public RangeDropDownControl()
        {
            InitializeComponent();

            EditorThemeUtility.ApplyDarkThemeToForm(this);
        }
Exemple #29
0
        public ColorValuePoweredSelectControl(HCItemProperty itemProperty)
        {
            InitializeComponent();
            AddOkCancelButtons(out okButton, out cancelButton);

            this.itemProperty = itemProperty;

            powered = ReferenceUtility.GetUnreferencedType(itemProperty.Property.Type.GetNetType()) == typeof(ColorValuePowered);

            var values = itemProperty.GetValues();

            if (values == null)
            {
                return;
            }

            //!!!!multiselection
            var value = values[0];

            ColorValuePowered initValue;

            bool readOnly;

            {
                var  netType         = itemProperty.Property.Type.GetNetType();
                bool isReferenceType = ReferenceUtility.IsReferenceType(netType);

                bool       referenceSpecified = false;
                IReference iReference         = null;
                if (isReferenceType && value != null)
                {
                    iReference         = (IReference)value;
                    referenceSpecified = !string.IsNullOrEmpty(iReference.GetByReference);
                }

                readOnly = referenceSpecified;
            }

            if (powered)
            {
                initValue = (ColorValuePowered)ReferenceUtility.GetUnreferencedValue(value);
            }
            else
            {
                var c = (ColorValue)ReferenceUtility.GetUnreferencedValue(value);
                initValue = new ColorValuePowered(c.Red, c.Green, c.Blue, c.Alpha, 1);
            }

            //for( int n = 0; n < propertyOwners.Length; n++ )
            //{
            //	ColorValue v = (ColorValue)property.GetValue( propertyOwners[ n ], null );

            //	if( n != 0 )
            //	{
            //		if( value != v )
            //		{
            //			value = new ColorValue( 1, 1, 1 );
            //			break;
            //		}
            //	}
            //	else
            //		value = v;
            //}

            bool noAlpha = itemProperty.Property.GetCustomAttributes(typeof(ColorValueNoAlphaAttribute), true).Length != 0;

            ApplicableRangeColorValuePowerAttribute powerRange = null;

            if (powered)
            {
                var array = itemProperty.Property.GetCustomAttributes(typeof(ApplicableRangeColorValuePowerAttribute), true);
                if (array.Length != 0)
                {
                    powerRange = (ApplicableRangeColorValuePowerAttribute)array[0];
                }
            }

            Init(initValue, noAlpha, powered, powerRange, readOnly);

            propertyItemForUndoSupport = itemProperty.GetItemInHierarchyToRestoreValues();
            propertyItemForUndoSupport.SaveValuesToRestore();

            EditorThemeUtility.ApplyDarkThemeToForm(this);
        }
Exemple #30
0
        //

        public ColorValuePoweredSelectControl()
        {
            InitializeComponent();
            AddOkCancelButtons(out okButton, out cancelButton);
            EditorThemeUtility.ApplyDarkThemeToForm(this);
        }