Esempio n. 1
0
        // Constructors

        public ShapePropertiesCon(WorldCon worldCon) : base(worldCon)
        {
            AppCon.InitControlTheme(ShapePropertiesEdit.SelectionToolbar);
            _selectionCon = new SelectionCon(worldCon);
            InitCommonControls(ShapePropertiesEdit.TableLayoutPanel);
            InitLocalControls();
        }
Esempio n. 2
0
 public static void Remove(WorldCon worldCon)
 {
     WorldCons.Remove(worldCon);
     if (WorldCons.Count == 0)
     {
         Close();
     }
 }
Esempio n. 3
0
        // Public methods

        public static WorldCon AddNewWorldCon()
        {
            var worldCon = new WorldCon();

            WorldCons.Add(worldCon);
            worldCon.Show();
            worldCon.RefreshGraphicsMode();
            return(worldCon);
        }
Esempio n. 4
0
        // Constructors

        public OptionsCon(WorldCon worldCon) : base(worldCon)
        {
            _optionsDialog = new OptionsDialog {
                Text = Resources.OptionsDialog.Format(Application.ProductName)
            };
            _optionsDialog.cbTheme.Items.AddRange(typeof(Theme).GetDescriptions().Reverse().Cast <object>().ToArray());
            _optionsDialog.btnFilesFolder.Click     += BtnFilesFolder_Click;
            _optionsDialog.btnTemplatesFolder.Click += BtnTemplatesFolder_Click;
        }
Esempio n. 5
0
        // Constructors

        protected SdiCon(WorldCon worldCon, string filter, string subKeyName) : base(worldCon, subKeyName)
        {
            _openFileDialog = new OpenFileDialog {
                Filter = filter, Title = Resources.OpenFileDialog_Title
            };
            _saveFileDialog = new SaveFileDialog {
                Filter = filter, Title = Resources.SaveFileDialog_Title
            };
        }
Esempio n. 6
0
 private void OnLoad()
 {
     WorldCon.ConnectCons(false);
     Scene.WorldCon = WorldCon;
     Scene.AttachShapes();
     CommandCon.Clear();
     WorldCon.ConnectCons(true);
     SceneCon.RecreateSceneControl();
     SignalsCon.Load();
     Reset();
 }
Esempio n. 7
0
        // Constructors

        protected MruCon(WorldCon worldCon, string subKeyName) : base(worldCon)
        {
            if (string.IsNullOrWhiteSpace(subKeyName))
            {
                throw new ArgumentNullException(nameof(subKeyName));
            }
            _subKeyName = string.Format(
                CultureInfo.InvariantCulture,
                @"Software\{0}\{1}\{2}",
                Application.CompanyName,
                Application.ProductName,
                subKeyName);
            RefreshRecentMenu();
        }
Esempio n. 8
0
        // Constructors

        public SignalCon(WorldCon worldCon, Signal signal) : base(worldCon)
        {
            if (signal == null)
            {
                throw new ArgumentNullException(nameof(signal));
            }
            SignalEdit          = new SignalEdit();
            Index               = Scene.Signals.IndexOf(signal);
            NameEditor.AutoSize = true;
            NameEditor.Text     = signal.Name;
            InitRanges(signal);
            InitSlider(AmplitudeSlider, AmpGaugeMin, AmpGaugeMax, AmpGaugeSmall, AmpGaugeLarge, AmplitudeToGauge(signal.Amplitude));
            InitSlider(FrequencySlider, FreqGaugeMin, FreqGaugeMax, FreqGaugeSmall, FreqGaugeLarge, FrequencyToGauge(signal.Frequency));
            SignalsForm.AddButton.CloneTo(SignalEdit.WaveTypeButton, ToolStripCloneOptions.None);
            AppCon.InitControlTheme(Toolbar);
            UpdateAllProperties();
        }
Esempio n. 9
0
        // Constructors

        protected CodeCon(WorldCon worldCon) : base(worldCon)
        {
            LoadShaderCode();
            AppCon.InitControlTheme(CodeEdit.HorizontalToolbar, CodeEdit.VerticalToolbar, CodeEdit.PopupEditMenu);
            ShowRuler       = false;
            ShowLineNumbers = false;
            ShowDocumentMap = false;
            SplitType       = SplitType.None;
            var items = CodeEdit.tbShader.DropDownItems;

            items[0].Tag = ShaderType.VertexShader;
            items[1].Tag = ShaderType.TessControlShader;
            items[2].Tag = ShaderType.TessEvaluationShader;
            items[3].Tag = ShaderType.GeometryShader;
            items[4].Tag = ShaderType.FragmentShader;
            items[5].Tag = ShaderType.ComputeShader;
        }
