Exemple #1
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);
}
Exemple #2
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   );
}
Exemple #3
0
accountList::accountList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) :
  QDialog(parent, name, modal, fl)
{
  if ( !name )
    setName( "accountList" );

  _accntid = -1;
  _type = GLCluster::cUndefined;

  setCaption(tr("Account Numbers"));

  Q3HBoxLayout *accountListLayout = new Q3HBoxLayout( this, 5, 7, "accountListLayout"); 
  Q3VBoxLayout *Layout68 = new Q3VBoxLayout( 0, 0, 0, "Layout68"); 
  Q3VBoxLayout *layout305 = new Q3VBoxLayout( 0, 0, 5, "layout305"); 

  QLabel *accountsLit = new QLabel(tr("Chart of Accounts:"), this, "accountsLit");
  Layout68->addWidget(accountsLit);

  _accnt = new XTreeWidget(this);
  _accnt->setName("_accnt");
  Layout68->addWidget( _accnt );
  accountListLayout->addLayout( Layout68 );

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

  _select = new QPushButton(tr("&Select"), this, "_select");
  _select->setAutoDefault( TRUE );
  _select->setDefault( TRUE );
  layout305->addWidget( _select );

  _clear = new QPushButton(tr("C&lear"), this, "_clear");
  layout305->addWidget( _clear );
  QSpacerItem* spacer = new QSpacerItem( 20, 269, QSizePolicy::Minimum, QSizePolicy::Expanding );
  layout305->addItem( spacer );
  accountListLayout->addLayout( layout305 );

  resize( QSize(571, 351).expandedTo(minimumSizeHint()) );
  //clearWState( WState_Polished );

  connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
  connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
  connect( _accnt, SIGNAL( itemSelected(int) ), this, SLOT( sSelect() ) );
  connect( _clear, SIGNAL( clicked() ), this, SLOT( sClear() ) );

  if (_x_metrics)
  {
    if (_x_metrics->value("GLCompanySize").toInt() > 0)
      _accnt->addColumn(tr("Company"), 50, Qt::AlignCenter);

    if (_x_metrics->value("GLProfitSize").toInt() > 0)
      _accnt->addColumn(tr("Profit"), 50, Qt::AlignCenter);
  }

  _accnt->addColumn(tr("Account Number"), 100, Qt::AlignCenter);

  if (_x_metrics)
  {
    if (_x_metrics->value("GLSubaccountSize").toInt() > 0)
      _accnt->addColumn(tr("Sub."), 50, Qt::AlignCenter);
  }

  _accnt->addColumn(tr("Description"), -1, Qt::AlignLeft);
}
Exemple #4
0
salesOrderList::salesOrderList( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, name, modal, fl )
{
  if ( !name )
    setName( "salesOrderList" );

  _soheadid = -1;
  _type = (cSoOpen | cSoClosed | cSoReleased);

  setCaption(tr("Sales Orders"));

  Q3VBoxLayout *mainLayout = new Q3VBoxLayout(this, 5, 5, "mainLayout"); 
  Q3VBoxLayout *warehouseLayout = new Q3VBoxLayout(0, 0, 0, "warehouseLayout"); 
  Q3HBoxLayout *topLayout = new Q3HBoxLayout( 0, 0, 7, "topLayout"); 
  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->setEnabled( FALSE );
  _select->setDefault( TRUE );
  buttonsLayout->addWidget(_select);
  topLayout->addLayout(buttonsLayout);
  mainLayout->addLayout(topLayout);

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

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

  resize( QSize(490, 390).expandedTo(minimumSizeHint()) );

  connect( _close, SIGNAL( clicked() ), this, SLOT( sClose() ) );
  connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
  connect( _so, SIGNAL( itemSelected(int) ), _select, SLOT( animateClick() ) );
  connect( _so, SIGNAL( valid(bool) ), _select, SLOT( setEnabled(bool) ) );
  connect( _warehouse, SIGNAL(updated()), this, SLOT( sFillList() ) );

  _so->addColumn(tr("Order #"),   _orderColumn, Qt::AlignLeft   );
  _so->addColumn(tr("Customer"),  -1,           Qt::AlignLeft   );
  _so->addColumn(tr("P/O #"),     _orderColumn, Qt::AlignLeft   );
  _so->addColumn(tr("Ordered"),   _dateColumn,  Qt::AlignCenter );
  _so->addColumn(tr("Scheduled"), _dateColumn,  Qt::AlignCenter );

  setTabOrder(_warehouse, _so);
  setTabOrder(_so, _select);
  setTabOrder(_select, _close);
  setTabOrder(_close, _warehouse);
  _warehouse->setFocus();
}