void HistoryManager::ResetHistory(ID id)
{
	ValueID vid(id, time);
	std::set<ValueID> resetHistory;
	resetHistory.insert(vid);
	SetHistory(id, resetHistory);
}
示例#2
0
void CRunCVNorm::SetValue(CParmCVNormDlg* pDlg)
{
   UpdateData(pDlg);
   PrepareParameters();
   if (CippiRun::CallIpp() < 0) return;
   Timing();
   SetHistory();
   UpdateData(pDlg,FALSE);
}
示例#3
0
void CRunUpdate::SetValue(CParmUpdateDlg* pDlg)
{
   UpdateData(pDlg);
   PrepareParameters();
   CippsRun::CallIpp();
   Timing();
   SetHistory();
   UpdateData(pDlg,FALSE);
}
示例#4
0
DlgEdit::DlgEdit(Dialog* pOwner,unsigned Index,DLGEDITTYPE Type):
	LastPartLength(-1),
	m_Dialog(pOwner),
	m_Index(Index),
	Type(Type),
	iHistory(nullptr),
#if defined(PROJECT_DI_MEMOEDIT)
	multiEdit(nullptr),
#endif
	lineEdit(nullptr)
{
	switch (Type)
	{
		case DLGEDIT_MULTILINE:
#if defined(PROJECT_DI_MEMOEDIT)
			multiEdit=new Editor(pOwner,true); // ??? (pOwner) ?
#endif
			break;
		case DLGEDIT_SINGLELINE:
		{
			EditControl::Callback callback={true,EditChange,this};

			FarList* iList=0;
			DWORD iFlags=0;
			if(pOwner)
			{
				DialogItemEx* CurItem=pOwner->Item[Index];
				if(Opt.Dialogs.AutoComplete && CurItem->Flags&(DIF_HISTORY|DIF_EDITPATH|DIF_EDITPATHEXEC) && !(CurItem->Flags&DIF_DROPDOWNLIST) && !(CurItem->Flags&DIF_NOAUTOCOMPLETE))
				{
					iFlags=EditControl::EC_ENABLEAUTOCOMPLETE;
				}
				if(CurItem->Flags&DIF_HISTORY && !CurItem->strHistory.IsEmpty())
				{
					SetHistory(CurItem->strHistory);
				}
				if(CurItem->Type == DI_COMBOBOX)
				{
					iList=CurItem->ListItems;
				}
				if(CurItem->Flags&DIF_HISTORY)
				{
					iFlags|=EditControl::EC_COMPLETE_HISTORY;
				}
				if(CurItem->Flags&DIF_EDITPATH)
				{
					iFlags|=EditControl::EC_COMPLETE_FILESYSTEM;
				}
				if(CurItem->Flags&DIF_EDITPATHEXEC)
				{
					iFlags|=EditControl::EC_COMPLETE_PATH;
				}
			}
			lineEdit=new EditControl(pOwner,&callback,true,iHistory,iList,iFlags);
		}
		break;
	}
}
示例#5
0
DlgEdit::DlgEdit(window_ptr Owner,size_t Index,DLGEDITTYPE Type):
	SimpleScreenObject(std::move(Owner)),
	LastPartLength(-1),
	m_Index(Index),
	Type(Type),
	iHistory(nullptr),
#if defined(PROJECT_DI_MEMOEDIT)
	multiEdit(nullptr),
#endif
	lineEdit(nullptr)
{
	switch (Type)
	{
		case DLGEDIT_MULTILINE:
#if defined(PROJECT_DI_MEMOEDIT)
			multiEdit=new Editor(pOwner,true); // ??? (pOwner) ?
#endif
			break;
		case DLGEDIT_SINGLELINE:
		{
			EditControl::Callback callback={true,EditChange,this};

			FarList* iList = nullptr;
			DWORD iFlags=0;
			auto& CurItem=GetDialog()->Items[Index];
			if(Global->Opt->Dialogs.AutoComplete && CurItem.Flags&(DIF_HISTORY|DIF_EDITPATH|DIF_EDITPATHEXEC) && !(CurItem.Flags&DIF_DROPDOWNLIST) && !(CurItem.Flags&DIF_NOAUTOCOMPLETE))
			{
				iFlags=EditControl::EC_ENABLEAUTOCOMPLETE;
			}
			if(CurItem.Flags&DIF_HISTORY && !CurItem.strHistory.empty())
			{
				SetHistory(CurItem.strHistory);
			}
			if(CurItem.Type == DI_COMBOBOX)
			{
				iList=CurItem.ListItems;
			}
			if(CurItem.Flags&DIF_HISTORY)
			{
				iFlags|=EditControl::EC_COMPLETE_HISTORY;
			}
			if(CurItem.Flags&DIF_EDITPATH)
			{
				iFlags|=EditControl::EC_COMPLETE_FILESYSTEM;
			}
			if(CurItem.Flags&DIF_EDITPATHEXEC)
			{
				iFlags|=EditControl::EC_COMPLETE_PATH;
			}
			iFlags|=EditControl::EC_COMPLETE_ENVIRONMENT;

			lineEdit = std::make_unique<EditControl>(GetOwner(), GetOwner().get(), nullptr, &callback, iHistory.get(), iList, iFlags);
		}
		break;
	}
}
示例#6
0
void CRunStat::SetValues(CParmStatDlg* pDlg)
{
   UpdateData(pDlg);
   if (m_Func.Found("Mean") || m_Func.Found("Sum"))
      m_value.Init(pp64f, 4);
   else
      m_value.Init(m_Func.SrcType(),4);
   PrepareParameters();
   if (CippiRun::CallIpp() < 0) return;
   Timing();
   SetHistory();
   UpdateData(pDlg,FALSE);
}
示例#7
0
文件: Game.cpp 项目: twilson-sf/diplo
BOOL PSGame::LoadHistory()
{
	// Get the name of the game.
	CFrameWnd* pFrame = (CFrameWnd*) AfxGetMainWnd();
	CDocument* pDoc = pFrame->GetActiveDocument();
	CString strName = pDoc->GetPathName();
	if (strName == "")
		return FALSE;

	// Open the history file.
	char* path_buffer = strName.GetBuffer(_MAX_PATH);
	char drive[_MAX_DRIVE];
	char dir[_MAX_DIR];
	char fname[_MAX_FNAME];
	char ext[_MAX_EXT];
	_splitpath( path_buffer, drive, dir, fname, ext );
	strName.Format("%s%s%s%s", drive, dir, fname, ".dph");

	CFile f;
	CFileException fe;
	f.Open(strName, CFile::modeRead, &fe);
	if (fe.m_cause)
		return FALSE;

	// Load the history.
	PSHistory* pHist = new PSHistory;
	CArchive arh(&f, CArchive::load);
	pHist->Serialize(arh);
	arh.Close();
	f.Close();

	// If the data in the last step of the history is the same as the game's data, copy the history
	// into the game's history. If not, disregard the loaded history.
	PSStep* pLastStep = pHist->GetLastStep();
	PSData* pLastData = pLastStep->GetData();
	if (!(*pLastData == m_Data))// Operator != not defined.
	{
		AfxMessageBox(IDS_BAD_HISTORY);
		delete pHist;
		return FALSE;
	}

	SetHistory(pHist);
	SetCurrentStep(pLastStep);
	return TRUE;
}