⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 childfrm.cpp

📁 打印数据生成和模拟
💻 CPP
📖 第 1 页 / 共 2 页
字号:
				  m_tskToolBar.GetItemRect(0, &rectToolBar);
				  rbbi.cyMinChild = rectToolBar.Height() + addHeight;
				  rbbi.cx = rbbi.cxIdeal = rectToolBar.Width() * m_tskToolBar.GetCount () + 50;
				  rbbi.cxMinChild = 0;	
				  m_wndReBar.GetReBarCtrl().SetBandInfo (0, &rbbi);
				  
					rbbi.cbSize = sizeof(rbbi);
					rbbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_SIZE;	
					CRect rectAssistantBar;
					m_wndAssistantBar.GetItemRect(0,&rectAssistantBar);
					rbbi.cyMinChild = rectAssistantBar.Height() + addHeight;
					rbbi.cx = rbbi.cxIdeal = rectAssistantBar.Width() * m_wndAssistantBar.GetCount ();
					rbbi.cxMinChild = 0;
					m_wndReBar.GetReBarCtrl().SetBandInfo (1, &rbbi);
					
					  rbbi.cbSize = sizeof(rbbi);
					  rbbi.fMask = RBBIM_CHILDSIZE | RBBIM_IDEALSIZE | RBBIM_SIZE;	
					  CRect rectformatToolBar;
					  m_formatToolBar.GetItemRect(0,&rectformatToolBar);
					  rbbi.cyMinChild = rectformatToolBar.Height() + addHeight;
					  rbbi.cx = rbbi.cxIdeal = rectformatToolBar.Width() * m_formatToolBar.GetCount ();
					  rbbi.cxMinChild = 0;
					  m_wndReBar.GetReBarCtrl().SetBandInfo (2, &rbbi);
	*/
	return 0;
}

void CChildFrame::OnLeftBar() 
{
	ShowControlBar(&m_wndTableInfBar, !(m_wndTableInfBar.GetStyle () & WS_VISIBLE), FALSE);
	RecalcLayout ();	
}

void CChildFrame::OnUpdateLeftBar(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	if(!m_pView) return;
	pCmdUI->Enable();
	pCmdUI->SetCheck(m_wndTableInfBar.IsWindowVisible());	
}
void CChildFrame::SetTskEditView(CToolSoftForPrintView *pView)
{
	m_pView = pView;
	//m_pTabReport    = m_pTaskEditView->GetTaskTable();
}

void CChildFrame::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CMDIChildWnd::OnShowWindow(bShow, nStatus);
	
	if (this)
		this->SetWindowText("软件");	
}

void CChildFrame::OnUpdateOpenexcel(CCmdUI* pCmdUI) 
{	
	pCmdUI->Enable(TRUE);	
}

void CChildFrame::OnASN() 
{

}

void CChildFrame::OnUpdateASN(CCmdUI* pCmdUI) 
{
  pCmdUI->Enable(TRUE);	
}

void CChildFrame::OnModal() 
{
	// TODO: Add your command handler code here
}

void CChildFrame::OnUpdateModal(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(TRUE);
}

void CChildFrame::OnUpdateCominf(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(TRUE);
}

void CChildFrame::OnCominf() 
{
	// TODO: Add your command handler code here

}

void CChildFrame::OnUpdatePath(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
		
	pCmdUI->Enable(TRUE);

}

void CChildFrame::OnPath() 
{
	// TODO: Add your command handler code here
}

void CChildFrame::OnRecAction() 
{
	// TODO: Add your command handler code here
	hookTmp.SetGlobleRecHook();
}

void CChildFrame::OnUpdateRecAction(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(TRUE);
}


void CChildFrame::OnStop() 
{
	// TODO: Add your command handler code here
	hookTmp.DestroyGlobleRecHook();
}

void CChildFrame::OnUpdateStop(CCmdUI* pCmdUI) 
{
 pCmdUI->Enable(TRUE);	
}

void CChildFrame::OnUpdateRepaly(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(TRUE);
}

void CChildFrame::OnRepaly() 
{
	hookTmp.ReplayAction();
}




void CChildFrame::OnUpdatesimulateSetFix(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(TRUE);
}

void CChildFrame::OnsimulateSetFix() 
{
	// TODO: Add your command handler code here
	AfxMessageBox("fsd");
}



void CChildFrame::OnUpdatefileSet(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(TRUE);
}

void CChildFrame::OnfileSet() 
{
	// TODO: Add your command handler code here
	CFileSetDlg dlgFileSet;
	dlgFileSet.DoModal();
}



