当前位置: 首页>>代码示例>>C++>>正文


C++ PrefDialog类代码示例

本文整理汇总了C++中PrefDialog的典型用法代码示例。如果您正苦于以下问题:C++ PrefDialog类的具体用法?C++ PrefDialog怎么用?C++ PrefDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PrefDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PrefDialog

void SYMBOL::formatDialog (QStringList &, QString &rv, QString &rs)
{
    rs.truncate(0);
    rv.truncate(0);
    QString pl = QObject::tr("Parms");
    QString vnl = QObject::tr("Variable Name");
    QString sl = QObject::tr("Symbol");
    PrefDialog *dialog = new PrefDialog(0);
    dialog->setCaption(QObject::tr("SYMBOL Format"));
    dialog->createPage (pl);
    dialog->setHelpFile(helpFile);

    QString s;
    Config config;
    dialog->addTextItem(vnl, pl, s);
    config.getData(Config::DataPath, s);
    dialog->addSymbolItem(sl, pl, s, symbol);

    int rc = dialog->exec();

    if (rc == QDialog::Accepted)
    {
        dialog->getText(vnl, rv);
        dialog->getSymbol(sl, rs);
    }

    delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:28,代码来源:SYMBOL.cpp

示例2: tr

void VerticalLine::prefDialog ()
{
  QString pl = tr("Details");
  QString cl = tr("Color");
  QString sd = tr("Set Default");

  PrefDialog *dialog = new PrefDialog();
  dialog->setCaption(tr("Edit VerticalLine"));
  dialog->createPage (pl);
  dialog->setHelpFile (helpFile);
  dialog->addColorPrefItem(cl, pl, color);
  dialog->addCheckItem(sd, pl, FALSE);

  int rc = dialog->exec();

  if (rc == QDialog::Accepted)
  {
    dialog->getColor(cl, color);

    bool f = dialog->getCheck(sd);
    if (f)
    {
      defaultColor = color;
      saveDefaults();
    }

    emit signalDraw();
  }

  delete dialog;
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:31,代码来源:VerticalLine.cpp

示例3: PrefDialog

void PP::formatDialog (QStringList &, QString &rv, QString &rs)
{
  rs.truncate(0);
  rv.truncate(0);
  QString pl = QObject::tr("Parms");
  QString vnl = QObject::tr("Variable Name");
  QString ppl = QObject::tr("PP Level");
  PrefDialog *dialog = new PrefDialog(0);
  dialog->setCaption(QObject::tr("PP Format"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  QString s;
  dialog->addTextItem(vnl, pl, s);
  dialog->addComboItem(ppl, pl, ppList, 0);

  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getText(vnl, rv);
    dialog->getCombo(ppl, rs);
  }

  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:26,代码来源:PP.cpp

示例4: PrefDialog

int DbPlugin::ccPref ()
{
  int rc = 0;
  QString pl = QObject::tr("Parms");
  QString gl = QObject::tr("Gapless");
  PrefDialog *dialog = new PrefDialog(0);
  dialog->setCaption(QObject::tr("Edit CC"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  QString s = "Adjustment";
  QString s2;
  getData(s, s2);
  dialog->addCheckItem(gl, pl, s2.toInt());

  int trc = dialog->exec();
  if (trc == QDialog::Accepted)
  {
    s2 = QString::number(dialog->getCheck(gl));
    setData(s, s2);
    rc = TRUE;
  }

  delete dialog;
  return rc;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:26,代码来源:DbPlugin.cpp

示例5: PrefDialog

bool Spread::prefDialog (QString &fs, QString &ss)
{
  QString pl = QObject::tr("Parms");
  QString fsl = QObject::tr("First Symbol");
  QString ssl = QObject::tr("Second Symbol");
  PrefDialog *dialog = new PrefDialog(0);
  dialog->setCaption(QObject::tr("Edit Spread"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  Config config;
  QString s;
  config.getData(Config::DataPath, s);
  dialog->addSymbolItem(fsl, pl, s, fs);
  dialog->addSymbolItem(ssl, pl, s, ss);

  int rc = dialog->exec();
  if (rc == QDialog::Accepted)
  {
    dialog->getSymbol(fsl, fs);
    dialog->getSymbol(ssl, ss);
    delete dialog;
    return TRUE;
  }
  delete dialog;
  return FALSE;
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:27,代码来源:Spread.cpp

示例6: set_state

/**
    \return  A dialog to get settings for this extension
	\brief   Create a dialog for preference for this extension

	Calls the implementation to get the preferences.
*/
bool
Output::prefs (void)
{
    if (!loaded())
        set_state(Extension::STATE_LOADED);
    if (!loaded()) return false;

    Gtk::Widget * controls;
    controls = imp->prefs_output(this);
    if (controls == NULL) {
        // std::cout << "No preferences for Output" << std::endl;
        return true;
    }

    PrefDialog * dialog = new PrefDialog(this->get_name(), this->get_help(), controls);
    int response = dialog->run();
    dialog->hide();

    delete dialog;

    if (response == Gtk::RESPONSE_OK) return true;
    return false;
}
开发者ID:step21,项目名称:inkscape-osx-packaging-native,代码行数:29,代码来源:output.cpp

示例7: PrefDialog

void IndexDialog::editItem ()
{
  QListViewItem *item = list->selectedItem();
  if (! item)
    return;

  QString s = item->text(0);
  double weight = item->text(1).toFloat();
  
  PrefDialog *dialog = new PrefDialog();
  dialog->setCaption(tr("Edit Index Item"));
  QString pl = tr("Details");
  dialog->createPage (pl);
  QString t = tr("Symbol");
  Config config;
  QString t2;
  config.getData(Config::DataPath, t2);
  dialog->addSymbolItem(t, pl, t2, s);
  t = tr("Weight");
  dialog->addDoubleItem(t, pl, weight);
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    t = tr("Symbol");
    dialog->getSymbol(t, s);
    if (! s.length())
    {
      delete dialog;
      return;
    }
    
    t = tr("Weight");
    weight = dialog->getDouble(t);
    
    symbolDict.remove(item->text(0));
    QStringList l = QStringList::split("/", s, FALSE);
    symbolDict.insert(l[l.count() - 1], new QString(s));
    
    item->setText(0, l[l.count() - 1]);
    item->setText(1, QString::number(weight));
   
    buttonStatus();
  }
  
  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:47,代码来源:IndexDialog.cpp

示例8: PrefDialog

void BARS::formatDialog (QStringList &, QString &rv, QString &rs)
{
  rs.truncate(0);
  rv.truncate(0);

  bool ok;
  method = QInputDialog::getItem(QObject::tr("BARS Method Selection"),
                                 QObject::tr("Select a method:"),
                                 methodList,
                                 0,
                                 TRUE,
                                 &ok,
                                 0);
  if (! ok)
    return;

  QString pl = QObject::tr("Parms");
  QString vnl = QObject::tr("Variable Name");
  QString cl = QObject::tr("Color");
  QString rl = QObject::tr("Reversal");
  PrefDialog *dialog = new PrefDialog(0);
  dialog->setCaption(QObject::tr("BARS Format"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  QString s;
  dialog->addTextItem(vnl, pl, s);

  if (! method.compare("HACandle"))
    dialog->addColorItem(cl, pl, candleColor);

  if (! method.compare("PF"))
    dialog->addIntItem(rl, pl, pfReversal);

  int rc = dialog->exec();

  if (rc == QDialog::Accepted)
  {
    dialog->getText(vnl, rv);
    rs = method;

    if (! method.compare("HACandle"))
    {
      dialog->getColor(cl, candleColor);
      rs.append("," + candleColor.name());
    }

    if (! method.compare("PF"))
    {
      pfReversal = dialog->getInt(rl);
      rs.append("," + QString::number(pfReversal));
    }
  }

  delete dialog;
}
开发者ID:DigitalPig,项目名称:qtstalker-qt4,代码行数:56,代码来源:BARS.cpp

示例9: PrefDialog

void THERM::formatDialog (QStringList &, QString &rv, QString &rs)
{
  rs.truncate(0);
  rv.truncate(0);
  QString pl = QObject::tr("Parms");
  QString vnl = QObject::tr("Variable Name");
  QString tl = QObject::tr("Threshold");
  QString sl = QObject::tr("Smoothing");
  QString stl = QObject::tr("Smoothing Type");
  QString mpl = QObject::tr("MA Period");
  QString mtl = QObject::tr("MA Type");
  PrefDialog *dialog = new PrefDialog(0);
  dialog->setCaption(QObject::tr("THERM Format"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  QString s;
  QStringList l;
  getMATypes(l);
  dialog->addTextItem(vnl, pl, s);
  dialog->addComboItem(mtl, pl, l, maType);
  dialog->addIntItem(mpl, pl, maPeriod, 0, 99999999);
  dialog->addDoubleItem(tl, pl, threshold, 1, 99999999);
  dialog->addComboItem(stl, pl, l, smoothType);
  dialog->addIntItem(sl, pl, smoothing, 0, 99999999);

  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getText(vnl, rv);

    dialog->getCombo(mtl, rs);

    int t = dialog->getInt(mpl);
    rs.append("," + QString::number(t));

    double d = dialog->getDouble(tl);
    rs.append("," + QString::number(d));

    dialog->getCombo(stl, s);
    rs.append("," + s);

    t = dialog->getInt(sl);
    rs.append("," + QString::number(t));
  }

  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:49,代码来源:THERM.cpp

示例10: TA_GetFuncHandle

void TALIB::formatDialog (QStringList &vl, QString &rv, QString &rs)
{
  rs.truncate(0);
  rv.truncate(0);

  const TA_FuncHandle *handle;
  const TA_FuncInfo *theInfo;
 
  // open a TALIB handle
  TA_RetCode retCode = TA_GetFuncHandle(formatMethod, &handle);
  if (retCode != TA_SUCCESS)
  {
    qDebug("TALIB::getFormatList:can't open handle");
    return;
  }

  // get info on the function
  retCode = TA_GetFuncInfo(handle, &theInfo);
  if (retCode != TA_SUCCESS)
  {
    qDebug("TALIB::getFormatList:can't get function info");
    return;
  }

  QString pl = QObject::tr("Parms");
  QString vnl = QObject::tr("Variable Name");
  PrefDialog *dialog = new PrefDialog(0);
  dialog->setCaption(QObject::tr("TALIB Format"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  QString s;
  dialog->addTextItem(vnl, pl, s);

  // check for any array inputs
  const TA_InputParameterInfo *inputParms;
  int loop;
  for (loop = 0; loop < (int) theInfo->nbInput; loop++ )
  {
    s = QObject::tr("Input") + QString::number(loop + 1);
    TA_GetInputParameterInfo(theInfo->handle, loop, &inputParms);
    switch (inputParms->type)
    {
      case TA_Input_Real:
        dialog->addComboItem(s, pl, vl, (int) BarData::Close);
        break;
      default:
        break;
    }
  }

  QStringList mal;
  getMATypes(mal);
  mal.remove("Wilder");

  // get the input parms
  const TA_OptInputParameterInfo *optInfo;
  for (loop = 0; loop < (int) theInfo->nbOptInput; loop++ )
  {
    TA_GetOptInputParameterInfo(theInfo->handle, loop, &optInfo);
    s = optInfo->displayName;
    switch (optInfo->type)
    {
      case TA_OptInput_RealRange:
        dialog->addDoubleItem(s, pl, (double) optInfo->defaultValue, 0, 99999999);
        break;
      case TA_OptInput_IntegerRange:
        dialog->addIntItem(s, pl, (int) optInfo->defaultValue, 1, 999999);
        break;
      case TA_OptInput_IntegerList:
        dialog->addComboItem(s, pl, mal, (int) optInfo->defaultValue);
        break;
      case TA_OptInput_RealList:
        break;
      default:
        break;
    }
  }

  if (theInfo->nbOutput > 1)
  {
    s = "Plot";
    dialog->addIntItem(s, pl, 1, 1, theInfo->nbOutput);
  }

  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getText(vnl, rv);
    rs = formatMethod;

    QString ts;
    for (loop = 0; loop < (int) theInfo->nbInput; loop++ )
    {
      s = QObject::tr("Input") + QString::number(loop + 1);
      TA_GetInputParameterInfo(theInfo->handle, loop, &inputParms);
      switch (inputParms->type)
      {
        case TA_Input_Real:
//.........这里部分代码省略.........
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:101,代码来源:TALIB.cpp

示例11: PrefDialog

int LOWPASS::indicatorPrefDialog (QWidget *w)
{
  QString pl = QObject::tr("Parms");
  QString cl = QObject::tr("Color");
  QString ll = QObject::tr("Label");
  QString ltl = QObject::tr("Line Type");
  QString fl = QObject::tr("Freq");
  QString wl = QObject::tr("Width");
  QString il = QObject::tr("Input");
  
  PrefDialog *dialog = new PrefDialog(w);
  dialog->setCaption(QObject::tr("LOWPASS Indicator"));
  dialog->createPage (pl);
  dialog->setHelpFile(helpFile);

  dialog->addColorItem(cl, pl, color);
  dialog->addTextItem(ll, pl, label);
  dialog->addComboItem(ltl, pl, lineTypes, lineType);
  dialog->addComboItem(il, pl, inputTypeList, input);
  dialog->addDoubleItem(fl, pl, freq, 0, 0.5);
  dialog->addDoubleItem(wl, pl, width, 0.0001, 0.2);
  
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getColor(cl, color);
    lineType = (PlotLine::LineType) dialog->getComboIndex(ltl);
    dialog->getText(ll, label);
    input = (BarData::InputType) dialog->getComboIndex(il);

    freq = dialog->getDouble(fl);
    if (freq < 0.0)
      freq = 0.0;
    if (freq > 0.5)
      freq = 0.5;

    width = dialog->getDouble(wl);
    if (width < 0.0001)
      width = 0.0001;
    if (width > 0.2)
      width = 0.2;

    rc = TRUE;
  }
  else
    rc = FALSE;
  
  delete dialog;
  return rc;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:51,代码来源:LOWPASS.cpp

示例12: tr

void Text::prefDialog ()
{
  QString pl = tr("Details");
  QString cl = tr("Color");
  QString sd = tr("Set Default");
  QString fl = tr("Font");
  QString ll = tr("Label");
  QString vl = tr("Value");

  PrefDialog *dialog = new PrefDialog();
  dialog->setCaption(tr("Edit Text"));
  dialog->createPage (pl);
  dialog->setHelpFile (helpFile);
  dialog->addColorPrefItem(cl, pl, color);
  dialog->addFontItem(fl, pl, font);
  dialog->addTextItem(ll, pl, label);
  dialog->addDoubleItem(vl, pl, getValue());
  dialog->addCheckItem(sd, pl, FALSE);
  
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getColor(cl, color);
    dialog->getText(ll, label);
    dialog->getFont(fl, font);
    value = dialog->getDouble(vl);
    
    setSaveFlag(TRUE);
    
    bool f = dialog->getCheck(sd);
    if (f)
    {
      dialog->getColor(cl, defaultColor);
      dialog->getFont(fl, dfont);
      saveDefaults();
    }
    
    emit signalDraw();
  }
  
  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:43,代码来源:Text.cpp

示例13: PrefDialog

int ExScript::indicatorPrefDialog (QWidget *w)
{
  QString pl2 = QObject::tr("Output");
  QString cl = QObject::tr("Color");
  QString ll = QObject::tr("Label");
  QString ltl = QObject::tr("Line Type");
  QString spl = QObject::tr("Script Path");
  QString clsl = QObject::tr("Switches");
  QString pl = QObject::tr("Input");
  QString dl = QObject::tr("Date");
  QString ol = QObject::tr("Open");
  QString hl = QObject::tr("High");
  QString lol = QObject::tr("Low");
  QString cll = QObject::tr("Close");
  QString vl = QObject::tr("Volume");
  QString oil = QObject::tr("Open Interest");
  QString tol = QObject::tr("Timeout Seconds");

  PrefDialog *dialog = new PrefDialog(w);
  dialog->setCaption(QObject::tr("ExScript Indicator"));
  dialog->setHelpFile(helpFile);

  dialog->createPage (pl);
  QStringList l;
  l.append(scriptPath);
  dialog->addFileItem(spl, pl, l, scriptPath);
  dialog->addTextItem(clsl, pl, comlineParms);
  dialog->addIntItem(tol, pl, seconds, 1, 999);
  dialog->addCheckItem(dl, pl, dateFlag);
  dialog->addCheckItem(ol, pl, openFlag);
  dialog->addCheckItem(hl, pl, highFlag);
  dialog->addCheckItem(lol, pl, lowFlag);
  dialog->addCheckItem(cll, pl, closeFlag);
  dialog->addCheckItem(vl, pl, volumeFlag);
  dialog->addCheckItem(oil, pl, oiFlag);

  dialog->createPage(pl2);
  dialog->addColorItem(cl, pl2, color);
  dialog->addTextItem(ll, pl2, label);
  dialog->addComboItem(ltl, pl2, lineTypes, lineType);
  
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getFile(spl, l);
    if (l.count())
      scriptPath = l[0];
    dialog->getText(clsl, comlineParms);
    seconds = dialog->getInt(tol);
    dateFlag = dialog->getCheck(dl);
    openFlag = dialog->getCheck(ol);
    highFlag = dialog->getCheck(hl);
    lowFlag = dialog->getCheck(lol);
    closeFlag = dialog->getCheck(cll);
    volumeFlag = dialog->getCheck(vl);
    oiFlag = dialog->getCheck(oil);

    dialog->getColor(cl, color);
    dialog->getText(ll, label);
    lineType = (PlotLine::LineType) dialog->getComboIndex(ltl);
    rc = TRUE;
  }
  else
    rc = FALSE;
  
  delete dialog;
  return rc;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:69,代码来源:ExScript.cpp

示例14: tr

void FormulaEdit::insertPlotItem ()
{
  QString pl = tr("Plot");
  QString cl = tr("Color");
  QString ll = tr("Label");
  QString ltl = tr("Line Type");
  QString vl = tr("Variable");

  PrefDialog *dialog = new PrefDialog(this);
  dialog->setCaption(tr("Insert Plot"));
  dialog->createPage (pl);

  QString s("Var");
  QStringList l;
  getVariableList(l, FALSE);
  dialog->addComboItem(vl, pl, l, 0);

  QColor c("red");
  dialog->addColorItem(cl, pl, c);
  s = "Label";
  dialog->addTextItem(ll, pl, s);

  dialog->addComboItem(ltl, pl, lineTypes, 4);

  int rc = dialog->exec();
  if (rc != QDialog::Accepted)
  {
    delete dialog;
    return;
  }

  QString ts;
  s = "plot (";
  dialog->getCombo(vl, ts);
  s.append(ts + ",");
  dialog->getColor(cl, c);
  s.append(c.name() + ",");
  dialog->getText(ll, ts);
  if (! ts.length())
    ts = " ";
  s.append(ts + ",");
  dialog->getCombo(ltl, ts);
  s.append(ts + ")");
  plot->insertItem(s, plot->currentItem() + 1);

  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:47,代码来源:FormulaEdit.cpp

示例15: tr

void SellArrow::prefDialog ()
{
  QString pl = tr("Details");
  QString cl = tr("Color");
  QString vl = tr("Value");
  QString il = tr("Identifier");
  QString bl = tr("Price");
  QString sd = tr("Set Default");

  PrefDialog *dialog = new PrefDialog();
  dialog->setCaption(tr("Edit SellArrow"));
  dialog->createPage (pl);
  dialog->setHelpFile (helpFile);
  dialog->addColorPrefItem(cl, pl, color);
  dialog->addDoubleItem(vl, pl, getValue());
  dialog->addTextItem(il, pl, identifier);
  dialog->addTextItem(bl, pl, price);
  dialog->addCheckItem(sd, pl, FALSE);
  
  int rc = dialog->exec();
  
  if (rc == QDialog::Accepted)
  {
    dialog->getColor(cl, color);
    value = dialog->getDouble(vl);
    dialog->getText(il, identifier);
    dialog->getText(bl, price);
    
    setSaveFlag(TRUE);
    
    bool f = dialog->getCheck(sd);
    if (f)
    {
      defaultColor = color;
      saveDefaults();
    }
    
    emit signalDraw();
  }
  
  delete dialog;
}
开发者ID:botvs,项目名称:FinancialAnalytics,代码行数:42,代码来源:SellArrow.cpp


注:本文中的PrefDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。