home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / netxp / netxp.exe / Samples / CS / Bars / TestPopup.cs < prev    next >
Encoding:
Text File  |  2004-03-16  |  5.3 KB  |  149 lines

  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using NETXP.Controls.Bars;
  7.  
  8. namespace Bars
  9. {
  10.     /// <summary>
  11.     /// Summary description for TestPopup.
  12.     /// </summary>
  13.     public class TestPopup : NETXP.Library.PopupForm
  14.     {
  15.         private NETXP.Controls.Bars.CommandBar commandBar1;
  16.         private NETXP.Controls.Bars.CommandBarButtonItem commandBarButtonItem1;
  17.         private NETXP.Controls.Bars.CommandBarSeparatorItem commandBarSeparatorItem1;
  18.         private NETXP.Controls.Bars.CommandBarButtonItem commandBarButtonItem2;
  19.         private NETXP.Controls.Bars.CommandBarButtonItem commandBarButtonItem3;
  20.         private NETXP.Controls.Bars.CommandBarButtonItem commandBarButtonItem4;
  21.         private System.Windows.Forms.ToolTip toolTip1;
  22.         private System.ComponentModel.IContainer components;
  23.  
  24.         public TestPopup()
  25.         {
  26.             //
  27.             // Required for Windows Form Designer support
  28.             //
  29.             InitializeComponent();
  30.  
  31.             this.commandBarButtonItem1.Click += new EventHandler(commandBarButtonItem1_Click);
  32.         }
  33.  
  34.         public void SetManager(CommandBarManager bm)
  35.         {
  36.             this.commandBar1.Renderer = bm.Renderer;
  37.         }
  38.  
  39.         /// <summary>
  40.         /// Clean up any resources being used.
  41.         /// </summary>
  42.         protected override void Dispose( bool disposing )
  43.         {
  44.             if( disposing )
  45.             {
  46.                 if(components != null)
  47.                 {
  48.                     components.Dispose();
  49.                 }
  50.             }
  51.             base.Dispose( disposing );
  52.         }
  53.  
  54.         #region Windows Form Designer generated code
  55.         /// <summary>
  56.         /// Required method for Designer support - do not modify
  57.         /// the contents of this method with the code editor.
  58.         /// </summary>
  59.         private void InitializeComponent()
  60.         {
  61.             this.components = new System.ComponentModel.Container();
  62.             System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TestPopup));
  63.             this.commandBar1 = new NETXP.Controls.Bars.CommandBar();
  64.             this.commandBarButtonItem1 = new NETXP.Controls.Bars.CommandBarButtonItem();
  65.             this.commandBarSeparatorItem1 = new NETXP.Controls.Bars.CommandBarSeparatorItem();
  66.             this.commandBarButtonItem2 = new NETXP.Controls.Bars.CommandBarButtonItem();
  67.             this.commandBarButtonItem3 = new NETXP.Controls.Bars.CommandBarButtonItem();
  68.             this.commandBarButtonItem4 = new NETXP.Controls.Bars.CommandBarButtonItem();
  69.             this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
  70.             ((System.ComponentModel.ISupportInitialize)(this.commandBar1)).BeginInit();
  71.             this.SuspendLayout();
  72.             // 
  73.             // commandBar1
  74.             // 
  75.             this.commandBar1.AutoFocus = false;
  76.             this.commandBar1.BackColor = System.Drawing.Color.Transparent;
  77.             this.commandBar1.Cursor = System.Windows.Forms.Cursors.Default;
  78.             this.commandBar1.CustomBackground = true;
  79.             this.commandBar1.CustomizeText = "&Customize Toolbar...";
  80.             this.commandBar1.Dock = System.Windows.Forms.DockStyle.Top;
  81.             this.commandBar1.ID = 548;
  82.             this.commandBar1.Items.AddRange(new NETXP.Controls.Bars.CommandBarItem[] {
  83.                                                                                          this.commandBarButtonItem1,
  84.                                                                                          this.commandBarSeparatorItem1,
  85.                                                                                          this.commandBarButtonItem2});
  86.             this.commandBar1.Location = new System.Drawing.Point(0, 0);
  87.             this.commandBar1.Margins.Bottom = 1;
  88.             this.commandBar1.Margins.Left = 1;
  89.             this.commandBar1.Margins.Right = 1;
  90.             this.commandBar1.Margins.Top = 1;
  91.             this.commandBar1.Name = "commandBar1";
  92.             this.commandBar1.Size = new System.Drawing.Size(168, 41);
  93.             this.commandBar1.TabIndex = 0;
  94.             this.commandBar1.TabStop = false;
  95.             this.commandBar1.Text = "commandBar1";
  96.             // 
  97.             // commandBarButtonItem1
  98.             // 
  99.             this.commandBarButtonItem1.Image = ((System.Drawing.Image)(resources.GetObject("commandBarButtonItem1.Image")));
  100.             this.commandBarButtonItem1.ShowText = true;
  101.             this.commandBarButtonItem1.Text = "Test";
  102.             // 
  103.             // commandBarButtonItem2
  104.             // 
  105.             this.commandBarButtonItem2.Image = ((System.Drawing.Image)(resources.GetObject("commandBarButtonItem2.Image")));
  106.             this.commandBarButtonItem2.Items.AddRange(new NETXP.Controls.Bars.CommandBarItem[] {
  107.                                                                                                    this.commandBarButtonItem3,
  108.                                                                                                    this.commandBarButtonItem4});
  109.             this.commandBarButtonItem2.Text = "Abc";
  110.             this.commandBarButtonItem2.Click += new System.EventHandler(this.commandBarButtonItem2_Click);
  111.             // 
  112.             // commandBarButtonItem3
  113.             // 
  114.             this.commandBarButtonItem3.Text = "Test1";
  115.             // 
  116.             // commandBarButtonItem4
  117.             // 
  118.             this.commandBarButtonItem4.Text = "Test2";
  119.             // 
  120.             // TestPopup
  121.             // 
  122.             this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  123.             this.BackColor = System.Drawing.SystemColors.Window;
  124.             this.ClientSize = new System.Drawing.Size(168, 96);
  125.             this.Controls.Add(this.commandBar1);
  126.             this.Name = "TestPopup";
  127.             this.Paint += new System.Windows.Forms.PaintEventHandler(this.TestPopup_Paint);
  128.             ((System.ComponentModel.ISupportInitialize)(this.commandBar1)).EndInit();
  129.             this.ResumeLayout(false);
  130.  
  131.         }
  132.         #endregion
  133.  
  134.         private void TestPopup_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
  135.         {
  136.             e.Graphics.DrawRectangle(SystemPens.WindowFrame, 0, 0, Width-1, Height-1);
  137.         }
  138.  
  139.         private void commandBarButtonItem1_Click(object sender, EventArgs e)
  140.         {
  141.             Close();
  142.         }
  143.  
  144.         private void commandBarButtonItem2_Click(object sender, System.EventArgs e)
  145.         {
  146.         }
  147.     }
  148. }
  149.