コード例 #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

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

            needCreateRenderWindow = true;
            //!!!!тут создавать?
            //!!!!!что-то opengl иногда при создании ошибку дает
            //if( CreateRenderTarget() )
            //	needCreateRenderWindow = false;

            float interval = 10;

            // ( automaticUpdateFPS != 0 ) ? ( ( 1.0f / automaticUpdateFPS ) * 1000.0f ) : 100;
            //float interval = ( automaticUpdateFPS != 0 ) ? ( ( 1.0f / automaticUpdateFPS ) * 1000.0f ) : 100;
            updateTimer          = new Timer();
            updateTimer.Interval = (int)interval;
            updateTimer.Tick    += updateTimer_Tick;
            updateTimer.Enabled  = true;

            //!!!!
            //WinFormsAppWorld.renderTargetUserControls.Add( this );

            loaded = true;

            allInstances.Add(this);
        }
コード例 #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }

            UpdateToolBarVisibility();

            UpdateControls();

            //update cursor
            if (EditorAPI.SelectedDocumentWindow == this)
            {
                if (browser != null && browser.CurrentCursor != null)
                {
                    ViewportControl.Cursor = browser.CurrentCursor;
                }
            }

            if (!string.IsNullOrEmpty(needOpenPackage))
            {
                EditorAPI.OpenPackages(needOpenPackage);
                needOpenPackage = null;
            }
        }
コード例 #3
0
        //private void UndoSystem_ListOfActionsChanged( object sender, EventArgs e )
        //{
        //	//needUpdate = true;
        //	needUpdateTime = EngineApp.GetSystemTime() + 0.1;

        //	////!!!!
        //	//Log.Warning( "update" );
        //}

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }

            if (Material != null)
            {
                //!!!!

                //if( Material.EditorAutoUpdate )//!!!! && needUpdate )
                //{
                //	Material.ResultCompile();

                //	//Material.ShouldRecompile = true;
                //	//needUpdate = false;
                //}

                //if( Material.EditorAutoUpdate && needUpdateTime.HasValue )
                //{
                //	var time = EngineApp.GetSystemTime();
                //	if( time > needUpdateTime.Value )
                //	{
                //		Material.ResultCompile();
                //		//Material.ShouldRecompile = true;
                //		needUpdateTime = null;
                //	}
                //}
            }
        }
コード例 #4
0
        private void SettingsCell_Properties_Load(object sender, EventArgs e)
        {
            timer1.Start();

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

            toolStrip1.Padding             = new Padding((int)EditorAPI.DPIScale);
            toolStrip1.Size                = new Size(10, (int)(21 * EditorAPI.DPIScale + 2));
            toolStripButtonProperties.Size = new Size((int)(20 * EditorAPI.DPIScale), (int)(20 * EditorAPI.DPIScale + 2));
            toolStripButtonEvents.Size     = new Size((int)(20 * EditorAPI.DPIScale), (int)(20 * EditorAPI.DPIScale + 2));

            hierarchicalContainerProperties.OverrideGroupDisplayName    += HierarchicalContainer1_OverrideGroupDisplayName;
            hierarchicalContainerProperties.OverridePropertyDisplayName += HierarchicalContainer1_OverridePropertyDisplayName;
            hierarchicalContainerProperties.OverrideMemberDescription   += HierarchicalContainer1_OverrideMemberDescription;
            hierarchicalContainerEvents.OverrideGroupDisplayName        += HierarchicalContainer1_OverrideGroupDisplayName;
            hierarchicalContainerEvents.OverridePropertyDisplayName     += HierarchicalContainer1_OverridePropertyDisplayName;
            hierarchicalContainerEvents.OverrideMemberDescription       += HierarchicalContainer1_OverrideMemberDescription;

            if (!AllowConfigureEvents)
            {
                toolStrip1.Visible                = false;
                toolStripButtonEvents.Enabled     = false;
                toolStripButtonProperties.Enabled = false;
            }

            UpdateControlsBounds();
        }
コード例 #5
0
        private void timer10ms_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            bool cancel = false;

            BeforeTimerUpdate?.Invoke(this, ref cancel);
            if (cancel)
            {
                return;
            }

            //!!!!когда не обновлять?
            PerformUpdate();

            if (doubleBufferCompositedTime.HasValue && (DateTime.Now - doubleBufferCompositedTime.Value).TotalSeconds > 0)
            {
                ControlDoubleBufferComposited.RestoreComposited(this);
                doubleBufferCompositedTime = null;
            }
        }
