Пример #1
0
            public MultiPropControl()
            {
                m_propControls    = new Sce.Atf.Controls.PropertyEditing.PropertyGrid[2];
                m_propControls[0] = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
                m_propControls[1] = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
                Layout           += OnLayout;

                m_splitContainer = new SplitContainer();

                SuspendLayout();
                m_splitContainer.SuspendLayout();
                m_splitContainer.Panel1.SuspendLayout();
                m_splitContainer.Panel2.SuspendLayout();

                m_propControls[0].Dock = DockStyle.Fill;
                m_splitContainer.Panel1.Controls.Add(m_propControls[0]);

                m_propControls[1].Dock = DockStyle.Fill;
                m_splitContainer.Panel2.Controls.Add(m_propControls[1]);

                m_splitContainer.FixedPanel = FixedPanel.None;
                m_splitContainer.Dock       = DockStyle.Fill;
                Controls.Add(m_splitContainer);

                m_splitContainer.Panel2.ResumeLayout(false);
                m_splitContainer.Panel1.ResumeLayout(false);
                m_splitContainer.ResumeLayout(false);
                this.ResumeLayout(true);
            }
Пример #2
0
 /// <summary>
 /// Configures the property editor</summary>
 /// <param name="propertyGrid">Property grid control</param>
 /// <param name="controlInfo">Information about the control for the hosting service</param>
 protected virtual void Configure(out PropertyGrid propertyGrid, out ControlInfo controlInfo)
 {
     propertyGrid = new PropertyGrid();
     controlInfo  = new ControlInfo(
         "Property Editor".Localize(),
         "Edits selected object properties".Localize(),
         StandardControlGroup.Right, null,
         "https://github.com/SonyWWS/ATF/wiki/Property-Editing-in-ATF".Localize());
 }
Пример #3
0
 protected override void Configure(out PropertyGrid propertyGrid, out ControlInfo controlInfo)
 {
     propertyGrid = new PropertyGrid();
      controlInfo = new ControlInfo(
          "Unit Property Editor".Localize(),
          "Edits selected object properties".Localize(),
          StandardControlGroup.Center, null,
          "asdf".Localize());
 }
Пример #4
0
 /// <summary>
 /// Configures the property editor</summary>
 /// <param name="propertyGrid">Property grid control</param>
 /// <param name="controlInfo">Information about the control for the hosting service</param>
 protected virtual void Configure(out PropertyGrid propertyGrid, out ControlInfo controlInfo)
 {
     propertyGrid = new PropertyGrid();
     controlInfo = new ControlInfo(
         "Property Editor".Localize(),
         "Edits selected object properties".Localize(),
         StandardControlGroup.Right, null,
         "https://github.com/SonyWWS/ATF/wiki/Property-Editing-in-ATF".Localize());
 }
Пример #5
0
 protected override void Configure(out PropertyGrid propertyGrid, out ControlInfo controlInfo)
 {
     // Test that DisplayTooltips works instead of the usual DisplayDescriptions.
     propertyGrid = new PropertyGrid(PropertyGridMode.DisplayTooltips, new PropertyGridView());
     controlInfo  = new ControlInfo(
         "Property Editor".Localize(),
         "Edits selected object properties".Localize(),
         StandardControlGroup.Right, null,
         "https://github.com/SonyWWS/ATF/wiki/Property-Editing-in-ATF".Localize());
 }
Пример #6
0
 /// <summary>
 /// Configures the property editor</summary>
 /// <param name="propertyGrid">Property grid control</param>
 /// <param name="controlInfo">Information about the control for the hosting service</param>
 protected virtual void Configure(out PropertyGrid propertyGrid, out ControlInfo controlInfo)
 {
     propertyGrid = new PropertyGrid();
     controlInfo  = new ControlInfo(
         "Property Editor", //Is the ID in the layout. We'll localize DisplayName instead.
         "Edits selected object properties".Localize(),
         StandardControlGroup.Right, null,
         "https://github.com/SonyWWS/ATF/wiki/Property-Editing-in-ATF".Localize())
     {
         DisplayName = "Property Editor".Localize()
     };
 }
