Esempio n. 1
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   );
}
Esempio n. 2
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();
}