Пример #1
0
CBrushProperties::CBrushProperties (QWidget * parent, const char *name):
        QWidget (parent, name)
{
    Q3HBoxLayout *topLayout = new Q3HBoxLayout (this);
    QLabel *title = new QLabel (this);
    title->setText ("Brush width :");
    topLayout->addWidget (title);

    textBox1 = new QLineEdit (this, "brustoolsizechooser");
    textBox1->setText ("10");
    textBox1->show ();
    textBox1->setMaximumWidth (50);

    topLayout->addWidget (textBox1);

    QLabel *label1 = new QLabel (this);
    label1->setText (" just enter width walue end start to draw.");
    label1->adjustSize ();
    topLayout->addWidget (label1);
        //  QPushButton *pushButton1=new QPushButton(this);
        //  pushButton1->setText("Set width");

        //  connect(pushButton1,SLOT(clicked()),this,SIGNAL());

}
Пример #2
0
//===========================================================
//
void ImportWizard::setupDstType()
{
    m_dstTypePage = new QWidget(this);

    KexiDB::DriverManager manager;
    KexiDB::Driver::InfoHash drvs = manager.driversInfo();

    Q3VBoxLayout *vbox = new Q3VBoxLayout(m_dstTypePage, KDialog::marginHint());

    Q3HBoxLayout *hbox = new Q3HBoxLayout(vbox);
    QLabel *lbl = new QLabel(i18n("Destination database type:") + " ", m_dstTypePage);
    lbl->setAlignment(Qt::AlignAuto | Qt::AlignTop);
    hbox->addWidget(lbl);

    m_dstPrjTypeSelector = new KexiPrjTypeSelector(m_dstTypePage);
    hbox->addWidget(m_dstPrjTypeSelector);
    m_dstPrjTypeSelector->option_file->setText(i18n("Database project stored in a file"));
    m_dstPrjTypeSelector->option_server->setText(i18n("Database project stored on a server"));

    QVBoxLayout *frame_server_vbox = new QVBoxLayout(
        m_dstPrjTypeSelector->frame_server, KDialog::spacingHint());
    m_dstServerTypeCombo = new KexiDBDriverComboBox(m_dstPrjTypeSelector->frame_server, drvs,
            KexiDBDriverComboBox::ShowServerDrivers);
    frame_server_vbox->addWidget(m_dstServerTypeCombo);
    hbox->addStretch(1);
    vbox->addStretch(1);
    lbl->setBuddy(m_dstServerTypeCombo);

//! @todo hardcoded: find a way to preselect default engine item
    //m_dstTypeCombo->setCurrentText("SQLite3");
    addPage(m_dstTypePage, i18n("Select Destination Database Type"));
}
Пример #3
0
GearPropertiesDialog::GearPropertiesDialog(QWidget *parent, Gear *gear, Engine *engine) :
  QDialog(parent, "Properties", true),
  _gear(gear),
  _engine(engine)
{
  setCaption("Properties");
  _verticalLayout = new Q3VBoxLayout(this, 12, 12, "layout");

  std::vector<Property*> properties;
  _gear->settings().getAll(&properties);


  //create all PropertieControls for the gear
  for (std::vector<Property*>::iterator it=properties.begin(); it!=properties.end(); ++it)
    addControl((*it));

  //ok cancels
  Q3HBoxLayout *hLayout = new Q3HBoxLayout(2);
  _okButton = new QPushButton("Ok", this);
  hLayout->addWidget(_okButton);
  QObject::connect(_okButton, SIGNAL(clicked()), this, SLOT(slotOK()));                
  _cancelButton =  new QPushButton("Cancel", this);
  QObject::connect(_cancelButton, SIGNAL(clicked()), this, SLOT(accept()));               
  hLayout->addWidget(_cancelButton);
  _verticalLayout->addLayout(hLayout);

}
Пример #4
0
ConfigForm::ConfigForm(int aCurrentIntervalValue, QWidget *parent,
		       const char *name,
		       bool modal, Qt::WFlags f)
  : QDialog( parent, name, modal, f ),
    mApplyButton(kNULL), mCancelButton(kNULL)
{
  mMinVal_Sec = float(kMIN_POLLING_INT) / 1000.f;
  mMaxVal_Sec = float(kMAX_POLLING_INT) / 1000.f;

  REG_DBGMSG1("ARPDBG: min val = ", mMinVal_Sec);
  REG_DBGMSG1("ARPDBG: max val = ", mMaxVal_Sec);

  REG_DBGCON("ConfigForm");

  // note aCurrentIntervalValue is in milliseconds - convert to
  // seconds for GUI entry

  this->setCaption( "Configure Polling" );
  resize( 150, 150 );

  // create the layouts for the form
  Q3VBoxLayout *lFormLayout = new Q3VBoxLayout(this, 10, 10, "configformlayout");
  Q3HBoxLayout *lButtonLayout = new Q3HBoxLayout(6, "configbuttonlayout");

  lFormLayout->addWidget(new QLabel("Enter interval value (seconds) \n"
				    "Valid range: "
				    +QString::number(mMinVal_Sec)
				    +" - "+QString::number(mMaxVal_Sec)
				    +" (2 d.p.)", this));

  mLineEdit = new QLineEdit( this );

  double lVal = (double) aCurrentIntervalValue/1000;

  mLineEdit->setText(QString::number(lVal, 'g', 3));
  mLineEdit->setValidator( new QDoubleValidator(mLineEdit, "dbleavlidator" ) );

  lFormLayout->addWidget( mLineEdit);

  mApplyButton = new QPushButton("Apply", this, "Applybutton"); \
  mApplyButton->setAutoDefault(FALSE);
  QToolTip::add(mApplyButton, "Apply to steerer");
  connect(mApplyButton, SIGNAL(clicked()), this, SLOT(applySlot()));

  mCancelButton = new QPushButton("Cancel", this, "cancelbutton");
  mCancelButton->setAutoDefault(FALSE);
  connect(mCancelButton,  SIGNAL(clicked()), this, SLOT( reject()));

  mCancelButton->setMinimumSize(mCancelButton->sizeHint());
  mCancelButton->setMaximumSize(mCancelButton->sizeHint());
  mApplyButton->setMinimumSize(mCancelButton->sizeHint());
  mApplyButton->setMaximumSize(mApplyButton->sizeHint());

  lButtonLayout->addWidget(mApplyButton);
  lButtonLayout->addWidget(mCancelButton);

  lFormLayout->addLayout(lButtonLayout);

}
Пример #5
0
TicTacToe::TicTacToe( bool meFirst, int boardSize, QWidget *parent, const char *name )
    : QWidget( parent, name )
{
    Q3VBoxLayout * l = new Q3VBoxLayout( this, 6 );

    // Create a message label

    message = new QLabel( this );
    message->setFrameStyle( Q3Frame::WinPanel | Q3Frame::Sunken );
    message->setAlignment( Qt::AlignCenter );
    l->addWidget( message );

    // Create the game board and connect the signal finished() to this
    // gameOver() slot

    board = new TicTacGameBoard( meFirst, boardSize, this );
    connect( board, SIGNAL(finished()), SLOT(gameOver()) );
    l->addWidget( board );

    // Create a horizontal frame line

    Q3Frame *line = new Q3Frame( this );
    line->setFrameStyle( Q3Frame::HLine | Q3Frame::Sunken );
    l->addWidget( line );

    // Create the combo box for deciding who should start, and
    // connect its clicked() signals to the buttonClicked() slot

    whoStarts = new QComboBox( this );
    whoStarts->insertItem( "Opponent starts" );
    whoStarts->insertItem( "You start" );
    l->addWidget( whoStarts );

	whoStarts->setEnabled(false);
	whoStarts->setCurrentIndex(meFirst); 
    // Create the push buttons and connect their clicked() signals
    // to this right slots.

	connect( board, SIGNAL(myMove(int)), this, SIGNAL(myMove(int)));
	connect( board, SIGNAL(stateChanged()), this, SLOT(newState()));
    newGame = new QPushButton( "Play!", this );
    connect( newGame, SIGNAL(clicked()), SLOT(newGameClicked()) );
	newGame->setEnabled(false);
    quit = new QPushButton( "Quit", this );
    connect( quit, SIGNAL(clicked()), this, SIGNAL(closing()) );
    Q3HBoxLayout * b = new Q3HBoxLayout;
    l->addLayout( b );
    b->addWidget( newGame );
    b->addWidget( quit );

    newState();
	//board->newGame();
	newGameClicked();
}
QWidget * QSettingColorTableItem::createEditor() const
{
	QWidget * pBox = new QWidget(table()->viewport());
	Q3HBoxLayout * pBoxLayout = new Q3HBoxLayout(pBox);
	QLineEdit * pEdit = new QLineEdit(pBox, "editor");
	QColorPushButton * pButton = new QColorPushButton(pEdit, "...", pBox, "colorbutton");
	pBoxLayout->addWidget(pEdit, 1);
	pBoxLayout->addWidget(pButton);
	pBox->setFocusProxy(pEdit);
	pEdit->setText(pButton->m_strColor = text());
	return pBox;
}
Пример #7
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()));
}
Пример #8
0
VTabWidget::VTabWidget(VTabPosition p,QWidget* parent, const char* name): QWidget(parent, name)
{
  m_position = p;
  Q3HBoxLayout *layout = new Q3HBoxLayout(this);
  m_bar = new VTabBar(p,this);
  m_wStack = new Q3WidgetStack(this);
  layout->addWidget(m_bar,0);
  layout->addWidget(m_wStack,5);
  m_autoIndexer = 0;
  m_wStack->hide();
  connect(m_bar,SIGNAL(allTabsOff()),m_wStack,SLOT(hide()));
  connect(m_bar, SIGNAL(activatedTab(int)), this, SLOT(setCurrentPage(int)));
        
  connect(m_bar,SIGNAL(allTabsOff()),this,SIGNAL(widgetStackHidden()));
  connect(m_bar,SIGNAL(activatedTab(int)),this,SIGNAL(widgetStackShown()));
}
Пример #9
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()));
}
Пример #10
0
StringListEdit::StringListEdit(const QStringList &list, 
                               UntitledList* unamedList, 
                               QWidget *parent)
    : QDialog(parent), 
      ask(false), 
      duplicatesOk(false),
      _suggestedStringsList(unamedList)
{
    addCaption = "Add String";
    addLabel = "String:";
    editCaption = "Edit String";
    editLabel = addLabel;

    Q3HBoxLayout *hbox = new Q3HBoxLayout(this, 5, 5);
    Q3VBoxLayout *vbox = new Q3VBoxLayout;
    listBox = new Q3ListBox(this);
    connect(listBox, SIGNAL(currentChanged(Q3ListBoxItem*)),
            this, SLOT(updateButtons()));
    hbox->addWidget(listBox, 1);
    QPushButton *button = new QPushButton(tr("&Add..."), this);
    connect(button, SIGNAL(clicked()), this, SLOT(addString()));
    vbox->addWidget(button);
    editButton = new QPushButton(tr("&Edit..."), this);
    connect(editButton, SIGNAL(clicked()), this, SLOT(editString()));
    vbox->addWidget(editButton);
    removeButton = new QPushButton(tr("&Remove..."), this);
    connect(removeButton, SIGNAL(clicked()), this, SLOT(removeString()));
    vbox->addWidget(removeButton);
    upButton = new QPushButton(tr("&Up"), this);
    connect(upButton, SIGNAL(clicked()), this, SLOT(moveUp()));
    vbox->addWidget(upButton);
    downButton = new QPushButton(tr("&Down"), this);
    connect(downButton, SIGNAL(clicked()), this, SLOT(moveDown()));
    vbox->addWidget(downButton);
    vbox->addStretch(1);
    button = new QPushButton(tr("OK"), this);
    connect(button, SIGNAL(clicked()), this, SLOT(accept()));
    vbox->addWidget(button);
    button = new QPushButton(tr("Cancel"), this);
    connect(button, SIGNAL(clicked()), this, SLOT(reject()));
    vbox->addWidget(button);
    hbox->addLayout(vbox);

    setList(list);
}
Пример #11
0
void VTabWidget::setPosition(VTabPosition p)
{
  if(m_position == p)
    return;
  m_position = p;
  Q3HBoxLayout *l = (Q3HBoxLayout*)layout();
  if(!l)
    {
      qWarning( "Error layout is null");
      return;
    }
  l->remove(m_wStack);
  l->remove(m_bar);

  m_bar->setPosition(p);
  if(p == TabLeft)
    {
      l->addWidget(m_bar,0);
      l->addWidget(m_wStack,5);
    }
  else
    {
      l->addWidget(m_wStack,5);
      l->addWidget(m_bar,0);
    }
}
Пример #12
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());
}
Пример #13
0
KexiCSVInfoLabel::KexiCSVInfoLabel(const QString& labelText, QWidget* parent)
        : QWidget(parent)
{
    Q3VBoxLayout *vbox = new Q3VBoxLayout(this, 0, KDialog::spacingHint());
    Q3HBoxLayout *hbox = new Q3HBoxLayout(this);
    vbox->addLayout(hbox);
    m_leftLabel = new QLabel(labelText, this);
    m_leftLabel->setMinimumWidth(130);
    m_leftLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    m_leftLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
    m_leftLabel->setWordWrap(true);
    hbox->addWidget(m_leftLabel);
    m_iconLbl = new QLabel(this);
    m_iconLbl->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
    m_iconLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
    m_fnameLbl = new QLabel(this);
    m_fnameLbl->setOpenExternalLinks(true);
    m_fnameLbl->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
    m_fnameLbl->setFocusPolicy(Qt::NoFocus);
    m_fnameLbl->setTextFormat(Qt::PlainText);
    m_fnameLbl->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding, 1, 0));
    m_fnameLbl->setLineWidth(1);
    m_fnameLbl->setFrameStyle(Q3Frame::Box);
    m_fnameLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
    m_fnameLbl->setWordWrap(true);
    hbox->addSpacing(5);
    hbox->addWidget(m_iconLbl);
    hbox->addWidget(m_fnameLbl, 1, Qt::AlignVCenter | Qt::AlignLeft
#ifdef __GNUC__
#warning TODO | Qt::TextWordWrap
#else
#pragma WARNING( TODO | Qt::TextWordWrap )
#endif
                   );
    hbox->addSpacing(10);
    m_commentLbl = new QLabel(this);
    m_commentLbl->setOpenExternalLinks(true);
    m_commentLbl->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard);
    m_commentLbl->setFocusPolicy(Qt::NoFocus);
    m_commentLbl->setTextFormat(Qt::PlainText);
    m_commentLbl->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    m_commentLbl->setLineWidth(1);
    m_commentLbl->setFrameStyle(QFrame::Box);
    m_commentLbl->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
    m_commentLbl->setWordWrap(true);
    hbox->addWidget(m_commentLbl, 0, Qt::AlignVCenter | Qt::AlignRight
#ifdef __GNUC__
#warning TODO | Qt::TextWordWrap
#else
#pragma WARNING( TODO | Qt::TextWordWrap )
#endif
                   );

    m_separator = new Q3Frame(this);
    m_separator->setFrameShape(Q3Frame::HLine);
    m_separator->setFrameShadow(Q3Frame::Sunken);
    vbox->addWidget(m_separator);
}
Пример #14
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()));
}
Пример #15
0
SetKeySig::SetKeySig(int keySig, QWidget *parent)
	: KDialog(parent)
{
	setCaption(i18n("Key signature"));
	setButtons(Ok | Cancel);
	setModal(true);

	QWidget *page = new QWidget(this);
	setMainWidget(page);

	QStringList signatures;
	signatures
		<< i18n("7 sharps") + " (C#/A#m)"
		<< i18n("6 sharps") + " (F/D#m)"
		<< i18n("5 sharps") + " (B/G#m)"
		<< i18n("4 sharps") + " (E/C#m)"
		<< i18n("3 sharps") + " (A/F#m)"
		<< i18n("2 sharps") + " (D/Bm)"
		<< i18n("1 sharp")  + " (G/Em)"
		<< i18n("none")     + " (C/Am)"
		<< i18n("1 flat")   + " (F/Dm)"
		<< i18n("2 flats")  + " (Bb/Gm)"
		<< i18n("3 flats")  + " (Eb/Cm)"
		<< i18n("4 flats")  + " (Ab/Fm)"
		<< i18n("5 flats")  + " (Db/Bbm)"
		<< i18n("6 flats")  + " (Gb/Ebm)"
		<< i18n("7 flats")  + " (Cb/Abm)";

	sig = new QComboBox(TRUE, page);
	sig->setEditable(false);
	sig->setInsertionPolicy(QComboBox::NoInsertion);
	sig->insertStringList(signatures);
	sig->setCurrentItem(7 - keySig);

	QLabel *sig_l = new QLabel(sig, i18n("Flats / sharps:"), page);

	Q3HBoxLayout *l = new Q3HBoxLayout(page, 0, spacingHint());
    l->addWidget(sig_l);
	l->addWidget(sig);
    l->activate();
}
Пример #16
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);
}
Пример #17
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);
        }
    }