void CChildFrame::OnUpdatenewFile(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(TRUE);
}

void CChildFrame::OnnewFile() 
{
	// TODO: Add your command handler code here
	CString strDataPathValue = CUtilityClass::getIniValueString("FileSet","DataPath","",CUtilityClass::getAppPath()+"\\conf\\conf.ini");


	m_fileDlg.SetInitDir(strDataPathValue);
	m_fileDlg.SetFileName("datatmp");
	m_fileDlg.SetDefaultExt("prt");
proPoint:
	m_fileDlg.ShowSave();

	CString strFileName = m_fileDlg.GetFileName();
	if ("" == strFileName)
		return;
	else
	{
		CSuperFileProc filePro;
		if (TRUE == filePro.Exist(strFileName))
		{
			if ((AfxMessageBox("此文件名已经存在,是否需要覆盖?",MB_YESNO))==IDYES)
			{
				filePro.Delete(strFileName);
			}
			else
			{
				AfxMessageBox("请重新约定名称!");
				goto proPoint;
				return;
			}
		}
	}
	writeLog("正在生成数据文件...");
	if (FALSE != CUtilityClass::writeRandomDatoToFileLine(strFileName))
	{
		CStringArray m_arr;
		Search m_search(CUtilityClass::getIniValueString("FileSet","DataPath","",CUtilityClass::getAppPath()+"\\conf\\conf.ini"),"*.prt");
		m_search.Start(m_arr);
		this->m_wndTableInfBar.m_List.m_listInf.DeleteAllItems();
		if (m_arr.GetSize())
		{	
			for (int iTmp=1;iTmp<=m_arr.GetSize();iTmp++)
			{
				CString strPath(m_arr.GetAt(iTmp-1));
				int iPos = strPath.ReverseFind('\\');
				strPath=strPath.Mid(iPos+1,strPath.GetLength()-iPos);
				this->m_wndTableInfBar.m_List.m_listInf.InsertItem(this->m_wndTableInfBar.m_List.m_listInf.GetItemCount(),strPath);
				this->m_wndTableInfBar.m_List.m_listInf.SetItemText(this->m_wndTableInfBar.m_List.m_listInf.GetItemCount()-1,1,m_arr.GetAt(iTmp-1));	
				this->m_wndTableInfBar.m_List.m_listInf.SetCheck(this->m_wndTableInfBar.m_List.m_listInf.GetItemCount()-1,FALSE);
			}

		}		
		
		int iPos = strFileName.ReverseFind('\\');
		CString strName = strFileName.Right(strFileName.GetLength()-1-iPos);
		for (int iIndex=0;iIndex<=this->m_wndTableInfBar.m_List.m_listInf.GetItemCount()-1;iIndex++)
		{
			if ((this->m_wndTableInfBar.m_List.m_listInf.GetItemText(iIndex,0) == strName)
				&&
				(this->m_wndTableInfBar.m_List.m_listInf.GetItemText(iIndex,1) == strFileName))
				this->m_wndTableInfBar.m_List.m_listInf.SetCheck(iIndex,TRUE);
		}

		writeLog("生成数据文件成功.");			
	}
	else
	{
		writeLog("生成数据文件失败");

	}
	if (FALSE != CUtilityClass::drawPrintLine(strFileName,
		                                       (CToolSoftForPrintView *)this->GetActiveView(),
											   &this->m_wndOutPutInfBar.m_wndInf.m_Inf))
	{
		
		writeLog("绘制数据文件成功,文件路径:"+strFileName);
	}
	else
	{
		writeLog("绘制数据文件失败,文件路径:"+strFileName);
	}
	

}

void CChildFrame::refreshDataToView(CString strDataPath) 
{
	// TODO: Add your command handler code here
	
}

void CChildFrame::writeLog(CString strLog)
{
	if (m_wndOutPutInfBar.m_wndInf.m_Inf.GetLineCount()==5000)
		m_wndOutPutInfBar.m_wndInf.m_Inf.Clear();
	CString sInfo;
	m_wndOutPutInfBar.m_wndInf.m_Inf.GetWindowText(sInfo);
	sInfo+="\r\n";
	sInfo+=strLog;
	m_wndOutPutInfBar.m_wndInf.m_Inf.SetWindowText(sInfo);
	int   nEnd   =   m_wndOutPutInfBar.m_wndInf.m_Inf.GetLineCount();   
    m_wndOutPutInfBar.m_wndInf.m_Inf.LineScroll(nEnd);  
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -