Exemple #1
0
		public void ShowPropertyGridItem(string category, string label)
		{
			RefreshPropertyGrid(); 
			GridItem gi = propertyGrid1.SelectedGridItem;
			while (gi != null && gi.GridItemType != GridItemType.Root)
				gi = gi.Parent;

			if (gi != null)
			{
				// Categories
				GridItemCollection categories = gi.GridItems;
				GridItem sliderCategory = categories[category];
				if (sliderCategory != null)
				{
					GridItemCollection items = sliderCategory.GridItems;
					GridItem item;
					if (label == "")
						item = items[Math.Min(10, items.Count-1)];
					else
						item = items[label];
					item.Select();
					if (item.Expandable)
					{
						propertyGrid1.ExpandAllGridItems();
						items = item.GridItems;
						items[Math.Min(10, items.Count-1)].Select();
					}
				}
			}
			RefreshPropertyGrid(); 
		}
Exemple #2
0
        private void Form1_Load(object sender, System.EventArgs e)
        {
            cbChartType.Text = "XYPlot";

            m_serData = new SeriesData(c1Chart1, ilTextures);
            propertyGrid1.SelectedObject = m_serData;
            propertyGrid1.ExpandAllGridItems();
        }
Exemple #3
0
        public CaPropForm(CaType cat)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            propertyGrid1.SelectedObject = cat;
            propertyGrid1.ExpandAllGridItems();
        }
Exemple #4
0
        // Gather image statistics
        public void GatherStatistics(Bitmap image)
        {
            // avoid calculation in the case of the same image
            if (image != null)
            {
                if (currentImageHash == image.GetHashCode( ))
                {
                    return;
                }
                currentImageHash = image.GetHashCode( );
            }
            else
            {
                propertyGrid.SelectedObject = null;
                return;
            }

            System.Diagnostics.Debug.WriteLine("--- Gathering stastics");

            // check pixel format
            if (image.PixelFormat == PixelFormat.Format24bppRgb)
            {
                // busy
                Capture = true;
                Cursor  = Cursors.WaitCursor;

                ColorImageStatisticsDescription statDesc = new ColorImageStatisticsDescription(image);
                // show statistics
                propertyGrid.SelectedObject = statDesc;
                propertyGrid.ExpandAllGridItems( );

                // free
                Cursor  = Cursors.Arrow;
                Capture = false;
            }
            else
            {
                propertyGrid.SelectedObject = null;
            }
        }
 private void InitializeComponent()
 {
     propertyOptions = new PropertyGrid();
     buttonOk = new Button();
     buttonCancel = new Button();
     panelTopMain = new Panel();
     panelBottomMain = new Panel();
     panelTopMain.SuspendLayout();
     panelBottomMain.SuspendLayout();
     base.SuspendLayout();
     propertyOptions.CommandsVisibleIfAvailable = true;
     propertyOptions.HelpVisible = false;
     propertyOptions.LargeButtons = false;
     propertyOptions.LineColor = SystemColors.ScrollBar;
     propertyOptions.Location = new Point(8, 8);
     propertyOptions.Name = "propertyOptions";
     propertyOptions.PropertySort = PropertySort.Alphabetical;
     propertyOptions.Dock = DockStyle.Fill;
     propertyOptions.TabIndex = 0;
     propertyOptions.Text = "PropertyGrid";
     propertyOptions.ToolbarVisible = false;
     propertyOptions.ViewBackColor = SystemColors.Window;
     propertyOptions.ViewForeColor = SystemColors.WindowText;
     propertyOptions.SelectedObject = Configuration.MasterConfig.Copy();
     buttonOk.DialogResult = DialogResult.Cancel;
     buttonOk.FlatStyle = FlatStyle.Popup;
     buttonOk.Location = new Point(8, 5);
     buttonOk.Name = "buttonOk";
     buttonOk.Size = new Size(50, 20);
     buttonOk.TabIndex = 1;
     buttonOk.Text = "OK";
     buttonOk.Click += new EventHandler(buttonOk_Click);
     buttonCancel.DialogResult = DialogResult.Cancel;
     buttonCancel.FlatStyle = FlatStyle.Popup;
     buttonCancel.Location = new Point(70, 5);
     buttonCancel.Name = "buttonCancel";
     buttonCancel.Size = new Size(50, 20);
     buttonCancel.TabIndex = 1;
     buttonCancel.Text = "Cancel";
     buttonCancel.Click += new EventHandler(buttonCancel_Click);
     panelTopMain.BorderStyle = BorderStyle.None;
     panelTopMain.Controls.AddRange(new Control[] {propertyOptions});
     panelTopMain.Dock = DockStyle.Fill;
     panelTopMain.Name = "panelTopMain";
     panelTopMain.Size = new Size(0, 250);
     panelTopMain.TabIndex = 0;
     panelBottomMain.BorderStyle = BorderStyle.None;
     panelBottomMain.Controls.AddRange(new Control[] {buttonOk, buttonCancel});
     panelBottomMain.Dock = DockStyle.Bottom;
     panelBottomMain.Size = new Size(0, 30);
     panelBottomMain.Name = "panelBottomMain";
     panelBottomMain.TabIndex = 1;
     base.AcceptButton = buttonOk;
     base.CancelButton = buttonCancel;
     AutoScaleBaseSize = new Size(5, 13);
     base.ClientSize = new Size(0x110, 0x12b);
     base.Controls.AddRange(new Control[] {panelTopMain, panelBottomMain});
     base.Name = "OptionDialog";
     Text = "Options ";
     panelTopMain.ResumeLayout(false);
     panelBottomMain.ResumeLayout(false);
     base.ResumeLayout(false);
     propertyOptions.ExpandAllGridItems();
 }
 public void ExpandAll()
 {
     propertyGrid.ExpandAllGridItems();
 }