Пример #18
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);
}
FileListDialog::FileListDialog(QWidget* parent,
			       QString const& _dialogTitle,
			       QString const& _listTitle,
			       char const * _filters[]) :
  QDialog(parent, "FileListDialog", TRUE),       // TRUE = modal dialog
  list_(NULL),
  delButton_(NULL),
  fileDialog_(NULL),
  modified_(false)
{
  resize(300, 200);
  setCaption(_dialogTitle);

  Q3VBoxLayout * topBox = new Q3VBoxLayout(this, 0, -1, "boxLayout");

  Q3VGroupBox * fileBox = new Q3VGroupBox(this, "fileBox");
  list_ = new Q3ListBox(fileBox, "list");

  Q3HBox * fileButtonsBox = new Q3HBox(fileBox, "fileButtons");
  QPushButton * addButton = new QPushButton("Add...", fileButtonsBox);
  delButton_ = new QPushButton("Remove", fileButtonsBox);

  fileDialog_ = new Q3FileDialog(this, "config file dialog", TRUE);

  topBox->addSpacing(10);
  topBox->addWidget(fileBox);
  fileBox->setTitle(_listTitle);

  topBox->addSpacing(10);
  Q3HBoxLayout * dialogButtonsBox = new Q3HBoxLayout(topBox, -1, "hBoxLayout");
  QSpacerItem * dBSpace = new QSpacerItem(0, 0);
  QPushButton * okButton = new QPushButton("OK", this);
  QPushButton * cancelButton = new QPushButton("Cancel", this);
  
  topBox->addSpacing(5);
  dialogButtonsBox->addItem(dBSpace);
  dialogButtonsBox->addWidget(okButton);
  dialogButtonsBox->addSpacing(5);
  dialogButtonsBox->addWidget(cancelButton);
  dialogButtonsBox->addSpacing(5);
  
  okButton->setDefault(true);

  static const char * filters[3] = { "all files (*)", NULL };

  fileDialog_->setCaption("File open dialog");
  fileDialog_->setFilters((_filters == NULL)? filters : _filters);

  // connect the dialogs functionality  
  connect(okButton,     SIGNAL(clicked()), SLOT(accept()));
  connect(cancelButton, SIGNAL(clicked()), SLOT(reject()));
  connect(addButton,    SIGNAL(clicked()), SLOT(add()));
  connect(delButton_,   SIGNAL(clicked()), SLOT(del()));

  selectListItem();
}
Пример #20
0
HIC::QHSpinBox::QHSpinBox(double minValue,double maxValue,double initialValue,double step,QWidget * parent,const char * name):QWidget(parent,name)
{
    m_min_value = minValue;
    m_max_value = maxValue;
    m_step      = step;
    m_value     = initialValue;    

    m_leftbutton  = new QPushButton("<<",this,"leftbutton");
    m_leftbutton->setAutoRepeat(true);
    QObject::connect(m_leftbutton, SIGNAL(clicked()), this, SLOT(stepDown()));
    m_rightbutton = new QPushButton(">>",this,"rightbutton");
    m_rightbutton->setAutoRepeat(true);
    QObject::connect(m_rightbutton ,SIGNAL(clicked()),this, SLOT(stepUp()));

    m_lineedit = new QLineEdit(QString::number(m_value),this,"lineedit");
    m_lineedit->setMaximumSize(60,20);
    QObject::connect(m_lineedit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));

    Q3HBoxLayout * layout = new Q3HBoxLayout(this,1,5,"hspinlayout");
    layout->addWidget(m_leftbutton);
    layout->addWidget(m_lineedit);
    layout->addWidget(m_rightbutton);
    layout->setResizeMode(QLayout::SetFixedSize);
}
Пример #21
0
VisualizationsEditor::VisualizationsEditor(const QString &currentSelection,
                                           MythMainWindow *parent, const char *name)
    : MythDialog(parent, name)
{
    Q3VBoxLayout *vbox = new Q3VBoxLayout(this, (int)(20 * wmult));
    Q3HBoxLayout *hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult));

    // Window title
    QString message = tr("Visualizations");
    QLabel *label = new QLabel(message, this);
    label->setBackgroundOrigin(WindowOrigin);
    QFont font = label->font();
    font.setPointSize(int (font.pointSize() * 1.5));
    font.setBold(true);
    label->setFont(font);
    label->setPaletteForegroundColor(QColor("yellow"));
    label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
    hbox->addWidget(label);

    hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult));
    label = new QLabel(tr("Selected Visualizations"), this);
    label->setBackgroundOrigin(WindowOrigin);
    label->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
    hbox->addWidget(label);

    label = new QLabel(tr("Available Visualizations"), this);
    label->setBackgroundOrigin(WindowOrigin);
    label->setAlignment(Qt::AlignLeft | Qt::AlignBottom);
    hbox->addWidget(label);

    // selected listview
    hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult));
    selectedList = new Q3MythListView(this);
    selectedList->addColumn(tr("Name"));
    selectedList->addColumn(tr("Provider"));
    selectedList->setSorting(-1);         // disable sorting
    selectedList->setSelectionMode(Q3ListView::Single);
    connect(selectedList, SIGNAL(currentChanged(Q3ListViewItem *)),
            this, SLOT(selectedChanged(Q3ListViewItem *)));
    connect(selectedList, SIGNAL(spacePressed(Q3ListViewItem *)),
            this, SLOT(selectedOnSelect(Q3ListViewItem *)));
    connect(selectedList, SIGNAL(returnPressed(Q3ListViewItem *)),
            this, SLOT(selectedOnSelect(Q3ListViewItem *)));
    selectedList->installEventFilter(this);
    hbox->addWidget(selectedList);

    // available listview
    availableList = new Q3MythListView(this);
    availableList->addColumn(tr("Name"));
    availableList->addColumn(tr("Provider"));
    availableList->setSorting(0);
    connect(availableList, SIGNAL(currentChanged(Q3ListViewItem *)),
            this, SLOT(availableChanged(Q3ListViewItem *)));
    connect(availableList, SIGNAL(spacePressed(Q3ListViewItem *)),
            this, SLOT(availableOnSelect(Q3ListViewItem *)));
    connect(availableList, SIGNAL(returnPressed(Q3ListViewItem *)),
            this, SLOT(availableOnSelect(Q3ListViewItem *)));
    availableList->installEventFilter(this);

    hbox->addWidget(availableList);


    hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult));
    MythPushButton *button = new MythPushButton( this, "Program" );
    button->setBackgroundOrigin(WindowOrigin);
    button->setText( tr( "Move Up" ) );
    button->setEnabled(true);
    connect(button, SIGNAL(clicked()), this, SLOT(upClicked()));
    hbox->addWidget(button);

    button = new MythPushButton( this, "Program" );
    button->setBackgroundOrigin(WindowOrigin);
    button->setText( tr( "Move Down" ) );
    button->setEnabled(true);
    connect(button, SIGNAL(clicked()), this, SLOT(downClicked()));
    hbox->addWidget(button);

    // fake labels used as spacers
    label = new QLabel(" ", this);
    label->setBackgroundOrigin(WindowOrigin);
    hbox->addWidget(label);

    label = new QLabel(" ", this);
    label->setBackgroundOrigin(WindowOrigin);
    hbox->addWidget(label);


    //OK Button
    hbox = new Q3HBoxLayout(vbox, (int)(10 * wmult));
    button = new MythPushButton( this, "Program" );
    button->setBackgroundOrigin(WindowOrigin);
    button->setText( tr( "OK" ) );
    button->setEnabled(true);
    hbox->addWidget(button);
    connect(button, SIGNAL(clicked()), this, SLOT(okClicked()));

    //Cancel Button
    button = new MythPushButton( this, "Program" );
    button->setBackgroundOrigin(WindowOrigin);
    button->setText( tr( "Cancel" ) );
    button->setEnabled(true);
    hbox->addWidget(button);
    connect(button, SIGNAL(clicked()), this, SLOT(cancelClicked()));

    availableList->setFocus();

    fillWidgets(currentSelection);
}
Пример #22
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);
}
Пример #23
0
void WomatlCluster::constructor()
{
  _valid  = FALSE;
  _id     = -1;
  _woid   = -1;
  _type   = (Push | Pull | Mixed);

  _source = WoMaterial;
  _sourceId = -1;

  _required = 0.0;
  _issued = 0.0;

//  Create the component Widgets
  QLabel *itemNumberLit = new QLabel(tr("Component Item Number:"), this, "itemNumberLit");
  itemNumberLit->setGeometry(0, 0, 140, 25);
  itemNumberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _itemNumber = new XComboBox(this, "_itemNumber");
  _itemNumber->setGeometry(145, 0, 120, 25);
  _itemNumber->setAllowNull(TRUE);

  QLabel *uomLit = new QLabel(tr("UOM:"), this, "uomLit");
  uomLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _uom = new QLabel(this, "_uom");
  _uom->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);

  _descrip1 = new QLabel(this, "_descrip1");
  _descrip1->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);

  _descrip2 = new QLabel(this, "_descrip2");
  _descrip2->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);

  QLabel *qtyPerLit = new QLabel(tr("Qty. Per:"), this, "qtyPerLit");
  qtyPerLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _qtyPer = new QLabel(this, "_qtyPer");
  _qtyPer->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  QLabel *scrapLit = new QLabel(tr("Scrap %:"), this, "scrapLit");
  scrapLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _scrap = new QLabel(this, "_scrap");
  _scrap->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  QLabel *qtyRequiredLit = new QLabel(tr("Qty. Required:"), this, "qtyRequiredLit");
  qtyRequiredLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _qtyRequired = new QLabel(this, "_qtyRequired");
  _qtyRequired->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  QLabel *qtyIssuedLit = new QLabel(tr("Qty. Issued:"), this, "qtyIssuedLit");
  qtyIssuedLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  _qtyIssued = new QLabel(this, "_qtyIssued");
  _qtyIssued->setAlignment(Qt::AlignRight | Qt::AlignVCenter);

  // lay out the component widgets
  Q3VBoxLayout *clusterLyt    = new Q3VBoxLayout(this, 5, -1, "clusterLyt");
  Q3HBoxLayout *itemMainLyt   = new Q3HBoxLayout(clusterLyt, -1, "itemMainLyt");
  Q3HBoxLayout *itemDescLyt   = new Q3HBoxLayout(clusterLyt, -1, "itemDescLyt");
  Q3HBoxLayout *qtyHBoxLyt    = new Q3HBoxLayout(clusterLyt, -1, "qtyHBoxLyt");
  Q3VBoxLayout *qtyLitVBoxLyt = new Q3VBoxLayout(qtyHBoxLyt, -1, "qtyLitVBoxLyt");
  Q3VBoxLayout *qtyVBoxLyt    = new Q3VBoxLayout(qtyHBoxLyt, -1, "qtyVBoxLyt");

  itemMainLyt->addWidget(itemNumberLit);
  itemMainLyt->addWidget(_itemNumber);
  itemMainLyt->addWidget(uomLit);
  itemMainLyt->addWidget(_uom);
  itemDescLyt->addWidget(_descrip1);
  itemDescLyt->addWidget(_descrip2);

  qtyLitVBoxLyt->addWidget(qtyPerLit);
  qtyLitVBoxLyt->addWidget(scrapLit);
  qtyLitVBoxLyt->addWidget(qtyRequiredLit);
  qtyLitVBoxLyt->addWidget(qtyIssuedLit);
  qtyVBoxLyt->addWidget(_qtyPer);
  qtyVBoxLyt->addWidget(_scrap);
  qtyVBoxLyt->addWidget(_qtyRequired);
  qtyVBoxLyt->addWidget(_qtyIssued);

  connect(_itemNumber, SIGNAL(newID(int)), SLOT(sPopulateInfo(int)));

  setFocusProxy(_itemNumber);
}
KexiSimplePrintPreviewWindow::KexiSimplePrintPreviewWindow(
    KexiSimplePrintingEngine &engine, const QString& previewName,
    QWidget *parent, Qt::WFlags f)
        : QWidget(parent, "KexiSimplePrintPreviewWindow", f)
        , m_engine(engine)
        , m_settings(*m_engine.settings())
        , m_pageNumber(-1)
        , m_pagesCount(-1)
{
    setWindowTitle(i18n("%1 - Print Preview - %2", previewName, KEXI_APP_NAME));
    setIcon(DesktopIcon("document-print-preview"));
    Q3VBoxLayout *lyr = new Q3VBoxLayout(this, 6);

    int id;
    m_toolbar = new KToolBar(0, this);
    m_toolbar->setLineWidth(0);
    m_toolbar->setFrameStyle(Q3Frame::NoFrame);
    m_toolbar->setIconText(KToolBar::IconTextRight);
    lyr->addWidget(m_toolbar);

    id = m_toolbar->insertWidget(-1, 0, new KPushButton(KStandardGuiItem::print(), m_toolbar));
    m_toolbar->addConnection(id, SIGNAL(clicked()), this, SLOT(slotPrintClicked()));
    static_cast<KPushButton*>(m_toolbar->getWidget(id))->setAccel(Qt::CTRL | Qt::Key_P);
    m_toolbar->insertSeparator();

    id = m_toolbar->insertWidget(-1, 0, new KPushButton(i18n("Page Set&up..."), m_toolbar));
    m_toolbar->addConnection(id, SIGNAL(clicked()), this, SLOT(slotPageSetup()));
    m_toolbar->insertSeparator();


#ifndef KEXI_NO_UNFINISHED
//! @todo unfinished
    id = m_toolbar->insertWidget(-1, 0, new KPushButton(KIcon("zoom-in"), i18n("Zoom In"), m_toolbar));
    m_toolbar->addConnection(id, SIGNAL(clicked()), this, SLOT(slotZoomInClicked()));
    m_toolbar->insertSeparator();

    id = m_toolbar->insertWidget(-1, 0, new KPushButton(KIcon("zoom-out"), i18n("Zoom Out"), m_toolbar));
    m_toolbar->addConnection(id, SIGNAL(clicked()), this, SLOT(slotZoomOutClicked()));
    m_toolbar->insertSeparator();
#endif

    id = m_toolbar->insertWidget(-1, 0, new KPushButton(KStandardGuiItem::close(), m_toolbar));
    m_toolbar->addConnection(id, SIGNAL(clicked()), this, SLOT(close()));
    m_toolbar->alignItemRight(id);

    m_scrollView = new KexiSimplePrintPreviewScrollView(this);
    m_scrollView->setUpdatesEnabled(false);
    m_view = m_scrollView->widget;
    m_scrollView->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    lyr->addWidget(m_scrollView);

    QWidget* navToolbarWidget = new QWidget(this); //widget used to center the navigator toolbar
    navToolbarWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
    Q3HBoxLayout *navToolbarLyr = new Q3HBoxLayout(navToolbarWidget);
    lyr->addWidget(navToolbarWidget);

    m_navToolbar = new KToolBar(0, navToolbarWidget);
    navToolbarLyr->addStretch(1);
    navToolbarLyr->addWidget(m_navToolbar);
    navToolbarLyr->addStretch(1);
// m_navToolbar->setFullWidth(true);
    m_navToolbar->setLineWidth(0);
    m_navToolbar->setFrameStyle(Q3Frame::NoFrame);
    m_navToolbar->setIconText(KToolBar::IconTextRight);

    m_idFirst = m_navToolbar->insertWidget(-1, 0, new KPushButton(KIcon("go-first"), i18n("First Page"), m_navToolbar));
    m_navToolbar->addConnection(m_idFirst, SIGNAL(clicked()), this, SLOT(slotFirstClicked()));
    m_navToolbar->insertSeparator();

    m_idPrevious = m_navToolbar->insertWidget(-1, 0, new KPushButton(KIcon("go-previous"), i18n("Previous Page"), m_navToolbar));
    m_navToolbar->addConnection(m_idPrevious, SIGNAL(clicked()), this, SLOT(slotPreviousClicked()));
    m_navToolbar->insertSeparator();

    m_idPageNumberLabel = m_navToolbar->insertWidget(-1, 0, new QLabel(m_navToolbar));
    m_navToolbar->insertSeparator();

    m_idNext = m_navToolbar->insertWidget(-1, 0, new KPushButton(KIcon("go-next"), i18n("Next Page"), m_navToolbar));
    m_navToolbar->addConnection(m_idNext, SIGNAL(clicked()), this, SLOT(slotNextClicked()));
    m_navToolbar->insertSeparator();

    m_idLast = m_navToolbar->insertWidget(-1, 0, new KPushButton(KIcon("go-last"), i18n("Last Page"), m_navToolbar));
    m_navToolbar->addConnection(m_idLast, SIGNAL(clicked()), this, SLOT(slotLastClicked()));
    m_navToolbar->insertSeparator();

    resize(width(), kapp->desktop()->height()*4 / 5);

//! @todo progress bar...

    QTimer::singleShot(50, this, SLOT(initLater()));
}
Пример #25
0
KAstTopLevel::KAstTopLevel( QWidget *parent, const char *name )
    : Q3MainWindow( parent, name, 0 )
{
    QWidget *border = new QWidget( this );
    border->setBackgroundColor( Qt::black );
    setCentralWidget( border );

    Q3VBoxLayout *borderLayout = new Q3VBoxLayout( border );
    borderLayout->addStretch( 1 );

    QWidget *mainWin = new QWidget( border );
    mainWin->setFixedSize(640, 480);
    borderLayout->addWidget( mainWin, 0, Qt::AlignHCenter );

    borderLayout->addStretch( 1 );

    view = new KAsteroidsView( mainWin );
    view->setFocusPolicy( Qt::StrongFocus );
    connect( view, SIGNAL( shipKilled() ), SLOT( slotShipKilled() ) );
    connect( view, SIGNAL( rockHit(int) ), SLOT( slotRockHit(int) ) );
    connect( view, SIGNAL( rocksRemoved() ), SLOT( slotRocksRemoved() ) );
    connect( view, SIGNAL( updateVitals() ), SLOT( slotUpdateVitals() ) );

    Q3VBoxLayout *vb = new Q3VBoxLayout( mainWin );
    Q3HBoxLayout *hb = new Q3HBoxLayout;
    Q3HBoxLayout *hbd = new Q3HBoxLayout;
    vb->addLayout( hb );

    QFont labelFont( "helvetica", 24 );
    QColorGroup grp( Qt::darkGreen, Qt::black, QColor( 128, 128, 128 ),
	    QColor( 64, 64, 64 ), Qt::black, Qt::darkGreen, Qt::black );
    QPalette pal( grp, grp, grp );

    mainWin->setPalette( pal );

    hb->addSpacing( 10 );

    QLabel *label;
    label = new QLabel( tr("Score"), mainWin );
    label->setFont( labelFont );
    label->setPalette( pal );
    label->setFixedWidth( label->sizeHint().width() );
    hb->addWidget( label );

    scoreLCD = new QLCDNumber( 6, mainWin );
    scoreLCD->setFrameStyle( Q3Frame::NoFrame );
    scoreLCD->setSegmentStyle( QLCDNumber::Flat );
    scoreLCD->setFixedWidth( 150 );
    scoreLCD->setPalette( pal );
    hb->addWidget( scoreLCD );
    hb->addStretch( 10 );

    label = new QLabel( tr("Level"), mainWin );
    label->setFont( labelFont );
    label->setPalette( pal );
    label->setFixedWidth( label->sizeHint().width() );
    hb->addWidget( label );

    levelLCD = new QLCDNumber( 2, mainWin );
    levelLCD->setFrameStyle( Q3Frame::NoFrame );
    levelLCD->setSegmentStyle( QLCDNumber::Flat );
    levelLCD->setFixedWidth( 70 );
    levelLCD->setPalette( pal );
    hb->addWidget( levelLCD );
    hb->addStretch( 10 );

    label = new QLabel( tr("Ships"), mainWin );
    label->setFont( labelFont );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hb->addWidget( label );

    shipsLCD = new QLCDNumber( 1, mainWin );
    shipsLCD->setFrameStyle( Q3Frame::NoFrame );
    shipsLCD->setSegmentStyle( QLCDNumber::Flat );
    shipsLCD->setFixedWidth( 40 );
    shipsLCD->setPalette( pal );
    hb->addWidget( shipsLCD );

    hb->addStrut( 30 );

    vb->addWidget( view, 10 );

// -- bottom layout:
    vb->addLayout( hbd );

    QFont smallFont( "helvetica", 14 );
    hbd->addSpacing( 10 );

    QString sprites_prefix = ":/trolltech/examples/graphicsview/portedasteroids/sprites/";
/*
    label = new QLabel( tr( "T" ), mainWin );
    label->setFont( smallFont );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    teleportsLCD = new QLCDNumber( 1, mainWin );
    teleportsLCD->setFrameStyle( QFrame::NoFrame );
    teleportsLCD->setSegmentStyle( QLCDNumber::Flat );
    teleportsLCD->setPalette( pal );
    teleportsLCD->setFixedHeight( 20 );
    hbd->addWidget( teleportsLCD );

    hbd->addSpacing( 10 );
*/
    QPixmap pm( sprites_prefix + "powerups/brake.png" );
    label = new QLabel( mainWin );
    label->setPixmap( pm );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    brakesLCD = new QLCDNumber( 1, mainWin );
    brakesLCD->setFrameStyle( Q3Frame::NoFrame );
    brakesLCD->setSegmentStyle( QLCDNumber::Flat );
    brakesLCD->setPalette( pal );
    brakesLCD->setFixedHeight( 20 );
    hbd->addWidget( brakesLCD );

    hbd->addSpacing( 10 );

    pm.load( sprites_prefix + "powerups/shield.png" );
    label = new QLabel( mainWin );
    label->setPixmap( pm );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    shieldLCD = new QLCDNumber( 1, mainWin );
    shieldLCD->setFrameStyle( Q3Frame::NoFrame );
    shieldLCD->setSegmentStyle( QLCDNumber::Flat );
    shieldLCD->setPalette( pal );
    shieldLCD->setFixedHeight( 20 );
    hbd->addWidget( shieldLCD );

    hbd->addSpacing( 10 );

    pm.load( sprites_prefix + "powerups/shoot.png" );
    label = new QLabel( mainWin );
    label->setPixmap( pm );
    label->setFixedWidth( label->sizeHint().width() );
    label->setPalette( pal );
    hbd->addWidget( label );

    shootLCD = new QLCDNumber( 1, mainWin );
    shootLCD->setFrameStyle( Q3Frame::NoFrame );
    shootLCD->setSegmentStyle( QLCDNumber::Flat );
    shootLCD->setPalette( pal );
    shootLCD->setFixedHeight( 20 );
    hbd->addWidget( shootLCD );

    hbd->addStretch( 1 );

    label = new QLabel( tr( "Fuel" ), mainWin );
    label->setFont( smallFont );
    label->setFixedWidth( label->sizeHint().width() + 10 );
    label->setPalette( pal );
    hbd->addWidget( label );

    powerMeter = new KALedMeter( mainWin );
    powerMeter->setFrameStyle( Q3Frame::Box | Q3Frame::Plain );
    powerMeter->setRange( MAX_POWER_LEVEL );
    powerMeter->addColorRange( 10, Qt::darkRed );
    powerMeter->addColorRange( 20, QColor(160, 96, 0) );
    powerMeter->addColorRange( 70, Qt::darkGreen );
    powerMeter->setCount( 40 );
    powerMeter->setPalette( pal );
    powerMeter->setFixedSize( 200, 12 );
    hbd->addWidget( powerMeter );

    shipsRemain = 3;
    showHiscores = FALSE;

    actions.insert( Qt::Key_Up, Thrust );
    actions.insert( Qt::Key_Left, RotateLeft );
    actions.insert( Qt::Key_Right, RotateRight );
    actions.insert( Qt::Key_Space, Shoot );
    actions.insert( Qt::Key_Z, Teleport );
    actions.insert( Qt::Key_X, Brake );
    actions.insert( Qt::Key_S, Shield );
    actions.insert( Qt::Key_P, Pause );
    actions.insert( Qt::Key_L, Launch );
    actions.insert( Qt::Key_N, NewGame );

    view->showText( tr( "Press N to start playing" ), Qt::yellow );
}
Пример #26
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()));
}
Пример #27
0
TesterTestPage::TesterTestPage (QWidget *p) : QWidget (p)
{
  fieldList.append(tr("Open"));
  fieldList.append(tr("Close"));
  fieldList.append(tr("Mid Point"));

  Q3HBoxLayout *hbox = new Q3HBoxLayout(this);
  hbox->setMargin(5);
  hbox->setSpacing(10);

  // left side grid

  Q3GridLayout *grid = new Q3GridLayout(hbox);
  grid->setColStretch(1, 1);
  grid->setSpacing(5);

  // trades area

  tradeLong = new QCheckBox(tr("Long"), this);
  grid->addWidget(tradeLong, 0, 0);

  tradeShort = new QCheckBox(tr("Short"), this);
  grid->addWidget(tradeShort, 1, 0);

  QLabel *label = new QLabel(tr("Trade Delay"), this);
  grid->addWidget(label, 2, 0);

  tradeDelay = new QSpinBox(1, 999999, 1, this);
  tradeDelay->setValue(1);
  grid->addWidget(tradeDelay, 2, 1);

  grid->setRowSpacing(grid->numRows(), 25);

  // account area

  label = new QLabel(tr("Account Balance"), this);
  grid->addWidget(label, 4, 0);

  account = new QSpinBox(0, 999999, 1, this);
  account->setValue(10000);
  grid->addWidget(account, 4, 1);

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

  margin = new QSpinBox(0, 999999, 1, this);
  grid->addWidget(margin, 5, 1);

  label = new QLabel(tr("Volume %"), this);
  grid->addWidget(label, 6, 0);

  volumePercent = new QSpinBox(0, 100, 1, this);
  grid->addWidget(volumePercent, 6, 1);

  grid->setRowSpacing(grid->numRows(), 25);

  // commission area

  commissionType = new QCheckBox(tr("Use Commission %"), this);
  grid->addWidget(commissionType, 8, 0);

  label = new QLabel(tr("Entry"), this);
  grid->addWidget(label, 9, 0);

  QDoubleValidator *dv = new QDoubleValidator(0, 99999999.0, 4, this, 0);
  entryCom = new QLineEdit(QString::number(10), this);
  entryCom->setValidator(dv);
  grid->addWidget(entryCom, 9, 1);

  label = new QLabel(tr("Exit"), this);
  grid->addWidget(label, 10, 0);

  QDoubleValidator *dv2 = new QDoubleValidator(0, 99999999.0, 4, this, 0);
  exitCom = new QLineEdit(QString::number(10), this);
  exitCom->setValidator(dv2);
  grid->addWidget(exitCom, 10, 1);

  grid->setRowStretch(grid->numRows() + 1, 1);

  // vline sperarator

  Q3Frame *line = new Q3Frame(this);
  line->setFrameStyle(Q3Frame::VLine | Q3Frame::Plain);
  hbox->addWidget(line);

  // right side grid

  grid = new Q3GridLayout(hbox);
  grid->setColStretch(1, 1);
  grid->setSpacing(5);

  // test area

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

  Config config;
  QString s, s2;
  config.getData(Config::DataPath, s);
  symbolButton = new SymbolButton(this, s, s2);
  connect(symbolButton, SIGNAL(symbolChanged()), this, SLOT(symbolButtonPressed()));
  grid->addWidget(symbolButton, 0, 1);

  label = new QLabel(tr("Bar Length"), this);
  grid->addWidget(label, 1, 0);

  BarData bd(s);
  barLength = new QComboBox(this);
  bd.getBarLengthList(barLengthList);
  barLength->insertStringList(barLengthList, -1);
  barLength->setCurrentItem(6);
  grid->addWidget(barLength, 1, 1);

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

  bars = new QSpinBox(1, 99999999, 1, this);
  bars->setValue(275);
  grid->addWidget(bars, 2, 1);

  label = new QLabel(tr("Entry/Exit Price"), this);
  grid->addWidget(label, 3, 0);

  priceField = new QComboBox(this);
  priceField->insertStringList(fieldList,-1);
  grid->addWidget(priceField, 3, 1);

  grid->setRowStretch(grid->numRows() + 1, 1);
}
Пример #28
0
woList::woList(QWidget * parent, const char * name, bool modal, Qt::WFlags fl) :
  QDialog( parent, name, modal, fl )
{
  setCaption(tr("Work Orders"));

  _woid = -1;
  _type = 0;

  if ( !name )
    setName( "woList" );

  Q3VBoxLayout *mainLayout = new Q3VBoxLayout( this, 5, 5, "woListLayout"); 
  Q3HBoxLayout *topLayout = new Q3HBoxLayout( 0, 0, 7, "topLayout"); 
  Q3VBoxLayout *warehouseLayout = new Q3VBoxLayout( 0, 0, 0, "warehouseLayout"); 
  Q3VBoxLayout *buttonsLayout = new Q3VBoxLayout( 0, 0, 5, "buttonsLayout"); 
  Q3VBoxLayout *listLayout = new Q3VBoxLayout( 0, 0, 0, "listLayout"); 

  _warehouse = new WarehouseGroup(this, "_warehouse");
  warehouseLayout->addWidget(_warehouse);

  QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Preferred);
  warehouseLayout->addItem(spacer);

  topLayout->addLayout(warehouseLayout);

  QSpacerItem* spacer_2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
  topLayout->addItem(spacer_2);

  _close = new QPushButton(tr("&Cancel"), this, "_close");
  buttonsLayout->addWidget(_close);

  _select = new QPushButton(tr("&Select"), this, "_select");
  _select->setAutoDefault(TRUE);
  _select->setDefault(TRUE);
  buttonsLayout->addWidget(_select);
  topLayout->addLayout(buttonsLayout);
  mainLayout->addLayout(topLayout);

  QLabel *_workOrdersLit = new QLabel(tr("Work Orders:"), this, "_workOrdersLit");
  listLayout->addWidget(_workOrdersLit);

  _wo = new XTreeWidget(this);
  _wo->setName("_wo");
  listLayout->addWidget( _wo );
  mainLayout->addLayout(listLayout);

  resize( QSize(484, 366).expandedTo(minimumSizeHint()) );

  connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
  connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
  connect( _wo, SIGNAL( itemSelected(int) ), this, SLOT( sSelect() ) );
  connect( _warehouse, SIGNAL(updated()), this, SLOT( sFillList() ) );

  setTabOrder(_warehouse, _wo);
  setTabOrder(_wo, _select);
  setTabOrder(_select, _close);
  setTabOrder(_close, _warehouse);
  _wo->setFocus();

  _wo->addColumn(tr("W/O #"),       _orderColumn, Qt::AlignLeft   );
  _wo->addColumn(tr("Status"),      40,           Qt::AlignCenter );
  _wo->addColumn(tr("Whs."),        _whsColumn,   Qt::AlignCenter );
  _wo->addColumn(tr("Item Number"), _itemColumn,  Qt::AlignLeft   );
  _wo->addColumn(tr("Description"), -1,           Qt::AlignLeft   );
}
Пример #29
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()));
}
Пример #30
0
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);
}