Example #1
0
void  Preferences::createETPage()
{
  // extra tool bar page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 2);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);

  vbox->insertStretch(-1, 1);

  int i = 0; // count rows
  int j = 0; // "count" cols
  bool tb; // temporary
  RcFile rcfile;

  QLabel *label = new QLabel(tr("Recent charts"), w);
  grid->addWidget(label, i, j);
  recentComboBoxCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowRecentCharts, tb);
  recentComboBoxCheck->setChecked(tb);
  connect(recentComboBoxCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(recentComboBoxCheck, i++, j + 1);

  addTab(w, tr("ExtraToolbar"));
}
Example #2
0
void Preferences::createFontPage()
{
  // font parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);
  grid->setColStretch(2, 2);

  vbox->insertStretch(-1, 1);

  // plot font
  QLabel *label = new QLabel(tr("Plot Font"), w);
  grid->addWidget(label, 0, 0);

  plotFontButton = new FontButton(w, plotFont);
  grid->addWidget(plotFontButton, 0, 1);
  connect(plotFontButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // app font
  label = new QLabel(tr("App Font"), w);
  grid->addWidget(label, 1, 0);

  appFontButton = new FontButton(w, appFont);
  grid->addWidget(appFontButton, 1, 1);
  connect(appFontButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  addTab(w, tr("Fonts"));

}
Example #3
0
void Preferences::createColorPage()
{
  // colors parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);
  grid->setColStretch(2, 2);

  vbox->insertStretch(-1, 1);

  // background color
  QLabel *label = new QLabel(tr("Chart Background"), w);
  grid->addWidget(label, 0, 0);

  backgroundColorButton = new ColorButton(w, backgroundColor);
  grid->addWidget(backgroundColorButton, 0, 1);
  backgroundColorButton->setColorButton();
  connect(backgroundColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // border color
  label = new QLabel(tr("Chart Border"), w);
  grid->addWidget(label, 1, 0);

  borderColorButton = new ColorButton(w, borderColor);
  grid->addWidget(borderColorButton, 1, 1);
  borderColorButton->setColorButton();
  connect(borderColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  // grid color
  label = new QLabel(tr("Chart Grid"), w);
  grid->addWidget(label, 2, 0);

  gridColorButton = new ColorButton(w, gridColor);
  grid->addWidget(gridColorButton, 2, 1);
  gridColorButton->setColorButton();
  connect(gridColorButton, SIGNAL(valueChanged()), this, SLOT(slotModified()));

  //FIXME: add adjustment possibility for prefered CO-colors.
  // in this way to add a spinbox to set the amount of colors too

  addTab(w, tr("Colors"));
}
void FuturesDialog::createDetailsPage ()
{
  QWidget *w = new QWidget(this);

  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);
  vbox->setMargin(5);
  vbox->setSpacing(0);

  Q3GridLayout *grid = new Q3GridLayout(vbox);
  grid->setSpacing(5);

  QLabel *label = new QLabel(tr("Symbol"), w);
  grid->addWidget(label, 0, 0);

  QString s;
  DBIndexItem item;
  index->getIndexItem(symbol, item);
  item.getSymbol(s);
  label = new QLabel(s, w);
  label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
  grid->addWidget(label, 0, 1);

  label = new QLabel(tr("Name"), w);
  grid->addWidget(label, 1, 0);

  item.getTitle(s);
  title = new QLineEdit(s, w);
  grid->addWidget(title, 1, 1);

  label = new QLabel(tr("Exchange"), w);
  grid->addWidget(label, 2, 0);

  item.getExchange(s);
  Exchange ex;
  ex.getExchange(s.toInt(), s);
  label = new QLabel(s, w);
  label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
  grid->addWidget(label, 2, 1);

  label = new QLabel(tr("Type"), w);
  grid->addWidget(label, 3, 0);

  item.getType(s);
  label = new QLabel(s, w);
  label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
  grid->addWidget(label, 3, 1);

  label = new QLabel(tr("Futures Type"), w);
  grid->addWidget(label, 4, 0);

  QString s2;
  item.getFuturesType(s2);
  label = new QLabel(s2, w);
  label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
  grid->addWidget(label, 4, 1);

  label = new QLabel(tr("Futures Month"), w);
  grid->addWidget(label, 5, 0);

  item.getFuturesMonth(s2);
  label = new QLabel(s2, w);
  label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
  grid->addWidget(label, 5, 1);

  label = new QLabel(tr("First Date"), w);
  grid->addWidget(label, 6, 0);

  Bar bar;
  db->getFirstBar(bar);
  if (! bar.getEmptyFlag())
  {
    bar.getDateTimeString(TRUE, s);
    label = new QLabel(s, w);
    label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
    grid->addWidget(label, 6, 1);
  }

  label = new QLabel(tr("Last Date"), w);
  grid->addWidget(label, 7, 0);


  Bar bar2;
  db->getLastBar(bar2);
  if (! bar2.getEmptyFlag())
  {
    bar2.getDateTimeString(TRUE, s);
    label = new QLabel(s, w);
    label->setFrameStyle(Q3Frame::WinPanel | Q3Frame::Sunken);
    grid->addWidget(label, 7, 1);
  }

  grid->setColStretch(1, 1);
  vbox->insertStretch(-1, 0);

  addTab(w, tr("Details"));
}
Example #5
0
void Preferences::createGeneralPage()
{
  // general parms page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 3);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1); // stretch 2nd col a little
  grid->setColStretch(2, 2); // stretch outer right col more

  vbox->insertStretch(-1, 1);

  // menubar checkbox
  QLabel *label = new QLabel(tr("Main Menubar"), w);
  grid->addWidget(label, 0, 0);

  menubarCheck = new QCheckBox(w);
  menubarCheck->setChecked(menubar);
  connect(menubarCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(menubarCheck, 0, 1);

  // extraToolbar checkbox
  label = new QLabel(tr("Extra Toolbar"), w);
  grid->addWidget(label, 1, 0);

  extraToolbarCheck = new QCheckBox(w);
  extraToolbarCheck->setChecked(extraToolbar);
  connect(extraToolbarCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(extraToolbarCheck, 1, 1);

  // bar spacing 1
  label = new QLabel(tr("Bar Spacing 1"), w);
  grid->addWidget(label, 2, 0);

  bs1Spinner = new QSpinBox(2, 99, 1, w);
  bs1Spinner->setValue(ps1Button);
  connect(bs1Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(bs1Spinner, 2, 1);

  // bar spacing 2
  label = new QLabel(tr("Bar Spacing 2"), w);
  grid->addWidget(label, 3, 0);

  bs2Spinner = new QSpinBox(2, 99, 1, w);
  bs2Spinner->setValue(ps2Button);
  connect(bs2Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(bs2Spinner, 3, 1);

  // bar spacing 3
  label = new QLabel(tr("Bar Spacing 3"), w);
  grid->addWidget(label, 4, 0);

  bs3Spinner = new QSpinBox(2, 99, 1, w);
  bs3Spinner->setValue(ps3Button);
  connect(bs3Spinner, SIGNAL(valueChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(bs3Spinner, 4, 1);

  addTab(w, tr("General"));
}
Example #6
0
void  Preferences::createCTPage()
{
  // chart tool bar page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 2);
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(1, 1);

  vbox->insertStretch(-1, 1);

  int i = 0; // count rows
  int j = 0; // "count" cols
  bool tb; // temporary
  RcFile rcfile;

  QLabel *label = new QLabel(tr("Compression list"), w);
  grid->addWidget(label, i, j);
  cmpsComboBoxCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmpsComboBox, tb);
  cmpsComboBoxCheck->setChecked(tb);
  connect(cmpsComboBoxCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmpsComboBoxCheck, i++, j + 1);

  label = new QLabel(tr("Compression 1 Minute"), w);
  grid->addWidget(label, i, j);
  cmps1MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps1MBtn, tb);
  cmps1MBtnCheck->setChecked(tb);
  connect(cmps1MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps1MBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 2 Minute"), w);
//  grid->addWidget(label, i, j);
//  cmps2MBtnCheck = new QCheckBox(w);
//  rcfile.loadData(RcFile::ShowCmps2MBtn, tb);
//  cmps2MBtnCheck->setChecked(tb);
//  connect(cmps2MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
//  grid->addWidget(cmps2MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 5 Minute"), w);
  grid->addWidget(label, i, j);
  cmps5MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps5MBtn, tb);
  cmps5MBtnCheck->setChecked(tb);
  connect(cmps5MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps5MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 10 Minute"), w);
  grid->addWidget(label, i, j);
  cmps10MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps10MBtn, tb);
  cmps10MBtnCheck->setChecked(tb);
  connect(cmps10MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps10MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 15 Minute"), w);
  grid->addWidget(label, i, j);
  cmps15MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps15MBtn, tb);
  cmps15MBtnCheck->setChecked(tb);
  connect(cmps15MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps15MBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 20 Minute"), w);
//  grid->addWidget(label, i, j);
//  cmps20MBtnCheck = new QCheckBox(w);
//  rcfile.loadData(RcFile::ShowCmps20MBtn, tb);
//  cmps20MBtnCheck->setChecked(tb);
//  connect(cmps20MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
//  grid->addWidget(cmps20MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 30 Minute"), w);
  grid->addWidget(label, i, j);
  cmps30MBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps30MBtn, tb);
  cmps30MBtnCheck->setChecked(tb);
  connect(cmps30MBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps30MBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 1 Hour"), w);
  grid->addWidget(label, i, j);
  cmps1HBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps1HBtn, tb);
  cmps1HBtnCheck->setChecked(tb);
  connect(cmps1HBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps1HBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 2 Hour"), w);
//  grid->addWidget(label, i, j);
//  cmps2HBtnCheck = new QCheckBox(w);
//  rcfile.loadData(RcFile::ShowCmps2HBtn, tb);
//  cmps2HBtnCheck->setChecked(tb);
//  connect(cmps2HBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
//  grid->addWidget(cmps2HBtnCheck, i++, j + 1);

//  label = new QLabel(tr("Compression 4 Hour"), w);
//  grid->addWidget(label, i, j);
//  cmps4HBtnCheck = new QCheckBox(w);
//  rcfile.loadData(RcFile::ShowCmps4HBtn, tb);
//  cmps4HBtnCheck->setChecked(tb);
//  connect(cmps4HBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
//  grid->addWidget(cmps4HBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 1 Day"), w);
  grid->addWidget(label, i, j);
  cmps1DBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps1DBtn, tb);
  cmps1DBtnCheck->setChecked(tb);
  connect(cmps1DBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps1DBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 1 Week"), w);
  grid->addWidget(label, i, j);
  cmps1WBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmps1WBtn, tb);
  cmps1WBtnCheck->setChecked(tb);
  connect(cmps1WBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmps1WBtnCheck, i++, j + 1);

  label = new QLabel(tr("Compression 1 Month"), w);
  grid->addWidget(label, i, j);
  cmpsMNBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCmpsMNBtn, tb);
  cmpsMNBtnCheck->setChecked(tb);
  connect(cmpsMNBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(cmpsMNBtnCheck, i++, j + 1);

  label = new QLabel(tr("BarSpacing spinner"), w);
  grid->addWidget(label, i, j);
  barSpSpinboxCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowBarSpSpinbox, tb);
  barSpSpinboxCheck->setChecked(tb);
  connect(barSpSpinboxCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(barSpSpinboxCheck, i++, j + 1);

  label = new QLabel(tr("BarsToLoad field"), w);
  grid->addWidget(label, i, j);
  barsToLoadFieldCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowBarsToLoadField, tb);
  barsToLoadFieldCheck->setChecked(tb);
  connect(barsToLoadFieldCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(barsToLoadFieldCheck, i++, j + 1);

  label = new QLabel(tr("Pan Chart slider"), w);
  grid->addWidget(label, i, j);
  sliderCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowSlider, tb);
  sliderCheck->setChecked(tb);
  connect(sliderCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(sliderCheck, i++, j + 1);

  addTab(w, tr("ChartToolbar"));
}
Example #7
0
void  Preferences::createMTPage()
{
  // main tool bar page

  QWidget *w = new QWidget(this);
  Q3VBoxLayout *vbox = new Q3VBoxLayout(w);

  Q3GridLayout *grid = new Q3GridLayout(vbox, 1, 6); // two more cols as needed
  grid->setMargin(5);
  grid->setSpacing(5);
  grid->setColStretch(2, 1); // middle spacing col
  grid->setColStretch(5, 2); // outer right col

  vbox->insertStretch(-1, 1);

  int i = 0; // count rows
  int j = 0; // "count" cols
  bool tb; // temporary
  RcFile rcfile;

  QLabel *label = new QLabel(tr("Quit"), w);
  grid->addWidget(label, i, j);
  quitBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowQuitBtn, tb);
  quitBtnCheck->setChecked(tb);
  connect(quitBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(quitBtnCheck, i++, j + 1);

  label = new QLabel(tr("Preferences"), w);
  grid->addWidget(label, i, j);
  prefBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowPrefBtn, tb);
  prefBtnCheck->setChecked(tb);
  connect(prefBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(prefBtnCheck, i++, j + 1);

  label = new QLabel(tr("Side Panel"), w);
  grid->addWidget(label, i, j);
  sidePanelBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowSidePanelBtn, tb);
  sidePanelBtnCheck->setChecked(tb);
  connect(sidePanelBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(sidePanelBtnCheck, i++, j + 1);

  label = new QLabel(tr("Grid"), w);
  grid->addWidget(label, i, j);
  gridBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowGridBtn, tb);
  gridBtnCheck->setChecked(tb);
  connect(gridBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(gridBtnCheck, i++, j + 1);

  label = new QLabel(tr("Scale to Screen"), w);
  grid->addWidget(label, i, j);
  scaleToScreenBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowScaleToScreenBtn, tb);
  scaleToScreenBtnCheck->setChecked(tb);
  connect(scaleToScreenBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(scaleToScreenBtnCheck, i++, j + 1);

  label = new QLabel(tr("CrossHair"), w);
  grid->addWidget(label, i, j);
  crosshairBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowCrosshairBtn, tb);
  crosshairBtnCheck->setChecked(tb);
  connect(crosshairBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(crosshairBtnCheck, i++, j + 1);

  // now fill a second col
  i = 0;
  j = 3;

  label = new QLabel(tr("PaperTrade"), w);
  grid->addWidget(label, i, j);
  paperTradeBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowPaperTradeBtn, tb);
  paperTradeBtnCheck->setChecked(tb);
  connect(paperTradeBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(paperTradeBtnCheck, i++, j + 1);

  label = new QLabel(tr("DrawMode"), w);
  grid->addWidget(label, i, j);
  drawModeBtnCheck= new QCheckBox(w);
  rcfile.loadData(RcFile::ShowDrawModeBtn, tb);
  drawModeBtnCheck->setChecked(tb);
  connect(drawModeBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(drawModeBtnCheck, i++, j + 1);

  label = new QLabel(tr("NewIndicator"), w);
  grid->addWidget(label, i, j);
  newIndicatorBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowNewIndicatorBtn, tb);
  newIndicatorBtnCheck->setChecked(tb);
  connect(newIndicatorBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(newIndicatorBtnCheck, i++, j + 1);

  label = new QLabel(tr("DataWindow"), w);
  grid->addWidget(label, i, j);
  dataWindowBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowDataWindowBtn, tb);
  dataWindowBtnCheck->setChecked(tb);
  connect(dataWindowBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(dataWindowBtnCheck, i++, j + 1);

  label = new QLabel(tr("MainQuote"), w);
  grid->addWidget(label, i, j);
  mainQuoteBtnCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowMainQuoteBtn, tb);
  mainQuoteBtnCheck->setChecked(tb);
  connect(mainQuoteBtnCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(mainQuoteBtnCheck, i++, j + 1);

  label = new QLabel(tr("Help"), w);
  grid->addWidget(label, i, j);
  helpButtonCheck = new QCheckBox(w);
  rcfile.loadData(RcFile::ShowHelpButton, tb);
  helpButtonCheck->setChecked(tb);
  connect(helpButtonCheck, SIGNAL(stateChanged(int)), this, SLOT(slotModified()));
  grid->addWidget(helpButtonCheck, i++, j + 1);

  addTab(w, tr("MainToolbar"));
}