Beispiel #1
0
void GetDocumentPosition(LPINT lpX, LPINT lpY)
/************************************************************************/
{
	CMDIFrame* pMDIFrame = (CMDIFrame*)PictPubApp.m_pMainWnd;
	int nDocs = pMDIFrame->GetNumMDIChildWindows() - 1; // don't count ourself
    int stagger = GetSystemMetrics(SM_CYCAPTION) + 
		GetSystemMetrics(SM_CYFRAME) - 2;
	*lpY = Control.yImage;
	if (nDocs)	
	    *lpY = *lpY + GetSystemMetrics(SM_CYFRAME) + (((nDocs)%5)*stagger);
    *lpX = Control.xImage + (((nDocs)%5)*stagger) + (((nDocs)/5)*stagger);
}
Beispiel #2
0
bool CMDIfileManager::CloseAll()
{
  size_t nSize = m_mapWindowFile.size();
  int nRunning = nSize ? RunningFrameCount() : 0;
  bool bRtn = !nRunning;
  if(nSize && bRtn)
  {
    CMDI_WF::iterator itr;
    CMDIFrame *pf;

    //  copy all frame pointers because m_mapWindowFile
    //  will change each time a window is closed

    std::list<CMDIFrame *> vpFrame;

    for(itr = m_mapWindowFile.begin();
      bRtn && _IteratorOK(itr);
      ++itr)
    {
      pf = itr->first;
      if(wxDynamicCast(pf,CFrameSample) == NULL)
      {
        vpFrame.push_back(pf);
      }
      else
      {
        vpFrame.push_front(pf);
      }
    }
    for(std::list<CMDIFrame *>::iterator itrv = vpFrame.begin();
      itrv != vpFrame.end();
      ++itrv)
    {
      pf = *itrv;
      itr = m_mapWindowFile.find(pf);
      if(!_IteratorOK(itr))
      {} // prevent window from being destroyed more than one
      else if(!pf->Close(false))
      {
        bRtn = false;
        break;
      }
    }
  }
  return bRtn;
}
Beispiel #3
0
int CMDIfileManager::RunningFrameCount()
{
  int nRtn = 0;
  CMDI_WF::iterator itr;
  CMDIFrame *pFrame;

  for(itr = m_mapWindowFile.begin();
    _IteratorOK(itr);
    ++itr)
  {
    pFrame = itr->first;
    if(pFrame->GetType() == CMDIFrame::FRAME_RUN)
    {
      CFrameRunAnalysis *pFrameRun = (CFrameRunAnalysis *)(pFrame);
      if(!pFrameRun->CheckIsDone())
      {
        nRtn++;
      }
    }
  }
  return nRtn;
}
Beispiel #4
0
bool CMDIfileManager::CloseAll()
{
  size_t nSize = m_mapWindowFile.size();
  int nRunning = nSize ? RunningFrameCount() : 0;
  bool bRtn = !nRunning;
  if(nSize && bRtn)
  {
    CMDI_WF::iterator itr;
    CMDIFrame *pf;

    //  copy all frame pointers because m_mapWindowFile
    //  will change each time a window is closed

    vector<CMDIFrame *> vpFrame;
    vpFrame.reserve(nSize);

    for(itr = m_mapWindowFile.begin();
      bRtn && _IteratorOK(itr);
      ++itr)
    {
      vpFrame.push_back(itr->first);
    }

    for(vector<CMDIFrame *>::iterator itrv = vpFrame.begin();
      itrv != vpFrame.end();
      ++itrv)
    {
      pf = *itrv;
      if(!pf->Close(false))
      {
        bRtn = false;
      }
    }
  }
  return bRtn;
}