void DialogResample::updateListBoxes()
{
	updateListBox(MESSAGEBOX_LISTBOX_VALUE_ONE, (float)relnote, 0);
	updateListBox(MESSAGEBOX_LISTBOX_VALUE_TWO, (float)finetune, 0);
	updateListBox(MESSAGEBOX_LISTBOX_VALUE_THREE, (float)c4spd, 2);

	PPStaticText* staticText = static_cast<PPStaticText*>(messageBoxContainerGeneric->getControlByID(MESSAGEBOX_STATICTEXT_USER1));
	staticText->setHexValue(finalSize, 8);	

	checkBox->checkIt(adjustFtAndRelnote);
}
void HelperPanel::setupHistoryList()
{
    _HistoryListModel = DefaultListModel::create();

    updateListBox();

}
Beispiel #3
0
void CCalcUnary::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CPropertyPage::OnShowWindow(bShow, nStatus);
	
	// TODO: Add your message handler code here
	if (bShow == TRUE)
		updateListBox();	
}
void MissionSelectionScreen::setMission(int32_t whichOne)
{
	LogisticsData::instance->setCurrentMission(missionNames[whichOne]);
	char text[64];
	sprintf(text, "%ld ", LogisticsData::instance->getCBills());
	textObjects[RP_TEXT].setText(text);
	updateListBox();
}
void HelperPanel::handleExecuteScriptAction(ActionEventDetails* const details)
{
    if(details->getSource() == _ExecuteBtn)
    {
        LuaManager::the()->runScript(std::string(_CodeTextArea->getText()));
        _ListOfCommands.push_back(std::string(_CodeTextArea->getText()));
        updateListBox();
    }
}
Beispiel #6
0
BOOL CCalcUnary::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
	// TODO: Add extra initialization here
	updateListBox();
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
void QCompletionEdit::textDidChange( const QString &text )
{
    if ( text.isEmpty() ) {
	popup->close();
	return;
    }
    updateListBox();
    placeListBox();
}
Beispiel #8
0
void CRecvM::OnDtnDatetimechangeDatetimepicker2(NMHDR *pNMHDR, LRESULT *pResult)
{
	LPNMDATETIMECHANGE pDTChange = reinterpret_cast<LPNMDATETIMECHANGE>(pNMHDR);
	
	UpdateData(TRUE);

	updateListBox(showBox, GetWndTextByCString(rulDateBox));

	UpdateData(FALSE);
	
	*pResult = 0;
}
Beispiel #9
0
void CRecvM::OnBnClickedButton1()
{
	UpdateData(TRUE);

	CStringArray ss;
	ss.Add(GetWndTextByCString(CmpyNameBox));
	ss.Add(GetWndTextByCString(dateBox));
	ss.Add(GetWndTextByCString(CourierNumBox));
	ss.Add(GetWndTextByCString(CsgBox));
	ss.Add(GetWndTextByCString(RecverBox));
	ss.Add(GetWndTextByCString(remarkBox));

	if (!(ss[0].GetLength() && ss[2].GetLength() && ss[3].GetLength() && ss[4].GetLength() && contain_box.GetItemCount())) 
	{
		AfxMessageBox(_T("请填写完整信息!"));
		return;
	}

	_RecordsetPtr m_pRecordset;
	m_pRecordset.CreateInstance(__uuidof(Recordset));
	try {
		USES_CONVERSION;
		memset(sql, 0, sizeof(sql));
		strcat_s(sql, "insert into RecvInfo (CorpName, RecvDate, WaybillNum, Consignee, Receiver, Remark) values ('");
		for (int i = 0; i < 5; i++)
		{
			strcat_s(sql, T2A(ss[i].GetBuffer())); strcat_s(sql, "','");
		}
		strcat_s(sql, T2A(ss[5].GetBuffer())); strcat_s(sql, "')");
		AfxMessageBox(CString(sql));
		m_pRecordset->Open(sql, m_pConnection.GetInterfacePtr(), adOpenDynamic, adLockOptimistic, adCmdText);
	} catch(_com_error *e) {
		CString errormessage;
		errormessage.Format(_T("操作数据库失败!\r\n错误信息:%s"), e->ErrorMessage());
		AfxMessageBox(errormessage);
		return;
	}
	updateListBox(showBox, ss[1]);
	UpdateData(FALSE);

	USES_CONVERSION;
	for (int i = 0; i < contain_box.GetItemCount(); i++)
	{
		InsertDetail(atoi(T2A(showBox.GetItemText(showBox.GetItemCount() - 1, 0).GetBuffer())), i);
	}

	contain_box.DeleteAllItems();
}
Beispiel #10
0
void UsageOptPage::slotDeleteUsage()
{
  int act = act_usage;
  if (usageList->count() != 0 && (int) usageList->count() > act) 
  {
    QString t;
    t.setNum(usageIndex[act_usage]+1);
    t.insert (0,  UL_USER_USAGE);
    t += UL_USAGE_DIV;
    for (int ent = 0; ent < doc->numEntries(); ent++) {
      // FIXME: ProgressDlg here?
      kvoctrainExpr *exp = doc->getEntry(ent);
      for (int lang = 0; lang < doc->numLangs(); lang++) {
        QString ul = exp->getUsageLabel(lang) + UL_USAGE_DIV;
        if (ul.find(t) >= 0 ) {
          KMessageBox::information(this,
                    i18n("usage (area) of an expression",
                        "This user-defined usage label could not be deleted "
                        "because it is in use."),
                    kapp->makeStdCaption(i18n("usage (area) of an expression",
                                              "Deleting Usage Label")));
          return;
        }
      }
    }

    usageList->removeItem (act);
    usageIndex.erase (usageIndex.begin() + act);

    if ((int) usageList->count() <= act)
      act = usageList->count()-1;
    else
      updateListBox(act); // update items after current

    if (act >= 0)
      usageList->setCurrentItem (act);
  }
  b_modify->setEnabled(usageList->count() != 0);
  b_delete->setEnabled(usageList->count() != 0);
}
Beispiel #11
0
BOOL CRecvM::OnInitDialog()
{
	CDialogEx::OnInitDialog();
	DWORD dwExStyle = LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP | LVS_EX_ONECLICKACTIVATE;

	contain_box.SetExtendedStyle(dwExStyle);
	contain_box.SetTextColor(RGB(255, 0, 0));
	contain_box.SetBkColor(RGB(200, 200, 250));
	contain_box.ModifyStyle(0, LVS_REPORT);
	contain_box.SetWindowPos(NULL, 0, 0, 510, 200, SWP_NOMOVE);

	CStringArray m_arrHeaderLable1;
	m_arrHeaderLable1.Add(_T("品名"));
	m_arrHeaderLable1.Add(_T("编号"));
	m_arrHeaderLable1.Add(_T("备注"));

	long col_wide_arr1[8] = {200, 200, 110};
	RefreshListViewHeader(&contain_box, m_arrHeaderLable1, col_wide_arr1);
	//--------------------------------------------------------------------//
	showBox.SetExtendedStyle(dwExStyle);
	showBox.SetTextColor(RGB(255, 0, 0));
	showBox.SetBkColor(RGB(200, 200, 250));
	showBox.ModifyStyle(0, LVS_REPORT);
	showBox.SetWindowPos(NULL, 0, 0, 580, 250, SWP_NOMOVE);

	CStringArray m_arrHeaderLable;
	m_arrHeaderLable.Add(_T("ID"));
	m_arrHeaderLable.Add(_T("公司名称"));
	m_arrHeaderLable.Add(_T("收货日期"));
	m_arrHeaderLable.Add(_T("运单号"));
	m_arrHeaderLable.Add(_T("收件人"));
	m_arrHeaderLable.Add(_T("签收人"));
	m_arrHeaderLable.Add(_T("备注"));

	long col_wide_arr[8] = {30, 110, 80, 110, 70, 70, 110, 80};
	RefreshListViewHeader(&showBox, m_arrHeaderLable, col_wide_arr);
	//--------------------------------------------------------------------//
	m_listCtr.SetExtendedStyle(dwExStyle);
	m_listCtr.SetTextColor(RGB(255, 0, 0));
	m_listCtr.SetBkColor(RGB(200, 200, 250));
	m_listCtr.ModifyStyle(0, LVS_REPORT);
	m_listCtr.SetWindowPos(NULL, 0, 0, 340, 250, SWP_NOMOVE);

	CStringArray m_arrHeaderLable2;
	m_arrHeaderLable2.Add(_T("品名"));
	m_arrHeaderLable2.Add(_T("编号"));
	m_arrHeaderLable2.Add(_T("备注"));

	long col_wide_arr2[8] = {120, 120, 100, 110, 70, 70, 110, 80};
	RefreshListViewHeader(&m_listCtr, m_arrHeaderLable2, col_wide_arr2);
	//--------------------------------------------------------------------//
	updateListBox(showBox, GetWndTextByCString(rulDateBox));
	//-----------------------------------------------------------//
	CFileOperation cfo;

	cfo.open(CString("ProductList.txt"));
	CString ProductName;
	while((ProductName = cfo.readProductName()).GetLength())
		ProductNumBox.AddString(ProductName);
	//---------------------------------------------------------------//
	m_edit.ShowWindow(FALSE);
	//--------------------------------------------------------------//
	//		p.Format(_T("%d"), var1.intVal);

	//		time_t q=(time_t)(((double)var3.date -70.0*365.0-19.0-8.0/24.0)*86400.0);//70年中假定有18年闰年,假定时区东八区需要加或减8小时,不对的话请楼主自行微调。

	return TRUE;
}
bool QCompletionEdit::eventFilter( QObject *o, QEvent *e )
{
    if ( o == popup || o == listbox || o == listbox->viewport() ) {
	if ( e->type() == QEvent::KeyPress ) {
	    QKeyEvent *ke = (QKeyEvent*)e;
	    if ( ke->key() == Key_Enter || ke->key() == Key_Return || ke->key() == Key_Tab ) {
		if ( ke->key() == Key_Tab && listbox->count() > 1 &&
		     listbox->currentItem() < (int)listbox->count() - 1 ) {
		    listbox->setCurrentItem( listbox->currentItem() + 1 );
		    return TRUE;
		}
		popup->close();
		setFocus();
		blockSignals( TRUE );
		setText( listbox->currentText() );
		blockSignals( FALSE );
		emit chosen( text() );
		return TRUE;
	    } else if ( ke->key() == Key_Left || ke->key() == Key_Right ||
			ke->key() == Key_Up || ke->key() == Key_Down ||
			ke->key() == Key_Home || ke->key() == Key_End ||
			ke->key() == Key_Prior || ke->key() == Key_Next ) {
		return FALSE;
	    } else if ( ke->key() == Key_Escape ) {
		popup->close();
		setFocus();
	    } else if ( ke->key() != Key_Shift && ke->key() != Key_Control &&
			ke->key() != Key_Alt ) {
		updateListBox();
		if ( listbox->count() == 0 || text().length() == 0 ) {
		    popup->close();
		    setFocus();
		}
		QApplication::sendEvent( this, e );
		return TRUE;
	    }
	} else if ( e->type() == QEvent::MouseButtonDblClick ) {
	    popup->close();
	    setFocus();
	    blockSignals( TRUE );
	    setText( listbox->currentText() );
	    blockSignals( FALSE );
	    emit chosen( text() );
	    return TRUE;
	}
    } else if ( o == this ) {
	if ( e->type() == QEvent::KeyPress ) {
	    QKeyEvent *ke = (QKeyEvent*)e;
	    if ( ke->key() == Key_Up ||
		 ke->key() == Key_Down ||
		 ke->key() == Key_Prior ||
		 ke->key() == Key_Next ||
		 ke->key() == Key_Return ||
		 ke->key() == Key_Enter ||
		 ke->key() == Key_Tab ||
		 ke->key() ==  Key_Escape ) {
		QApplication::sendEvent( listbox, e );
		return TRUE;
	    }
	}
    }
    return QLineEdit::eventFilter( o, e );
}