示例#1
0
  //-------------------------------------------------------------------------------------
  #region << Constructors >>
  public SimDateSelect() : base()
  {
   this.monthCalendar1 = new System.Windows.Forms.MonthCalendar();
   this.panel1 = new System.Windows.Forms.Panel();
   this.simLabel1 = new Sim.Controls.SimLabel();
   this.simPopupButton1 = new Sim.Controls.SimPopupButton();
   this.panelMain = new System.Windows.Forms.Panel();
   this.panelMain.SuspendLayout();
   this.panel1.SuspendLayout();
   // 
   // monthCalendar1
   // 
   this.monthCalendar1.Dock = System.Windows.Forms.DockStyle.Top;
   this.monthCalendar1.ShowToday = false;
   this.monthCalendar1.ShowTodayCircle = false;
   this.monthCalendar1.MaxSelectionCount = 1;
   this.monthCalendar1.DateSelected += new DateRangeEventHandler(monthCalendar1_DateSelected);
   // 
   // simLabel1
   // 
   this.simLabel1.AutoSize = false;
   this.simLabel1.Dock = System.Windows.Forms.DockStyle.Fill;
   this.simLabel1.Text = DateTime.Now.Date.ToString("dd.MM.yyyy");
   // 
   // simPopupButton1
   // 
   this.simPopupButton1.Dock = System.Windows.Forms.DockStyle.Right;
   this.simPopupButton1.Image = global::Sim.Controls.Properties.Resources.OK;
   this.simPopupButton1.Size = new System.Drawing.Size(21, 21);
   this.simPopupButton1.Click += new EventHandler(simPopupButton1_Click);
   // 
   // panel1
   // 
   this.panel1.Controls.Add(this.simLabel1);
   this.panel1.Controls.Add(this.simPopupButton1);
   this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
   this.panel1.Padding = new System.Windows.Forms.Padding(0, 0, 3, 0);
   this.panel1.Size = new System.Drawing.Size(315, 21);
   // 
   // panelMain
   // 
   this.panelMain.Controls.Add(this.panel1);
   this.panelMain.Controls.Add(this.monthCalendar1);
   this.panelMain.Padding = new System.Windows.Forms.Padding(0);
   this.panelMain.BackColor = System.Drawing.Color.Transparent;
   this.panel1.ResumeLayout();
   this.panelMain.ResumeLayout();
   this.panelMain.Size = new Size(monthCalendar1.Height-5, monthCalendar1.Height + panel1.Height-5);


   base.Control = panelMain;

  }
示例#2
0
		//-------------------------------------------------------------------------------------
		private void treeContextMenuStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
		{
			try
			{
				ContextMenuStrip menu = (ContextMenuStrip)sender;
				menu.Hide();
				if(tree == null || SelectedNodeItem == null)
					return;
				switch(e.ClickedItem.Name)
				{
					case "toolStripMenuItemCount":
						{
							Point p = menu.Location;
							SimLabel l = new SimLabel();
							l.Image = Properties.Resources.Info;
							l.Text = "Количество конечных элементов: " + tree.GetEndItems(SelectedNodeItem).Count().ToString();
							l.BackColor = Color.Transparent;
							l.Width = l.GetPreferredSize(Size.Empty).Width + 20;
							SimPopupControl.Show(l, p, false, true);
							//MessageBox.Show("Количество конечных элементов: " + 
							//                 tree.GetEndItems(SelectedNodeItem).Count.ToString(),
							//                 "Количество элементов",
							//                 MessageBoxButtons.OK, MessageBoxIcon.Information);
						}
						break;
					case "toolStripMenuItemExAll":
						ExpandAll(SelectedNodeItem);
						break;
					case "toolStripMenuItemColAll":
						CollapseAll(SelectedNodeItem);
						if(SelectedNodeItem.Parent == null)
							Expand(SelectedNodeItem);
						break;
				}
			}
			catch(Exception Err)
			{
				Sim.Controls.ErrorBox.Show(Err);
			}
		}
