home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / netxp / netxp.exe / Samples / CS / Docking / Form1.cs < prev    next >
Encoding:
Text File  |  2004-04-09  |  11.3 KB  |  275 lines

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using System.Data;
  7. using NETXP.Controls.Docking;
  8.  
  9. namespace Docking
  10. {
  11.     /// <summary>
  12.     /// Summary description for Form1.
  13.     /// </summary>
  14.     public class Form1 : System.Windows.Forms.Form
  15.     {
  16.         private NETXP.Controls.Docking.DockingManagerExtender dockingManagerExtender1;
  17.         private System.Windows.Forms.Panel panelSettings;
  18.         private System.Windows.Forms.PropertyGrid propertyGrid1;
  19.         private System.Windows.Forms.Label label1;
  20.         private System.Windows.Forms.ImageList imageList1;
  21.         private System.Windows.Forms.Panel panel1;
  22.         private NETXP.Controls.Docking.TabbedGroups tabbedGroups1;
  23.         private System.Windows.Forms.TreeView treeView2;
  24.         private System.Windows.Forms.RadioButton radioButton1;
  25.         private System.Windows.Forms.RadioButton radioButton2;
  26.         private System.Windows.Forms.RadioButton radioButton3;
  27.         private System.ComponentModel.IContainer components;
  28.  
  29.         public Form1()
  30.         {
  31.             //
  32.             // Required for Windows Form Designer support
  33.             //
  34.             InitializeComponent();
  35.         }
  36.  
  37.         /// <summary>
  38.         /// Clean up any resources being used.
  39.         /// </summary>
  40.         protected override void Dispose( bool disposing )
  41.         {
  42.             if( disposing )
  43.             {
  44.                 if (components != null) 
  45.                 {
  46.                     components.Dispose();
  47.                 }
  48.             }
  49.             base.Dispose( disposing );
  50.         }
  51.  
  52.         #region Windows Form Designer generated code
  53.         /// <summary>
  54.         /// Required method for Designer support - do not modify
  55.         /// the contents of this method with the code editor.
  56.         /// </summary>
  57.         private void InitializeComponent()
  58.         {
  59.             this.components = new System.ComponentModel.Container();
  60.             System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
  61.             this.dockingManagerExtender1 = new NETXP.Controls.Docking.DockingManagerExtender(this.components);
  62.             this.panel1 = new System.Windows.Forms.Panel();
  63.             this.tabbedGroups1 = new NETXP.Controls.Docking.TabbedGroups();
  64.             this.label1 = new System.Windows.Forms.Label();
  65.             this.panelSettings = new System.Windows.Forms.Panel();
  66.             this.radioButton3 = new System.Windows.Forms.RadioButton();
  67.             this.radioButton2 = new System.Windows.Forms.RadioButton();
  68.             this.radioButton1 = new System.Windows.Forms.RadioButton();
  69.             this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
  70.             this.treeView2 = new System.Windows.Forms.TreeView();
  71.             this.imageList1 = new System.Windows.Forms.ImageList(this.components);
  72.             this.panel1.SuspendLayout();
  73.             ((System.ComponentModel.ISupportInitialize)(this.tabbedGroups1)).BeginInit();
  74.             this.panelSettings.SuspendLayout();
  75.             this.SuspendLayout();
  76.             // 
  77.             // dockingManagerExtender1
  78.             // 
  79.             this.dockingManagerExtender1.ContainerControl = this;
  80.             this.dockingManagerExtender1.InnerControl = this.panel1;
  81.             this.dockingManagerExtender1.OuterControl = this.label1;
  82.             // 
  83.             // panel1
  84.             // 
  85.             this.panel1.Controls.Add(this.tabbedGroups1);
  86.             this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
  87.             this.dockingManagerExtender1.SetFullTitle(this.panel1, "panel1");
  88.             this.panel1.Location = new System.Drawing.Point(144, 0);
  89.             this.panel1.Name = "panel1";
  90.             this.panel1.Size = new System.Drawing.Size(280, 390);
  91.             this.panel1.TabIndex = 8;
  92.             this.dockingManagerExtender1.SetTitle(this.panel1, "panel1");
  93.             // 
  94.             // tabbedGroups1
  95.             // 
  96.             this.tabbedGroups1.ActiveNode = null;
  97.             this.tabbedGroups1.AllowDrop = true;
  98.             this.tabbedGroups1.AtLeastOneNode = false;
  99.             this.tabbedGroups1.CloseShortcut = System.Windows.Forms.Shortcut.CtrlShiftC;
  100.             this.tabbedGroups1.Dirty = true;
  101.             this.tabbedGroups1.Dock = System.Windows.Forms.DockStyle.Fill;
  102.             this.tabbedGroups1.Location = new System.Drawing.Point(0, 0);
  103.             this.tabbedGroups1.MoveNextShortcut = System.Windows.Forms.Shortcut.CtrlShiftN;
  104.             this.tabbedGroups1.MovePreviousShortcut = System.Windows.Forms.Shortcut.CtrlShiftP;
  105.             this.tabbedGroups1.Name = "tabbedGroups1";
  106.             this.tabbedGroups1.ProportionalResizeShortcut = System.Windows.Forms.Shortcut.CtrlShiftR;
  107.             this.tabbedGroups1.SelectedNode = null;
  108.             this.tabbedGroups1.SelectedShortcut = System.Windows.Forms.Shortcut.CtrlShiftT;
  109.             this.tabbedGroups1.Size = new System.Drawing.Size(280, 390);
  110.             this.tabbedGroups1.SplitHorizontalShortcut = System.Windows.Forms.Shortcut.CtrlShiftH;
  111.             this.tabbedGroups1.SplitVerticalShortcut = System.Windows.Forms.Shortcut.CtrlShiftV;
  112.             this.tabbedGroups1.TabIndex = 0;
  113.             // 
  114.             // label1
  115.             // 
  116.             this.label1.Dock = System.Windows.Forms.DockStyle.Bottom;
  117.             this.label1.Location = new System.Drawing.Point(0, 390);
  118.             this.label1.Name = "label1";
  119.             this.label1.Size = new System.Drawing.Size(592, 0);
  120.             this.label1.TabIndex = 7;
  121.             this.label1.Text = "label1";
  122.             // 
  123.             // panelSettings
  124.             // 
  125.             this.dockingManagerExtender1.SetAllowDocking(this.panelSettings, true);
  126.             this.panelSettings.Controls.Add(this.radioButton3);
  127.             this.panelSettings.Controls.Add(this.radioButton2);
  128.             this.panelSettings.Controls.Add(this.radioButton1);
  129.             this.panelSettings.Dock = System.Windows.Forms.DockStyle.Left;
  130.             this.dockingManagerExtender1.SetFullTitle(this.panelSettings, "Settings");
  131.             this.dockingManagerExtender1.SetIcon(this.panelSettings, ((System.Drawing.Image)(resources.GetObject("panelSettings.Icon"))));
  132.             this.panelSettings.Location = new System.Drawing.Point(0, 0);
  133.             this.dockingManagerExtender1.SetMinimumSize(this.panelSettings, 80);
  134.             this.panelSettings.Name = "panelSettings";
  135.             this.panelSettings.Size = new System.Drawing.Size(144, 390);
  136.             this.panelSettings.TabIndex = 4;
  137.             this.dockingManagerExtender1.SetTitle(this.panelSettings, "Settings");
  138.             // 
  139.             // radioButton3
  140.             // 
  141.             this.radioButton3.Location = new System.Drawing.Point(16, 64);
  142.             this.radioButton3.Name = "radioButton3";
  143.             this.radioButton3.Size = new System.Drawing.Size(112, 24);
  144.             this.radioButton3.TabIndex = 2;
  145.             this.radioButton3.Text = "Windows Default";
  146.             this.radioButton3.CheckedChanged += new System.EventHandler(this.radioButton3_CheckedChanged);
  147.             // 
  148.             // radioButton2
  149.             // 
  150.             this.radioButton2.Location = new System.Drawing.Point(16, 40);
  151.             this.radioButton2.Name = "radioButton2";
  152.             this.radioButton2.Size = new System.Drawing.Size(112, 24);
  153.             this.radioButton2.TabIndex = 1;
  154.             this.radioButton2.Text = "Office XP";
  155.             this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
  156.             // 
  157.             // radioButton1
  158.             // 
  159.             this.radioButton1.Checked = true;
  160.             this.radioButton1.Location = new System.Drawing.Point(16, 16);
  161.             this.radioButton1.Name = "radioButton1";
  162.             this.radioButton1.Size = new System.Drawing.Size(112, 24);
  163.             this.radioButton1.TabIndex = 0;
  164.             this.radioButton1.TabStop = true;
  165.             this.radioButton1.Text = "Office 2003";
  166.             this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
  167.             // 
  168.             // propertyGrid1
  169.             // 
  170.             this.dockingManagerExtender1.SetAllowDocking(this.propertyGrid1, true);
  171.             this.propertyGrid1.CommandsVisibleIfAvailable = true;
  172.             this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Right;
  173.             this.dockingManagerExtender1.SetFullTitle(this.propertyGrid1, "Properties");
  174.             this.dockingManagerExtender1.SetIcon(this.propertyGrid1, ((System.Drawing.Image)(resources.GetObject("propertyGrid1.Icon"))));
  175.             this.propertyGrid1.LargeButtons = false;
  176.             this.propertyGrid1.LineColor = System.Drawing.SystemColors.ScrollBar;
  177.             this.propertyGrid1.Location = new System.Drawing.Point(424, 0);
  178.             this.dockingManagerExtender1.SetMinimumSize(this.propertyGrid1, 80);
  179.             this.propertyGrid1.Name = "propertyGrid1";
  180.             this.propertyGrid1.Size = new System.Drawing.Size(168, 390);
  181.             this.propertyGrid1.TabIndex = 5;
  182.             this.propertyGrid1.Text = "propertyGrid1";
  183.             this.dockingManagerExtender1.SetTitle(this.propertyGrid1, "Properties");
  184.             this.propertyGrid1.ViewBackColor = System.Drawing.SystemColors.Window;
  185.             this.propertyGrid1.ViewForeColor = System.Drawing.SystemColors.WindowText;
  186.             // 
  187.             // treeView2
  188.             // 
  189.             this.dockingManagerExtender1.SetAllowDocking(this.treeView2, true);
  190.             this.treeView2.Dock = System.Windows.Forms.DockStyle.Bottom;
  191.             this.dockingManagerExtender1.SetFullTitle(this.treeView2, "Tree View");
  192.             this.dockingManagerExtender1.SetIcon(this.treeView2, ((System.Drawing.Image)(resources.GetObject("treeView2.Icon"))));
  193.             this.treeView2.ImageIndex = -1;
  194.             this.treeView2.Location = new System.Drawing.Point(144, 238);
  195.             this.dockingManagerExtender1.SetMinimumSize(this.treeView2, 100);
  196.             this.treeView2.Name = "treeView2";
  197.             this.treeView2.SelectedImageIndex = -1;
  198.             this.treeView2.Size = new System.Drawing.Size(280, 152);
  199.             this.treeView2.TabIndex = 9;
  200.             this.dockingManagerExtender1.SetTitle(this.treeView2, "Tree View");
  201.             // 
  202.             // imageList1
  203.             // 
  204.             this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
  205.             this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
  206.             this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
  207.             this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
  208.             // 
  209.             // Form1
  210.             // 
  211.             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  212.             this.ClientSize = new System.Drawing.Size(592, 390);
  213.             this.Controls.Add(this.treeView2);
  214.             this.Controls.Add(this.panel1);
  215.             this.Controls.Add(this.propertyGrid1);
  216.             this.Controls.Add(this.panelSettings);
  217.             this.Controls.Add(this.label1);
  218.             this.Name = "Form1";
  219.             this.Text = "Form1";
  220.             this.Load += new System.EventHandler(this.Form1_Load);
  221.             this.panel1.ResumeLayout(false);
  222.             ((System.ComponentModel.ISupportInitialize)(this.tabbedGroups1)).EndInit();
  223.             this.panelSettings.ResumeLayout(false);
  224.             this.ResumeLayout(false);
  225.  
  226.         }
  227.         #endregion
  228.  
  229.         /// <summary>
  230.         /// The main entry point for the application.
  231.         /// </summary>
  232.         [STAThread]
  233.         static void Main() 
  234.         {
  235.             Application.Run(new Form1());
  236.         }
  237.  
  238.         private void Form1_Load(object sender, System.EventArgs e)
  239.         {
  240.             TabGroupNode tn = this.tabbedGroups1.RootSequence.AddNewNode();
  241.             tn.TabPages.Add(new NETXP.Controls.Docking.TabPage("Test 1"));
  242.             tn.TabPages.Add(new NETXP.Controls.Docking.TabPage("Test 2"));
  243.             tn = this.tabbedGroups1.RootSequence.AddNewNode();
  244.             tn.TabPages.Add(new NETXP.Controls.Docking.TabPage("Test 3"));
  245.         }
  246.  
  247.         private void radioButton1_CheckedChanged(object sender, System.EventArgs e)
  248.         {
  249.             if(radioButton1.Checked)
  250.             {
  251.                 this.dockingManagerExtender1.DockingManager.Renderer = new NETXP.Controls.Docking.Renderers.Office2003();
  252.                 this.tabbedGroups1.Renderer = new NETXP.Controls.Docking.Renderers.Office2003();
  253.             }
  254.         }
  255.  
  256.         private void radioButton2_CheckedChanged(object sender, System.EventArgs e)
  257.         {
  258.             if(radioButton2.Checked)
  259.             {
  260.                 this.dockingManagerExtender1.DockingManager.Renderer = new NETXP.Controls.Docking.Renderers.OfficeXP();
  261.                 this.tabbedGroups1.Renderer = new NETXP.Controls.Docking.Renderers.OfficeXP();
  262.             }        
  263.         }
  264.  
  265.         private void radioButton3_CheckedChanged(object sender, System.EventArgs e)
  266.         {
  267.             if(radioButton3.Checked)
  268.             {
  269.                 this.dockingManagerExtender1.DockingManager.Renderer = new NETXP.Controls.Docking.Renderers.WindowsDefault();
  270.                 this.tabbedGroups1.Renderer = new NETXP.Controls.Docking.Renderers.WindowsDefault();
  271.             }
  272.         }
  273.     }
  274. }
  275.