Esempio n. 1
0
ACLiteral *ACDoc::_Literal()
{
  ACLiteral *first = 0;
  ACLiteral **patch = &first;
  ACLiteral *lit = 0;

  Scan.Match('{');
  while(Scan.Errors==0 && Scan.Token!='}')
  {
    if(Scan.Token=='{')
    {
      lit = Pool->Alloc<ACLiteral>();
      sClear(*lit);
      lit->Child = _Literal();
    }
    else
    {
      lit = Pool->Alloc<ACLiteral>();
      sClear(*lit);
      lit->Expr = _Expression();
    }
    /*
    else if(Scan.Token==sTOK_INT)
    {
      lit = Pool->Alloc<ACLiteral>();
      sClear(*lit);
      lit->Token = sTOK_INT;
      lit->Value = Scan.ValueString;
      lit->ValueI = Scan.ValI;
      lit->ValueF = lit->ValueI;
      Scan.Scan();
    }
    else if(Scan.Token==sTOK_FLOAT)
    {
      lit = Pool->Alloc<ACLiteral>();
      sClear(*lit);
      lit->Token = sTOK_FLOAT;
      lit->Value = Scan.ValueString;
      lit->ValueF = Scan.ValF;
      lit->ValueI = lit->ValueF;
      Scan.Scan();
    }
    else
    {
      Scan.Error(L"literal expected");
    }
    */
    *patch = lit;
    patch = &lit->Next;

    if(Scan.Token==',')
      Scan.Scan();
    else
      if(Scan.Token!='}')
        Scan.Error(L"comma expected");
  }
  Scan.Match('}');

  return first;
}
Esempio n. 2
0
void sFont2D::Init(const sChar *name,sInt size,sInt flags,sInt width)
{
  Exit();

  TEXTMETRIC tm;

  prv = new sFont2DPrivate;
  prv->Font=0;
  prv->BackPen = 0;

  if (name && name[0])
  {
    LOGFONTW log;
    sClear(log);
    log.lfHeight = size;
    log.lfWidth = width;
    log.lfCharSet = DEFAULT_CHARSET;
    if(flags & sF2C_BOLD)
      log.lfWeight = FW_BOLD;
    if(flags & sF2C_ITALICS)
      log.lfItalic = 1;
    if(flags & sF2C_UNDERLINE)
      log.lfUnderline = 1;
    if(flags & sF2C_STRIKEOUT)
      log.lfStrikeOut = 1;
    if(flags & sF2C_SYMBOLS)
      log.lfCharSet = SYMBOL_CHARSET;
    if(flags & sF2C_NOCLEARTYPE)
      log.lfQuality = ANTIALIASED_QUALITY;
    sCopyString(log.lfFaceName,name,LF_FACESIZE);
    prv->Font = CreateFontIndirectW(&log);
  }

  if (!prv->Font) // no font found -> get default Windows font
  {
    NONCLIENTMETRICS ncm;
    sClear(ncm);
    ncm.cbSize=sizeof(ncm);
    SystemParametersInfo(SPI_GETNONCLIENTMETRICS,sizeof(ncm),&ncm,0);
    prv->Font = CreateFontIndirectW(&ncm.lfMessageFont);
  }

  prv->BackColor = GDICOL(0xffffff);
  prv->TextColor = GDICOL(0x000000);

  // Get font metrics. must create a DC for this!
  HDC dc = GetDC(sHWND);
  HGDIOBJ oldfont = SelectObject(dc,prv->Font);
  GetTextMetricsW(dc,&tm);
  GetCharABCWidths(dc,0,NUMABC-1,prv->Widths);
  SelectObject(dc,oldfont);
  ReleaseDC(sHWND,dc);

  prv->Baseline = tm.tmAscent;
  prv->Height = tm.tmHeight;
  prv->CharHeight = tm.tmHeight - tm.tmInternalLeading;
}
Esempio n. 3
0
dspCreditCardTransactions::dspCreditCardTransactions(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_query, SIGNAL(clicked()), this, SLOT(sFillList()));
  connect(_preauth, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(sgetCCAmount()));
  connect(_postPreauth, SIGNAL(clicked()), this, SLOT(sPostPreauth()));
  connect(_voidPreauth, SIGNAL(clicked()), this, SLOT(sVoidPreauth()));
  connect(_customerSelector, SIGNAL(newState(int)), this, SLOT(sClear()));
  connect(_customerSelector, SIGNAL(newCustId(int)), this, SLOT(sClear()));
  connect(_customerSelector, SIGNAL(newCustTypeId(int)), this, SLOT(sClear()));
  connect(_customerSelector, SIGNAL(newTypePattern(QString)), this, SLOT(sClear()));
  
  _preauth->addColumn(tr("Timestamp"),   _dateColumn, Qt::AlignLeft, true,  "ccpay_transaction_datetime"  ); 
  _preauth->addColumn(tr("Cust. #"),    _orderColumn, Qt::AlignLeft,  true, "cust_number");  
  _preauth->addColumn(tr("Name"),                 -1, Qt::AlignLeft,  true, "cust_name");
  _preauth->addColumn(tr("Type"),       _orderColumn, Qt::AlignLeft,  true, "type"  );
  _preauth->addColumn(tr("Status"),  _bigMoneyColumn, Qt::AlignLeft,  true,  "status"  );
  _preauth->addColumn(tr("Document #"),           -1, Qt::AlignLeft,  true,  "docnumber"  );
  _preauth->addColumn(tr("Amount"),     _moneyColumn, Qt::AlignRight, true, "ccpay_amount");
  _preauth->addColumn(tr("Currency"),_currencyColumn, Qt::AlignLeft,  true, "currabbr");;
  _preauth->addColumn(tr("Entered By"),   _userColumn,     Qt::AlignLeft,   false,  "ccpay_by_username"  );
  _preauth->addColumn(tr("Reference"),    _orderColumn,    Qt::AlignLeft,   false,  "ccpay_r_ref"  );
  _preauth->addColumn(tr("Allocated"),    _moneyColumn,    Qt::AlignRight,  false,  "allocated" );
  _preauth->addColumn(tr("Allocated Currency"), _currencyColumn, Qt::AlignLeft,   false,  "payco_currAbbr"  );
  
  if (omfgThis->singleCurrency())
    _preauth->hideColumn(2);

  if (_metrics->value("CCValidDays").toInt())
    _validDays->setValue(_metrics->value("CCValidDays").toInt());
  else
    _validDays->setValue(7);
}
Esempio n. 4
0
cashReceipt::cashReceipt(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_close, SIGNAL(clicked()), this, SLOT(close()));
  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulateCustomerInfo(int)));
  connect(_received, SIGNAL(lostFocus()), this, SLOT(sUpdateBalance()));
  connect(_applyToBalance, SIGNAL(clicked()), this, SLOT(sApplyToBalance()));
  connect(_apply, SIGNAL(clicked()), this, SLOT(sApply()));
  connect(_applyLineBalance, SIGNAL(clicked()), this, SLOT(sApplyLineBalance()));
  connect(_add, SIGNAL(clicked()), this, SLOT(sAdd()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete()));
  connect(_clear, SIGNAL(clicked()), this, SLOT(sClear()));
  connect(_searchDocNum, SIGNAL(textChanged(const QString&)), this, SLOT(sSearchDocNumChanged()));
  connect(_applied, SIGNAL(valueChanged()), this, SLOT(sUpdateBalance()));
  connect(_miscDistribs, SIGNAL(valueChanged()), this, SLOT(sUpdateBalance()));
  connect(_received, SIGNAL(valueChanged()), this, SLOT(sUpdateBalance()));
  connect(_received, SIGNAL(idChanged(int)), this, SLOT(sFillApplyList()));
  connect(_received, SIGNAL(idChanged(int)), this, SLOT(sFillMiscList()));
  connect(_received, SIGNAL(effectiveChanged(const QDate&)), this, SLOT(sFillApplyList()));
  connect(_received, SIGNAL(effectiveChanged(const QDate&)), this, SLOT(sFillMiscList()));
  connect(_received, SIGNAL(idChanged(int)), this, SLOT(sChangeCurrency(int)));
  if (_metrics->boolean("CCAccept"))
  {
    connect(_newCC, SIGNAL(clicked()), this, SLOT(sNewCreditCard()));
    connect(_editCC, SIGNAL(clicked()), this, SLOT(sEditCreditCard()));
    connect(_viewCC, SIGNAL(clicked()), this, SLOT(sViewCreditCard()));
    connect(_upCC, SIGNAL(clicked()), this, SLOT(sMoveUp()));
    connect(_downCC, SIGNAL(clicked()), this, SLOT(sMoveDown()));
    connect(_fundsType, SIGNAL(activated(int)), this, SLOT(setCreditCard()));
  }
