示例#1
0
        private void InitializeSceneViewPage()
        {
            m_sceneViewPage = new SceneViewPageControl();
            m_sceneViewPage.Dock = DockStyle.Fill;

            AddTabPage(m_sceneViewPage, TAB_NAME_SCENE_VIEW);

            m_sceneViewPage.RefreshContent();
            m_sceneViewPage.StartServer();
            m_sceneViewPage.RebuildFilesList();
            m_sceneViewPage.RegisterPropertyEditors();
        }
        public SceneViewAssetsControl(SceneViewPageControl owner)
        {
            MetroSkinManager.ApplyMetroStyle(this);
            m_owner = owner;
            m_backImage = Bitmap.FromFile("resources/icons/appbar.arrow.left.png");
            m_dirImage = Bitmap.FromFile("resources/icons/appbar.folder.png");
            m_fileImage = Bitmap.FromFile("resources/icons/appbar.page.png");
            m_fileCodeImage = Bitmap.FromFile("resources/icons/appbar.page.code.png");
            m_fileImageImage = Bitmap.FromFile("resources/icons/appbar.page.image.png");
            m_fileMusicImage = Bitmap.FromFile("resources/icons/appbar.page.music.png");
            m_fileTextImage = Bitmap.FromFile("resources/icons/appbar.page.text.png");
            m_fileDataImage = Bitmap.FromFile("resources/icons/appbar.page.xml.png");
            Resize += SceneViewAssetsControl_Resize;

            m_toolbarPanel = new MetroPanel();
            MetroSkinManager.ApplyMetroStyle(m_toolbarPanel);
            m_toolbarPanel.Dock = DockStyle.Top;
            m_toolbarPanel.Height = DEFAULT_SIZE;

            m_menuAddTile = new MetroTileIcon();
            MetroSkinManager.ApplyMetroStyle(m_menuAddTile);
            m_menuAddTile.Top = 2;
            m_menuAddTile.Width = DEFAULT_SIZE - 4;
            m_menuAddTile.Height = DEFAULT_SIZE - 4;
            m_menuAddTile.Image = Bitmap.FromFile("resources/icons/appbar.add.png");
            m_menuAddTile.IsImageScaled = true;
            m_menuAddTile.ImageScale = new PointF(0.5f, 0.5f);
            m_menuAddTile.MouseUp += m_menuAddTile_MouseUp;
            m_toolbarPanel.Controls.Add(m_menuAddTile);

            m_menuTypeCombobox = new MetroComboBox();
            MetroSkinManager.ApplyMetroStyle(m_menuTypeCombobox);
            m_menuTypeCombobox.Left = m_menuAddTile.Right + DEFAULT_SEPARATOR;
            m_menuTypeCombobox.Width = 100;
            m_menuTypeCombobox.Height = DEFAULT_SIZE;
            m_menuTypeCombobox.BindingContext = new BindingContext();
            m_menuTypeCombobox.DataSource = ASSET_TYPES;
            m_menuTypeCombobox.SelectedValueChanged += m_menuTypeCombobox_SelectedValueChanged;
            m_toolbarPanel.Controls.Add(m_menuTypeCombobox);

            m_menuSearchTextbox = new MetroTextBox();
            MetroSkinManager.ApplyMetroStyle(m_menuSearchTextbox);
            m_menuSearchTextbox.Left = m_menuTypeCombobox.Right + DEFAULT_SEPARATOR;
            m_menuSearchTextbox.Width = 250;
            m_menuSearchTextbox.Height = DEFAULT_SIZE;
            m_menuSearchTextbox.Text = "";
            m_menuSearchTextbox.TextChanged += m_menuSearchTextbox_TextChanged;
            m_toolbarPanel.Controls.Add(m_menuSearchTextbox);

            m_menuPathLabel = new MetroLabel();
            MetroSkinManager.ApplyMetroStyle(m_menuPathLabel);
            m_menuPathLabel.Left = m_menuSearchTextbox.Right + DEFAULT_SEPARATOR;
            m_menuPathLabel.Width = 0;
            m_menuPathLabel.Height = 0;
            m_menuPathLabel.Text = "";
            m_menuPathLabel.AutoSize = true;
            m_toolbarPanel.Controls.Add(m_menuPathLabel);

            m_filesListPanel = new MetroPanel();
            MetroSkinManager.ApplyMetroStyle(m_filesListPanel);
            m_filesListPanel.Dock = DockStyle.Fill;

            m_filesListScrollbar = new MetroScrollBar(MetroScrollOrientation.Horizontal);
            MetroSkinManager.ApplyMetroStyle(m_filesListScrollbar);
            m_filesListScrollbar.Dock = DockStyle.Bottom;
            m_filesListScrollbar.Scroll += m_filesListScrollbar_Scroll;

            Controls.Add(m_filesListPanel);
            Controls.Add(m_toolbarPanel);
            Controls.Add(m_filesListScrollbar);

            UpdateScrollbar();
        }
示例#3
0
 public void DeinitializeProjectPages()
 {
     if (m_buildPage != null)
     {
         RemoveTabPage(TAB_NAME_BUILD);
         m_buildPage.Dispose();
         m_buildPage = null;
     }
     if (m_sceneViewPage != null)
     {
         RemoveTabPage(TAB_NAME_SCENE_VIEW);
         m_sceneViewPage.Dispose();
         m_sceneViewPage = null;
     }
 }