Пример #7
0
 /// <summary>
 /// Configures the property editor</summary>
 /// <param name="propertyGrid">Property grid control</param>
 /// <param name="controlInfo">Information about the control for the hosting service</param>
 protected virtual void Configure(out PropertyGrid propertyGrid, out ControlInfo controlInfo)
 {
     propertyGrid = new PropertyGrid();
     controlInfo = new ControlInfo(
         "Property Editor", //Is the ID in the layout. We'll localize DisplayName instead.
         "Edits selected object properties".Localize(),
         StandardControlGroup.Right, null,
         "https://github.com/SonyWWS/ATF/wiki/Property-Editing-in-ATF".Localize())
     {
         DisplayName = "Property Editor".Localize()
     };
 }
Пример #8
0
        /// <summary>
        /// Constructor</summary>
        /// <param name="settingsService">Settings service</param>
        /// <param name="dialogOwner">Dialog owner window HWND</param>
        /// <param name="pathName">Path of settings to display initially, or null</param>
        public SettingsDialog(SettingsService settingsService, IWin32Window dialogOwner, string pathName)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            SplitterRatio = 0.33f;

            m_settingsService = settingsService;
            m_dialogOwner     = dialogOwner;

            m_originalState = m_settingsService.UserState; // for cancel

            m_treeControl               = new TreeControl(TreeControl.Style.SimpleTree);
            m_treeControl.Dock          = DockStyle.Fill;
            m_treeControl.SelectionMode = SelectionMode.One;
            m_treeControl.ShowRoot      = false;
            m_treeControl.ImageList     = ResourceUtil.GetImageList16();
            m_treeControl.ExpandAll();

            m_treeControl.NodeSelectedChanged += treeControl_NodeSelectedChanged;

            m_treeControlAdapter          = new TreeControlAdapter(m_treeControl);
            m_treeControlAdapter.TreeView = settingsService.UserSettings;

            treePanel.Controls.Add(m_treeControl);

            m_propertyGrid      = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
            m_propertyGrid.Dock = DockStyle.Fill;
            propertiesPanel.Controls.Add(m_propertyGrid);

            // select an initial node so something is displayed in the PropertyGrid
            TreeControl.Node firstNode = null;
            if (pathName != null)
            {
                firstNode = m_treeControlAdapter.ExpandPath(m_settingsService.GetSettingsPath(pathName));
            }
            if (firstNode == null) // in case pathName is not null, but ExpandPath returns null
            {
                firstNode = m_treeControl.ExpandToFirstLeaf();
            }



            firstNode.Selected = true;
            ShowProperties(m_settingsService.GetProperties((Tree <object>)firstNode.Tag)); //does auto-setting of column widths

            defaultsButton.Click += DefaultsButton_Click;
        }
Пример #9
0
        public MatTab()
        {
            SuspendLayout();
            m_child = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();

            m_child.Location = new System.Drawing.Point(158, 3);
            m_child.Size = new System.Drawing.Size(341, 188);
            m_child.TabIndex = 1;
            m_child.Dock = DockStyle.Fill;
            m_child.Visible = true;

            Controls.Add(m_child);
            Dock = DockStyle.Fill;
            Padding = new System.Windows.Forms.Padding(0);
            ResumeLayout(false);
        }
Пример #10
0
        /// <summary>
        /// Constructor</summary>
        /// <param name="settingsService">Settings service</param>
        /// <param name="dialogOwner">Dialog owner window HWND</param>
        /// <param name="pathName">Path of settings to display initially, or null</param>
        public SettingsDialog(SettingsService settingsService, IWin32Window dialogOwner, string pathName)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            SplitterRatio = 0.33f;

            m_settingsService = settingsService;
            m_dialogOwner = dialogOwner;

            m_originalState = m_settingsService.UserState; // for cancel

            m_treeControl = new TreeControl(TreeControl.Style.SimpleTree);
            m_treeControl.Dock = DockStyle.Fill;
            m_treeControl.SelectionMode = SelectionMode.One;
            m_treeControl.ShowRoot = false;
            m_treeControl.ImageList = ResourceUtil.GetImageList16();
            m_treeControl.ExpandAll();

            m_treeControl.NodeSelectedChanged += treeControl_NodeSelectedChanged;

            m_treeControlAdapter = new TreeControlAdapter(m_treeControl);
            m_treeControlAdapter.TreeView = settingsService.UserSettings;

            treePanel.Controls.Add(m_treeControl);

            m_propertyGrid = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
            m_propertyGrid.Dock = DockStyle.Fill;
            propertiesPanel.Controls.Add(m_propertyGrid);

            // select an initial node so something is displayed in the PropertyGrid
            TreeControl.Node firstNode = null;
            if (pathName != null)
                firstNode = m_treeControlAdapter.ExpandPath(m_settingsService.GetSettingsPath(pathName));
            if (firstNode == null) // in case pathName is not null, but ExpandPath returns null  
                firstNode = m_treeControl.ExpandToFirstLeaf();
            


            firstNode.Selected = true;
            ShowProperties(m_settingsService.GetProperties((Tree<object>)firstNode.Tag)); //does auto-setting of column widths

            defaultsButton.Click += DefaultsButton_Click;
        }