コード例 #6
0
        public HierarchicalContainer()
        {
            InitializeComponent();

            //AutoScroll = false;
            ////!!!!так?
            //HorizontalScroll.Maximum = 0;
            //AutoScroll = false;
            //VerticalScroll.Visible = false;
            //AutoScroll = true;

            //VerticalScroll.Enabled = true;
            //VerticalScroll.Visible = true;
            //VerticalScroll.Minimum = 0;
            //VerticalScroll.Maximum = 2000;
            //VerticalScroll.Value = 0;

            //RegisterDefaultItemTypeByPropertyType();

            // register filter for redirect scroll event to childs
            Application.AddMessageFilter(this);

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

            engineScrollBar1.Visible = false;
            //UpdateControls();

            panel1.MouseLeave += Panel1_MouseLeave;
            panel1.MouseMove  += Panel1_MouseMove;
            panel1.MouseDown  += Panel1_MouseDown;
            panel1.MouseUp    += Panel1_MouseUp;
        }
コード例 #7
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            InfoUpdate();
            NewUpdate();
            //OpenUpdate();
            PackagingUpdate();
            LoginUpdate();

            if (Visible && doInitActionsInTimer)
            {
                doInitActionsInTimer = false;

                kryptonNavigator1.Focus();
                kryptonNavigator1.Select();
                kryptonTextBoxInfoName.Select(0, 0);
            }
        }
コード例 #8
0
        public bool IsAllowRender()
        {
            if (EngineApp.Instance == null)
            {
                return(false);
            }

            //!!!!new. надо ли. поставлено т.к. валилось в UpdateTransformToolObjects на "foreach( var obj in transformTool.Objects )" в OnPaint, в Tick
            if (!loaded)
            {
                return(false);
            }

            //if( WinFormsAppWorld.DuringWarningOrErrorMessageBox )
            //	return;
            //if( RenderSystem.IsDeviceLostByTestCooperativeLevel() )
            //	return;

            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return(false);
            }

            //!!!! check perf. replace to alternative with flag check for better perf.
            if (!IsPhysicalVisibleCheckBy5Points(this))
            {
                return(false);
            }

            return(true);
        }
コード例 #9
0
        void UpdateContent()
        {
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            var lines = new List <string>();

            if (contentBrowserList.SelectedItems.Length != 0)
            {
                var page = (DebugInfoPage)((ContentBrowserItem_Virtual)contentBrowserList.SelectedItems[0]).Tag;
                lines = page.Content;
            }

            if (dataItems == null || dataItems.Count != lines.Count)
            {
                dataItems = new List <ContentBrowser.Item>();
                for (int n = 0; n < lines.Count; n++)
                {
                    var item = new ContentBrowserItem_Virtual(contentBrowserData, null, lines[n]);
                    dataItems.Add(item);
                }
                contentBrowserData.SetData(dataItems, false);
            }
            else
            {
                for (int n = 0; n < lines.Count; n++)
                {
                    ((ContentBrowserItem_Virtual)dataItems[n]).SetText(lines[n]);
                }
            }
        }
コード例 #10
0
ファイル: SchedulesPanel.cs プロジェクト: rob-opsi/ARGUS-TV
 public SchedulesPanel(ScheduleType scheduleType)
 {
     InitializeComponent();
     _iconColumn.ValuesAreIcons = true;
     _scheduleType = scheduleType;
     _schedulesDataGridView.ColumnHeadersHeight = (int)(23 * _heightFactor);
     WinFormsUtility.ResizeDataGridViewColumns(_schedulesDataGridView, _widthFactor);
 }
コード例 #11
0
 private void ForeachDocumentContainer_Load(object sender, EventArgs e)
 {
     //to prevent crash designer. happens on ObjectsWindow
     if (!WinFormsUtility.IsDesignerHosted(this))
     {
         timer1.Enabled = true;
     }
 }
コード例 #12
0
 public UpcomingOrActiveProgramsControl()
 {
     InitializeComponent();
     _programsDataGridView.MouseUp += new MouseEventHandler(_programsDataGridView_MouseUp);
     _iconColumn.ValuesAreIcons     = true;
     _scheduleNameColumn.Visible    = false;
     WinFormsUtility.ResizeDataGridViewColumnsForCurrentDpi(_programsDataGridView);
 }
