TesterRulePage::TesterRulePage (QWidget *p) : QWidget (p)
{
    Q3VBoxLayout *vbox = new Q3VBoxLayout(this);
    vbox->setMargin(5);
    vbox->setSpacing(5);

    Q3GridLayout *grid = new Q3GridLayout(vbox, 2, 2);

    Q3VGroupBox *gbox = new Q3VGroupBox(tr("Enter Long"), this);
    grid->addWidget(gbox, 0, 0);

    enterLongEdit = new FormulaEdit(gbox, FormulaEdit::Logic);

    gbox = new Q3VGroupBox(tr("Exit Long"), this);
    grid->addWidget(gbox, 0, 1);

    exitLongEdit = new FormulaEdit(gbox, FormulaEdit::Logic);

    gbox = new Q3VGroupBox(tr("Enter Short"), this);
    grid->addWidget(gbox, 1, 0);

    enterShortEdit = new FormulaEdit(gbox, FormulaEdit::Logic);

    gbox = new Q3VGroupBox(tr("Exit Short"), this);
    grid->addWidget(gbox, 1, 1);

    exitShortEdit = new FormulaEdit(gbox, FormulaEdit::Logic);
}
Example #2
0
void StocksDialog::createDataPage ()
{
    QWidget *w = new QWidget(this);

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

    barEdit = new BarEdit(w);
    QString s = tr("Open");
    QString s2 = "Open";
    barEdit->createField(s, s2, FALSE);
    s = tr("High");
    s2 = "High";
    barEdit->createField(s, s2, FALSE);
    s = tr("Low");
    s2 = "Low";
    barEdit->createField(s, s2, FALSE);
    s = tr("Close");
    s2 = "Close";
    barEdit->createField(s, s2, FALSE);
    s = tr("Volume");
    s2 = "Volume";
    barEdit->createField(s, s2, FALSE);
    connect(barEdit, SIGNAL(signalDeleteRecord()), this, SLOT(deleteRecord()));
    connect(barEdit, SIGNAL(signalSaveRecord()), this, SLOT(saveRecord()));
    connect(barEdit, SIGNAL(signalSearch(QDateTime)), this, SLOT(slotDateSearch(QDateTime)));
    connect(barEdit, SIGNAL(signalFirstRecord()), this, SLOT(slotFirstRecord()));
    connect(barEdit, SIGNAL(signalLastRecord()), this, SLOT(slotLastRecord()));
    connect(barEdit, SIGNAL(signalPrevRecord()), this, SLOT(slotPrevRecord()));
    connect(barEdit, SIGNAL(signalNextRecord()), this, SLOT(slotNextRecord()));
    vbox->addWidget(barEdit);

    addTab(w, tr("Data"));
}
Example #3
0
ConstraintDialog::ConstraintDialog(ConstraintCanvas * c)
    : QDialog(0, "ConstraintVisibilityDialog", TRUE, 0), constraint(c)
{
    setCaption(TR("Constraints visibility dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

    vbox->setMargin(5);

    table = new ConstraintTable(this, constraint);
    vbox->addWidget(table);
    vbox->addWidget(new QLabel(this));

    Q3HBoxLayout * hbox;

    hbox = new Q3HBoxLayout(vbox);

    cb_visible = new QCheckBox(TR("Specify visible elements rather than hidden ones"), this);
    cb_visible->setChecked(constraint->indicate_visible);
    hbox->addWidget(cb_visible);

    QPushButton * showall = new QPushButton(TR("Show all"), this);
    QPushButton * hideall = new QPushButton(TR("Hide all"), this);
    QPushButton * hideinherited = new QPushButton(TR("Hide inherited"), this);
    QSize bs = hideinherited->sizeHint();

    showall->setFixedSize(bs);
    hideall->setFixedSize(bs);
    hideinherited->setFixedSize(bs);

    hbox->addWidget(new QLabel(this));
    hbox->addWidget(showall);
    hbox->addWidget(new QLabel(this));
    hbox->addWidget(hideall);
    hbox->addWidget(new QLabel(this));
    hbox->addWidget(hideinherited);
    hbox->addWidget(new QLabel(this));

    connect(showall, SIGNAL(clicked()), this, SLOT(show_all()));
    connect(hideall, SIGNAL(clicked()), this, SLOT(hide_all()));
    connect(hideinherited, SIGNAL(clicked()), this, SLOT(hide_inherited()));

    vbox->addWidget(new QLabel(this));
    hbox = new Q3HBoxLayout(vbox);

    hbox->setMargin(5);
    QPushButton * ok = new QPushButton(TR("&OK"), this);
    QPushButton * cancel = new QPushButton(TR("&Cancel"), this);

    ok->setDefault(TRUE);
    bs = cancel->sizeHint();
    ok->setFixedSize(bs);
    cancel->setFixedSize(bs);

    hbox->addWidget(ok);
    hbox->addWidget(cancel);

    connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
Example #4
0
Dialog::Dialog(BooL & rec, char & lang) : QDialog(0, 0, TRUE), _rec(rec), _lang(lang) {
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
  Q3HBox * htab;
  
  vbox->setMargin(5);
  
  // recursive checkbox
  if (rec) {
    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);
    
    rec_cb = new QCheckBox("Do recursively", htab);
  }
  else
    rec_cb = 0;

  // langs + cancel buttons
  
  htab = new Q3HBox(this);
  htab->setMargin(5);
  vbox->addWidget(htab);
  
  QPushButton * cpp = new QPushButton("&C++", htab);
  new QLabel(htab);
  QPushButton * java = new QPushButton("&Java", htab);
  new QLabel(htab);
  QPushButton * idl = new QPushButton("&Idl", htab);
  new QLabel(htab);
  QPushButton * php = new QPushButton("P&hp", htab);
  new QLabel(htab);
  QPushButton * python = new QPushButton("P&ython", htab);
  new QLabel(htab);
  QPushButton * cancel = new QPushButton("&Cancel", htab);
  new QLabel(htab);
  QSize bs(cancel->sizeHint());
  
  cpp->setFixedSize(bs);
  java->setFixedSize(bs);
  
  connect(cpp, SIGNAL(clicked()), this, SLOT(accept_cpp()));
  connect(java, SIGNAL(clicked()), this, SLOT(accept_java()));
  connect(idl, SIGNAL(clicked()), this, SLOT(accept_idl()));
  connect(php, SIGNAL(clicked()), this, SLOT(accept_php()));
  connect(python, SIGNAL(clicked()), this, SLOT(accept_python()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));

  // help
  
  htab = new Q3HBox(this);
  htab->setMargin(5);
  vbox->addWidget(htab);
  
  new QLabel(htab);
  new QLabel("Warning : reset the declarations/definitions to\n"
	     "their default value from the 'generation settings'", htab);
  new QLabel(htab);
}
Example #5
0
AboutDialog::AboutDialog() : QDialog(0, "About DoUML", TRUE)
{
    setCaption(TR("About DoUML"));
    //move(p);

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
    Q3HBoxLayout * hbox;

    vbox->setMargin(5);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);

    QPixmap bp((const char **) bp_xpm);
    // QLabel * lbp = new QLabel(this);

    // lbp->setPixmap(bp);
    //  hbox->addWidget(lbp);
    hbox->addWidget(new QLabel("  ", this));
    // Replacing about to bouml-ng
    const char htmltext[] = "<p>DoUML</p>\n"
                            "<p>This project is a fork of\n"
                            "Bruno Pages's work, BoUML:\n"
                            "<i>http://sourceforge.net/projects/douml/</i></p>\n"
                            "<p>DoUML focus is to port BoUML to Qt4\n"
                            "and to maintain it as a community</p>\n"
                            "<p>Join us at:<br>\n"
                            "https://github.com/leonardo2d/douml/<br>\n"
                            "#[email protected]</p>\n\n\n";

    Q3TextView * tx =
        new Q3TextView(htmltext, QString(), this);
    QFont fnt = tx->font();

    fnt.setItalic(TRUE);

    QFontMetrics fm(fnt);

    tx->setVScrollBarMode(Q3ScrollView::AlwaysOff);
    tx->setHScrollBarMode(Q3ScrollView::AlwaysOff);
    tx->setMinimumSize(fm.size(0, htmltext));
    hbox->addWidget(tx);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    QPushButton * ok = new QPushButton(TR("&OK"), this);

    ok->setDefault(TRUE);

    hbox->addWidget(new QLabel(this));
    hbox->addWidget(ok);
    hbox->addWidget(new QLabel(this));

    if (UmlDesktop::fixed())
        UmlDesktop::tocenter(this);

    connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
}
Example #6
0
AboutDialog::AboutDialog() : QDialog(0, "About " PROJECT_NAME, TRUE) {
  setCaption(TR("About " PROJECT_NAME));
  //move(p);
  
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);  
  Q3HBoxLayout * hbox; 
  
  vbox->setMargin(5);
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);

  QPixmap bp((const char **) bp_xpm);
  QLabel * lbp = new QLabel(this);
  
 // lbp->setPixmap(bp);