Esempio n. 5
0
static void SetupScreenMode(Config::Resolution resolution, sBool fullscreen)
{
  sClear(ScreenMode);
  ScreenMode.Aspect = (float)resolution.Width/(float)resolution.Height;
  ScreenMode.Display = -1;
  if (fullscreen)
  {
    ScreenMode.Flags |= sSM_FULLSCREEN;
  }
  ScreenMode.Frequency = resolution.RefreshRate;
  ScreenMode.MultiLevel = -1;
  ScreenMode.OverMultiLevel = -1;
  ScreenMode.OverX = ScreenMode.ScreenX = MyConfig->DefaultResolution.Width;
  ScreenMode.OverY = ScreenMode.ScreenY = MyConfig->DefaultResolution.Height;

  // find max resolution for z buffer
  //ScreenMode.RTZBufferX = 2048;
  //ScreenMode.RTZBufferY = 2048;
  /*
  for (sInt i=0; i<MyConfig->Keys.GetCount(); i++) if (MyConfig->Keys[i].Type == Config::SETRESOLUTION)
  {
    sm.RTZBufferX = sMax(sm.RTZBufferX, MyConfig->Keys[i].ParaRes.Width);
    sm.RTZBufferY = sMax(sm.RTZBufferY, MyConfig->Keys[i].ParaRes.Height);
  }
  */
}
Esempio n. 6
0
applyARCreditMemo::applyARCreditMemo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_apply,            SIGNAL(clicked()),      this, SLOT(sApply()));
  connect(_applyLineBalance, SIGNAL(clicked()),      this, SLOT(sApplyLineBalance()));
  connect(_applyToBalance,   SIGNAL(clicked()),      this, SLOT(sApplyBalance()));
  connect(_available,        SIGNAL(idChanged(int)), this, SLOT(sPriceGroup()));
  connect(_clear,            SIGNAL(clicked()),      this, SLOT(sClear()));
  connect(_close,            SIGNAL(clicked()),      this, SLOT(sClose()));
  connect(_post,             SIGNAL(clicked()),      this, SLOT(sPost()));
  connect(_searchDocNum,     SIGNAL(textChanged(const QString&)), this, SLOT(sSearchDocNumChanged(const QString&)));

  _captive = FALSE;

  _aropen->addColumn(tr("Doc. Type"),   _docTypeColumn, Qt::AlignCenter, true, "doctype");
  _aropen->addColumn(tr("Doc. Number"), -1,             Qt::AlignCenter, true, "aropen_docnumber");
  _aropen->addColumn(tr("Doc. Date"),   _dateColumn,    Qt::AlignCenter, true, "aropen_docdate");
  _aropen->addColumn(tr("Due Date"),    _dateColumn,    Qt::AlignCenter, true, "aropen_duedate");
  _aropen->addColumn(tr("Open"),        _moneyColumn,   Qt::AlignRight,  true, "balance");
  _aropen->addColumn(tr("Currency"),	_currencyColumn,Qt::AlignLeft,   !omfgThis->singleCurrency(), "balance_curr");
  _aropen->addColumn(tr("Applied"),     _moneyColumn,   Qt::AlignRight,  true, "applied");
  _aropen->addColumn(tr("Currency"),	_currencyColumn,Qt::AlignLeft,   !omfgThis->singleCurrency(), "applied_curr");
  _aropen->addColumn(tr("All Pending"), _moneyColumn,   Qt::AlignRight,  true, "pending");
  _aropen->addColumn(tr("Currency"),	_currencyColumn,Qt::AlignLeft,   !omfgThis->singleCurrency(), "balance_curr");

  _cust->setReadOnly(TRUE);

  if(_metrics->boolean("HideApplyToBalance"))
    _applyToBalance->hide();

  sPriceGroup();
}
Esempio n. 7
0
Parameter::Parameter()
{
  Type = 0;
  Offset = 0;
  Label = L"";
  Symbol = L"";
  Min = 0;
  Max = 255;
  Step = 0.125f;
  RStep = 0.125f;
  sClear(DefaultU);
  DefaultString = L"";
  Options = L"";
  Count = 1;
  XYZW = 0;
  LinkMethod = 0;
  DefaultStringRandom = 0;
  Condition = 0;
  LayoutFlag = 0;
  ContinueFlag = 0;
  FilterMode = -1;
  Format = L"";
  GridLines = 1;
  Flags = 0;
/*
  OverBoxFlag = 0;
  AnimFlag = 0;
  OverLabelFlag = 0;
  LineNumberFlag = 0;
  NarrowFlag = 0;
  */
}
Esempio n. 8
0
applyAPCreditMemo::applyAPCreditMemo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
    : XDialog(parent, name, modal, fl)
{
  setupUi(this);

  connect(_apply,          SIGNAL(clicked()), this, SLOT(sApply()));
  connect(_applyToBalance, SIGNAL(clicked()), this, SLOT(sApplyBalance()));
  connect(_available, SIGNAL(idChanged(int)), this, SLOT(sPriceGroup()));
  connect(_clear,          SIGNAL(clicked()), this, SLOT(sClear()));
  connect(_close,          SIGNAL(clicked()), this, SLOT(sClose()));
  connect(_post,           SIGNAL(clicked()), this, SLOT(sPost()));

  _captive = FALSE;

  _apopen->addColumn(tr("Doc. Type"),   _docTypeColumn,  Qt::AlignCenter,true, "doctype");
  _apopen->addColumn(tr("Doc. Number"), -1,              Qt::AlignCenter,true, "apopen_docnumber");
  _apopen->addColumn(tr("Doc. Date"),   _dateColumn,     Qt::AlignCenter,true, "apopen_docdate");
  _apopen->addColumn(tr("Due Date"),    _dateColumn,     Qt::AlignCenter,true, "apopen_duedate");
  _apopen->addColumn(tr("Open"),        _moneyColumn,    Qt::AlignRight, true, "openamount");
  _apopen->addColumn(tr("Currency"),    _currencyColumn, Qt::AlignLeft,  true, "opencurrabbr");
  _apopen->addColumn(tr("Applied"),     _moneyColumn,    Qt::AlignRight, true, "apcreditapply_amount");
  _apopen->addColumn(tr("Currency"),    _currencyColumn, Qt::AlignLeft,  true, "appliedcurrabbr");
  if (omfgThis->singleCurrency())
  {
    _apopen->hideColumn("opencurrabbr");
    _apopen->hideColumn("appliedcurrabbr");
  }

  _vend->setReadOnly(TRUE);
  sPriceGroup();
}
Esempio n. 9
0
static void sInitGdiPlus()
{
  Gdiplus::GdiplusStartupInput gsin;
  sClear(gsin);
  gsin.GdiplusVersion=1;
  GdiplusStartup(&sGdiToken,&gsin,NULL);
}
Esempio n. 10
0
selectedPayments::selectedPayments(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sFillList()));
  connect(_clear, SIGNAL(clicked()), this, SLOT(sClear()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_selectedBankAccount, SIGNAL(toggled(bool)), this, SLOT(sFillList()));

  _apselect->addColumn(tr("Bank Accnt."), _itemColumn, Qt::AlignLeft  , true, "f_bank"  );
  _apselect->addColumn(tr("Vendor"),      -1,          Qt::AlignLeft  , true, "f_vendor");
  _apselect->addColumn(tr("Doc. Type"),  _orderColumn, Qt::AlignLeft  , true, "doctype");
  _apselect->addColumn(tr("Doc. #"),     _orderColumn, Qt::AlignRight , true, "apopen_docnumber");
  _apselect->addColumn(tr("Inv. #"),     _orderColumn, Qt::AlignRight , true, "apopen_invcnumber");
  _apselect->addColumn(tr("P/O #"),      _orderColumn, Qt::AlignRight , true, "apopen_ponumber");
  _apselect->addColumn(tr("Selected"),   _moneyColumn, Qt::AlignRight , true, "apselect_amount");
  _apselect->addColumn(tr("Currency"),   _currencyColumn, Qt::AlignLeft,true, "currAbbr" );
  _apselect->addColumn(tr("Running (%1)").arg(CurrDisplay::baseCurrAbbr()), _bigMoneyColumn, Qt::AlignRight, true, "apselect_running_base" );
  if (omfgThis->singleCurrency())
  {
    _apselect->hideColumn("currAbbr");
    _apselect->headerItem()->setText(8, tr("Running"));
  }

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

  sFillList();
}
Esempio n. 11
0
selectedPayments::selectedPayments(QWidget* parent, const char* name, Qt::WFlags fl)
    : QMainWindow(parent, name, fl)
{
  setupUi(this);

  connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sFillList()));
  connect(_clear, SIGNAL(clicked()), this, SLOT(sClear()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit()));
  connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
  connect(_selectedBankAccount, SIGNAL(toggled(bool)), this, SLOT(sFillList()));

  QString base;
  q.exec("SELECT currConcat(baseCurrID()) AS base;");
  if (q.first())
    base = q.value("base").toString();

  _apselect->addColumn(tr("Bank Accnt."), _itemColumn, Qt::AlignLeft  );
  _apselect->addColumn(tr("Vendor"),      -1,          Qt::AlignLeft  );
  _apselect->addColumn(tr("Doc. Type"),  _orderColumn, Qt::AlignRight );
  _apselect->addColumn(tr("Doc. #"),     _orderColumn, Qt::AlignRight );
  _apselect->addColumn(tr("Inv. #"),     _orderColumn, Qt::AlignRight );
  _apselect->addColumn(tr("P/O #"),      _orderColumn, Qt::AlignRight );
  _apselect->addColumn(tr("Selected"),   _moneyColumn, Qt::AlignRight );
  _apselect->addColumn(tr("Currency"),   _currencyColumn, Qt::AlignLeft );
  _apselect->addColumn(tr("Running\n(%1)").arg(base), _moneyColumn, Qt::AlignRight );
  if (omfgThis->singleCurrency())
  {
    _apselect->hideColumn(7);
    _apselect->headerItem()->setText(8, tr("Running"));
  }

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

  sFillList();
}
Esempio n. 12
0
// get packet
sBool sUDPSocket::Read(void *buffer, sInt size, sInt &read, sIPAddress &srcaddr, sIPPort &srcport)
{
  read=0;
  if (!P) return sFALSE;

  sockaddr_in from;
  sClear(from);
  from.sin_family=AF_INET;
  socklen_t fromlen=sizeof(from);

  sInt res=recvfrom(P->Socket,(char*)buffer,size,0,(sockaddr*)&from,&fromlen);
  sU32 addr=ntohl(from.sin_addr.s_addr);

  srcaddr.Addr[0]=(addr>>24)&0xff;
  srcaddr.Addr[1]=(addr>>16)&0xff;
  srcaddr.Addr[2]=(addr>> 8)&0xff;
  srcaddr.Addr[3]=(addr>> 0)&0xff;
  srcport=htons(from.sin_port);

  if (res==sSOCKET_ERROR)
  {
    read=0;
    return sFALSE;
  }

  read=res;
  return sTRUE;
}
Esempio n. 13
0
sBool sTCPSocket::GetLocalPort(sIPPort &port)
{
  sClear(port);
  if (!IsConnected()) return sFALSE;
  port=ntohs(P->LocalAddress.sin_port);
  return sTRUE;
}
Esempio n. 14
0
sBool sTCPSocket::GetLocalAddress(sIPAddress &address)
{
  sClear(address);
  if (!IsConnected()) return sFALSE;
  sCopyMem(&address,&P->LocalAddress.sin_addr,4);
  return sTRUE;
}
Esempio n. 15
0
sBool sResolveName(const sChar *hostname, sIPAddress &address)
{
  sChar8 name[512];
  sCopyString(name,hostname,511);

  sClear(address);

  struct hostent *result=gethostbyname(name);

  if (result && result->h_addrtype==AF_INET && result->h_length==4)
  {
    sInt n=0;
    while (result->h_addr_list[n]) n++;
    if (n>1)
    {
      // if there are several IP addresses for a host name, pick one
      // randomly. In most cases this is due to load balancing anyway.
      sRandom rnd;
      rnd.Seed(sGetRandomSeed());
      n=rnd.Int(n);
    }
    else n--;

    for (sInt i=0; i<4; i++)
      address.Addr[i]=result->h_addr_list[n][i];
    return sTRUE;
  }
  return sFALSE;
}
Esempio n. 16
0
voucher::voucher(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_save,          SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_distributions, SIGNAL(clicked()), this, SLOT(sDistributions()));
  connect(_distributeline, SIGNAL(clicked()), this, SLOT(sDistributeLine()));
  connect(_clear, SIGNAL(clicked()), this, SLOT(sClear()));
  connect(_distributeall, SIGNAL(clicked()), this, SLOT(sDistributeAll()));
  connect(_voucherNumber, SIGNAL(lostFocus()), this, SLOT(sHandleVoucherNumber()));
  connect(_poNumber, SIGNAL(newId(int, const QString&)), this, SLOT(sFillList()));
  connect(_poNumber, SIGNAL(newId(int, const QString&)), this, SLOT(sPopulatePoInfo()));
  connect(_amountToDistribute, SIGNAL(valueChanged()), this, SLOT(sPopulateBalanceDue()));
  connect(_new, SIGNAL(clicked()), this, SLOT(sNewMiscDistribution()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEditMiscDistribution()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDeleteMiscDistribution()));
  connect(_invoiceDate, SIGNAL(newDate(const QDate&)), this, SLOT(sPopulateDistDate()));
  connect(_terms, SIGNAL(newID(int)), this, SLOT(sPopulateDueDate()));
  connect(_poitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_amountToDistribute, SIGNAL(idChanged(int)), this, SLOT(sFillList()));
  connect(_amountDistributed, SIGNAL(valueChanged()), this, SLOT(sPopulateBalanceDue()));

  _terms->setType(XComboBox::APTerms);
  _poNumber->setAllowedStatuses(OrderLineEdit::Open);
  _poNumber->setAllowedTypes(OrderLineEdit::Purchase);
  _poNumber->setInfoVisible(false);
  _poNumber->setLabel("");
  _poNumber->findChild<QWidget*>("_name")->hide();
  _poNumber->findChild<QWidget*>("_description")->hide();
  _poNumber->findChild<QWidget*>("_fromLit")->hide();
  _poNumber->findChild<QWidget*>("_from")->hide();
  _poNumber->findChild<QWidget*>("_toLit")->hide();
  _poNumber->findChild<QWidget*>("_to")->hide();
  _poNumber->setMinimumHeight(32);
  
  /* a VendorCluster keeps the vend_id handy and handles address info easily */
  _vendor->setVisible(false);

  _poitem->addColumn(tr("#"),               _whsColumn,   Qt::AlignCenter, true,  "poitem_linenumber" );
  _poitem->addColumn(tr("Status"),          _uomColumn,   Qt::AlignCenter, true,  "poitemstatus" );
  _poitem->addColumn(tr("Item Number"),     _itemColumn,  Qt::AlignLeft,   true,  "itemnumber"   );
  _poitem->addColumn(tr("UOM"),             _uomColumn,   Qt::AlignCenter, true,  "uom" );
  _poitem->addColumn(tr("Vend. Item #"),    -1,           Qt::AlignLeft,   true,  "poitem_vend_item_number"   );
  _poitem->addColumn(tr("UOM"),             _uomColumn,   Qt::AlignCenter, true,  "poitem_vend_uom" );
  _poitem->addColumn(tr("Ordered"),         _qtyColumn,   Qt::AlignRight,  true,  "poitem_qty_ordered"  );
  _poitem->addColumn(tr("Invoiced"),        _qtyColumn,   Qt::AlignRight,  false, "invoiced" );
  _poitem->addColumn(tr("Uninvoiced"),      _qtyColumn,   Qt::AlignRight,  true,  "qtyreceived"  );
  _poitem->addColumn(tr("Rejected"),        _qtyColumn,   Qt::AlignRight,  true,  "qtyrejected"  );
  _poitem->addColumn(tr("Amount"),          _moneyColumn, Qt::AlignRight,  true,  "invoiceamount"  );
  _poitem->addColumn(tr("PO Unit Price"),   _moneyColumn, Qt::AlignRight,  true,  "poitem_unitprice" );
  _poitem->addColumn(tr("PO Ext Price"),    _moneyColumn, Qt::AlignRight,  true,  "extprice"  );
  _poitem->addColumn(tr("PO Line Freight"), _moneyColumn, Qt::AlignRight,  true,  "poitem_freight" );

  _miscDistrib->addColumn(tr("Account"),    -1,           Qt::AlignLeft,   true,  "account"  );
  _miscDistrib->addColumn(tr("Amount"),     _moneyColumn, Qt::AlignRight,  true,  "vodist_amount" ); 

  setWindowModified(false);
}
Esempio n. 17
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();
}
Esempio n. 18
0
ACStatement *ACDoc::NewStat()
{
  ACStatement *stat = Pool->Alloc<ACStatement>();
  sClear(*stat);
  stat->SourceFile = Scan.TokenFile;
  stat->SourceLine = Scan.TokenLine;
  return stat;
}
Esempio n. 19
0
sQueryQueue::sQueryQueue(sAdapter *adapter,sGpuQueryKind kind)
{
    Adapter = adapter;
    Kind = kind;
    LastU32 = 0;
    LastU64 = 0;
    sClear(LastStats);
    Current = 0;
}
Esempio n. 20
0
 Config()
 {
   Scan=0;
   sClear(DefaultResolution);
   DefaultFullscreen = sRELEASE;
   Port = 1234;
   HttpPort = 8080;
   BarAnimTime = 9;
   BarAnimSpread = 0.5;
   MovieVolume = 1.0;
 }