コード例 #13
0
 private static void PlayRecording(UpcomingOrActiveProgramView upcomingProgramView)
 {
     if (upcomingProgramView != null &&
         upcomingProgramView.ActiveRecording != null)
     {
         WinFormsUtility.RunVlc(upcomingProgramView.ActiveRecording.RecordingFileName);
     }
 }
コード例 #14
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }

            procedureUI.PerformUpdate();
        }
コード例 #15
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }

            UpdateControlsChecked();
        }
コード例 #16
0
        private void contentBrowser1_ItemAfterSelect(ContentBrowser sender, IList <ContentBrowser.Item> items, bool selectedByUser, ref bool handled)
        {
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            UpdateSelectedType();
        }
コード例 #17
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (KryptonPage == null || KryptonPage.Parent == null)
            {
                return;
            }

            if (selectedPanel != null)
            {
                selectedPanel.layoutPanel.Enabled = GetEnabledForSelectedPanel();
            }

            //check for DisplayHierarchyOfObjectsInSettingsWindow update
            if (settingsDisplayHierarchyOfObjectsInSettingsWindow != ProjectSettings.Get.DisplayHierarchyOfObjectsInSettingsWindow.Value)
            {
                settingsDisplayHierarchyOfObjectsInSettingsWindow = ProjectSettings.Get.DisplayHierarchyOfObjectsInSettingsWindow.Value;

                DocumentWindow documentWindow     = null;
                ESet <object>  selectedObjectsSet = null;
                if (SelectedPanel != null)
                {
                    documentWindow     = SelectedPanel.documentWindow;
                    selectedObjectsSet = SelectedPanel.selectedObjectsSet;
                }

                RemoveCachedPanels();

                if (selectedObjectsSet != null)
                {
                    SelectObjects(documentWindow, selectedObjectsSet);
                }
            }

            //recreate panels
            if (needRecreatePanels)
            {
                var      documentWindow  = needRecreatePanelsDocumentWindow;
                object[] selectedObjects = needRecreatePanelsSelectObjects;

                needRecreatePanels = false;
                needRecreatePanelsDocumentWindow = null;
                needRecreatePanelsSelectObjects  = null;

                RemoveCachedPanels();

                if (selectedObjects != null)
                {
                    SelectObjects(documentWindow, selectedObjects);
                }
            }
        }
コード例 #18
0
        public HCGridCheckBox()
        {
            InitializeComponent();

            if (!WinFormsUtility.IsDesignerHosted(this))
            {
                checkBox1.Location = new Point(1, DpiHelper.Default.ScaleValue(5));
                checkBox1.AutoSize = false;
                checkBox1.Size     = new Size(1, 1);
            }
        }
コード例 #19
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            if (!WinFormsUtility.IsDesignerHosted(this))
            {
                if (checkBox1.AutoSize != true)
                {
                    checkBox1.AutoSize = true;
                }
            }
        }
コード例 #20
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            UpdateContentBrowser();
            SelectedTypeChanged();
            timer1.Start();
        }
コード例 #21
0
        private void StoreDocumentWindow_Load(object sender, EventArgs e)
        {
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            toolbarMustVisibleForTime = Time.Current;
            timer1.Start();

            UpdateControls();
        }
コード例 #22
0
        //

        public EngineLabel()
        {
            _style = LabelStyle.NormalControl;
            _paletteCommonRedirect = new PaletteContentInheritRedirect(Redirector, PaletteContentStyle.LabelNormalControl);

            ReadOnly = true;
            TabStop  = false;
            if (!WinFormsUtility.IsDesignerHosted(this))
            {
                StateCommon.Back.Color1 = GetResolvedPalette().GetBackColor1(PaletteBackStyle.PanelClient, PaletteState.Normal);
                StateCommon.Border.Draw = InheritBool.False;
            }
        }
コード例 #23
0
        private void StartPageWindow_Load(object sender, EventArgs e)
        {
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            EditorLocalization.TranslateForm("StartPageWindow", this);

            timer1.Start();

            UpdateControls();
        }
コード例 #24
0
        private void contentBrowser1_ItemAfterSelect(ContentBrowser sender, IList <ContentBrowser.Item> items, bool selectedByUser, ref bool handled)
        {
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            if (!contentBrowserItemAfterSelectDisabled)
            {
                manuallyEdited = false;
                UpdateSelectedReference();
            }
        }
