IndicatorPlugin::IndicatorPlugin() { saveFlag = FALSE; dateFlag = FALSE; logScale = FALSE; PlotLine pl; pl.getLineTypes(lineTypes); BarData it(pluginName); it.getInputFields(inputTypeList); opList.append("EQ"); opList.append("LT"); opList.append("LTEQ"); opList.append("GT"); opList.append("GTEQ"); opList.append("AND"); opList.append("OR"); opList.append("XOR"); maList.append("SMA"); // TA_MAType_SMA =0, maList.append("EMA"); // TA_MAType_EMA =1, maList.append("WMA"); // TA_MAType_WMA =2, maList.append("DEMA"); // TA_MAType_DEMA =3, maList.append("TEMA"); // TA_MAType_TEMA =4, maList.append("TRIMA"); // TA_MAType_TRIMA =5, maList.append("KAMA"); // TA_MAType_KAMA =6, maList.append("MAMA"); // TA_MAType_MAMA =7, maList.append("T3"); // TA_MAType_T3 =8 maList.append("Wilder"); }
FormulaEdit::FormulaEdit (QWidget *w, int t) : QWidget(w) { type = (FormulaEditType) t; /* FIXME: take no effect, outdated or not yet implemented? config.getPluginList(Config::IndicatorPluginPath, functionList); */ PlotLine pl; pl.getLineTypes(lineTypes); QHBoxLayout *hbox = new QHBoxLayout(this); hbox->setMargin(0); hbox->setSpacing(1); QTabWidget *tab = new QTabWidget(this); hbox->addWidget(tab); // create formula page QWidget *tw = new QWidget(this); QHBoxLayout *thbox = new QHBoxLayout(tw); thbox->setMargin(5); thbox->setSpacing(0); formula = new QTextEdit(tw); thbox->addWidget(formula); ftoolbar = new Toolbar(tw, Toolbar::Vertical); thbox->addWidget(ftoolbar); QString s = "open"; QString s2 = tr("Open Rule"); ftoolbar->addButton(s, openchart, s2); QObject::connect(ftoolbar->getButton(s), SIGNAL(clicked()), this, SLOT(openRule())); s = "include"; s2 = tr("Include Rule"); ftoolbar->addButton(s, include, s2); QObject::connect(ftoolbar->getButton(s), SIGNAL(clicked()), this, SLOT(includeRule())); s = "add"; s2 = tr("Function Dialog"); ftoolbar->addButton(s, insert, s2); QObject::connect(ftoolbar->getButton(s), SIGNAL(clicked()), this, SLOT(functionDialog())); tab->addTab(tw, tr("Formula")); // create plot page tw = new QWidget(this); thbox = new QHBoxLayout(tw); thbox->setMargin(5); thbox->setSpacing(0); plot = new QListBox(tw); connect(plot, SIGNAL(doubleClicked(QListBoxItem *)), this, SLOT(slotDoubleClicked(QListBoxItem *))); thbox->addWidget(plot); ptoolbar = new Toolbar(tw, Toolbar::Vertical); thbox->addWidget(ptoolbar); s = "insert"; s2 = tr("Insert"); ptoolbar->addButton(s, insert, s2); QObject::connect(ptoolbar->getButton(s), SIGNAL(clicked()), this, SLOT(insertPlotItem())); s = "edit"; s2 = tr("Edit"); ptoolbar->addButton(s, edit, s2); QObject::connect(ptoolbar->getButton(s), SIGNAL(clicked()), this, SLOT(editPlotItem())); s = "delete"; s2 = tr("Delete"); ptoolbar->addButton(s, deleteitem, s2); QObject::connect(ptoolbar->getButton(s), SIGNAL(clicked()), this, SLOT(deletePlotItem())); tab->addTab(tw, tr("Plot")); }