Esempio n. 21
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");
}
Esempio n. 22
0
MyApp::MyApp()
{
  // debug output

  Painter = new sPainter;

  // geometry 

  for(sInt i=0;i<4;i++)
  {
    Geo[i] = new sGeometry();
    Geo[i]->Init(sGF_QUADRICS,sVertexFormatSingle);
  }

  // texture

  sImage img;
  img.Init(256,256);
  for(sInt i=0;i<4;i++)
  {
    static const sU32 c0[4] = { 0xff202020,0xff404040,0xff606060,0xff808080 };
    static const sU32 c1[4] = { 0xffff0000,0xff00ff00,0xff0000ff,0xffff00ff };
    img.Checker(c0[i],c1[i],8<<i,8<<i);
    Tex[i] = sLoadTexture2D(&img,sTEX_ARGB8888|sTEX_2D);
  }

  // material

  for(sInt i=0;i<4;i++)
  {
    Mtrl[i] = new sSimpleMaterial;
    Mtrl[i]->Flags = sMTRL_ZON | sMTRL_CULLOFF;
    Mtrl[i]->Flags |= sMTRL_LIGHTING;
    Mtrl[i]->Texture[0] = Tex[i];
    Mtrl[i]->TFlags[0] = sMTF_LEVEL2|sMTF_TILE;
    Mtrl[i]->Prepare(sVertexFormatSingle);
  }

  // light

  sClear(Env);
  Env.AmbientColor  = 0xff404040;
  Env.LightColor[0] = 0x00c00000;
  Env.LightColor[1] = 0x0000c000;
  Env.LightColor[2] = 0x000000c0;
  Env.LightColor[3] = 0x00000000;
  Env.LightDir[0].Init(1,0,0);
  Env.LightDir[1].Init(0,1,0);
  Env.LightDir[2].Init(0,0,1);
  Env.LightDir[3].Init(0,0,0);
  Env.Fix();
}
Esempio n. 23
0
void Init()
{
    sASSERT(Active==0);
    Active = 2;
    MemLeakLock = new sThreadLock();
    Free = 0;
    LeakCount = 0;
    sClear(Hash);
    FirstBlock = 0;
    atexit(Exit);
    Active = 1;
    sLog("sys","leak tracking activated");
}
Esempio n. 24
0
void sBlit2D(const sU32 *data,sInt width,const sRect &dest)
{
  BITMAPINFO bmi;
  sClear(bmi);

  bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
  bmi.bmiHeader.biWidth = width;
  bmi.bmiHeader.biHeight = -dest.SizeY();
  bmi.bmiHeader.biPlanes = 1;
  bmi.bmiHeader.biBitCount = 32;
  bmi.bmiHeader.biCompression = BI_RGB;
  SetDIBitsToDevice(sGDIDC,dest.x0,dest.y0,dest.SizeX(),dest.SizeY(),0,0,0,dest.SizeY(),data,&bmi,DIB_RGB_COLORS);
}
Esempio n. 25
0
MyApp::MyApp()
{
  // adapter and screen names 

  sGraphicsCaps caps;
  sGetGraphicsCaps(caps);
  AdapterName=caps.AdapterName;

  sInt max = sGetScreenCount();
  ScreenNames.HintSize(max);
  for (sInt i=0; i<max; i++)
  {
    sScreenInfo info;
    sGetScreenInfo(info,0,i);
    ScreenNames.AddTail(info.MonitorName);
  }

  // debug output

  Painter = new sPainter;

  // geometry 

  Geo = new sGeometry();
  Geo->Init(sGF_TRILIST|sGF_INDEX16,sVertexFormatStandard);
  Geo->LoadCube(-1,2,2,2);

  // texture

  sImage img(64,64);
  img.Checker(0xffff8080,0xff80ff80,8,8);
  img.Glow(0.5f,0.5f,0.25f,0.25f,0xffffffff,1.0f,4.0f);
  Tex = sLoadTexture2D(&img,sTEX_2D|sTEX_ARGB8888);

  // material

  Mtrl = new sSimpleMaterial;
  Mtrl->Flags = sMTRL_ZON | sMTRL_CULLON;
  Mtrl->Flags |= sMTRL_LIGHTING;
  Mtrl->Texture[0] = Tex;
  Mtrl->TFlags[0] = sMTF_LEVEL2|sMTF_CLAMP;
  Mtrl->Prepare(Geo->GetFormat());

  // light

  sClear(Env);
  Env.AmbientColor  = 0x00202020;
  Env.LightColor[0] = 0x00ffffff;
  Env.LightDir[0].Init(0,0,1);
  Env.Fix();
}
Esempio n. 26
0
// broadcast packet to everyone
sBool sUDPSocket::Broadcast(sIPPort destport, const void *buffer, sInt size)
{
  if (!P) return sFALSE;

  sockaddr_in to;
  sClear(to);
  to.sin_family=AF_INET;
    to.sin_port=htons(destport);
  to.sin_addr.s_addr=INADDR_BROADCAST;

  sInt res=sendto(P->Socket,(const char*)buffer,size,0,(sockaddr*)&to,sizeof(to));

  return res==size;
}
Esempio n. 27
0
sFont2D::sLetterDimensions sFont2D::sGetLetterDimensions(const sChar letter)
{
  sLetterDimensions result;

  SelectObject(sGDIDCOffscreen,prv->Font);

  ABC abc;
  
  if(GetCharABCWidths(sGDIDCOffscreen,letter,letter,&abc))
  {
    result.Pre      = abc.abcA;
    result.Cell     = abc.abcB;
    result.Post     = abc.abcC;
    result.Advance  = abc.abcA + abc.abcB + abc.abcC;

    MAT2 mat;
    sClear(mat);
    mat.eM11.value = 1;
    mat.eM22.value = 1;
    GLYPHMETRICS metrics;

    if (GDI_ERROR != GetGlyphOutline(sGDIDCOffscreen, letter, GGO_METRICS, &metrics, 0, 0, &mat))
    {
      result.Height = metrics.gmBlackBoxY;
      result.OriginY = metrics.gmptGlyphOrigin.y;
    }
    else
    {
      SIZE size;
      GetTextExtentPoint32(sGDIDCOffscreen, &letter, 1, &size);
      result.Height = size.cy;
      result.OriginY = size.cy;
    }
  }
  else
  {
    SIZE size;
    GetTextExtentPoint32(sGDIDCOffscreen,&letter,1,&size);
    
    result.Pre      = 0;
    result.Cell     = size.cx;
    result.Post     = 0;
    result.Advance  = size.cx;
    result.Height   = size.cy;
    result.OriginY  = size.cy;
  }
  

  return result;
}
Esempio n. 28
0
voucher::voucher(QWidget* parent, const char* name, Qt::WFlags fl)
    : XWidget(parent, name, fl)
{
  setupUi(this);

  connect(_poList, SIGNAL(clicked()), this, SLOT(sPoList()));
  connect(_save, SIGNAL(clicked()), this, SLOT(sSave()));
  connect(_distributions, SIGNAL(clicked()), this, SLOT(sDistributions()));
  connect(_distributeline, SIGNAL(clicked()), this, SLOT(sDistributeLine()));
  connect(_clear, SIGNAL(clicked()), this, SLOT(sClear()));
  connect(_distributeall, SIGNAL(clicked()), this, SLOT(sDistributeAll()));
  connect(_voucherNumber, SIGNAL(lostFocus()), this, SLOT(sHandleVoucherNumber()));
  connect(_poNumber, SIGNAL(newId(int)), this, SLOT(sFillList()));
  connect(_amountToDistribute, SIGNAL(valueChanged()), this, SLOT(sPopulateBalanceDue()));
  connect(_new, SIGNAL(clicked()), this, SLOT(sNewMiscDistribution()));
  connect(_edit, SIGNAL(clicked()), this, SLOT(sEditMiscDistribution()));
  connect(_delete, SIGNAL(clicked()), this, SLOT(sDeleteMiscDistribution()));
  connect(_invoiceDate, SIGNAL(newDate(const QDate&)), this, SLOT(sPopulateDistDate()));
  connect(_terms, SIGNAL(newID(int)), this, SLOT(sPopulateDueDate()));
  connect(_poNumber, SIGNAL(newId(int)), this, SLOT(sPopulatePoInfo()));
  connect(_poitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*)));
  connect(_amountToDistribute, SIGNAL(idChanged(int)), this, SLOT(sFillList()));
  connect(_amountDistributed, SIGNAL(valueChanged()), this, SLOT(sPopulateBalanceDue()));