コード例 #25
0
        private void contentBrowser1_ItemAfterChoose(ContentBrowser sender, ContentBrowser.Item item, ref bool handled)
        {
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            if (!IsReadyToSelect())
            {
                return;
            }
            ButtonSelect_Click(null, null);
        }
コード例 #26
0
        private void contentBrowser1_ItemAfterChoose(ContentBrowser sender, ContentBrowser.Item item, ref bool handled)
        {
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            handled = true;
            if (IsReadyToImport(out _))
            {
                ButtonImport_Click(null, null);
            }
        }
コード例 #27
0
ファイル: DockWindow.cs プロジェクト: yf885188/NeoAxisEngine
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (!IsHandleCreated || WinFormsUtility.IsDesignerHosted(this) || EditorAPI.ClosingApplication)
            {
                return;
            }
            if (!WinFormsUtility.IsControlVisibleInHierarchy(this))
            {
                return;
            }

            UpdateWindowTitle();
        }
コード例 #28
0
        private void contentBrowser1_ItemAfterChoose(ContentBrowser sender, ContentBrowser.Item item, ref bool handled)
        {
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            if (!IsReadyToCreate(out string dummy))
            {
                return;
            }
            ButtonCreateAndClose_Click(null, null);
        }
コード例 #29
0
ファイル: EditorForm.cs プロジェクト: yf885188/NeoAxisEngine
        /////////////////////////////////////////

        //internal class CoverControl : Control
        //{
        //	Label label;
        //	public CoverControl()
        //	{
        //		label = new Label() { Dock = DockStyle.Fill, TextAlign = ContentAlignment.MiddleCenter };
        //		Controls.Add( label );
        //		BackColor = Color.Black;
        //		Dock = DockStyle.Fill;
        //	}

        //	public void UpdateText( string text )
        //	{
        //		label.Text = text;
        //		Application.DoEvents();
        //	}
        //}

        /////////////////////////////////////////

        public EditorForm()
        {
            instance = this;

            //get CustomWindowsStyle project settings
            var customWindowsStyle = ProjectSettings.ReadParameterFromFile("CustomWindowsStyle");

            if (!string.IsNullOrEmpty(customWindowsStyle))
            {
                try
                {
                    KryptonToolkitSettings.AllowFormChrome = (bool)SimpleTypes.ParseValue(typeof(bool), customWindowsStyle);
                }
                catch { }
            }
            AllowFormChrome = KryptonToolkitSettings.AllowFormChrome;

            //if( /*showSplashScreenAtStartup &&*/ !Debugger.IsAttached )
            //{
            //	//Image image = MapEditor.Properties.Resources.MapEditorSplash;
            //	var splashForm = new SplashForm();// image );
            //	splashForm.Show();
            //}

            InitializeComponent();

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

            ////!!!!new
            //buttonQATFormIntegration.Enabled = DWM.IsCompositionEnabled && AllowFormChrome;
            //allowFormChromeButton.Enabled = KryptonManager.AllowFormChrome;

            workspaceController = new WorkspaceControllerForForm(kryptonPanel, this);

            //EnableLocalization();

            EditorAssemblyInterface.Instance.InitializeWPFApplicationAndScriptEditor();
            //InitializeWPFApplication();
            //InitializeScriptEditor();

            //!!!!!тут?
            //QATButtonsInit();

            //apply editor settings
            EditorSettingsSerialization.Init();
            EditorFavorites.Init();
        }
コード例 #30
0
        //public RichTextBox RichTextBox
        //{
        //	get { return richTextBox1; }
        //}

        private void DebugInfoForm_Load(object sender, EventArgs e)
        {
            if (WinFormsUtility.IsDesignerHosted(this))
            {
                return;
            }

            //Translate();

            //richTextBox1.Select();
            UpdateList();

            timer1.Start();
        }
コード例 #31
0
        public CommandRibbonFactory( Utility.Assemblies.ManifestResources resources,
            System.Reflection.Assembly assembly, string prefix, WinFormsUtility.Commands.CommandControlSet commandControlSet)
            : base(resources)
        {
            if( assembly == null )
            {
                throw new ArgumentNullException( "assembly" );
            }
            if( prefix == null )
            {
                throw new ArgumentNullException( "prefix" );
            }
            if( commandControlSet == null )
            {
                throw new ArgumentNullException( "commandControlSet" );
            }

            _assembly = assembly;
            _prefix = prefix;
            _commandControlSet = commandControlSet;
        }
