Deprecated: Required parameter $errors follows optional parameter $type in /customers/5/9/f/padowan.dk/httpd.www/forum/include/parser.php on line 524

Topic: List out all the function in the graph

i want to display all the function in a dropdown box. so than i can select it and do some calculation over it.
thanks

Re: List out all the function in the graph

I am unsure what you are asking. But the following will show a form with a drop down box. You can find the documentation for TComboBox here: http://docwiki.embarcadero.com/Librarie … .TComboBox

F = vcl.TForm(None)
Box = vcl.TComboBox(None, Parent=F, Left=16, Top=16,  Style="csDropDownList")
Box.Items.Add("sin")
Box.Items.Add("cos")
Box.Items.Add("log")
Button = vcl.TButton(None, Parent=F, Left=16, Top=50, Caption="OK", ModalResult=1)
F.ShowModal()
print("Selected item:", Box.Items.Strings[Box.ItemIndex])

Re: List out all the function in the graph

thanks ivan
i actually want to select one function which is already plotted on the graph.
i wish to list out all the function present in the Graph.FunctionList  into the dropdown list.
if any new function is added to the functioList then it should also appear in the dropdown list.
thanks

Re: List out all the function in the graph

Okay, now I understand. The following example will show a form with a drop down box with all the standard functions. It will update when new items are added to the function list.

def Update(Elem):
  Box.Items.Clear()
  for Item in Graph.FunctionList:
    if isinstance(Item, Graph.TStdFunc):    
      Box.Items.Add(Item.Text)

Form = vcl.TForm(None)
Box = vcl.TComboBox(None, Parent=Form, Left=16, Top=16,  Style="csDropDownList")
Update(None)
Form.Show()
Graph.OnNewElem.append(Update)