示例#3
0
 /// <summary> 
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
  this.slText = new Sim.Controls.SimLabel();
  this.slValue = new Sim.Controls.SimLabel();
  this.SuspendLayout();
  // 
  // slText
  // 
  this.slText.AutoSize = true;
  this.slText.Dock = System.Windows.Forms.DockStyle.Left;
  this.slText.Location = new System.Drawing.Point(0, 0);
  this.slText.MinimumSize = new System.Drawing.Size(30, 18);
  this.slText.Name = "slText";
  this.slText.Size = new System.Drawing.Size(54, 18);
  this.slText.Text = "Заголовок";
  // 
  // slValue
  // 
  this.slValue.BackColor = System.Drawing.Color.Ivory;
  this.slValue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
  this.slValue.Dock = System.Windows.Forms.DockStyle.Fill;
  this.slValue.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
  this.slValue.Location = new System.Drawing.Point(54, 0);
  this.slValue.MinimumSize = new System.Drawing.Size(30, 18);
  this.slValue.Image = global::Sim.Controls.Properties.Resources.Edit4;
  this.slValue.Name = "slValue";
  this.slValue.Size = new System.Drawing.Size(75, 18);
  this.slValue.Text = null;
  this.slValue.MouseLeave += new System.EventHandler(this.slValue_MouseLeave);
  this.slValue.MouseMove += new System.Windows.Forms.MouseEventHandler(this.slValue_MouseMove);
  this.slValue.MouseUp += new System.Windows.Forms.MouseEventHandler(this.slValue_MouseUp);
  // 
  // SimPropertyEditor
  // 
  this.AutoSize = true;
  this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
  this.BackColor = System.Drawing.Color.Transparent;
  this.Controls.Add(this.slValue);
  this.Controls.Add(this.slText);
  this.MinimumSize = new System.Drawing.Size(0, 18);
  this.Name = "SimPropertyEditor";
  this.Size = new System.Drawing.Size(129, 18);
  this.ResumeLayout(false);
  this.PerformLayout();
 }
示例#4
0
		/// <summary>
		/// ћетод, вызываемый при выборе элемента контекстного меню по умолчанию.
		/// </summary>
		/// <param name="sender">sender</param>
		/// <param name="e">e</param>
		protected virtual void OnDefaultContextMenuItemsClick(object sender, EventArgs e)
		{
			try
			{
				if(sender as ToolStripSeparator != null)
					return;
				Point p = contextMenuStrip1.Location;
				contextMenuStrip1.Hide();
				switch(((ToolStripMenuItem)sender).Name)
				{
					case "toolStripMenuItemSelectAll":
						this.SelectAll();
						break;
					case "toolStripMenuItemCopy":
						{
							DataObject obj = GetClipboardContent();
							Clipboard.SetDataObject(obj, true);
						} break;
					case "toolStripMenuItemCopyCell":
						{
							DataObject obj = GetCellClipboardContent();
							Clipboard.SetDataObject(obj, true);
							break;
						}
					case "toolStripMenuItemFind":
						p = this.PointToClient(p);
						HitTestInfo hti = this.HitTest(p.X, p.Y);
						Find(hti.ColumnIndex);
						break;
					case "toolStripMenuItemCount":
						{
							SimLabel l = new SimLabel();
							l.Image = Properties.Resources.Info;
							l.Text = "„исло строк : " + this.RowCount.ToString();
							l.BackColor = Color.Transparent;
							l.Width = l.GetPreferredSize(Size.Empty).Width + 10;
							SimPopupControl.Show(l, p, false, true);
							//MessageBox.Show("„исло строк : " + this.RowCount.ToString(),
							//               "SimDataGridView Info",
							//               MessageBoxButtons.OK,
							//               MessageBoxIcon.Information);
						}
						break;
					case "toolStripMenuItemExportExcel":
						DoExport(true);
						break;
					case "toolStripMenuItemExportCsv":
						DoExport(false);
						break;
				}
			}
			catch(Exception Err)
			{
				ErrorBox.Show(Err);
			}
		}