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(); }
public void RefreshContent() { m_filesListPanel.Controls.Clear(); MainForm mainForm = FindForm() as MainForm; if (mainForm == null || mainForm.ProjectModel == null) return; MetroTileIcon tile; bool upDownRow = false; int x = 0; string assetsPath = Path.Combine(mainForm.ProjectModel.WorkingDirectory, "assets"); if (m_viewPath == null) m_viewPath = assetsPath; m_menuPathLabel.Text = m_viewPath; DirectoryInfo info = new DirectoryInfo(m_viewPath); if (!info.Exists) return; if (m_viewPath != assetsPath) { tile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(tile); tile.Tag = info.FullName + @"\.."; tile.Top = DEFAULT_SEPARATOR; tile.Left = x; tile.Size = DEFAULT_TILE_SIZE; tile.Image = m_backImage; tile.IsImageScaled = true; tile.ImageScale = new PointF(0.85f, 0.85f); tile.MouseUp += tile_MouseUp; m_filesListPanel.Controls.Add(tile); upDownRow = !upDownRow; } DirectoryInfo[] dirs = info.GetDirectories(); foreach (var dirInfo in dirs) { tile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(tile); tile.Tag = dirInfo.FullName; tile.Top = upDownRow ? (DEFAULT_SEPARATOR + DEFAULT_TILE_SIZE.Height + DEFAULT_SEPARATOR) : DEFAULT_SEPARATOR; tile.Left = x; tile.Size = DEFAULT_TILE_SIZE; tile.Text = dirInfo.Name; tile.TextAlign = ContentAlignment.BottomRight; tile.TileTextFontSize = MetroTileTextSize.Small; tile.TileTextFontWeight = MetroTileTextWeight.Regular; tile.Image = m_dirImage; tile.IsImageScaled = true; tile.ImageScale = new PointF(0.85f, 0.85f); tile.ImageAlign = ContentAlignment.TopLeft; tile.ImageOffset = new Point(-10, -10); tile.MouseUp += tile_MouseUp; m_filesListPanel.Controls.Add(tile); upDownRow = !upDownRow; if (!upDownRow) x += DEFAULT_TILE_SIZE.Width + DEFAULT_SEPARATOR; } string ext; foreach (var fileInfo in info.GetFiles()) { ext = Path.GetExtension(fileInfo.Name); tile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(tile); tile.Tag = fileInfo.FullName; tile.Top = upDownRow ? (DEFAULT_SEPARATOR + DEFAULT_TILE_SIZE.Height + DEFAULT_SEPARATOR) : DEFAULT_SEPARATOR; tile.Left = x; tile.Size = DEFAULT_TILE_SIZE; tile.Text = ext + "\n" + Path.GetFileNameWithoutExtension(fileInfo.Name); tile.TextAlign = ContentAlignment.BottomRight; tile.TileTextFontSize = MetroTileTextSize.Small; tile.TileTextFontWeight = MetroTileTextWeight.Regular; if (ext == ".js") tile.Image = m_fileCodeImage; else if (ext == ".png" || ext == ".jpg" || ext == ".jpeg") tile.Image = m_fileImageImage; else if (ext == ".ogg" || ext == ".mp3") tile.Image = m_fileMusicImage; else if (ext == ".txt") tile.Image = m_fileTextImage; else if (ext == ".json" || ext == ".xml" || ext == ".js") tile.Image = m_fileDataImage; else tile.Image = m_fileImage; tile.IsImageScaled = true; tile.ImageScale = new PointF(0.85f, 0.85f); tile.ImageAlign = ContentAlignment.TopLeft; tile.ImageOffset = new Point(-10, -10); tile.MouseUp += tile_MouseUp; m_filesListPanel.Controls.Add(tile); upDownRow = !upDownRow; if (!upDownRow) x += DEFAULT_TILE_SIZE.Width + DEFAULT_SEPARATOR; } UpdateScrollbar(); }
private void InitializeSpecific() { m_specificPanel = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(m_specificPanel); m_specificPanel.Size = new Size(); m_specificPanel.AutoSize = true; m_specificPanel.Left = DEFAULT_SECTION_SEPARATOR; m_specificPanel.Top = m_generalPanel.Bottom + DEFAULT_SECTION_SEPARATOR; Controls.Add(m_specificPanel); MetroLabel title = new MetroLabel(); MetroSkinManager.ApplyMetroStyle(title); title.Text = "Project-specific"; title.Size = new Size(); title.AutoSize = true; m_specificPanel.Controls.Add(title); m_specificExportProjectTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_specificExportProjectTile); m_specificExportProjectTile.Text = "EXPORT\nPROJECT"; m_specificExportProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.page.upload.png"); m_specificExportProjectTile.Size = DEFAULT_TILE_SIZE; m_specificExportProjectTile.Location = new Point(DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_specificExportProjectTile.Click += new EventHandler(m_specificExportProjectTile_Click); m_specificPanel.Controls.Add(m_specificExportProjectTile); m_specificCloseProjectTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_specificCloseProjectTile); m_specificCloseProjectTile.Text = "CLOSE\nPROJECT"; m_specificCloseProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.close.png"); m_specificCloseProjectTile.Size = DEFAULT_TILE_SIZE; m_specificCloseProjectTile.Location = new Point(m_specificExportProjectTile.Right + DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_specificCloseProjectTile.Click += new EventHandler(m_specificCloseProjectTile_Click); m_specificPanel.Controls.Add(m_specificCloseProjectTile); }
private void InitializeGeneral() { m_generalPanel = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(m_generalPanel); m_generalPanel.Size = new Size(); m_generalPanel.AutoSize = true; m_generalPanel.Left = DEFAULT_SECTION_SEPARATOR; m_generalPanel.Top = DEFAULT_SECTION_SEPARATOR; Controls.Add(m_generalPanel); MetroLabel title = new MetroLabel(); MetroSkinManager.ApplyMetroStyle(title); title.Text = "General"; title.Size = new Size(); title.AutoSize = true; m_generalPanel.Controls.Add(title); m_generalNewProjectTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_generalNewProjectTile); m_generalNewProjectTile.Text = "NEW\nPROJECT"; m_generalNewProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.page.new.png"); m_generalNewProjectTile.Size = DEFAULT_TILE_SIZE; m_generalNewProjectTile.Location = new Point(DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_generalNewProjectTile.Click += new EventHandler(m_generalNewProjectTile_Click); m_generalPanel.Controls.Add(m_generalNewProjectTile); m_generalOpenProjectTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_generalOpenProjectTile); m_generalOpenProjectTile.Text = "OPEN\nPROJECT"; m_generalOpenProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.page.edit.png"); m_generalOpenProjectTile.Size = DEFAULT_TILE_SIZE; m_generalOpenProjectTile.Location = new Point(m_generalNewProjectTile.Right + DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_generalOpenProjectTile.Click += new EventHandler(m_generalOpenProjectTile_Click); m_generalPanel.Controls.Add(m_generalOpenProjectTile); //m_generalImportProjectTile = new MetroTileIcon(); //MetroSkinManager.ApplyMetroStyle(m_generalImportProjectTile); //m_generalImportProjectTile.Text = "IMPORT\nPROJECT"; //m_generalImportProjectTile.Image = Bitmap.FromFile("resources/icons/appbar.page.download.png"); //m_generalImportProjectTile.Size = DEFAULT_TILE_SIZE; //m_generalImportProjectTile.Location = new Point(m_generalOpenProjectTile.Right + DEFAULT_TILE_SEPARATOR.X, title.Bottom + DEFAULT_TILE_SEPARATOR.Y); //m_generalImportProjectTile.Click += new EventHandler(m_generalImportProjectTile_Click); //m_generalPanel.Controls.Add(m_generalImportProjectTile); }
public BuildPageControl() { MetroSkinManager.ApplyMetroStyle(this); AutoScroll = true; Disposed += BuildPageControl_Disposed; m_buildDebugTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_buildDebugTile); m_buildDebugTile.Text = "DEBUG\nBUILD"; m_buildDebugTile.Image = Bitmap.FromFile("resources/icons/appbar.cog.png"); m_buildDebugTile.Size = DEFAULT_TILE_SIZE; m_buildDebugTile.Location = new Point(64, 64); m_buildDebugTile.Click += m_buildDebugTile_Click; Controls.Add(m_buildDebugTile); m_buildReleaseTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_buildReleaseTile); m_buildReleaseTile.Text = "RELEASE\nBUILD"; m_buildReleaseTile.Image = Bitmap.FromFile("resources/icons/appbar.cog.png"); m_buildReleaseTile.Size = DEFAULT_TILE_SIZE; m_buildReleaseTile.Location = new Point(m_buildDebugTile.Left, m_buildDebugTile.Bottom + DEFAULT_TILE_SEPARATOR.Y); m_buildReleaseTile.Click += m_buildReleaseTile_Click; Controls.Add(m_buildReleaseTile); m_buildAndRunDebugTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_buildAndRunDebugTile); m_buildAndRunDebugTile.Text = "DEBUG\nBUILD AND RUN"; m_buildAndRunDebugTile.Image = Bitmap.FromFile("resources/icons/appbar.control.play.png"); m_buildAndRunDebugTile.Size = DEFAULT_TILE_SIZE; m_buildAndRunDebugTile.Location = new Point(m_buildDebugTile.Right + DEFAULT_TILE_SEPARATOR.X, m_buildDebugTile.Top); m_buildAndRunDebugTile.Click += m_buildAndRunDebugTile_Click; Controls.Add(m_buildAndRunDebugTile); m_buildAndRunReleaseTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_buildAndRunReleaseTile); m_buildAndRunReleaseTile.Text = "RELEASE\nBUILD AND RUN"; m_buildAndRunReleaseTile.Image = Bitmap.FromFile("resources/icons/appbar.control.play.png"); m_buildAndRunReleaseTile.Size = DEFAULT_TILE_SIZE; m_buildAndRunReleaseTile.Location = new Point(m_buildReleaseTile.Right + DEFAULT_TILE_SEPARATOR.X, m_buildReleaseTile.Top); m_buildAndRunReleaseTile.Click += m_buildAndRunReleaseTile_Click; Controls.Add(m_buildAndRunReleaseTile); m_runDebugTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_runDebugTile); m_runDebugTile.Text = "DEBUG\nRUN"; m_runDebugTile.Image = Bitmap.FromFile("resources/icons/appbar.control.play.png"); m_runDebugTile.Size = DEFAULT_TILE_SIZE; m_runDebugTile.Location = new Point(m_buildAndRunDebugTile.Right + DEFAULT_TILE_SEPARATOR.X, m_buildAndRunDebugTile.Top); m_runDebugTile.Click += m_runDebugTile_Click; Controls.Add(m_runDebugTile); m_runReleaseTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_runReleaseTile); m_runReleaseTile.Text = "RELEASE\nRUN"; m_runReleaseTile.Image = Bitmap.FromFile("resources/icons/appbar.control.play.png"); m_runReleaseTile.Size = DEFAULT_TILE_SIZE; m_runReleaseTile.Location = new Point(m_buildAndRunReleaseTile.Right + DEFAULT_TILE_SEPARATOR.X, m_buildAndRunReleaseTile.Top); m_runReleaseTile.Click += m_runReleaseTile_Click; Controls.Add(m_runReleaseTile); m_cleanDebugTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_cleanDebugTile); m_cleanDebugTile.Text = "DEBUG\nCLEAN"; m_cleanDebugTile.Image = Bitmap.FromFile("resources/icons/appbar.delete.png"); m_cleanDebugTile.Size = DEFAULT_TILE_SIZE; m_cleanDebugTile.Location = new Point(m_runDebugTile.Right + DEFAULT_TILE_SEPARATOR.X, m_runDebugTile.Top); m_cleanDebugTile.Click += m_cleanDebugTile_Click; Controls.Add(m_cleanDebugTile); m_cleanReleaseTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_cleanReleaseTile); m_cleanReleaseTile.Text = "RELEASE\nCLEAN"; m_cleanReleaseTile.Image = Bitmap.FromFile("resources/icons/appbar.delete.png"); m_cleanReleaseTile.Size = DEFAULT_TILE_SIZE; m_cleanReleaseTile.Location = new Point(m_runReleaseTile.Right + DEFAULT_TILE_SEPARATOR.X, m_runReleaseTile.Top); m_cleanReleaseTile.Click += m_cleanReleaseTile_Click; Controls.Add(m_cleanReleaseTile); }
public MetroSidePanel() { MetroSkinManager.ApplyMetroStyle(this); m_moveAnim = new MoveAnimation(); Padding = new Padding(4); MetroPanel contentPanel = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(contentPanel); contentPanel.Dock = DockStyle.Fill; Controls.Add(contentPanel); m_content = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(m_content); m_content.Dock = DockStyle.Fill; m_content.Controls.Clear(); m_content.ControlAdded += new ControlEventHandler(m_content_ControlAdded); m_content.ControlRemoved += new ControlEventHandler(m_content_ControlRemoved); contentPanel.Controls.Add(m_content); m_contentScrollbarV = new MetroScrollBar(MetroScrollOrientation.Vertical); MetroSkinManager.ApplyMetroStyle(m_contentScrollbarV); m_contentScrollbarV.Dock = DockStyle.Right; m_contentScrollbarV.Scroll += new ScrollEventHandler(m_contentScrollbarV_Scroll); contentPanel.Controls.Add(m_contentScrollbarV); m_contentScrollbarH = new MetroScrollBar(MetroScrollOrientation.Horizontal); MetroSkinManager.ApplyMetroStyle(m_contentScrollbarH); m_contentScrollbarH.Dock = DockStyle.Bottom; m_contentScrollbarH.Scroll += new ScrollEventHandler(m_contentScrollbarH_Scroll); contentPanel.Controls.Add(m_contentScrollbarH); MetroPanel titlePanel = new MetroPanel(); MetroSkinManager.ApplyMetroStyle(titlePanel); titlePanel.Height = 20; titlePanel.Dock = DockStyle.Top; Controls.Add(titlePanel); m_titleBar = new MetroTile(); MetroSkinManager.ApplyMetroStyle(m_titleBar); m_titleBar.Text = "SidePanelControler"; m_titleBar.Height = titlePanel.Height; m_titleBar.Click += new EventHandler(m_titleBar_Click); titlePanel.Controls.Add(m_titleBar); m_dockImage = Bitmap.FromFile("resources/icons/appbar.pin.png"); m_undockImage = Bitmap.FromFile("resources/icons/appbar.pin.remove.png"); m_dockTile = new MetroTileIcon(); MetroSkinManager.ApplyMetroStyle(m_dockTile); m_dockTile.Size = new Size(titlePanel.Height, titlePanel.Height); m_dockTile.Image = m_dockImage; m_dockTile.ImageAlign = ContentAlignment.MiddleCenter; m_dockTile.IsImageScaled = true; m_dockTile.ImageScale = new PointF(0.5f, 0.5f); m_dockTile.Click += new EventHandler(m_dockTile_Click); titlePanel.Controls.Add(m_dockTile); Load += new EventHandler(SidePanelControl_Load); ParentChanged += new EventHandler(SidePanelControl_ParentChanged); Fit(); Apply(); UpdateScrollbars(); }