Ejemplo n.º 1
0
        public ParameterForm(Parameters parameters, string title, string helpDescription, string helpOutput,
                             IList <string> helpSuppls, Action helpAction)
        {
            InitializeComponent();
            this.helpAction = helpAction;
            if (helpAction == null)
            {
                helpButton1.Width = 0;
                helpButton2.Width = 0;
            }
            okButton1.Click     += OkButtonClick;
            okButton2.Click     += OkButtonClick;
            cancelButton1.Click += CancelButtonClick;
            cancelButton2.Click += CancelButtonClick;
            helpButton1.Click   += HelpButtonClick;
            helpButton2.Click   += HelpButtonClick;
            Bitmap bm = new Bitmap(GraphUtils.ToBitmap(Bitmap2.GetImage("help.png")), 18, 18);

            helpButton1.Image = bm;
            helpButton2.Image = bm;
            KeyDown          += OnKeyDownHandler;
            Height            = (int)(parameterPanel1.Init(parameters) + 65);
            helpPanel1.Controls.Clear();
            helpPanel2.Controls.Clear();
            List <string> titles      = new List <string>();
            List <string> description = new List <string>();

            if (!string.IsNullOrEmpty(helpDescription))
            {
                titles.Add("Description");
                description.Add(helpDescription);
            }
            if (!string.IsNullOrEmpty(helpOutput))
            {
                titles.Add(" - ");
                description.Add(null);
                titles.Add("Output");
                description.Add(helpOutput);
            }
            if (helpSuppls != null)
            {
                for (int i = 0; i < helpSuppls.Count; i++)
                {
                    if (!string.IsNullOrEmpty(helpSuppls[i]))
                    {
                        titles.Add(" - ");
                        description.Add(null);
                        titles.Add("Suppl. table " + (i + 1));
                        description.Add(helpSuppls[i]);
                    }
                }
            }
            AddHelp(titles, description, title, helpPanel1);
            AddHelp(titles, description, title, helpPanel2);
        }
Ejemplo n.º 2
0
 public FilterForm(SubSelectionControl subSelectionControl)
 {
     InitializeComponent();
     this.subSelectionControl = subSelectionControl;
     addButton.Image          = GraphUtils.ToBitmap(Bitmap2.GetImage("plus1.bmp"));
     removeButton.Image       = GraphUtils.ToBitmap(Bitmap2.GetImage("minus1.bmp"));
     //Icon = GraphUtils.ToBitmap(Bitmap2.GetImage("Perseus.jpg"));
     addButton.Click    += AddButton_OnClick;
     removeButton.Click += RemoveButton_OnClick;
     RebuildGui();
 }
Ejemplo n.º 3
0
        public ParameterForm(Parameters parameters, string title, string helpDescription, string helpOutput,
                             IList <string> helpSuppls, Action helpAction)
        {
            InitializeComponent();
            this.helpAction = helpAction;
            if (helpAction == null)
            {
                helpButton.Width = 0;
            }
            okButton.Click     += OkButtonClick;
            cancelButton.Click += CancelButtonClick;
            helpButton.Click   += HelpButtonClick;
            helpButton.Image    = new Bitmap(GraphUtils.ToBitmap(Bitmap2.GetImage("help.png")), 18, 18);
            KeyDown            += OnKeyDownHandler;
            Height              = (int)(parameterPanel1.Init(parameters) + 65);
            helpPanel.Controls.Clear();
            List <string> titles      = new List <string>();
            List <string> description = new List <string>();

            if (!string.IsNullOrEmpty(helpDescription))
            {
                titles.Add("Description");
                description.Add(helpDescription);
            }
            if (!string.IsNullOrEmpty(helpOutput))
            {
                titles.Add(" - ");
                description.Add(null);
                titles.Add("Output");
                description.Add(helpOutput);
            }
            if (helpSuppls != null)
            {
                for (int i = 0; i < helpSuppls.Count; i++)
                {
                    if (!string.IsNullOrEmpty(helpSuppls[i]))
                    {
                        titles.Add(" - ");
                        description.Add(null);
                        titles.Add("Suppl. table " + (i + 1));
                        description.Add(helpSuppls[i]);
                    }
                }
            }
            TableLayoutPanel g = new TableLayoutPanel();

            g.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
            for (int i = 0; i < titles.Count; i++)
            {
                g.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize, 50));
            }
            g.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50));
            for (int i = 0; i < titles.Count; i++)
            {
                Label tb = new Label {
                    Text = titles[i]
                };
                //ToolTipService.SetShowDuration(tb, 400000);
                //if (description[i] != null){
                //	tb.ToolTip = new ToolTip{
                //		Content = StringUtils.Concat("\n", StringUtils.Wrap(description[i], 75))
                //	};
                //}
                g.Controls.Add(tb, i + 1, 0);
            }
            helpPanel.Controls.Add(g);
            Text = title;
        }