Esempio n. 10
0
        private void UpdateUI()
        {
            if (_updateCount > 0)
            {
                return;
            }
            string
                undo = CanUndo ? $"Undo {UndoAction}" : "Undo",
                redo = CanRedo ? $"Redo {RedoAction}" : "Redo";

            WorldForm.EditUndo.Enabled   = WorldForm.tbUndo.Enabled = CanUndo;
            WorldForm.EditRedo.Enabled   = WorldForm.tbRedo.Enabled = CanRedo;
            WorldForm.EditUndo.Text      = $"&{undo}";
            WorldForm.EditRedo.Text      = $"&{redo}";
            WorldForm.tbUndo.ToolTipText = $"{undo} (^Z)";
            WorldForm.tbRedo.ToolTipText = $"{redo} (^Y)";
            WorldCon.ModifiedChanged();
        }
Esempio n. 11
0
        public AboutCon(WorldCon worldCon) : base(worldCon)
        {
            var asm = Assembly.GetExecutingAssembly();

            AboutDialog.Text = Resources.AboutDialog.Format(Application.ProductName);
            AboutDialog.lblProductName.Text = Application.ProductName;
            AboutDialog.lblDescription.Text = asm.GetCustomAttribute <AssemblyDescriptionAttribute>().Description;
            AboutDialog.lblVersion.Text     = Application.ProductVersion;
            AboutDialog.lblAuthor.Text      = Application.CompanyName;
            AboutDialog.lblCopyright.Text   = asm.GetCustomAttribute <AssemblyCopyrightAttribute>().Copyright;

            /*
             * var info = AppCon.WorldCons[0].GLInfo;
             * AboutDialog.lblOpenGLVersion.Text = info.Number;
             * AboutDialog.lblGLSLVersion.Text = info.Shader;
             * AboutDialog.lblVendorName.Text = info.Vendor;
             * AboutDialog.lblRendererName.Text = info.Renderer;
             */
        }
Esempio n. 12
0
 public CameraCon(WorldCon worldCon) : base(worldCon) => SetDefaultCamera();
Esempio n. 13
0
        // Constructors

        public ScenePropertiesCon(WorldCon worldCon) : base(worldCon)
        {
            InitCommonControls(ScenePropertiesEdit.TableLayoutPanel);
            InitLocalControls();
        }
Esempio n. 14
0
        // Constructors

        public SignalPropertiesCon(WorldCon worldCon) : base(worldCon)
        {
        }
Esempio n. 15
0
 private void Reset()
 {
     SetDefaultCamera();
     WorldCon.UpdateAllProperties();
 }
Esempio n. 16
0
        // Constructors

        public ShapeCodeCon(WorldCon worldCon) : base(worldCon)
        {
        }
Esempio n. 17
0
        // Constructors

        public JsonCon(WorldCon worldCon) : base(worldCon, Settings.Default.FileFilter, "LibraryMRU")
        {
        }
Esempio n. 18
0
        // Constructors

        protected DockingCon(WorldCon worldCon) : base(worldCon)
        {
        }
Esempio n. 19
0
        // Constructors

        protected PropertiesCon(WorldCon worldCon) : base(worldCon)
        {
        }
Esempio n. 20
0
        // Constructors

        public FullScreenCon(WorldCon worldCon) : base(worldCon)
        {
        }
Esempio n. 21
0
        // Constructors

        public SelectionCon(WorldCon worldCon) : base(worldCon)
        {
        }
Esempio n. 22
0
        // Constructors

        public SceneCon(WorldCon worldCon) : base(worldCon)
        {
        }
Esempio n. 23
0
        // Constructors

        public SignalsCon(WorldCon worldCon) : base(worldCon)
        {
        }
Esempio n. 24
0
        // Constructors

        public RenderCon(WorldCon worldCon) : base(worldCon) => _stopwatch.Start();
Esempio n. 25
0
        // Constructors

        public ClockCon(WorldCon worldCon) : base(worldCon) => UpdateTimeControls();
Esempio n. 26
0
        // Constructors

        public CommandCon(WorldCon worldCon) : base(worldCon)
        {
        }
Esempio n. 27
0
        // Constructors

        public HotkeysCon(WorldCon worldCon) : base(worldCon)
        {
        }
Esempio n. 28
0
        // Constructors

        protected LocalCon(WorldCon worldCon) => WorldCon = worldCon;