//  hbox->addWidget(lbp);
  hbox->addWidget(new QLabel("  ", this));

  QString htmltext;
  htmltext.sprintf("%s <b>%d.%d-%d</b> release <b>%s</b><br>\n"
                   "<br>\n"
                   "<i>%s</i><br>\n"
                   "<br>\n"
                   "%s (<i>%s</i>)",
    PROJECT_NAME, PROJECT_MAJOR, PROJECT_MINOR, PROJECT_REVISION, PROJECT_RELEASE,
    PROJECT_HOME, PROJECT_ADMIN, PROJECT_CONTACT);
                            
  Q3TextView * tx =
    new Q3TextView(htmltext, QString::null, this);
  QFont fnt = tx->font();
  
  fnt.setItalic(TRUE);
  
  QFontMetrics fm(fnt);
  
  tx->setVScrollBarMode(Q3ScrollView::AlwaysOff);
  tx->setHScrollBarMode(Q3ScrollView::AlwaysOff);
  tx->setMinimumSize(fm.size(0, htmltext));
  hbox->addWidget(tx);
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * ok = new QPushButton(TR("&OK"), this);
  
  ok->setDefault( TRUE );
  
  hbox->addWidget(new QLabel(this));
  hbox->addWidget(ok);
  hbox->addWidget(new QLabel(this));
  
  if (UmlDesktop::fixed())
    UmlDesktop::tocenter(this);
  
  connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
}
Example #7
0
ReferenceDialog::ReferenceDialog(BrowserNode * bn)
    : QDialog(0, "Referenced By dialog", FALSE, Qt::WDestructiveClose)
{
    the = this;
    target = bn;

    setCaption(TR("Referenced By dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

    vbox->setMargin(5);

    QString s = target->get_name();

    s += TR(" is referenced by :");

    vbox->addWidget(new QLabel(s, this));

    results = new Q3ComboBox(FALSE, this);
    vbox->addWidget(results);

    Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox);
    QPushButton * search_b = new QPushButton(TR("Recompute"), this);
    QPushButton * close_b = new QPushButton(TR("Close"), this);

    hbox->setMargin(5);
    hbox->addWidget(search_b);
    hbox->addWidget(select_b = new QPushButton(TR("Select"), this));
    hbox->addWidget(mark_unmark_b = new QPushButton(TR("Unmark"), this));
    hbox->addWidget(mark_them_b = new QPushButton(TR("Mark them"), this));
    hbox->addWidget(unmark_all_b = new QPushButton(TR("Unmark all"), this));
    hbox->addWidget(close_b);

    search_b->setDefault(TRUE);

    connect(search_b, SIGNAL(clicked()), this, SLOT(compute()));
    connect(select_b, SIGNAL(clicked()), this, SLOT(select()));
    connect(close_b, SIGNAL(clicked()), this, SLOT(reject()));
    connect(mark_unmark_b, SIGNAL(clicked()), this, SLOT(mark_unmark()));
    connect(mark_them_b, SIGNAL(clicked()), this, SLOT(mark_them()));
    connect(unmark_all_b, SIGNAL(clicked()), this, SLOT(unmark_all()));
    connect(results, SIGNAL(activated(int)), this, SLOT(selected(int)));

    compute();

    open_dialog(this);
}
Example #8
0
BrowserSearchDialog::BrowserSearchDialog(const QPoint & p)
    : QDialog(0, "Browser search", TRUE) {
  setCaption("Browser search");
  move(p);
  
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);  
  
  vbox->setMargin(5);
  
  Q3GridLayout * gl = new Q3GridLayout(vbox, 4, 2, 5/*space*/);

  ed = new QLineEdit(this);
  ed->setText(saved_ed);
  gl->addWidget(new QLabel("Containing", this), 1, 0, Qt::AlignLeft);
  gl->addWidget(ed, 1, 1);
  
  Q3GroupBox * gb = new Q3GroupBox(2, Qt::Horizontal, this);

  case_sensitive = new QCheckBox("case sensitive", gb);
  case_sensitive->setChecked(saved_case_sensitive);
  
  gl->addWidget(gb, 2, 1);

  gl->addWidget(new QLabel("Result", this), 3, 0, Qt::AlignLeft);
  results = new Q3ComboBox(FALSE, this);
  gl->addWidget(results, 3, 1);

  Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * search_b = new QPushButton("Search", this);
  QPushButton * select_b = new QPushButton("Select", this);
  QPushButton * close_b = new QPushButton("Close", this);
  
  search_b->setDefault(TRUE);
  
  hbox->addWidget(search_b);
  hbox->addWidget(select_b);
  hbox->addWidget(close_b);
  
  connect(search_b, SIGNAL(clicked()), this, SLOT(search()));
  connect(select_b, SIGNAL(clicked()), this, SLOT(select()));
  connect(close_b, SIGNAL(clicked()), this, SLOT(reject()));
  
  setMaximumHeight(sizeHint().height());
}
Example #9
0
void StocksDialog::createFundamentalsPage ()
{
    QWidget *w = new QWidget(this);

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

    Setting fund;
    QString s, s2;
    index->getFundamentals(symbol, s2);
    fund.parse(s2);

    s = tr("Fundamentals: last updated ");
    s2 = "updateDate";
    QString s3;
    fund.getData(s2, s3);
    s.append(s3);
    fund.remove(s2);
    QStringList key;
    fund.getKeyList(key);
    key.sort();

    vbox->addSpacing(10);
    QLabel *label = new QLabel(s, w);
    vbox->addWidget(label);

    fundView = new Q3ListView(w);
    fundView->addColumn(tr("Description"));
    fundView->addColumn(tr("Value"));
    vbox->addWidget(fundView);

    int loop;
    for (loop = 0; loop < (int) key.count(); loop++)
    {
        fund.getData(key[loop], s);
        new Q3ListViewItem(fundView, key[loop], s);
    }

    if (! key.count())
        new Q3ListViewItem(fundView, tr("No data available."));

    addTab(w, tr("Fundamentals"));
}
Example #10
0
ClassSettingsDialog::ClassSettingsDialog(ClassSettings * se, bool nodefault)
    : QDialog(0, "Class Settings dialog", TRUE), settings(se) {
  setCaption(TR("Class Settings dialog"));
  
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);  
  Q3HBoxLayout * hbox;
  QString s;
  
  vbox->setMargin(5);
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  hbox->addWidget(new QLabel(TR("default attributes visibility : "), this), 1000);
  cbattribute = new ComboVisibility(this, settings->attribute_visibility, nodefault);
  hbox->addWidget(cbattribute);

  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  hbox->addWidget(new QLabel(TR("default relations visibility : "), this), 1000);
  cbrelation = new ComboVisibility(this, settings->relation_visibility, nodefault);
  hbox->addWidget(cbrelation);

  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  hbox->addWidget(new QLabel(TR("default operations visibility : "), this), 1000);
  cboperation = new ComboVisibility(this, settings->operation_visibility, nodefault);
  hbox->addWidget(cboperation);

  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * accept = new QPushButton(TR("&OK"), this);
  QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
  QSize bs(cancel->sizeHint());
  
  accept->setDefault(TRUE);  
  accept->setFixedSize(bs);
  cancel->setFixedSize(bs);
  
  hbox->addWidget(accept);
  hbox->addWidget(cancel);
    
  connect(accept, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
Example #11
0
ScannerPage::ScannerPage (QWidget *w, DBIndex *i) : QWidget (w)
{
  chartIndex = i;
  idir.setFilter(QDir::Files);

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

  search = new QLineEdit(this);
  search->setText("*");
  connect(search, SIGNAL(textChanged(const QString &)), this, SLOT(searchChanged(const QString &)));
  QToolTip::add(search, tr("List Filter, e.g. s* or sb*"));
  vbox->addWidget(search);

  list = new Q3ListBox(this);
  connect(list, SIGNAL(contextMenuRequested(Q3ListBoxItem *, const QPoint &)), this,
          SLOT(rightClick(Q3ListBoxItem *)));
  connect(list, SIGNAL(highlighted(const QString &)), this, SLOT(scannerSelected(const QString &)));
  connect(list, SIGNAL(doubleClicked(Q3ListBoxItem *)), this, SLOT(doubleClick(Q3ListBoxItem *)));
  vbox->addWidget(list);

  menu = new QMenu(this);
  menu->insertItem(QPixmap(newchart), tr("&New Scanner		Ctrl+N"), this, SLOT(newScanner()));
  menu->insertItem(QPixmap(openitem), tr("&Open Scanner		Ctrl+O"), this, SLOT(openScanner()));
  menu->insertItem(QPixmap(deleteitem), tr("&Delete Scanner	Ctrl+D"), this, SLOT(deleteScanner()));
  menu->insertItem(QPixmap(renameitem), tr("&Rename Scanner		Ctrl+R"), this, SLOT(renameScanner()));
  menu->insertItem(QPixmap(macro), tr("R&un Scanner		Ctrl+U"), this, SLOT(runScanner()));
  menu->insertSeparator(-1);
  menu->insertItem(QPixmap(help), tr("&Help		Ctrl+H"), this, SLOT(slotHelp()));

  Q3Accel *a = new Q3Accel(this);
  connect(a, SIGNAL(activated(int)), this, SLOT(slotAccel(int)));
  a->insertItem(Qt::CTRL+Qt::Key_N, NewScanner);
  a->insertItem(Qt::CTRL+Qt::Key_O, OpenScanner);
  a->insertItem(Qt::CTRL+Qt::Key_D, DeleteScanner);
  a->insertItem(Qt::CTRL+Qt::Key_R, RenameScanner);
  a->insertItem(Qt::CTRL+Qt::Key_U, RunScanner);
  a->insertItem(Qt::CTRL+Qt::Key_H, Help);

  refreshList();
  scannerSelected(QString());
}
Example #12
0
OperationListDialog::OperationListDialog(const char * m,
					 Q3PtrList<BrowserOperation> & l)
    : QDialog(0, m, TRUE) {
  setCaption(m);
  move(QCursor::pos());
 
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
  Q3HBoxLayout * hbox;
 
  vbox->setMargin(5);
 
  cb = new Q3ComboBox(FALSE, this);
  vbox->addWidget(cb);
  
  for (BrowserOperation * oper = l.first(); oper; oper = l.next()) {
    QString s = ((BrowserNode *) oper->parent())->get_name() +
      QString("::") + oper->get_data()->definition(TRUE, FALSE);
    
    if (((OperationData *) oper->get_data())->get_is_abstract())
      cb->insertItem("[a] " + s);
    else
      cb->insertItem(s);
  }
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * ok = new QPushButton(TR("&OK"), this);
  QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
  QSize bs(cancel->sizeHint());
  
  ok->setDefault(TRUE);
  ok->setFixedSize(bs);
  cancel->setFixedSize(bs);
  
  hbox->addWidget(ok);
  hbox->addWidget(cancel);

  UmlDesktop::limitsize_center(this, previous_size, 0.8, 0.8);
  
  connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
Example #13
0
void StocksDialog::createSplitPage ()
{
    QWidget *w = new QWidget(this);

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

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

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

    Bar bar;
    db->getLastBar(bar);
    QDateTime dt;
    bar.getDate(dt);
    if (! bar.getEmptyFlag())
        splitDate = new Q3DateEdit(dt.date(), w);
    else
        splitDate = new Q3DateEdit(QDate::currentDate(), w);
    splitDate->setOrder(Q3DateEdit::YMD);
    grid->addWidget(splitDate, 0, 1);

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

    splitRatio = new QLineEdit("2:1", w);
    grid->addWidget(splitRatio, 1, 1);

    QPushButton *button = new QPushButton(tr("Perform Split"), w);
    connect(button, SIGNAL(clicked()), this, SLOT(split()));
    vbox->addWidget(button);

    vbox->addStretch(1);

    addTab(w, tr("Split"));
}
Example #14
0
ClassListDialog::ClassListDialog(const char * m,
				 const Q3ValueList<BrowserClass *> & l)
    : QDialog(0, m, TRUE) {
  setCaption(m);
  move(QCursor::pos());
 
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
  Q3HBoxLayout * hbox;
 
  vbox->setMargin(5);
 
  cb = new Q3ComboBox(FALSE, this);
  vbox->addWidget(cb);
  
  Q3ValueList<BrowserClass *>::ConstIterator end = l.end();
  Q3ValueList<BrowserClass *>::ConstIterator it;
  
    for (it = l.begin(); it != end; ++it)
      if (!(*it)->deletedp())
	cb->insertItem((*it)->full_name(TRUE));
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * ok = new QPushButton(TR("&OK"), this);
  QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
  QSize bs(cancel->sizeHint());
  
  ok->setDefault(TRUE);  
  ok->setFixedSize(bs);
  cancel->setFixedSize(bs);
  
  hbox->addWidget(ok);
  hbox->addWidget(cancel);
  
  connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
  
  UmlDesktop::limitsize_center(this, previous_size, 0.8, 0.8);
}
Example #15
0
CodAddMsgDialog::CodAddMsgDialog(CodObjCanvas * from, CodObjCanvas * to,
                                 CodMsgSupport * i, ColDiagramView * v,
                                 bool fo)
    : QDialog(0, "add msg dialog", TRUE), in(i), view(v), forward(fo)
{
    setCaption(TR("Add message dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
    Q3HBoxLayout * hbox;

    vbox->setMargin(5);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(10);
    QLabel * label1 = new QLabel(TR("Add message to %1", to->get_full_name()), this);
    label1->setAlignment(Qt::AlignCenter);
    hbox->addWidget(label1);

    Q3Grid * grid = new Q3Grid(2, this);

    vbox->addWidget(grid);
    new QLabel(TR("rank : "), grid);
    cbrank = new Q3ComboBox(FALSE, grid);

    ColMsgList all_in;
    ColMsgList all_out;

    from->get_all_in_all_out(all_in, all_out);

    QStringList new_ones;
    foreach (ColMsg *m, all_out) {
        QString s = m->next_hierarchical_rank();

        if ((s.find('.') != - 1) && (ColMsg::find(s, all_out) == 0)) {
            cbrank->insertItem(QString::number(m->get_rank() + 1) + " : " + s);
            new_ones.append(s);
        }
    }
Example #16
0
ConstrDestrCopyDialog::ConstrDestrCopyDialog(UmlClass * cl, bool have_constructor,
        bool have_destructor, bool have_copy,
        bool have_const_copy, bool have_assignment,
        bool have_const_assignment)
    : QDialog(0, 0, TRUE), target(cl)
{
    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
    Q3HGroupBox * g;
    Q3PtrList<QLabel> labels;
    QLabel * lbl;

    vbox->setSpacing(5);
    vbox->setMargin(5);

    lbl = new QLabel(QString("<big><b>C++ utilities for the class <i><tt>") +
                     (const char *) cl->name() + "</tt></i></b></big>",
                     this);
    lbl->setAlignment(Qt::AlignCenter);
    vbox->addWidget(lbl);

    // constructor

    g = new Q3HGroupBox(this);
    vbox->addWidget(g);

    labels.append(new QLabel((have_constructor)
                             ? "the class already have contructor  "
                             : "the class doesn't have contructor  ",
                             g));

    Q3HBox * h = new Q3HBox(g);

    add_constr = new QCheckBox("add constructor", h);
    constr_explicit = new QCheckBox("explicit", h);

    // destructor

    if (! have_destructor) {
        g = new Q3HGroupBox(this);
        vbox->addWidget(g);

        labels.append(new QLabel("the class doesn't have destructor  ",
                                 g));

        h = new Q3HBox(g);

        add_destr = new QCheckBox("add destructor", h);
        virtual_destr = new QCheckBox("virtual", h);
    }
    else
        add_destr = 0;

    // copy contructor

    if (have_copy) {
        add_copy = 0;

        if (!have_const_copy) {
            g = new Q3HGroupBox(this);
            vbox->addWidget(g);

            labels.append(new QLabel("the class doesn't have copy contructor  \nwith const argument  ",
                                     g));
            add_const_copy = new QCheckBox("add copy constructor\nwith const argument",
                                           g);
        }
        else
            add_const_copy = 0;
    }
    else if (!have_const_copy) {
        g = new Q3HGroupBox(this);
        vbox->addWidget(g);

        labels.append(new QLabel("the class doesn't have copy contructor  ",
                                 g));

        Q3VBox * v = new Q3VBox(g);

        add_const_copy = new QCheckBox("add copy constructor\nwith const argument",
                                       v);
        add_copy = new QCheckBox("add copy constructor\nwith non const argument",
                                 v);
    }
    else {
        g = new Q3HGroupBox(this);
        vbox->addWidget(g);

        labels.append(new QLabel("the class doesn't have copy contructor  \nwith non const argument  ",
                                 g));
        add_copy = new QCheckBox("add copy constructor\nwith non const argument",
                                 g);
        add_const_copy = 0;
    }

    // assignment

    if (have_assignment) {
        add_assign = 0;

        if (!have_const_assignment) {
            g = new Q3HGroupBox(this);
            vbox->addWidget(g);

            labels.append(new QLabel("the class doesn't have assignment\noperator with const argument  ",
                                     g));
            add_const_assign = new QCheckBox("add assignment\nwith const argument",
                                             g);
        }
        else
            add_const_assign = 0;
    }
    else if (!have_const_assignment) {
        g = new Q3HGroupBox(this);
        vbox->addWidget(g);

        labels.append(new QLabel("the class doesn't have assignment operator  ", g));

        Q3VBox * v = new Q3VBox(g);

        add_const_assign = new QCheckBox("add assignment\nwith const argument",
                                         v);
        add_assign = new QCheckBox("add assignment\nwith non const argument",
                                   v);
    }
    else {
        g = new Q3HGroupBox(this);
        vbox->addWidget(g);

        labels.append(new QLabel("the class doesn't have assignment operator  \nwith non const argument  ",
                                 g));
        add_assign = new QCheckBox("add assignment\nwith non const argument",
                                   g);
        add_const_assign = 0;
    }

    // use the same width for all the labels on the first column

    QSize sz(labels.first()->sizeHint());

    while ((lbl = labels.next()) != 0) {
        if (lbl->sizeHint().width() > sz.width())
            sz.setWidth(lbl->sizeHint().width());
    }

    for (lbl = labels.first(); lbl != 0; lbl = labels.next()) {
        sz.setHeight(lbl->sizeHint().height());
        lbl->setFixedSize(sz);
    }

    // ok & cancel buttons

    Q3HBox * hbox = new Q3HBox(this);

    vbox->addWidget(hbox);

    QPushButton * ok = new QPushButton("&OK", hbox);
    QPushButton * cancel = new QPushButton("&Cancel", hbox);

    QSize bs(cancel->sizeHint());

    ok->setDefault(TRUE);

    ok->setFixedSize(bs);
    cancel->setFixedSize(bs);

    connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
BrowserSearchDialog::BrowserSearchDialog()
    : QDialog(0, "Browser search", FALSE, Qt::WDestructiveClose)
{
    the = this;
    setCaption(TR("Browser search"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

    vbox->setMargin(5);

    Q3GridLayout * gl = new Q3GridLayout(vbox, 4, 2, 5/*space*/);

    gl->addWidget(new QLabel(TR("Kind"), this), 0, 0, Qt::AlignLeft);
    kind = new Q3ComboBox(FALSE, this);

    for (int index = 0; index != sizeof(Kinds) / sizeof(*Kinds); index += 1)
        kind->insertItem(TR(Kinds[index].lbl));

    kind->setCurrentItem(saved_kind);
    gl->addWidget(kind, 0, 1);

    ed = new LineEdit(this);
    ed->setText(saved_ed);
    gl->addWidget(new QLabel(TR("Containing"), this), 1, 0, Qt::AlignLeft);
    gl->addWidget(ed, 1, 1);
    ed->setFocus();

    Q3HBox * hb = new Q3HBox(this);

    gl->addWidget(hb, 2, 1);

    Q3GroupBox * gb = new Q3GroupBox(2, Qt::Horizontal, hb);

    case_sensitive = new QCheckBox(TR("case sensitive"), gb);
    case_sensitive->setChecked(saved_case_sensitive);
    even_deleted = new QCheckBox(TR("even deleted"), gb);
    even_deleted->setChecked(saved_even_deleted);

    Q3ButtonGroup * bg = new Q3ButtonGroup(4, Qt::Horizontal, hb);

    bg->setExclusive(TRUE);
    for_name = new QRadioButton(TR("name"), bg);
    for_name->setChecked(saved_name);
    for_stereotype = new QRadioButton(TR("stereotype"), bg);
    for_stereotype->setChecked(saved_stereotype);
    for_comment = new QRadioButton(TR("description"), bg);
    for_comment->setChecked(saved_comment);
    for_decldefbody = new QRadioButton(TR("declaration/definition/body"), bg);
    for_decldefbody->setChecked(saved_decldefbody);

    gl->addWidget(new QLabel(TR("Result"), this), 3, 0, Qt::AlignLeft);
    results = new Q3ComboBox(FALSE, this);
    gl->addWidget(results, 3, 1);

    Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox);
    QPushButton * search_b = new QPushButton(TR("Search"), this);
    QPushButton * close_b = new QPushButton(TR("Close"), this);

    hbox->setMargin(5);
    hbox->addWidget(search_b);
    hbox->addWidget(select_b = new QPushButton(TR("Select"), this));
    hbox->addWidget(mark_unmark_b = new QPushButton(TR("Unmark"), this));
    hbox->addWidget(mark_them_b = new QPushButton(TR("Mark them"), this));
    hbox->addWidget(unmark_all_b = new QPushButton(TR("Unmark all"), this));
    hbox->addWidget(close_b);

    search_b->setDefault(TRUE);

    connect(search_b, SIGNAL(clicked()), this, SLOT(search()));
    connect(select_b, SIGNAL(clicked()), this, SLOT(select()));
    connect(close_b, SIGNAL(clicked()), this, SLOT(reject()));
    connect(mark_unmark_b, SIGNAL(clicked()), this, SLOT(mark_unmark()));
    connect(mark_them_b, SIGNAL(clicked()), this, SLOT(mark_them()));
    connect(unmark_all_b, SIGNAL(clicked()), this, SLOT(unmark_all()));
    connect(results, SIGNAL(activated(int)), this, SLOT(selected(int)));

    if ((saved_kind != 0) || !saved_ed.isEmpty())
        search();
    else
        selected(-1);

    open_dialog(this);
}
Example #18
0
FragmentDialog::FragmentDialog(const QStringList & defaults, QString & s,
                               QString & fo, BrowserNode *& d)
    : QDialog(0, "Fragment dialog", TRUE), name(s), form(fo), refer(d)
{
    setCaption(TR("Fragment dialog"));

    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
    Q3HBoxLayout * hbox;
    QLabel * lbl1;
    QLabel * lbl2;
    SmallPushButton * refer_bt;
    BrowserNode * bn;

    vbox->setMargin(5);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    hbox->addWidget(lbl1 = new QLabel(TR("name : "), this));
    name_cb = new Q3ComboBox(TRUE, this);
    name_cb->insertItem(name);
    name_cb->setCurrentItem(0);
    name_cb->insertStringList(defaults);
    name_cb->setAutoCompletion(completion());
    hbox->addWidget(name_cb);

    QSizePolicy sp = name_cb->sizePolicy();

    sp.setHorData(QSizePolicy::Expanding);
    name_cb->setSizePolicy(sp);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    hbox->addWidget(refer_bt = new SmallPushButton(TR("refer to : "), this));
    connect(refer_bt, SIGNAL(clicked()), this, SLOT(menu_refer()));
    diag_cb = new Q3ComboBox(FALSE, this);
    BrowserDiagram::instances(nodes, TRUE);
    diag_cb->insertItem("");

    for (bn = nodes.first(); bn != 0; bn = nodes.next())
        diag_cb->insertItem(*(bn->pixmap(0)), bn->full_name(TRUE));

    diag_cb->setCurrentItem((refer == 0)
                            ? 0
                            : nodes.findRef(refer) + 1);
    diag_cb->setSizePolicy(sp);
    hbox->addWidget(diag_cb);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    hbox->addWidget(lbl2 = new QLabel(TR("arguments \n/ value : "), this));
    hbox->addWidget(ed_form = new LineEdit(this));
    ed_form->setText(form);

    same_width(lbl1, lbl2, refer_bt);

    hbox = new Q3HBoxLayout(vbox);
    hbox->setMargin(5);
    QPushButton * accept = new QPushButton(TR("&OK"), this);
    QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
    QSize bs(cancel->sizeHint());

    accept->setDefault(TRUE);
    accept->setFixedSize(bs);
    cancel->setFixedSize(bs);

    hbox->addWidget(accept);
    hbox->addWidget(cancel);

    connect(accept, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
Example #19
0
Dialog::Dialog() : QDialog(0, 0, TRUE)
{
    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
    Q3VGroupBox * gbox;
    Q3HButtonGroup * bg;
    Q3HBox * htab;

    vbox->setMargin(5);

    gbox = new Q3VGroupBox("Filters" , this);
    vbox->addWidget(gbox);

    htab = new Q3HBox(gbox);
    //htab->setMargin(5);

    new QLabel("filter 1 : ", htab);
    filter1_le = new LineEdit(htab);

    new QLabel("  ", htab);

    bg = new Q3HButtonGroup(htab);
    bg->setRadioButtonExclusive(TRUE);

    with1_rb = new QRadioButton("with", bg);
    new QRadioButton("without", bg);
    with1_rb->setChecked(TRUE);

    //

    htab = new Q3HBox(gbox);
    //htab->setMargin(5);

    new QLabel("", htab);
    bg = new Q3HButtonGroup(htab);
    bg->setRadioButtonExclusive(TRUE);

    and12_rb = new QRadioButton("and", bg);
    new QRadioButton("or", bg);
    and12_rb->setChecked(TRUE);

    new QLabel("", htab);

    //

    htab = new Q3HBox(gbox);
    //htab->setMargin(5);

    new QLabel("filter 2 : ", htab);
    filter2_le = new LineEdit(htab);

    new QLabel("  ", htab);

    bg = new Q3HButtonGroup(htab);
    bg->setRadioButtonExclusive(TRUE);

    with2_rb = new QRadioButton("with", bg);
    new QRadioButton("without", bg);
    with2_rb->setChecked(TRUE);

    //

    htab = new Q3HBox(gbox);
    //htab->setMargin(5);

    new QLabel("", htab);
    bg = new Q3HButtonGroup(htab);
    bg->setRadioButtonExclusive(TRUE);

    and23_rb = new QRadioButton("and", bg);
    new QRadioButton("or", bg);
    and23_rb->setChecked(TRUE);

    new QLabel("", htab);

    //

    htab = new Q3HBox(gbox);
    //htab->setMargin(5);

    new QLabel("filter 3 : ", htab);
    filter3_le = new LineEdit(htab);

    new QLabel("  ", htab);

    bg = new Q3HButtonGroup(htab);
    bg->setRadioButtonExclusive(TRUE);

    with3_rb = new QRadioButton("with", bg);
    new QRadioButton("without", bg);
    with3_rb->setChecked(TRUE);

    //
    //

    gbox = new Q3VGroupBox("Stereotype" , this);
    vbox->addWidget(gbox);

    htab = new Q3HBox(gbox);
    //htab->setMargin(5);

    bg = new Q3HButtonGroup(htab);
    bg->setRadioButtonExclusive(TRUE);

    any_rb = new QRadioButton("any", bg);
    is_rb = new QRadioButton("is", bg);
    isnot_rb = new QRadioButton("is not", bg);
    any_rb->setChecked(TRUE);
    stereotype_le = new QLineEdit(htab);

    //
    //

    gbox = new Q3VGroupBox("Targets" , this);
    vbox->addWidget(gbox);

    htab = new Q3HBox(gbox);
    //htab->setMargin(5);

    artifact_cb = new QCheckBox("artifact", htab);
    class_cb = new QCheckBox("class", htab);
    operation_cb = new QCheckBox("operation", htab);
    attribute_cb = new QCheckBox("attribute", htab);
    relation_cb = new QCheckBox("relation", htab);

    //
    //

    gbox = new Q3VGroupBox("Languages" , this);
    vbox->addWidget(gbox);

    htab = new Q3HBox(gbox);
    //htab->setMargin(5);

    cpp_cb = new QCheckBox("C++", htab);
    java_cb = new QCheckBox("Java", htab);
    php_cb = new QCheckBox("Php", htab);
    python_cb = new QCheckBox("Python", htab);
    idl_cb = new QCheckBox("Idl", htab);

    //
    //

    Q3Grid * grid = new Q3Grid(2, this);
    vbox->addWidget(grid);
    grid->setMargin(5);
    grid->setSpacing(5);

    new QLabel("current : ", grid);
    current_le  = new LineEdit(grid);

    new QLabel("new : ", grid);
    new_le  = new LineEdit(grid);

    //
    //

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    new QLabel(htab);
    QPushButton * replace = new QPushButton("Replace", htab);
    new QLabel(htab);
    QPushButton * quit = new QPushButton("Quit", htab);
    new QLabel(htab);

    QSize bs(replace->sizeHint());

    quit->setFixedSize(bs);

    connect(replace, SIGNAL(clicked()), this, SLOT(do_replace()));
    connect(quit, SIGNAL(clicked()), this, SLOT(reject()));

}
Example #20
0
RelatedElementsDialog::RelatedElementsDialog(BrowserNode * e, const char * what,
					     bool inh, bool assoc, BrowserNodeList & l)
    : QDialog(0, "Related elements dialog", TRUE), elt(e), elts(l) {
  setCaption(TR("Related elements dialog"));
  
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);  
  Q3HBoxLayout * hbox;
  
  vbox->setMargin(5);
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);  
  hbox->addWidget(new QLabel(TR("Search for : "), this));
  referenced_rb = new QCheckBox(TR("referenced elements  "), this);
  referenced_rb->setChecked(TRUE);
  hbox->addWidget(referenced_rb);
  referencing_rb = new QCheckBox(TR("referencing elements  "), this);
  hbox->addWidget(referencing_rb);
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);  
  hbox->addWidget(new QLabel(TR("Through relations : "), this));
  if (inh) {
    inh_rb = new QCheckBox(TR("generalization  "), this);
    inh_rb->setChecked(TRUE);
    hbox->addWidget(inh_rb);
  }
  else
    inh_rb = 0;
  dep_rb = new QCheckBox(TR("dependency  "), this);
  dep_rb->setChecked(TRUE);
  hbox->addWidget(dep_rb);
  if (assoc) {
    assoc_rb = new QCheckBox(TR("other"), this);
    assoc_rb->setChecked(TRUE);
    hbox->addWidget(assoc_rb);
  }
  else
    assoc_rb = 0;
  hbox->addWidget(new QLabel(this), 1000);
  
  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);  
  sametype_rb = new QCheckBox(TR("Search only for %1", what), this);
  sametype_rb->setChecked(TRUE);
  hbox->addWidget(sametype_rb);
  hbox->addWidget(new QLabel(this), 1000);
  hbox->addWidget(new QLabel(TR("     Search on "), this));
  sb_level = new QSpinBox(1, 10, 1, this, TR("levels"));
  sb_level->setValue(1);
  hbox->addWidget(sb_level);
  hbox->addWidget(new QLabel(TR("levels"), this));

  hbox = new Q3HBoxLayout(vbox); 
  hbox->setMargin(5);
  QPushButton * accept = new QPushButton(TR("&OK"), this);
  QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
  QSize bs(cancel->sizeHint());
  
  accept->setDefault(TRUE);
  accept->setFixedSize(bs);
  cancel->setFixedSize(bs);
  
  hbox->addWidget(accept);
  hbox->addWidget(cancel);
    
  connect(accept, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
Example #21
0
UserDialog::UserDialog(const QPoint & p)
    : QDialog(0, "Browser search", TRUE) {
  setCaption("Choose user");
  move(p);
  
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
  Q3HBoxLayout * hbox;
  QLabel * lbl1;
  QLabel * lbl2;
  
  vbox->setMargin(5);

  QLabel * lbl = 
    new QLabel("\nSelect a user to get its identity,\nyou may change or set his name\n", 
	       this);
  
  lbl->setAlignment(::Qt::AlignCenter);
  vbox->addWidget(lbl);
  
  hbox = new Q3HBoxLayout(vbox);
  hbox->setMargin(5);
  lbl1 = new QLabel("User : "******" (" + s + ")");
  }
  ids->setCurrentItem(user_id() - 2);
  
  QSizePolicy sp = ids->sizePolicy();

  sp.setHorData(QSizePolicy::Expanding);
  ids->setSizePolicy(sp);

  hbox->addWidget(ids);
  
  hbox = new Q3HBoxLayout(vbox);
  hbox->setMargin(5);
  lbl2 = new QLabel("New name : ", this);
  lbl1->setFixedWidth(lbl2->sizeHint().width());
  hbox->addWidget(lbl2);
  edname = new QLineEdit(this);
  hbox->addWidget(edname);
    
  hbox = new Q3HBoxLayout(vbox);
  hbox->setMargin(5);

  QPushButton * ok = new QPushButton("Ok", this);
  QPushButton * cancel = new QPushButton("Cancel", this);
  
  hbox->addWidget(new QLabel(this));
  hbox->addWidget(ok);
  hbox->addWidget(new QLabel(this));
  hbox->addWidget(cancel);
  hbox->addWidget(new QLabel(this));
  
  connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
Example #22
0
Dialog::Dialog(WrapperStr & path, WrapperStr & encoding, WrapperStr & nomodel, WrapperStr & genview, WrapperStr & uml20, WrapperStr & pk, WrapperStr & vis, WrapperStr & primitivetype, WrapperStr & genextension, WrapperStr & geneclipse, WrapperStr & commentexporter, WrapperStr & linefeed, Language & lang)
    : QDialog(0, 0, TRUE), _path(path), _encoding(encoding), _nomodel(nomodel), _genview(genview), _uml20(uml20), _pk(pk), _vis(vis), _primitivetype(primitivetype), _genextension(genextension), _geneclipse(geneclipse), _commentexporter(commentexporter), _linefeed(linefeed), _lang(lang)
{
    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
    Q3HBox * htab;

    vbox->setMargin(5);

    // get xmi pathname

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    new QLabel("generated \nXMI file : ", htab);

    ed = new QLineEdit(htab);
    ed->setText(_path);

    new QLabel(" ", htab);

    SmallPushButton * br = new SmallPushButton("browse", htab);

    connect(br, SIGNAL(clicked()), this, SLOT(browse()));

    // to choose encoding

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    new QLabel("Encoding : ", htab);

    QString charset = getenv("BOUML_CHARSET");
    int index = 0;

    while ((index = charset.find('_')) != -1) {
        charset[index] = '-';
        index += 1;
    }

    encoding_cb = new QComboBox(TRUE, htab);
    htab->setStretchFactor(encoding_cb, 1000);

    if (_encoding.isEmpty())
        _encoding = "UTF-8";

    encoding_cb->insertItem(QString(_encoding));

    if (!charset.isEmpty() && (_encoding != (const char *) charset))
        encoding_cb->insertItem(charset);

    if (_encoding != "UTF-8")
        encoding_cb->insertItem("UTF-8");

#ifdef WIN32

    if ((_encoding != "windows-1252") && (charset != "windows-1252"))
        encoding_cb->insertItem("windows-1252");

    if ((_encoding != "ISO-8859-1") && (charset != "ISO-8859-1"))
        encoding_cb->insertItem("ISO-8859-1");

#else

    if ((_encoding != "ISO-8859-1") && (charset != "ISO-8859-1"))
        encoding_cb->insertItem("ISO-8859-1");

    if ((_encoding != "windows-1252") && (charset != "windows-1252"))
        encoding_cb->insertItem("windows-1252");

#endif

    // uml 2.0 or uml2.1

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    Q3ButtonGroup * bg = new Q3ButtonGroup(2, Qt::Horizontal, "Uml", htab);

    uml20_rb = new QRadioButton("uml 2.0", bg);
    uml21_rb = new QRadioButton("uml 2.1", bg);

    if (uml20 == "yes")
        uml20_rb->setChecked(TRUE);
    else
        uml21_rb->setChecked(TRUE);

    // generate model

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    nomodel_cb = new QCheckBox("Don't generate model level", htab);

    if (_nomodel == "yes")
        nomodel_cb->setChecked(TRUE);

    // generate view checkbox

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    genview_cb = new QCheckBox("Generate views as package (not compatible with profile generation)", htab);

    if (_genview == "yes")
        genview_cb->setChecked(TRUE);

    // generate pk_ prefix

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    pk_cb = new QCheckBox("Generate 'pk_' prefix for parameter direction", htab);

    if (_pk == "yes")
        pk_cb->setChecked(TRUE);

    // generate vis_ prefix

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    vis_cb = new QCheckBox("Generate 'vis_' prefix for visibility", htab);

    if (_vis == "yes")
        vis_cb->setChecked(TRUE);

    // use PrimitiveType rather than DataType

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    primitivetype_cb = new QCheckBox("Use PrimitiveType rather than DataType", htab);

    if (_primitivetype == "yes")
        primitivetype_cb->setChecked(TRUE);

    // generate extension

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    genextension_cb = new QCheckBox("Generate extensions", htab);

    if (_genextension == "yes")
        genextension_cb->setChecked(TRUE);

    // generate for Eclipse

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    geneclipse_cb = new QCheckBox("Generate for Eclipse (aggregation set on other relation side)", htab);

    if (_geneclipse == "yes")
        geneclipse_cb->setChecked(TRUE);

    // comment exporter

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    commentexporter_cb = new QCheckBox("Comment exporter indication (needed to import in some tools like Rsa)", htab);

    if (_commentexporter == "yes")
        commentexporter_cb->setChecked(TRUE);

    // generate &#10; rather than linefeed

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    linefeed_cb = new QCheckBox("Generate lf and cr characters in string rather than '&&#10;' and '&&#13;'", htab);

    if (_linefeed == "yes")
        linefeed_cb->setChecked(TRUE);

    // uml , c++, java, cancel buttons

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    new QLabel(htab);
    QPushButton * uml = new QPushButton("&Uml", htab);
    new QLabel(htab);
    QPushButton * cpp = new QPushButton("&C++", htab);
    new QLabel(htab);
    QPushButton * java = new QPushButton("&Java", htab);
    new QLabel(htab);
    QPushButton * cancel = new QPushButton("&Cancel", htab);
    new QLabel(htab);
    QSize bs(cancel->sizeHint());

    uml->setFixedSize(bs);
    cpp->setFixedSize(bs);
    java->setFixedSize(bs);

    connect(uml, SIGNAL(clicked()), this, SLOT(accept_uml()));
    connect(cpp, SIGNAL(clicked()), this, SLOT(accept_cpp()));
    connect(java, SIGNAL(clicked()), this, SLOT(accept_java()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));

    // help

    htab = new Q3HBox(this);
    htab->setMargin(5);
    vbox->addWidget(htab);

    new QLabel(htab);
    new QLabel("Remark : to help Eclipse to import the generated file,\n"
               "choose Uml 2.1 and name the file with the extension '.xmi'", htab);
    new QLabel(htab);
}
Example #23
0
AnnotationDialog::AnnotationDialog(QWidget * parent, QString & s, bool visit)
    : QDialog(parent, "annotation editor", TRUE), value(s)
{
    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);

    vbox->setMargin(5);

    // multiline edit

    e = new MultiLineEdit(this);
    e->setText(s);
    vbox->addWidget(e);

    if (! visit) {
        e->setFocus();

        // to choose and add an annotation

        QLabel * label =
            new QLabel(TR("\nTo add an annotation at the cursor position\n"
                          "you may select it in the list and press 'add'\n"),
                       this);
        label->setAlignment(Qt::AlignCenter);
        vbox->addWidget(label);

        Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox);
        QPushButton * add_button;

        hbox->setMargin(5);
        add_button = new QPushButton(TR("Add "), this);
        hbox->addWidget(add_button);
        connect(add_button, SIGNAL(clicked()), this, SLOT(add_annotation()));

        cb = new Q3ComboBox(FALSE, this);

        QSizePolicy sp = cb->sizePolicy();

        sp.setHorData(QSizePolicy::Expanding);
        cb->setSizePolicy(sp);
        cb->setAutoCompletion(completion());

        for (int i = 0;
             i != sizeof(DefaultAnnotations) / sizeof(*DefaultAnnotations);
             i += 1)
            cb->insertItem(DefaultAnnotations[i]);

        QStringList list;

        BrowserClass::instances(annotations, "@interface");

        if (! annotations.isEmpty()) {
            annotations.full_names(list);
            cb->insertStringList(list);
        }

        hbox->addWidget(cb);

        // buttons ok, cancel

        vbox->addWidget(new QLabel("", this));

        hbox = new Q3HBoxLayout(vbox);
        hbox->setMargin(5);
        QPushButton * accept = new QPushButton(TR("&OK"), this);
        QPushButton * cancel = new QPushButton(TR("&Cancel"), this);
        QSize bs(cancel->sizeHint());

        accept->setDefault(TRUE);
        accept->setFixedSize(bs);
        cancel->setFixedSize(bs);

        hbox->addWidget(accept);
        hbox->addWidget(cancel);

        connect(accept, SIGNAL(clicked()), this, SLOT(accept()));
        connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
    }
    else {
        e->setReadOnly(TRUE);

        // buttons cancel

        vbox->addWidget(new QLabel("", this));

        Q3HBoxLayout * hbox = new Q3HBoxLayout(vbox);

        hbox->setMargin(5);
        QPushButton * close = new QPushButton(TR("&Close"), this);

        hbox->addWidget(close);

        connect(close, SIGNAL(clicked()), this, SLOT(reject()));
    }

    // not done in polish else the initial size is too small
    UmlDesktop::setsize_center(this, previous_size, 0.3, 0.3);
}
Example #24
0
SynchroDialog::SynchroDialog(Q3PtrList<BrowserView> & b)
    : QDialog(0, "Synchronize", TRUE), browsers(b) {
  setCaption("Synchronize");
  
  Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
  Q3HBoxLayout * hbox;
  
  vbox->setMargin(5);
  
  bool has_ro = FALSE;
  bool has_ro_need_update = FALSE;
  bool has_need_update = FALSE;
  Q3PtrListIterator<BrowserView> it(browsers);
  
  for (; it.current(); ++it) {
    if (it.current()->is_need_update()) {
      if (it.current()->is_cant_update()) {
	has_ro = TRUE;
	has_ro_need_update = TRUE;
      }
      else
	has_need_update = TRUE;
    }
  }  

  QLabel * lbl;
  
  if (has_need_update) {
    lbl = 
      new QLabel("\nChoose the projects to synchronize with the others\n", 
		 this);
    
    lbl->setAlignment(::Qt::AlignCenter);
    vbox->addWidget(lbl);
    
    if (has_ro_need_update) {
      lbl = 
	new QLabel("\nWarning : some projects can't be synchronized because of read-only files\n", 
		   this);
      
      lbl->setAlignment(::Qt::AlignCenter);
      vbox->addWidget(lbl);
    }
  }
  else if (has_ro_need_update) {
    lbl = 
      new QLabel("\nSynchronisation not possible because of read-only files\n", 
		 this);
    
    lbl->setAlignment(::Qt::AlignCenter);
    vbox->addWidget(lbl);
  }
  else {
    lbl = 
      new QLabel("\nAll the projects are synchronized\n",
		 this);
    
    lbl->setAlignment(::Qt::AlignCenter);
    vbox->addWidget(lbl);
  }
  
  //
  
  for (it.toFirst() ; it.current(); ++it) {
    if (it.current()->is_need_update()) {
      QCheckBox * cb = new QCheckBox(it.current()->get_dir().path(), this);
      
      vbox->addWidget(cb);
      
      if (it.current()->is_cant_update())
	cb->setEnabled(FALSE);
      else
	checks.append(cb);
    }
  }
  
  //
  
  hbox = new Q3HBoxLayout(vbox);
  hbox->setMargin(5);

  if (has_need_update) {
    QPushButton * ok = new QPushButton("Synchronize", this);
  
    hbox->addWidget(new QLabel(this));
    hbox->addWidget(ok);
    connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
  }
  
  QPushButton * cancel = new QPushButton("Cancel", this);
  
  hbox->addWidget(new QLabel(this));
  hbox->addWidget(cancel);
  hbox->addWidget(new QLabel(this));
  connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}
Example #25
0
void StocksDialog::createDetailsPage ()
{
    QWidget *w = new QWidget(this);

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

    Q3GridLayout *grid = new Q3GridLayout(vbox);
    grid->setMargin(0);
    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("First Date"), w);
    grid->addWidget(label, 4, 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, 4, 1);
    }

    label = new QLabel(tr("Last Date"), w);
    grid->addWidget(label, 5, 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, 5, 1);
    }

    grid->expand(grid->numRows() + 1, grid->numCols());
    grid->setColStretch(1, 1);

    vbox->addStretch(1);

    addTab(w, tr("Details"));
}
Example #26
0
TesterReport::TesterReport (QWidget *p) : QWidget (p)
{
  Q3VBoxLayout *vbox = new Q3VBoxLayout(this);
  vbox->setMargin(5);
  vbox->setSpacing(5);

  tradeTable = new Q3Table(0, 9, this);
  tradeTable->setSelectionMode(Q3Table::Single);
  tradeTable->setSorting(FALSE);
  Q3Header *header = tradeTable->horizontalHeader();
  header->setLabel(0, tr("Type"), 40);
  header->setLabel(1, tr("Entry"), 80);
  header->setLabel(2, tr("Entry Price"), 70);
  header->setLabel(3, tr("Exit"), 80);
  header->setLabel(4, tr("Exit Price"), 70);
  header->setLabel(5, tr("Signal"), -1);
  header->setLabel(6, tr("Profit"), -1);
  header->setLabel(7, tr("Balance"), -1);
  header->setLabel(8, tr("Vol"), -1);
  vbox->addWidget(tradeTable);

  int loop;
  for (loop = 0; loop < 9; loop++)
    tradeTable->setColumnReadOnly(loop, TRUE);

  // test summary
  Q3HBoxLayout *hbox = new Q3HBoxLayout(vbox);
  hbox->setSpacing(5);

  Q3VGroupBox *gbox = new Q3VGroupBox(tr("Test Summary"), this);
  gbox->setInsideSpacing(2);
  gbox->setColumns(2);
  hbox->addWidget(gbox);

  QLabel *label = new QLabel(tr("Account Balance "), gbox);
  summaryBalance = new QLabel(" ", gbox);

  label = new QLabel(tr("Net Profit "), gbox);
  summaryNetProfit = new QLabel(" ", gbox);

  label = new QLabel(tr("Net Profit % "), gbox);
  summaryNetPercentage = new QLabel(" ", gbox);

  label = new QLabel(tr("Initial Investment "), gbox);
  summaryInvestment = new QLabel(" ", gbox);

  label = new QLabel(tr("Commissions "), gbox);
  summaryCommission = new QLabel(" ", gbox);

  label = new QLabel(tr("Largest Drawdown "), gbox);
  summaryDrawdown = new QLabel(" ", gbox);

  label = new QLabel(tr("Trades "), gbox);
  summaryTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Long Trades "), gbox);
  summaryLongTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Short Trades "), gbox);
  summaryShortTrades = new QLabel(" ", gbox);

  // win summary
  gbox = new Q3VGroupBox(tr("Win Summary"), this);
  gbox->setInsideSpacing(2);
  gbox->setColumns(2);
  hbox->addWidget(gbox);

  label = new QLabel(tr("Trades "), gbox);
  summaryWinTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Profit "), gbox);
  summaryTotalWinTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Average "), gbox);
  summaryAverageWin = new QLabel(" ", gbox);

  label = new QLabel(tr("Largest "), gbox);
  summaryLargestWin = new QLabel(" ", gbox);

  label = new QLabel(tr("Long Trades "), gbox);
  summaryWinLongTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Short Trades "), gbox);
  summaryWinShortTrades = new QLabel(" ", gbox);

  // lose summary
  gbox = new Q3VGroupBox(tr("Lose Summary"), this);
  gbox->setInsideSpacing(2);
  gbox->setColumns(2);
  hbox->addWidget(gbox);

  label = new QLabel(tr("Trades "), gbox);
  summaryLoseTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Loss "), gbox);
  summaryTotalLoseTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Average "), gbox);
  summaryAverageLose = new QLabel(" ", gbox);

  label = new QLabel(tr("Largest "), gbox);
  summaryLargestLose = new QLabel(" ", gbox);

  label = new QLabel(tr("Long Trades "), gbox);
  summaryLoseLongTrades = new QLabel(" ", gbox);

  label = new QLabel(tr("Short Trades "), gbox);
  summaryLoseShortTrades = new QLabel(" ", gbox);
}
Example #27
0
Dialog::Dialog(UmlArtifact * art, const Q3CString & path_exe, Q3CString & pro, Q3CString & target, Q3CString & tmplt, Q3CString & config, Q3CString & defines, Q3CString & includepath, Q3CString & dependpath, Q3CString & objectsdir, Q3CString & footer)
    : QDialog(0, 0, TRUE), _art(art), _pro(pro), _target(target), _tmplt(tmplt),
      _config(config), _defines(defines), _includepath(includepath), _dependpath(dependpath),
      _objectsdir(objectsdir), _footer(footer)
{
    QDir d(path_exe);
    Q3VBoxLayout * vbox = new Q3VBoxLayout(this);
    Q3Grid * grid = new Q3Grid(2, this);
    Q3HBox * htab;
    int index;

    vbox->addWidget(grid);
    vbox->setMargin(5);

    new QLabel(".pro file : ", grid);
    htab = new Q3HBox(grid);
    edpro = new QLineEdit(htab);
    edpro->setText(d.absFilePath(pro));

    new QLabel(" ", htab);
    browsepro = new SmallPushButton("browse", htab);
    connect(browsepro, SIGNAL(clicked()), this, SLOT(browse_pro()));

    new QLabel("target : ", grid);
    htab = new Q3HBox(grid);
    edtarget = new QLineEdit(htab);
    edtarget->setText(d.absFilePath(target));
    new QLabel(" ", htab);
    browsetarget = new SmallPushButton("browse", htab);
    connect(browsetarget, SIGNAL(clicked()), this, SLOT(browse_target()));

    new QLabel("template : ", grid);
    cbtemplate = new Q3ComboBox(TRUE, grid);

    static const char * templates[] = { "app", "lib", "subdirs" };
    bool find = FALSE;

    for (index = 0; index != sizeof(templates) / sizeof(*templates); index += 1) {
        cbtemplate->insertItem(templates[index]);

        if (tmplt == templates[index]) {
            cbtemplate->setCurrentItem(index);
            find = TRUE;
        }
    }

    if (! find) {
        cbtemplate->insertItem((QString) tmplt);
        cbtemplate->setCurrentItem(index);
    }

    new QLabel("config : ", grid);
    htab = new Q3HBox(grid);
    cbconf[0] = new Q3ComboBox(FALSE, htab);
    cbconf[0]->insertItem("debug");
    cbconf[0]->insertItem("release");

    QStringList lcnf =
        QStringList::split(" ", (const char *) config);
    QStringList::Iterator it = lcnf.begin();

    cbconf[0]->setCurrentItem((*it++ == "debug") ? 0 : 1);

    cbconf[1] = new Q3ComboBox(FALSE, htab);
    cbconf[1]->insertItem("warn_on");
    cbconf[1]->insertItem("warn_off");
    cbconf[1]->setCurrentItem((*it++ == "warn_on") ? 0 : 1);

    QSizePolicy sp = cbconf[0]->sizePolicy();

    sp.setHorData(QSizePolicy::Fixed);
    cbconf[0]->setSizePolicy(sp);
    cbconf[1]->setSizePolicy(sp);

    new QLabel(" qt ", htab);
    it++;	// qt

    const char * configs[] = {
        "", "opengl", "thread", "x11", "windows",
        "console", "dll", "staticlib", 0
    };

    for (index = 2;
         index != sizeof(cbconf) / sizeof(*cbconf) - 1;
         index += 1) {
        cbconf[index] = new Q3ComboBox(TRUE, htab);

        if (it != lcnf.end())
            cbconf[index]->insertItem(*it++);

        cbconf[index]->insertStrList(configs);
        cbconf[index]->setCurrentItem(0);
    }

    cbconf[index] = new Q3ComboBox(TRUE, htab);

    if (it != lcnf.end()) {
        QString s = *it++;

        while (it != lcnf.end())
            s += " " + *it++;

        cbconf[index]->insertItem(s);
    }

    cbconf[index]->insertStrList(configs);
    cbconf[index]->setCurrentItem(0);


    new QLabel("defines : ", grid);
    eddefines = new QLineEdit(grid);
    eddefines->setText(defines);

    ///may be computed
    new QLabel("include paths : ", grid);
    htab = new Q3HBox(grid);
    edincludepath = new QLineEdit(htab);
    edincludepath->setText(includepath);
    new QLabel(" ", htab);
    computeincludepath = new SmallPushButton("compute", htab);
    connect(computeincludepath, SIGNAL(clicked()), this, SLOT(compute_includepath()));

    new QLabel("depend paths : ", grid);
    eddependpath = new QLineEdit(grid);
    eddependpath->setText(dependpath);

    new QLabel("objects dir : ", grid);
    htab = new Q3HBox(grid);
    edobjectsdir = new QLineEdit(htab);
    edobjectsdir->setText(objectsdir);
    new QLabel(" ", htab);
    browseobjectsdir = new SmallPushButton("browse", htab);
    connect(browseobjectsdir, SIGNAL(clicked()), this, SLOT(browse_objectsdir()));

    new QLabel("footer : ", grid);
    edfooter = new Q3TextEdit(grid);
    edfooter->setText(footer);

    new QLabel(grid);
    new QLabel(grid);

    new QLabel(grid);
    htab = new Q3HBox(grid);
    new QLabel(htab);
    QPushButton * ok = new QPushButton("&OK", htab);
    new QLabel(htab);
    QPushButton * cancel = new QPushButton("&Cancel", htab);
    new QLabel(htab);
    QSize bs(cancel->sizeHint());

    ok->setDefault(TRUE);

    if (ok->sizeHint().width() > bs.width())
        bs.setWidth(ok->sizeHint().width());

    ok->setFixedSize(bs);
    cancel->setFixedSize(bs);

    connect(ok, SIGNAL(clicked()), this, SLOT(accept()));
    connect(cancel, SIGNAL(clicked()), this, SLOT(reject()));
}