コード例 #32
0
        public static void DestroyToolStrip( WinFormsUtility.Commands.CommandControlSet commandControlSet, ToolStrip toolStrip )
        {
            foreach( ToolStripItem toolStripItem in toolStrip.Items )
            {
                CommandToolStripButton commandToolStripButton = toolStripItem as CommandToolStripButton;

                if( commandToolStripButton != null )
                {
                    commandControlSet.RemoveControl( commandToolStripButton );
                    commandToolStripButton.Command = null;
                }
            }
        }
コード例 #33
0
        public static void DestroyRibbon( WinFormsUtility.Commands.CommandControlSet commandControlSet, Controls.Ribbon.RibbonControl ribbonControl )
        {
            foreach( Controls.Ribbon.Section section in ribbonControl.Sections )
            {
                foreach( Controls.Ribbon.Item item in section.Items )
                {
                    CommandRibbonButtonItem commandRibbonButtonItem = item as CommandRibbonButtonItem;

                    if( commandRibbonButtonItem != null )
                    {
                        commandControlSet.RemoveControl( commandRibbonButtonItem );
                        commandRibbonButtonItem.Command = null;
                    }
                }
            }

            while( ribbonControl.Sections.Length > 0 )
            {
                ribbonControl.RemoveSection( ribbonControl.Sections[0] );
            }
        }
コード例 #34
0
 public CommandRibbonFactory( Utility.Assemblies.ManifestResources resources,
     string prefix, WinFormsUtility.Commands.CommandControlSet commandControlSet)
     : this(resources, System.Reflection.Assembly.GetCallingAssembly(), prefix, commandControlSet)
 {
 }
コード例 #35
0
        public static void DestroyContextMenuStrip( WinFormsUtility.Commands.CommandControlSet commandControlSet, ContextMenuStrip menuStrip )
        {
            foreach( ToolStripItem toolStripItem in menuStrip.Items )
            {
                CommandToolStripMenuItem commandToolStripMenuItem = toolStripItem as CommandToolStripMenuItem;

                if( commandToolStripMenuItem != null )
                {
                    commandControlSet.RemoveControl( commandToolStripMenuItem );
                    commandToolStripMenuItem.Command = null;
                }
            }
        }
コード例 #36
0
ファイル: ProcessingItem.cs プロジェクト: CecleCW/ProductMan
        protected virtual void OnProcessingEndFailure( WinFormsUtility.Controls.ExceptionEventArgs e )
        {
            Stop();

            if( ProcessingEndFailure != null )
            {
                ProcessingEndFailure( this, e );
            }
        }
コード例 #37
0
ファイル: ProcessingItem.cs プロジェクト: CecleCW/ProductMan
 public ProcessingItem( WinFormsUtility.Drawing.Animation animation )
     : base(animation)
 {
 }
コード例 #38
0
ファイル: AnimationItem.cs プロジェクト: CecleCW/ProductMan
 public AnimationItem( WinFormsUtility.Drawing.Animation animation )
 {
     _animation = animation;
 }
コード例 #39
0
 public void StartAnimating( WinFormsUtility.Drawing.Animation animation )
 {
     _animation = animation;
     _start = DateTime.Now;
     StartTimer();
 }
コード例 #40
0
ファイル: RibbonControl.cs プロジェクト: CecleCW/ProductMan
        public void UpdateKeys( WinFormsUtility.Commands.KeyCommandLauncher keyCommandLauncher )
        {
            foreach( Controls.Ribbon.Section section in Sections )
            {
                foreach( Controls.Ribbon.Item item in section.Items )
                {
                    Commands.CommandRibbonButtonItem buttonItem = item as Commands.CommandRibbonButtonItem;
                    Commands.CommandSemiDropDownRibbonButtonItem semiButtonItem = item as Commands.CommandSemiDropDownRibbonButtonItem;

                    if( buttonItem != null && buttonItem.Command != null )
                    {
                        string keyText = keyCommandLauncher.GetKeyText( buttonItem.Command );

                        if( keyText != null )
                        {
                            buttonItem.TooltipDescription += string.Format( " ({0})", keyText );
                        }
                    }

                    if( semiButtonItem != null && semiButtonItem.Command != null )
                    {
                        string keyText = keyCommandLauncher.GetKeyText( semiButtonItem.Command );

                        if( keyText != null )
                        {
                            semiButtonItem.TooltipDescription += string.Format( " ({0})", keyText );
                        }
                    }
                }
            }
        }