Exemplo n.º 1
0
vendorPriceList::vendorPriceList(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);
  XSqlQuery vendorPrice;

  // signals and slots connections
  connect(_price, SIGNAL(clicked(QModelIndex)), this, SLOT(sQtyUpdate()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  connect(_price, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
  connect(_price, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
  connect(_qty, SIGNAL(textChanged(const QString&)), this, SLOT(sQtyEntered()));

  QString base;
  vendorPrice.exec("SELECT currConcat(baseCurrID()) AS base;");
  if (vendorPrice.first())
    base = vendorPrice.value("base").toString();
  else
    base = tr("Base");

  if (_metrics->boolean("MultiWhs"))
  {
    _price->addColumn(tr("Site"),                      _qtyColumn, Qt::AlignCenter,true, "warehous_code");
    _price->addColumn(tr("Order Type"),                        -1, Qt::AlignCenter,true, "itemsrcp_dropship");
  }
  _price->addColumn(tr("Qty Break"),                   _qtyColumn, Qt::AlignRight,true, "itemsrcp_qtybreak");
  _price->addColumn(tr("Currency"),               _currencyColumn, Qt::AlignLeft, true, "item_curr");
  _price->addColumn(tr("Unit Price"),                          -1, Qt::AlignRight,true, "itemsrcp_price");
  _price->addColumn(tr("Discount Percent"),                    -1, Qt::AlignRight,true, "itemsrcp_discntprcnt" );
  _price->addColumn(tr("Discount Fixed Amt."),                 -1, Qt::AlignRight,true, "itemsrcp_fixedamtdiscount" );
  _price->addColumn(tr("Unit Price\n(%1)").arg(base),_moneyColumn, Qt::AlignRight,true, "price_base");
  _price->addColumn(tr("Type"),                       _itemColumn, Qt::AlignLeft, true, "type");

}
Exemplo n.º 2
0
/*
 *  Constructs a priceList as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
priceList::priceList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, name, modal, fl)
{
  setupUi(this);


  // signals and slots connections
  connect(_price, SIGNAL(itemSelected(int)), this, SLOT(sSelect()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  connect(_price, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
  connect(_price, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));

  _price->addColumn(tr("Schedule"),    _itemColumn,  Qt::AlignLeft  );
  _price->addColumn(tr("Source"),      _itemColumn,  Qt::AlignLeft  );
  _price->addColumn(tr("Qty. Break"),  _qtyColumn,   Qt::AlignRight );
  _price->addColumn(tr("Price"),       _priceColumn, Qt::AlignRight );
  _price->addColumn(tr("Currency"),    _currencyColumn, Qt::AlignLeft );
  _price->addColumn(tr("Price (in curr)"), _priceColumn, Qt::AlignRight );
  // column title reset in priceList::set

  if (omfgThis->singleCurrency())
  {
      _price->hideColumn(4);
      _price->hideColumn(5);
  }

  _shiptoid = -1;
}
Exemplo n.º 3
0
priceList::priceList(QWidget* parent, const char * name, Qt::WindowFlags fl)
    : XDialog(parent, name, fl)
{
  setupUi(this);


  // signals and slots connections
  connect(_price, SIGNAL(itemSelected(int)), this, SLOT(sSelect()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  connect(_price, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
  connect(_price, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));

  _price->addColumn(tr("Schedule"),        _itemColumn,  Qt::AlignLeft,     true, "schedulename"  );
  _price->addColumn(tr("Source"),          _itemColumn,  Qt::AlignLeft,     true, "type"  );
  _price->addColumn(tr("Qty. Break"),      _qtyColumn,   Qt::AlignRight,    true, "qty_break" );
  _price->addColumn(tr("Qty. UOM"),        _qtyColumn,   Qt::AlignRight,    true, "qty_uom" );
  _price->addColumn(tr("Price"),           _priceColumn, Qt::AlignRight ,   true, "base_price");
  _price->addColumn(tr("Price UOM"),       _priceColumn, Qt::AlignRight ,   true, "price_uom");
  _price->addColumn(tr("Currency"),        _currencyColumn, Qt::AlignLeft , true, "currency");
  _price->addColumn(tr("Price (in curr)"), _priceColumn, Qt::AlignRight ,   true, "price");
  // column title reset in priceList::set

  if (omfgThis->singleCurrency())
  {
      _price->hideColumn(4);
      _price->hideColumn(5);
  }

  _shiptoid = -1;

  _qty->setValidator(omfgThis->qtyVal());
}
Exemplo n.º 4
0
/*
 *  Constructs a substituteList as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
substituteList::substituteList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    setupUi(this);

    QButtonGroup * showByButtonGroup = new QButtonGroup(this);
    showByButtonGroup->addButton(_byLeadTime);
    showByButtonGroup->addButton(_byDays);
    showByButtonGroup->addButton(_byDate);

    // signals and slots connections
    connect(_byDays, SIGNAL(toggled(bool)), _days, SLOT(setEnabled(bool)));
    connect(_byDate, SIGNAL(toggled(bool)), _date, SLOT(setEnabled(bool)));
    connect(_subs, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
    connect(_subs, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
    connect(showByButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(sFillList()));
    connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
    connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
    connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemsites(int)));
    connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int)));
    init();

    //If not multi-warehouse hide whs control
    if (!_metrics->boolean("MultiWhs"))
    {
      _warehouseLit->hide();
      _warehouse->hide();
    }
}
Exemplo n.º 5
0
substituteList::substituteList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
  : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  QButtonGroup * showByButtonGroup = new QButtonGroup(this);
  showByButtonGroup->addButton(_byLeadTime);
  showByButtonGroup->addButton(_byDays);
  showByButtonGroup->addButton(_byDate);

  // signals and slots connections
  connect(_byDays, SIGNAL(toggled(bool)), _days, SLOT(setEnabled(bool)));
  connect(_byDate, SIGNAL(toggled(bool)), _date, SLOT(setEnabled(bool)));
  connect(_subs, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
  connect(_subs, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
  connect(showByButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(sFillList()));
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
  connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemsites(int)));
  connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int)));

  _subs->addColumn(tr("Item Number"),  _itemColumn, Qt::AlignLeft,   true,  "item_number"  );
  _subs->addColumn(tr("Description"),  -1,          Qt::AlignLeft,   true,  "itemdescrip"  );
  _subs->addColumn(tr("QOH"),          _qtyColumn,  Qt::AlignRight,  true,  "qoh" );
  _subs->addColumn(tr("Norm. QOH"),    _qtyColumn,  Qt::AlignRight,  true,  "normqoh" );
  _subs->addColumn(tr("Availability"), _qtyColumn,  Qt::AlignRight,  true,  "available" );
  _subs->addColumn(tr("Norm. Avail."), _qtyColumn,  Qt::AlignRight,  true,  "normavailable" );

  //If not multi-warehouse hide whs control
  if (!_metrics->boolean("MultiWhs"))
  {
    _warehouseLit->hide();
    _warehouse->hide();
  }
}
Exemplo n.º 6
0
void CClientWeaponMgr::SelectCustomWeapon(HWEAPON hWeapon)
{
	if (hWeapon)
	{
		// find the common prefix of the custom weapon select and deselect enums
		HWEAPONDATA hWpnData = g_pWeaponDB->GetWeaponData(hWeapon, !USE_AI_DATA);
		std::string sSelect(  g_pWeaponDB->GetString( hWpnData, "CustomSelectStimulus" ));
		std::string sDeselect(  g_pWeaponDB->GetString( hWpnData, "CustomDeselectStimulus" ));
		std::pair<std::string::iterator,std::string::iterator> prCommonPrefix;
		prCommonPrefix = std::mismatch(sSelect.begin(), sSelect.end(), sDeselect.begin());
		std::string sStimulusGroup(sSelect.begin(),prCommonPrefix.first);

		// Play an appropriate animation...
		CPlayerBodyMgr& PlayerBodyMgr = CPlayerBodyMgr::Instance();

		PlayerBodyMgr.HandleAnimationStimulus(sSelect.c_str());
		if(PlayerBodyMgr.ActiveAnimationStimulus())
		{
			CClientWeapon* pWeapon = g_pPlayerMgr->GetClientWeaponMgr()->GetClientWeapon(hWeapon);
			if (pWeapon)
			{
				// Attach the weapon model
				g_pPlayerMgr->GetClientWeaponMgr()->ShowCustomWeapon(pWeapon, sStimulusGroup.c_str());
			}
		}
	}		
}
Exemplo n.º 7
0
purchaseOrderList::purchaseOrderList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) :
  QDialog(parent, name, modal, fl)
{
  if (!name)
    setName("purchaseOrderList");

  _poheadid = -1;
  _type = (cPOUnposted | cPOOpen | cPOClosed);

  setCaption(tr("Purchase Orders"));

  QHBoxLayout *purchaseOrderListLayout = new QHBoxLayout(this);
  QVBoxLayout *tableLayout = new QVBoxLayout(purchaseOrderListLayout);
  QVBoxLayout *buttonLayout = new QVBoxLayout(purchaseOrderListLayout);

  QHBoxLayout *vendLayout = new QHBoxLayout(tableLayout);
  _vend = new VendorCluster(this, "_vend");
  vendLayout->addWidget(_vend);
  vendLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding,
				      QSizePolicy::Minimum));

  QLabel *_poheadLit = new QLabel(tr("&Purchase Orders:"), this, "_poheadLit");
  tableLayout->addWidget( _poheadLit );

  _pohead = new XTreeWidget(this);
  _pohead->setName("_pohead");
  _poheadLit->setBuddy(_pohead);
  tableLayout->addWidget(_pohead);

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

  _select = new QPushButton(tr("&Select"), this, "_select");
  _select->setEnabled( FALSE );
  _select->setDefault( TRUE );
  buttonLayout->addWidget( _select );

  QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
  buttonLayout->addItem( spacer );

  resize( QSize(550, 350).expandedTo(minimumSizeHint()) );
  //clearWState( WState_Polished );

    // signals and slots connections
  connect(_close,  SIGNAL(clicked()),		this,	SLOT(sClose()	     ));
  connect(_pohead, SIGNAL(itemSelected(int)), _select,	SLOT(animateClick()  ));
  connect(_pohead, SIGNAL(valid(bool)),       _select,	SLOT(setEnabled(bool)));
  connect(_select, SIGNAL(clicked()),		this,	SLOT(sSelect()	     ));
  connect(_vend,   SIGNAL(newId(int)),		this,	SLOT(sFillList()     ));

  _type = 0;

  _pohead->addColumn(tr("Number"), _orderColumn, Qt::AlignRight  );
  _pohead->addColumn(tr("Vendor"), -1,           Qt::AlignLeft   );
  _pohead->addColumn(tr("Agent"),  _itemColumn,  Qt::AlignCenter );
  _pohead->addColumn(tr("Order Date"),	_dateColumn,	Qt::AlignLeft  );
  _pohead->addColumn(tr("First Item"),	_itemColumn,	Qt::AlignLeft  );

  _pohead->setFocus();
}
Exemplo n.º 8
0
selectPayments::selectPayments(QWidget* parent, const char* name, Qt::WFlags fl, bool pAutoFill)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  _ignoreUpdates = true;

  connect(_clear, SIGNAL(clicked()), this, SLOT(sClear()));
  connect(_clearAll, SIGNAL(clicked()), this, SLOT(sClearAll()));
  connect(_selectDate, SIGNAL(currentIndexChanged(int)), this, SLOT(sFillList()));
  connect(_startDate, SIGNAL(newDate(const QDate&)), this, SLOT(sFillList()));
  connect(_endDate, SIGNAL(newDate(const QDate&)), this, SLOT(sFillList()));
  connect(_onOrBeforeDate, SIGNAL(newDate(const QDate&)), this, SLOT(sFillList()));
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
  connect(_selectDiscount, SIGNAL(clicked()), this, SLOT(sSelectDiscount()));
  connect(_selectDue, SIGNAL(clicked()), this, SLOT(sSelectDue()));
  connect(_selectLine, SIGNAL(clicked()), this, SLOT(sSelectLine()));
  connect(_applyallcredits, SIGNAL(clicked()), this, SLOT(sApplyAllCredits()));
  connect(_vendorgroup, SIGNAL(updated()), this, SLOT(sFillList()));
  connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sFillList()));
  connect(_apopen, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*, int)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*)));

  _bankaccnt->setType(XComboBox::APBankAccounts);

  _apopen->addColumn(tr("Vendor"),         -1,           Qt::AlignLeft  ,        true, "vendor" );
  _apopen->addColumn(tr("Doc. Type"),      _orderColumn, Qt::AlignCenter,        true, "doctype" );
  _apopen->addColumn(tr("Doc. #"),         _orderColumn, Qt::AlignRight ,        true, "apopen_docnumber" );
  _apopen->addColumn(tr("Inv. #"),         _orderColumn, Qt::AlignRight ,        true, "apopen_invcnumber" );
  _apopen->addColumn(tr("P/O #"),          _orderColumn, Qt::AlignRight ,        true, "apopen_ponumber" );
  _apopen->addColumn(tr("Due Date"),       _dateColumn,  Qt::AlignCenter,        true, "apopen_duedate" );
  _apopen->addColumn(tr("Doc. Date"),      _dateColumn,  Qt::AlignCenter,        false, "apopen_docdate" );
  _apopen->addColumn(tr("Amount"),         _moneyColumn, Qt::AlignRight ,        true, "amount" );
  _apopen->addColumn(tr("Amount (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, false, "base_amount"  );
  _apopen->addColumn(tr("Running Amount (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight,         false, "running_amount" );
  _apopen->addColumn(tr("Selected"),       _moneyColumn, Qt::AlignRight ,        true, "selected" );
  _apopen->addColumn(tr("Selected (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, false, "base_selected"  );
  _apopen->addColumn(tr("Running Selected (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight,       true, "running_selected"  );
  _apopen->addColumn(tr("Discount"),       _moneyColumn, Qt::AlignRight ,        true, "discount" );
  _apopen->addColumn(tr("Discount (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, false, "base_discount"  );
  _apopen->addColumn(tr("Currency"),       _currencyColumn, Qt::AlignLeft,       true, "curr_concat" );
  _apopen->addColumn(tr("Status"),         _currencyColumn, Qt::AlignCenter,     true, "apopen_status" );

//  if (omfgThis->singleCurrency())
//  {
//    _apopen->hideColumn("curr_concat");
//    _apopen->headerItem()->setText(11, tr("Running"));
//  }

  if (_privileges->check("ApplyAPMemos"))
      connect(_apopen, SIGNAL(valid(bool)), _applyallcredits, SLOT(setEnabled(bool)));

  connect(omfgThis, SIGNAL(paymentsUpdated(int, int, bool)), this, SLOT(sFillList()));

  _ignoreUpdates = false;

  if(pAutoFill)
    sFillList();
}
registrationKeyDialog::registrationKeyDialog(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
  : QDialog(parent, modal ? (fl | Qt::Dialog) : fl)
{
  setupUi(this);

  // signals and slots connections
  connect(_key, SIGNAL(textChanged(const QString&)), this, SLOT(sCheckKey()));
  connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
}
Exemplo n.º 10
0
//#include "purchaseOrder.h"
openPurchaseOrder::openPurchaseOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  _po->addColumn(tr("PO #"),        -1,  Qt::AlignLeft,   true,  "pohead_number");
  _po->addColumn(tr("PO Date"),        -1,  Qt::AlignLeft,   true,  "pohead_orderdate");
  _po->addColumn(tr("Created By"),        -1,  Qt::AlignLeft,   true,  "pohead_agent_username");
}
Exemplo n.º 11
0
void contactMerge::sCntctDoubleClicked()
{
  if ((_cntct->altId() == 0) || (_cntct->altId() == 4)) // cNone or cError
  {
    sSelect(false);
  }
  else if ((_cntct->altId() == 1) || (_cntct->altId() == 2)) // cTarget or cSource
  {
    sDeselect(_cntct->id());
  }
}
Exemplo n.º 12
0
selectShippedOrders::selectShippedOrders(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
  : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  // signals and slots connections
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));

  _customerType->setType(ParameterGroup::CustomerType);
}
Exemplo n.º 13
0
/*
 *  Constructs a selectBankAccount as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
selectBankAccount::selectBankAccount(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    setupUi(this);


    // signals and slots connections
    connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
    connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
    init();
}
Exemplo n.º 14
0
/*
 *  Constructs a archRestoreSalesHistory as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
archRestoreSalesHistory::archRestoreSalesHistory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    setupUi(this);


    // signals and slots connections
    connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
    connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
    init();
}
Exemplo n.º 15
0
registrationKeyDialog::registrationKeyDialog(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
  : QDialog(parent, modal ? (fl | Qt::Dialog) : fl)
{
  setObjectName(name);
  setupUi(this);

  connect(_key, SIGNAL(textChanged(const QString&)), this, SLOT(sCheckKey()));
  connect(_close,   SIGNAL(clicked()), this, SLOT(reject()));
  connect(_request, SIGNAL(clicked()), this, SLOT(sRequest()));
  connect(_select,  SIGNAL(clicked()), this, SLOT(sSelect()));
}
Exemplo n.º 16
0
customerTypeList::customerTypeList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

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

  _custtype->addColumn(tr("Code"), _itemColumn, Qt::AlignCenter,true, "custtype_code");
  _custtype->addColumn(tr("Description"),   -1, Qt::AlignLeft,  true, "custtype_descrip");
}
Exemplo n.º 17
0
XListDialog::XListDialog( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) :
  QDialog( parent, name, modal, fl )
{
  if ( !name )
    setName( "XListDialog" );

  Q3VBoxLayout * XListDialogLayout = new Q3VBoxLayout( this, 11, 6, "XListDialogLayout"); 

  Q3HBoxLayout * layout13 = new Q3HBoxLayout( 0, 0, 6, "layout13"); 

  _altFrame = new Q3Frame( this, "_altFrame" );
  _altFrame->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, 0, 0, _altFrame->sizePolicy().hasHeightForWidth() ) );
  _altFrame->setFrameShape( Q3Frame::NoFrame );
  _altFrame->setFrameShadow( Q3Frame::Raised );
  layout13->addWidget( _altFrame );

  Q3VBoxLayout * layout12 = new Q3VBoxLayout( 0, 0, 6, "layout12"); 

  _close = new QPushButton( tr( "&Close" ), this, "_close" );
  _close->setAccel( QKeySequence( tr( "Alt+C" ) ) );
  layout12->addWidget( _close );

  _select = new QPushButton( tr( "&Select" ), this, "_select" );
  _select->setAccel( QKeySequence( tr( "Alt+S" ) ) );
  _select->setEnabled(FALSE);
  layout12->addWidget( _select );
  QSpacerItem* spacer = new QSpacerItem( 20, 0, QSizePolicy::Minimum, QSizePolicy::Minimum );
  layout12->addItem( spacer );
  layout13->addLayout( layout12 );
  XListDialogLayout->addLayout( layout13 );

  _listLabel = new QLabel( tr( "List:" ), this, "_listLabel" );
  XListDialogLayout->addWidget( _listLabel );

  _list = new XListView( this, "_list" );
  XListDialogLayout->addWidget( _list );

  setCaption( tr( "XListDialog" ) );
  resize( QSize(420, 380).expandedTo(minimumSizeHint()) );
  //clearWState( WState_Polished );

  setTabOrder(_list, _select);
  setTabOrder(_select, _close);
  setTabOrder(_close, _list);
  _select->setFocus();

  // signals and slots connections
  connect( _close,  SIGNAL( clicked() ), this, SLOT( sClose() ) );
  connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) );
  connect( _list,   SIGNAL( itemSelected(int) ), _select, SLOT( animateClick() ) );
  connect( _list,   SIGNAL( valid(bool) ), _select, SLOT( setEnabled(bool) ) );
}
Exemplo n.º 18
0
/*
 *  Constructs a imageList as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
imageList::imageList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    setupUi(this);


    // signals and slots connections
    connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
    connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
    connect(_image, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
    connect(_image, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
    init();
}
Exemplo n.º 19
0
main()
{
  const unsigned POP_SIZE = 8, CHROM_SIZE = 4;
  unsigned i;

  eoBinRandom<Chrom> random;
  eoPop<Chrom> pop; 

  // Create the population
  for (i = 0; i < POP_SIZE; ++i) {
    Chrom chrom(CHROM_SIZE);
    random(chrom);
    BinaryValue()(chrom);
    pop.push_back(chrom);
  }
  
  // print population
  std::cout << "population:" << std::endl;
  for (i = 0; i < pop.size(); ++i)
    std::cout << pop[i] << " " << pop[i].fitness() << std::endl;

  // Declare 1-selectors
  eoUniformSelect<Chrom> uSelect;

  Chrom aChrom;
  aChrom = uSelect( pop );
  std::cout << "Uniform Select " << aChrom << " " << aChrom.fitness() << std::endl;

  eoStochTournament<Chrom> sSelect(0.7);
  aChrom = sSelect( pop );
  std::cout << "Stochastic Tournament " << aChrom << " " << aChrom.fitness() << std::endl;

  eoDetTournament<Chrom> dSelect(3);
  aChrom = dSelect( pop );
  std::cout << "Deterministic Tournament " << aChrom << " " << aChrom.fitness() << std::endl;

  return 0;
}
Exemplo n.º 20
0
/*
 *  Constructs a invoiceList as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
invoiceList::invoiceList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    setupUi(this);


    // signals and slots connections
    connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
    connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
    connect(_invoice, SIGNAL(itemSelected(int)), this, SLOT(sSelect()));
    connect(_cust, SIGNAL(newId(int)), this, SLOT(sFillList()));
    connect(_dates, SIGNAL(updated()), this, SLOT(sFillList()));
    init();
}
Exemplo n.º 21
0
imageList::imageList(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
  : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  // signals and slots connections
  connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
  connect(_image, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
  connect(_image, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));

  _image->addColumn(tr("Name"),        _itemColumn, Qt::AlignLeft, true, "image_name" );
  _image->addColumn(tr("Description"), -1,          Qt::AlignLeft, true, "image_descrip" );
}
Exemplo n.º 22
0
currency::currency(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    setupUi(this);

    connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
    connect(_currBase, SIGNAL(toggled(bool)), this, SLOT(sConfirmBaseFlag()));
    connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
    connect(_select,	SIGNAL(clicked()),	this, SLOT(sSelect()));

    // avoid sConfirmBaseFlag() when calling populate for editing base currency
    // baseOrig gets set in set() for cNew and in populate() for cEdit and cView
    baseOrig = TRUE;
}
Exemplo n.º 23
0
/*
 *  Constructs a countTagList as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
countTagList::countTagList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : QDialog(parent, name, modal, fl)
{
    setupUi(this);


    // signals and slots connections
    connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
    connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
    connect(_cnttag, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
    connect(_cnttag, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
    connect(_searchFor, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&)));
    connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList()));
    init();
}
Exemplo n.º 24
0
countTagList::countTagList(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
  connect(_searchFor, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&)));
  connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList()));

  _cnttag->addColumn(tr("Tag #"),       _orderColumn, Qt::AlignLeft,  true, "invcnt_tagnumber");
  _cnttag->addColumn(tr("Item Number"), _itemColumn,  Qt::AlignLeft,  true, "item_number");
  _cnttag->addColumn(tr("Description"), -1,           Qt::AlignLeft,  true, "item_descrip1");
  _cnttag->addColumn(tr("Site"),        _whsColumn,   Qt::AlignCenter,true, "warehous_code");
}
Exemplo n.º 25
0
priceList::priceList(QWidget* parent, const char * name, Qt::WindowFlags fl)
    : XDialog(parent, name, fl)
{
  setupUi(this);

  connect(_cust,   SIGNAL(newId(int)),        this,    SLOT(sNewCust()));
  connect(_item,   SIGNAL(newId(int)),        this,    SLOT(sNewItem()));
  connect(_warehouse, SIGNAL(newID(int)),     this,    SLOT(sNewItem()));
  connect(_close,  SIGNAL(clicked()),         this,    SLOT(reject()));
  connect(_price,  SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
  connect(_price,  SIGNAL(itemSelected(int)), this,    SLOT(sSelect()));
  connect(_price,  SIGNAL(valid(bool)),       _select, SLOT(setEnabled(bool)));
  connect(_select, SIGNAL(clicked()),         this,    SLOT(sSelect()));

  _price->addColumn(tr("Schedule"),                  -1, Qt::AlignLeft,  true, "schedulename");
  _price->addColumn(tr("Source"),           _itemColumn, Qt::AlignLeft,  true, "type");
  _price->addColumn(tr("Qty. Break"),        _qtyColumn, Qt::AlignRight, true, "qty_break");
  _price->addColumn(tr("Qty. UOM"),          _qtyColumn, Qt::AlignRight, true, "qty_uom");
  _price->addColumn(tr("Price"),           _priceColumn, Qt::AlignRight, true, "base_price");
  _price->addColumn(tr("Price UOM"),       _priceColumn, Qt::AlignRight, true, "price_uom");
  _price->addColumn(tr("Percent"),         _prcntColumn, Qt::AlignRight, true, "discountpercent");
  _price->addColumn(tr("Fixed Amt."),      _priceColumn, Qt::AlignRight, true, "discountfixed");
  _price->addColumn(tr("Type"),             _itemColumn, Qt::AlignLeft,  true, "price_type");
  _price->addColumn(tr("Currency"),     _currencyColumn, Qt::AlignLeft,  true, "currency");
  _price->addColumn(tr("Price (in Base)"), _priceColumn, Qt::AlignRight, true, "price");
  // column title reset in priceList::set

  if (omfgThis->singleCurrency())
  {
    _price->hideColumn(_price->column("price"));
    _price->hideColumn(_price->column("currency"));
  }

  _shiptoid = -1;
  _shiptonum = "";
  _prodcatid = -1;
  _custtypeid = -1;
  _custtypecode = "";
  _iteminvpricerat = 1.0;

  _qty->setValidator(omfgThis->qtyVal());
  _listPrice->setPrecision(omfgThis->priceVal());
  _listCost->setPrecision(omfgThis->priceVal());
  _unitCost->setPrecision(omfgThis->costVal());
  _unitCost->setVisible(_privileges->check("ViewSOItemUnitCost"));
  _unitCostLit->setVisible(_privileges->check("ViewSOItemUnitCost"));

}
Exemplo n.º 26
0
/*
 *  Constructs a booItemList as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal dialog.
 */
booItemList::booItemList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);


  // signals and slots connections
  connect(_item, SIGNAL(newId(int)), this, SLOT(sFillList()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
  connect(_booitem, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
  connect(_close, SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_clear, SIGNAL(clicked()), this, SLOT(sClear()));

  _booitem->addColumn(tr("#"),           _seqColumn, Qt::AlignCenter );
  _booitem->addColumn(tr("Description"), -1,         Qt::AlignLeft   );
}
Exemplo n.º 27
0
currency::currency(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
    setupUi(this);

    _select = _buttonBox->addButton(tr("Select"), QDialogButtonBox::ActionRole);

    connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave()));
//    connect(_currBase, SIGNAL(toggled(bool)), this, SLOT(sConfirmBaseFlag()));
    connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose()));
    connect(_select,	SIGNAL(clicked()),	this, SLOT(sSelect()));

    // avoid sConfirmBaseFlag() when calling populate for editing base currency
    // baseOrig gets set in set() for cNew and in populate() for cEdit and cView
    baseOrig = TRUE;
}
Exemplo n.º 28
0
void VirtualList::init()
{
    setWindowModality(Qt::WindowModal);
    setAttribute(Qt::WA_DeleteOnClose);
    _search	= new QLineEdit(this, "_search");
    _searchLit	= new QLabel(_search, tr("S&earch for:"), this, "_searchLit");
    _close	= new QPushButton(tr("&Cancel"), this, "_close");
    _select	= new QPushButton(tr("&Select"), this, "_select");
    _listTab	= new XTreeWidget(this);
    _titleLit	= new QLabel(_listTab, "", this, "_titleLit");

    _listTab->setName("_listTab");

    _searchLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
    _select->setEnabled(false);
    _select->setAutoDefault(true);
    _select->setDefault(true);
    _listTab->setMinimumHeight(250);
    _titleLit->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);

    QVBoxLayout* dialogLyt    = new QVBoxLayout(this,      5, -1, "dialogLyt");
    QHBoxLayout* topLyt	      = new QHBoxLayout(dialogLyt,    -1, "topLyt");
    QVBoxLayout* searchLyt    = new QVBoxLayout(topLyt,       -1, "searchLyt");
    topLyt->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding,
					    QSizePolicy::Minimum));
    QVBoxLayout* buttonsLyt   = new QVBoxLayout(topLyt,       -1, "buttonsLyt");
    QHBoxLayout* searchStrLyt = new QHBoxLayout(searchLyt,    -1, "searchStrLyt");
    QVBoxLayout* tableLyt     = new QVBoxLayout(dialogLyt,    -1, "tableLyt");

    searchStrLyt->addWidget(_searchLit);
    searchStrLyt->addWidget(_search);
    buttonsLyt->addWidget(_close);
    buttonsLyt->addWidget(_select);

    tableLyt->addWidget(_titleLit);
    tableLyt->addWidget(_listTab);

    ((QBoxLayout*)topLyt)->setStretchFactor(searchLyt, 0);
    ((QBoxLayout*)dialogLyt)->setStretchFactor(topLyt, 0);
    ((QBoxLayout*)dialogLyt)->setStretchFactor(tableLyt, 1);

    connect(_close,   SIGNAL(clicked()),	 this,   SLOT(sClose()));
    connect(_listTab, SIGNAL(itemSelected(int)), this,	 SLOT(sSelect()));
    connect(_listTab, SIGNAL(valid(bool)),     _select, SLOT(setEnabled(bool)));
    connect(_search,  SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&)));
    connect(_select,  SIGNAL(clicked()),         this,	 SLOT(sSelect()));
}
Exemplo n.º 29
0
accountSearch::accountSearch(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
  : QDialog(parent, name, modal, fl)
{
  setupUi(this);

  _type->addItem(tr("ALL"), QVariant(""));
  _type->addItem(tr("Asset"), QVariant("A"));
  _type->addItem(tr("Liability"), QVariant("L"));
  _type->addItem(tr("Expense"), QVariant("E"));
  _type->addItem(tr("Revenue"), QVariant("R"));
  _type->addItem(tr("Equity"), QVariant("Q"));

  // signals and slots connections
  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() ) );
  connect(_type, SIGNAL(currentIndexChanged(int)), this, SLOT(sFillList()));
  connect(_descrip, SIGNAL(textChanged(const QString &)), this, SLOT(sFillList()));

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

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

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

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

  _accnt->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "accnt_descrip");

  _accnt->addColumn(tr("Type"),            75, Qt::AlignLeft ,  true, "accnt_type");

  _accnt->addColumn(tr("Sub. Type Code"),  75, Qt::AlignLeft,  false, "subaccnttype_code");

  _accnt->addColumn(tr("Sub. Type"),      100, Qt::AlignLeft,  false, "subaccnttype_descrip");

  _showExternal = false;
}
Exemplo n.º 30
0
itemSourceList::itemSourceList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
  : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  // signals and slots connections
  connect(_itemsrc, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
  connect(_itemsrc, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
  connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
  connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));

  _itemsrc->addColumn(tr("Ranking"),      _orderColumn, Qt::AlignRight,  true, "itemsrc_ranking" );
  _itemsrc->addColumn(tr("Vendor"),       -1,           Qt::AlignLeft,   true, "vend_name");
  _itemsrc->addColumn(tr("Vend Item#"),   _itemColumn,  Qt::AlignRight,  true, "itemsrc_vend_item_number" );
  _itemsrc->addColumn(tr("Manufacturer"), _itemColumn,  Qt::AlignLeft,   true, "itemsrc_manuf_name");
  _itemsrc->addColumn(tr("Manuf. Item#"), _itemColumn,  Qt::AlignRight,  true, "itemsrc_manuf_item_number" );
  _itemsrc->addColumn(tr("Default"),      _itemColumn,  Qt::AlignLeft,   true, "itemsrc_default" );
}