#ifndef Q_WS_MAC
  _poList->setMaximumWidth(25);
#endif

  _terms->setType(XComboBox::APTerms);
  _poNumber->setType(cPOOpen);

  _poitem->addColumn(tr("#"),               _whsColumn,   Qt::AlignCenter, true,  "poitem_linenumber" );
  _poitem->addColumn(tr("Status"),          _uomColumn,   Qt::AlignCenter, true,  "poitemstatus" );
  _poitem->addColumn(tr("Item Number"),     _itemColumn,  Qt::AlignLeft,   true,  "itemnumber"   );
  _poitem->addColumn(tr("UOM"),             _uomColumn,   Qt::AlignCenter, true,  "uom" );
  _poitem->addColumn(tr("Vend. Item #"),    -1,           Qt::AlignLeft,   true,  "poitem_vend_item_number"   );
  _poitem->addColumn(tr("UOM"),             _uomColumn,   Qt::AlignCenter, true,  "poitem_vend_uom" );
  _poitem->addColumn(tr("Ordered"),         _qtyColumn,   Qt::AlignRight,  true,  "poitem_qty_ordered"  );
  _poitem->addColumn(tr("Invoiced"),        _qtyColumn,   Qt::AlignRight,  false, "invoiced" );
  _poitem->addColumn(tr("Uninvoiced"),      _qtyColumn,   Qt::AlignRight,  true,  "qtyreceived"  );
  _poitem->addColumn(tr("Rejected"),        _qtyColumn,   Qt::AlignRight,  true,  "qtyrejected"  );
  _poitem->addColumn(tr("Amount"),          _moneyColumn, Qt::AlignRight,  true,  "invoiceamount"  );
  _poitem->addColumn(tr("PO Unit Price"),   _moneyColumn, Qt::AlignRight,  true,  "poitem_unitprice" );
  _poitem->addColumn(tr("PO Ext Price"),    _moneyColumn, Qt::AlignRight,  true,  "extprice"  );
  _poitem->addColumn(tr("PO Line Freight"), _moneyColumn, Qt::AlignRight,  true,  "poitem_freight" );

  _miscDistrib->addColumn(tr("Account"),    -1,           Qt::AlignLeft,   true,  "account"  );
  _miscDistrib->addColumn(tr("Amount"),     _moneyColumn, Qt::AlignRight,  true,  "vodist_amount" ); 
}
Esempio n. 29
0
// send packet to destination
sBool sUDPSocket::Write(const sIPAddress &destaddr, sIPPort destport, const void *buffer, sInt size)
{
  if (!P) return sFALSE;

  sockaddr_in to;
  sClear(to);
  to.sin_family=AF_INET;
  to.sin_port=htons(destport);
  sCopyMem(&to.sin_addr,&destaddr,4);

  sInt res=sendto(P->Socket,(const char*)buffer,size,0,(sockaddr*)&to,sizeof(to));

  return res==size;

}
Esempio n. 30
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   );
}