Пример #11
0
        public MatTab(MaterialSchemaLoader schemaLoader)
        {
            m_schemaLoader = schemaLoader;

            SuspendLayout();
            m_child = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();

            m_child.Location = new System.Drawing.Point(158, 3);
            m_child.Size     = new System.Drawing.Size(341, 188);
            m_child.TabIndex = 1;
            m_child.Dock     = DockStyle.Fill;
            m_child.Visible  = true;

            Controls.Add(m_child);
            Dock    = DockStyle.Fill;
            Padding = new System.Windows.Forms.Padding(0);
            ResumeLayout(false);
        }
Пример #12
0
        public DomExplorer(IControlHostService controlHostService)
        {
            m_controlHostService = controlHostService;

            m_treeControl                      = new TreeControl();
            m_treeControl.Dock                 = DockStyle.Fill;
            m_treeControl.AllowDrop            = true;
            m_treeControl.SelectionMode        = SelectionMode.MultiExtended;
            m_treeControl.ImageList            = ResourceUtil.GetImageList16();
            m_treeControl.NodeSelectedChanged += treeControl_NodeSelectedChanged;

            m_treeControlAdapter = new TreeControlAdapter(m_treeControl);
            m_treeView           = new TreeView();

            m_propertyGrid      = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
            m_propertyGrid.Dock = DockStyle.Fill;

            m_splitContainer      = new SplitContainer();
            m_splitContainer.Text = "Dom Explorer";
            m_splitContainer.Panel1.Controls.Add(m_treeControl);
            m_splitContainer.Panel2.Controls.Add(m_propertyGrid);
        }
Пример #13
0
        public DomExplorer(IControlHostService controlHostService)
        {
            m_controlHostService = controlHostService;

            m_treeControl = new TreeControl();
            m_treeControl.Dock = DockStyle.Fill;
            m_treeControl.AllowDrop = true;
            m_treeControl.SelectionMode = SelectionMode.MultiExtended;
            m_treeControl.ImageList = ResourceUtil.GetImageList16();
            m_treeControl.NodeSelectedChanged += treeControl_NodeSelectedChanged;

            m_treeControlAdapter = new TreeControlAdapter(m_treeControl);
            m_treeView = new TreeView();

            m_propertyGrid = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
            m_propertyGrid.Dock = DockStyle.Fill;

            m_splitContainer = new SplitContainer();
            m_splitContainer.Text = "Dom Explorer";
            m_splitContainer.Panel1.Controls.Add(m_treeControl);
            m_splitContainer.Panel2.Controls.Add(m_propertyGrid);
        }
