Beispiel #1
0
        public void Configurate(IPluginConfig Input)
        {
            //nothing to configure in this plugin
            //only used in conjunction with inputs of type cmpdConfigurate
            if (Input == FListCount)
            {
                FWindowWidth = this.Width;
                double count;
                FListCount.GetValue(0, out count);
                int diff = FComboList.Count - (int)Math.Round(count);

                if (diff > 0)         //delete pins
                {
                    for (int i = 0; i < diff; i++)
                    {
                        Controls.RemoveAt(FComboList.Count - 1);
                        FComboList.RemoveAt(FComboList.Count - 1);
                    }
                }

                else if (diff < 0)         //create pins
                {
                    double cols, newWidth;
                    FColumns.GetValue(0, out cols);
                    newWidth = FWindowWidth / cols;
                    for (int i = 0; i > diff; i--)
                    {
                        ComboBoxSpread newCombo = new ComboBoxSpread(FComboList.Count, (int)newWidth, (int)cols);
                        Controls.Add(newCombo);
                        FComboList.Add(newCombo);
                    }
                }
                Refresh();
            }

            if (Input == FColumns)
            {
                FWindowWidth = this.Width;
                double cols, newWidth;
                FColumns.GetValue(0, out cols);
                newWidth = FWindowWidth / cols;
                foreach (ComboBoxSpread c in FComboList)
                {
                    c.SetBox((int)cols, (int)newWidth);
                }
                Refresh();
            }
        }
Beispiel #2
0
 private void InitializeComponent()
 {
     this.startCombo = new ComboBoxSpread(FComboList.Count, 150, 1);
     this.SuspendLayout();
     //
     // GUITemplateWrk
     //
     this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
     this.Controls.Add(startCombo);
     this.DoubleBuffered = true;
     this.Name           = "DropDownString";
     this.Size           = new System.Drawing.Size(150, 25);
     this.Load          += new System.EventHandler(this.GUITemplatePluginLoad);
     this.ResumeLayout(false);
     FWindowWidth = this.Width;
 }