//--------------------------------------------------------------------------------------------------------------------------------------------------- // // Copyright (C)2007 DarkWynter Studios. All rights reserved. // //--------------------------------------------------------------------------------------------------------------------------------------------------- // {Contact : darkwynter.com for licensing information //--------------------------------------------------------------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; namespace DarkWynter.App { public class TemplatesPanel : Panel { List panelTemplate; int currentTemplatePanel; /// /// Templates Panel /// //private System.Windows.Forms.Panel panelTemplates; private System.Windows.Forms.Label lableTemplates; public System.Windows.Forms.ListBox listBoxTemplates; private System.Windows.Forms.Button buttonTemplatesNew; private System.Windows.Forms.Button buttonTemplatesSave; private System.Windows.Forms.Button buttonTemplatesLoad; private System.Windows.Forms.Button buttonTemplateDelete; private System.Windows.Forms.Button buttonTemplateClone; /// /// Subtemplate Panel /// /// private System.Windows.Forms.Label labelSubTemplates; private System.Windows.Forms.ListBox listBoxSubTemplates; private System.Windows.Forms.Button buttonSubTemplatesToLibrary; private System.Windows.Forms.Button buttonSubTemplatesNew; private System.Windows.Forms.Button buttonSubTemplatesLoad; private System.Windows.Forms.Button buttonSubTemplatesSave; public TemplatesPanel() { this.buttonTemplatesSave = new System.Windows.Forms.Button(); this.buttonSubTemplatesToLibrary = new System.Windows.Forms.Button(); this.lableTemplates = new System.Windows.Forms.Label(); this.buttonTemplatesNew = new System.Windows.Forms.Button(); this.labelSubTemplates = new System.Windows.Forms.Label(); this.listBoxSubTemplates = new System.Windows.Forms.ListBox(); this.buttonTemplateDelete = new System.Windows.Forms.Button(); this.buttonSubTemplatesNew = new System.Windows.Forms.Button(); this.listBoxTemplates = new System.Windows.Forms.ListBox(); this.buttonSubTemplatesLoad = new System.Windows.Forms.Button(); this.buttonTemplateClone = new System.Windows.Forms.Button(); this.buttonSubTemplatesSave = new System.Windows.Forms.Button(); this.buttonTemplatesLoad = new System.Windows.Forms.Button(); this.SuspendLayout(); // // panelTemplates // this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.Location = new System.Drawing.Point(0, 0); this.Name = "panelTemplates"; this.Size = new System.Drawing.Size(300, 175); this.TabIndex = 14; #region Templates // // buttonTemplatesLoad // this.buttonTemplatesLoad.Location = new System.Drawing.Point(171, 139); this.buttonTemplatesLoad.Name = "buttonTemplatesLoad"; this.buttonTemplatesLoad.Size = new System.Drawing.Size(40, 22); this.buttonTemplatesLoad.TabIndex = 9; this.buttonTemplatesLoad.Text = "Load"; this.buttonTemplatesLoad.UseVisualStyleBackColor = true; //this.buttonTemplatesLoad.Click += new System.EventHandler(this.ObjectLibraryLoad_Click); // // buttonTemplatesNew // this.buttonTemplatesNew.Location = new System.Drawing.Point(125, 139); this.buttonTemplatesNew.Name = "buttonTemplatesNew"; this.buttonTemplatesNew.Size = new System.Drawing.Size(40, 22); this.buttonTemplatesNew.TabIndex = 14; this.buttonTemplatesNew.Text = "New"; this.buttonTemplatesNew.UseVisualStyleBackColor = true; // // buttonTemplatesSave // this.buttonTemplatesSave.Location = new System.Drawing.Point(217, 139); this.buttonTemplatesSave.Name = "buttonTemplatesSave"; this.buttonTemplatesSave.Size = new System.Drawing.Size(40, 22); this.buttonTemplatesSave.TabIndex = 10; this.buttonTemplatesSave.Text = "Save"; this.buttonTemplatesSave.UseVisualStyleBackColor = true; //this.buttonTemplatesSave.Click += new System.EventHandler(this.ObjectLibrarySave_Click); // // buttonSubTemplatesToLibrary // this.buttonSubTemplatesToLibrary.Location = new System.Drawing.Point(64, 170); this.buttonSubTemplatesToLibrary.Name = "buttonSubTemplatesToLibrary"; this.buttonSubTemplatesToLibrary.Size = new System.Drawing.Size(118, 22); this.buttonSubTemplatesToLibrary.TabIndex = 12; this.buttonSubTemplatesToLibrary.Text = "Copy To Library"; this.buttonSubTemplatesToLibrary.UseVisualStyleBackColor = false; this.buttonSubTemplatesToLibrary.Click += new System.EventHandler(this.buttonAddToLibrary_Click); // // lableTemplates // this.lableTemplates.AutoSize = true; this.lableTemplates.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lableTemplates.Location = new System.Drawing.Point(6, 18); this.lableTemplates.Name = "lableTemplates"; this.lableTemplates.Size = new System.Drawing.Size(92, 20); this.lableTemplates.TabIndex = 12; this.lableTemplates.Text = "Templates"; // // labelSubTemplates // this.labelSubTemplates.AutoSize = true; this.labelSubTemplates.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelSubTemplates.Location = new System.Drawing.Point(128, 18); this.labelSubTemplates.Name = "labelSubTemplates"; this.labelSubTemplates.Size = new System.Drawing.Size(124, 20); this.labelSubTemplates.TabIndex = 19; this.labelSubTemplates.Text = "SubTemplates"; // // listBoxSubTemplates // this.listBoxSubTemplates.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.listBoxSubTemplates.ForeColor = System.Drawing.Color.Maroon; this.listBoxSubTemplates.FormattingEnabled = true; this.listBoxSubTemplates.Location = new System.Drawing.Point(133, 41); this.listBoxSubTemplates.Name = "listBoxSubTemplates"; this.listBoxSubTemplates.Size = new System.Drawing.Size(120, 95); this.listBoxSubTemplates.TabIndex = 1; // // buttonTemplateDelete // this.buttonTemplateDelete.Location = new System.Drawing.Point(64, 142); this.buttonTemplateDelete.Name = "buttonTemplateDelete"; this.buttonTemplateDelete.Size = new System.Drawing.Size(46, 22); this.buttonTemplateDelete.TabIndex = 15; this.buttonTemplateDelete.Text = "Delete"; this.buttonTemplateDelete.UseVisualStyleBackColor = true; // // buttonSubTemplatesNew // this.buttonSubTemplatesNew.Location = new System.Drawing.Point(125, 142); this.buttonSubTemplatesNew.Name = "buttonSubTemplatesNew"; this.buttonSubTemplatesNew.Size = new System.Drawing.Size(40, 22); this.buttonSubTemplatesNew.TabIndex = 17; this.buttonSubTemplatesNew.Text = "New"; this.buttonSubTemplatesNew.UseVisualStyleBackColor = true; // // listBoxTemplates // this.listBoxTemplates.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); this.listBoxTemplates.ForeColor = System.Drawing.Color.Maroon; this.listBoxTemplates.FormattingEnabled = true; this.listBoxTemplates.Location = new System.Drawing.Point(10, 41); this.listBoxTemplates.Name = "listBoxTemplates"; this.listBoxTemplates.Size = new System.Drawing.Size(104, 95); this.listBoxTemplates.TabIndex = 0; this.listBoxTemplates.SelectedIndexChanged += new System.EventHandler(this.listBoxTemplateObjects_SelectedIndexChanged); // // buttonSubTemplatesLoad // this.buttonSubTemplatesLoad.Location = new System.Drawing.Point(171, 142); this.buttonSubTemplatesLoad.Name = "buttonSubTemplatesLoad"; this.buttonSubTemplatesLoad.Size = new System.Drawing.Size(40, 22); this.buttonSubTemplatesLoad.TabIndex = 15; this.buttonSubTemplatesLoad.Text = "Load"; this.buttonSubTemplatesLoad.UseVisualStyleBackColor = true; // // buttonTemplateClone // this.buttonTemplateClone.Location = new System.Drawing.Point(10, 142); this.buttonTemplateClone.Name = "buttonTemplateClone"; this.buttonTemplateClone.Size = new System.Drawing.Size(48, 22); this.buttonTemplateClone.TabIndex = 14; this.buttonTemplateClone.Text = "Clone"; this.buttonTemplateClone.UseVisualStyleBackColor = true; // // buttonSubTemplatesSave // this.buttonSubTemplatesSave.Location = new System.Drawing.Point(217, 142); this.buttonSubTemplatesSave.Name = "buttonSubTemplatesSave"; this.buttonSubTemplatesSave.Size = new System.Drawing.Size(40, 22); this.buttonSubTemplatesSave.TabIndex = 16; this.buttonSubTemplatesSave.Text = "Save"; this.buttonSubTemplatesSave.UseVisualStyleBackColor = true; #endregion this.Controls.Add(this.labelSubTemplates); this.Controls.Add(this.listBoxSubTemplates); this.Controls.Add(this.buttonTemplateDelete); this.Controls.Add(this.buttonSubTemplatesToLibrary); this.Controls.Add(this.buttonSubTemplatesNew); this.Controls.Add(this.lableTemplates); this.Controls.Add(this.listBoxTemplates); this.Controls.Add(this.buttonSubTemplatesLoad); this.Controls.Add(this.buttonTemplateClone); this.Controls.Add(this.buttonSubTemplatesSave); this.Controls.Add(this.buttonTemplatesLoad); this.Controls.Add(this.buttonTemplatesNew); this.Controls.Add(this.buttonTemplatesSave); this.ResumeLayout(false); this.PerformLayout(); } private void buttonAddToLibrary_Click(object sender, EventArgs e) { //currentTemplatePanel = this.templatesPanel.listBoxTemplates.SelectedIndex; //if (this.sceneLibraryPanel.currentContentPanel != -1) //{ // // Clone currently selected Template // ContentPanel panel = panelTemplate[currentTemplatePanel].Clone(); // // Add to the Content panel list // this.sceneLibraryPanel.Controls.Add(panel); // this.sceneLibraryPanel.listBoxSceneLibrary.Items.Add(panel.panelName); // // Show new panel // //ClearPropertiesPanel(); // this.Controls.Add(this.sceneLibraryPanel.panelContent[this.sceneLibraryPanel.panelContent.Count - 1]); //} } private void listBoxTemplateObjects_SelectedIndexChanged(object sender, EventArgs e) { //Load panel selected by user in ListBox currentTemplatePanel = this.listBoxTemplates.SelectedIndex; if (currentTemplatePanel != -1) { // Assumes ListBox and contentPanels use same indexing //ClearPropertiesPanel(); this.Controls.Add(this.panelTemplate[currentTemplatePanel]); } } } }