Пример #14
0
        private void Init()
        {
            if (s_schemaLoader == null)
            {
                s_schemaLoader = new SchemaLoader();
            }
            m_PropertyGrid = new PropertyGrid(PropertyGridMode.PropertySorting | PropertyGridMode.DisplayDescriptions | PropertyGridMode.HideResetAllButton);
            m_treeControl  = new TreeControl();
            m_menu         = new MenuStrip();
            var fileMenu = new ToolStripMenuItem();
            var newMenu  = new ToolStripMenuItem();
            var openMenu = new ToolStripMenuItem();

            var exitMenu = new ToolStripMenuItem();
            var splitter = new SplitContainer();

            m_menu.SuspendLayout();
            splitter.BeginInit();
            splitter.Panel1.SuspendLayout();
            splitter.Panel2.SuspendLayout();
            splitter.SuspendLayout();

            SuspendLayout();

            // m_menu
            m_menu.Location = new System.Drawing.Point(0, 0);
            m_menu.Name     = "m_menu";
            m_menu.TabIndex = 0;
            m_menu.Text     = "m_menu";
            m_menu.Items.Add(fileMenu);


            // file
            fileMenu.Name             = "fileToolStripMenuItem";
            fileMenu.Size             = new System.Drawing.Size(37, 20);
            fileMenu.Text             = "File".Localize();
            fileMenu.DropDownOpening += new EventHandler(fileMenu_DropDownOpening);
            fileMenu.DropDownItems.AddRange(new ToolStripItem[]
            {
                newMenu,
                openMenu,
                m_openFolderMenu,
                m_saveMenu,
                m_saveAsMenu,
                exitMenu
            });

            // new
            newMenu.Name         = "newToolStripMenuItem";
            newMenu.ShortcutKeys = Keys.Control | Keys.N;
            newMenu.Text         = "New".Localize();
            newMenu.Click       += NewToolStripMenuItem_Click;

            //open
            openMenu.Name         = "openToolStripMenuItem";
            openMenu.ShortcutKeys = Keys.Control | Keys.O;
            openMenu.Text         = "Open...".Localize();
            openMenu.Click       += OpenToolStripMenuItem_Click;


            // open containing folder
            m_openFolderMenu.Name   = "OpenFolderMenu";
            m_openFolderMenu.Text   = "Open Containing Folder".Localize();
            m_openFolderMenu.Click += new EventHandler(OpenFolderMenu_Click);

            //save
            m_saveMenu.Name         = "saveToolStripMenuItem";
            m_saveMenu.ShortcutKeys = Keys.Control | Keys.S;
            m_saveMenu.Text         = "Save".Localize();
            m_saveMenu.Click       += SaveToolStripMenuItem_Click;

            // save as
            m_saveAsMenu.Name   = "saveAsToolStripMenuItem";
            m_saveAsMenu.Text   = "Save As...".Localize();
            m_saveAsMenu.Click += SaveAsToolStripMenuItem_Click;

            // exit
            exitMenu.Name   = "exitToolStripMenuItem";
            exitMenu.Text   = "Exit".Localize();
            exitMenu.Click += ExitToolStripMenuItem_Click;

            // tree control
            m_treeControl.Dock          = DockStyle.Fill;
            m_treeControl.Name          = "m_treeControl";
            m_treeControl.TabIndex      = 1;
            m_treeControl.Width         = 150;
            m_treeControl.ShowRoot      = false;
            m_treeControl.AllowDrop     = false;
            m_treeControl.SelectionMode = SelectionMode.One;
            m_treeControlAdapter        = new TreeControlAdapter(m_treeControl);

            // propertyGrid1
            m_PropertyGrid.Dock            = DockStyle.Fill;
            m_PropertyGrid.Name            = "propertyGrid1";
            m_PropertyGrid.TabIndex        = 3;
            m_PropertyGrid.PropertySorting = PropertySorting.None;

            // splitter
            splitter.Dock = DockStyle.Fill;
            splitter.Name = "splitContainer1";
            splitter.Panel1.Controls.Add(m_treeControl);
            splitter.Panel2.Controls.Add(m_PropertyGrid);
            splitter.SplitterDistance = 100;
            splitter.TabIndex         = 1;

            AutoScaleMode = AutoScaleMode.Font;
            ClientSize    = new System.Drawing.Size(600, 400);
            Controls.Add(splitter);
            Controls.Add(m_menu);
            MainMenuStrip = m_menu;
            Name          = "SkinEditor";
            Icon          = GdiUtil.CreateIcon(ResourceUtil.GetImage(Sce.Atf.Resources.AtfIconImage));
            UpdateTitleText();
            m_menu.ResumeLayout(false);
            m_menu.PerformLayout();
            splitter.Panel1.ResumeLayout(false);
            splitter.Panel2.ResumeLayout(false);
            splitter.EndInit();
            splitter.ResumeLayout(false);

            ResumeLayout(false);
            PerformLayout();
            splitter.SplitterDistance = 170;
        }
Пример #15
0
 public DescriptionControl(PropertyGrid propertyGrid)
 {
     m_propertyGrid = propertyGrid;
     m_textBrush    = new SolidBrush(SystemColors.WindowText);
     CreateBoldFont();
 }
Пример #16
0
        public virtual void Initialize()
        {
            // register a custom menu without any commands, so it won't appear in the main menu bar
            MenuInfo menuInfo = m_commandService.RegisterMenu(this, "RenderModes", "Rendering modes");
            ToolStrip strip = menuInfo.GetToolStrip();
          
             CommandInfo cmdInfo = m_commandService.RegisterCommand(                
                Command.RenderSmooth,
                StandardMenu.View,
                m_commandGroup,
                "Solid".Localize(),
                "Solid rendering".Localize(),
                Keys.None,
                Resources.SmoothImage,
                CommandVisibility.Menu,
                this);
             strip.Items.Add(cmdInfo.GetButton());

             cmdInfo = m_commandService.RegisterCommand(                
                Command.RenderWireFrame,
                StandardMenu.View,
                m_commandGroup,
                "Wireframe".Localize(),
                "Wireframe rendering".Localize(),
                Keys.None,
                Resources.WireframeImage,
                CommandVisibility.Menu,
                this);
             strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(                
                Command.RenderOutlined,
                StandardMenu.View,
                m_commandGroup,
                "SolidOverWire",
                "Solid over wireframe rendering".Localize(),
                Keys.None,
                Resources.OutlinedImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(                
                Command.RenderTextured,
                StandardMenu.View,
                m_commandGroup,
                "Textured".Localize(),
                "Textured rendering".Localize(),
                Keys.T,
                Resources.TexturedImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());


            cmdInfo = m_commandService.RegisterCommand(                
                Command.RenderLight,
                StandardMenu.View,
                m_commandGroup,
                "Lighting".Localize(),
                "Lighting".Localize(),
                Keys.L,
                Resources.LightImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(                
                Command.RenderBackFace,
                StandardMenu.View,
                m_commandGroup,
                "BackFace".Localize(),
                "Render back faces".Localize(),
                Keys.B,
                Resources.BackfaceImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
               Command.RenderShadow,
               StandardMenu.View,
               m_commandGroup,
               "Shadow".Localize(),
               "Render shadow".Localize(),
               Keys.None,
               Resources.ShadowImage,
               CommandVisibility.Menu,
               this);
            strip.Items.Add(cmdInfo.GetButton());


            cmdInfo = m_commandService.RegisterCommand(
             Command.RenderNormals,
             StandardMenu.View,
             m_commandGroup,
             "Normals".Localize(),
             "Render Normals".Localize(),
             Keys.None,
             Resources.NormalImage,
             CommandVisibility.Menu,
             this);
            strip.Items.Add(cmdInfo.GetButton());

            m_commandService.RegisterCommand(                
                Command.RenderCycle,
                StandardMenu.View,
                m_commandGroup,
                "CycleRenderModes".Localize(),
                "Cycle render modes".Localize(),
                Keys.Space,
                null,
                CommandVisibility.Menu,
                this);
          
            //cmdInfo = m_commandService.RegisterCommand(
            //  Command.RealTime,
            //  StandardMenu.View,
            //  m_commandGroup,
            //  "RealTime".Localize(),
            //  "Toggle real time rendering".Localize(),
            //  Keys.None,
            //  Resources.RealTimeImage,
            //  CommandVisibility.Menu,
            //  this);
            //strip.Items.Add(cmdInfo.GetButton());

            ControlInfo controlInfo = new ControlInfo("Render settings", "per view port render settings", StandardControlGroup.Hidden);
            
            m_propertyGrid = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
            m_controlHostService.RegisterControl(m_propertyGrid, controlInfo, null);                       

            if (m_scriptingService != null)
                m_scriptingService.SetVariable("renderCommands", this);
        }
Пример #17
0
        public virtual void Initialize()
        {
            // register a custom menu without any commands, so it won't appear in the main menu bar
            MenuInfo  menuInfo = m_commandService.RegisterMenu(this, "RenderModes", "Rendering modes");
            ToolStrip strip    = menuInfo.GetToolStrip();

            CommandInfo cmdInfo = m_commandService.RegisterCommand(
                Command.RenderSmooth,
                StandardMenu.View,
                m_commandGroup,
                "Solid".Localize(),
                "Solid rendering".Localize(),
                Keys.None,
                Resources.SmoothImage,
                CommandVisibility.Menu,
                this);

            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderWireFrame,
                StandardMenu.View,
                m_commandGroup,
                "Wireframe".Localize(),
                "Wireframe rendering".Localize(),
                Keys.None,
                Resources.WireframeImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderOutlined,
                StandardMenu.View,
                m_commandGroup,
                "SolidOverWire",
                "Solid over wireframe rendering".Localize(),
                Keys.None,
                Resources.OutlinedImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderTextured,
                StandardMenu.View,
                m_commandGroup,
                "Textured".Localize(),
                "Textured rendering".Localize(),
                Keys.T,
                Resources.TexturedImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());


            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderLight,
                StandardMenu.View,
                m_commandGroup,
                "Lighting".Localize(),
                "Lighting".Localize(),
                Keys.L,
                Resources.LightImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderBackFace,
                StandardMenu.View,
                m_commandGroup,
                "BackFace".Localize(),
                "Render back faces".Localize(),
                Keys.B,
                Resources.BackfaceImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderShadow,
                StandardMenu.View,
                m_commandGroup,
                "Shadow".Localize(),
                "Render shadow".Localize(),
                Keys.None,
                Resources.ShadowImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());


            cmdInfo = m_commandService.RegisterCommand(
                Command.RenderNormals,
                StandardMenu.View,
                m_commandGroup,
                "Normals".Localize(),
                "Render Normals".Localize(),
                Keys.None,
                Resources.NormalImage,
                CommandVisibility.Menu,
                this);
            strip.Items.Add(cmdInfo.GetButton());

            m_commandService.RegisterCommand(
                Command.RenderCycle,
                StandardMenu.View,
                m_commandGroup,
                "CycleRenderModes".Localize(),
                "Cycle render modes".Localize(),
                Keys.Space,
                null,
                CommandVisibility.Menu,
                this);

            //cmdInfo = m_commandService.RegisterCommand(
            //  Command.RealTime,
            //  StandardMenu.View,
            //  m_commandGroup,
            //  "RealTime".Localize(),
            //  "Toggle real time rendering".Localize(),
            //  Keys.None,
            //  Resources.RealTimeImage,
            //  CommandVisibility.Menu,
            //  this);
            //strip.Items.Add(cmdInfo.GetButton());

            ControlInfo controlInfo = new ControlInfo("Render settings", "per view port render settings", StandardControlGroup.Hidden);

            m_propertyGrid = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
            m_controlHostService.RegisterControl(m_propertyGrid, controlInfo, null);

            if (m_scriptingService != null)
            {
                m_scriptingService.SetVariable("renderCommands", this);
            }
        }
Пример #18
0
            public MultiPropControl()
            {
                m_propControls = new Sce.Atf.Controls.PropertyEditing.PropertyGrid[2];
                m_propControls[0] = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
                m_propControls[1] = new Sce.Atf.Controls.PropertyEditing.PropertyGrid();
                Layout += OnLayout;

                m_splitContainer = new SplitContainer();

                SuspendLayout();
                m_splitContainer.SuspendLayout();
                m_splitContainer.Panel1.SuspendLayout();
                m_splitContainer.Panel2.SuspendLayout();

                m_propControls[0].Dock = DockStyle.Fill;
                m_splitContainer.Panel1.Controls.Add(m_propControls[0]);

                m_propControls[1].Dock = DockStyle.Fill;
                m_splitContainer.Panel2.Controls.Add(m_propControls[1]);

                m_splitContainer.FixedPanel = FixedPanel.None;
                m_splitContainer.Dock = DockStyle.Fill;
                Controls.Add(m_splitContainer);

                m_splitContainer.Panel2.ResumeLayout(false);
                m_splitContainer.Panel1.ResumeLayout(false);
                m_splitContainer.ResumeLayout(false);
                this.ResumeLayout(true);
            }
Пример #19
0
        private void Init()
        {
            if (s_schemaLoader == null)
                s_schemaLoader = new SchemaLoader();
            m_PropertyGrid = new PropertyGrid(PropertyGridMode.PropertySorting | PropertyGridMode.DisplayDescriptions | PropertyGridMode.HideResetAllButton);
            m_treeControl = new TreeControl();
            m_menu = new MenuStrip();
            var fileMenu = new ToolStripMenuItem();
            var newMenu = new ToolStripMenuItem();
            var openMenu = new ToolStripMenuItem();

            var exitMenu = new ToolStripMenuItem();
            var splitter = new SplitContainer();

            m_menu.SuspendLayout();
            splitter.BeginInit();
            splitter.Panel1.SuspendLayout();
            splitter.Panel2.SuspendLayout();
            splitter.SuspendLayout();

            SuspendLayout();

            // m_menu
            m_menu.Location = new System.Drawing.Point(0, 0);
            m_menu.Name = "m_menu";
            m_menu.TabIndex = 0;
            m_menu.Text = "m_menu";
            m_menu.Items.Add(fileMenu);


            // file            
            fileMenu.Name = "fileToolStripMenuItem";
            fileMenu.Size = new System.Drawing.Size(37, 20);
            fileMenu.Text = "File".Localize();
            fileMenu.DropDownOpening += new EventHandler(fileMenu_DropDownOpening);
            fileMenu.DropDownItems.AddRange(new ToolStripItem[]
            {
                newMenu,             
                openMenu,
                m_openFolderMenu,
                m_saveMenu,
                m_saveAsMenu,
                exitMenu
            });

            // new
            newMenu.Name = "newToolStripMenuItem";
            newMenu.ShortcutKeys = Keys.Control | Keys.N;
            newMenu.Text = "New".Localize();
            newMenu.Click += NewToolStripMenuItem_Click;

            //open
            openMenu.Name = "openToolStripMenuItem";
            openMenu.ShortcutKeys = Keys.Control | Keys.O;
            openMenu.Text = "Open...".Localize();
            openMenu.Click += OpenToolStripMenuItem_Click;


            // open containing folder
            m_openFolderMenu.Name = "OpenFolderMenu";
            m_openFolderMenu.Text = "Open Containing Folder".Localize();
            m_openFolderMenu.Click += new EventHandler(OpenFolderMenu_Click);

            //save
            m_saveMenu.Name = "saveToolStripMenuItem";
            m_saveMenu.ShortcutKeys = Keys.Control | Keys.S;
            m_saveMenu.Text = "Save".Localize();
            m_saveMenu.Click += SaveToolStripMenuItem_Click;

            // save as
            m_saveAsMenu.Name = "saveAsToolStripMenuItem";
            m_saveAsMenu.Text = "Save As...".Localize();
            m_saveAsMenu.Click += SaveAsToolStripMenuItem_Click;

            // exit
            exitMenu.Name = "exitToolStripMenuItem";
            exitMenu.Text = "Exit".Localize();
            exitMenu.Click += ExitToolStripMenuItem_Click;

            // tree control
            m_treeControl.Dock = DockStyle.Fill;
            m_treeControl.Name = "m_treeControl";
            m_treeControl.TabIndex = 1;
            m_treeControl.Width = 150;
            m_treeControl.ShowRoot = false;
            m_treeControl.AllowDrop = false;
            m_treeControl.SelectionMode = SelectionMode.One;
            m_treeControlAdapter = new TreeControlAdapter(m_treeControl);

            // propertyGrid1            
            m_PropertyGrid.Dock = DockStyle.Fill;
            m_PropertyGrid.Name = "propertyGrid1";
            m_PropertyGrid.TabIndex = 3;
            m_PropertyGrid.PropertySorting = PropertySorting.None;

            // splitter           
            splitter.Dock = DockStyle.Fill;
            splitter.Name = "splitContainer1";
            splitter.Panel1.Controls.Add(m_treeControl);
            splitter.Panel2.Controls.Add(m_PropertyGrid);
            splitter.SplitterDistance = 100;
            splitter.TabIndex = 1;

            AutoScaleMode = AutoScaleMode.Font;
            ClientSize = new System.Drawing.Size(600, 400);
            Controls.Add(splitter);
            Controls.Add(m_menu);
            MainMenuStrip = m_menu;
            Name = "SkinEditor";
            Icon = GdiUtil.CreateIcon(ResourceUtil.GetImage(Sce.Atf.Resources.AtfIconImage));
            UpdateTitleText();
            m_menu.ResumeLayout(false);
            m_menu.PerformLayout();
            splitter.Panel1.ResumeLayout(false);
            splitter.Panel2.ResumeLayout(false);
            splitter.EndInit();
            splitter.ResumeLayout(false);

            ResumeLayout(false);
            PerformLayout();
            splitter.SplitterDistance = 170;
        }