Exemplo n.º 1
0
bool CDirList::Traverse(
  const wxString &sDirInput, 
  const wxString &sDirOutput,
  int nFileType)
{
  INITMAP();
  Cleanup();
  if(!nFileType)
  {
    nFileType = FILE_ANY;
  }
  m_nFileType = nFileType;
  if(!wxDir::Exists(sDirInput)) //wxFileName::Mkdir(sDirInput,0755,wxPATH_MKDIR_FULL))
  {
    m_nStatus = DIRLIST_INPUT_NOT_EXIST;
  }
  else if(!wxFileName::Mkdir(sDirOutput,0755,wxPATH_MKDIR_FULL))
  {
    m_nStatus = DIRLIST_OUTPUT_NOT_EXIST;
  }
  else
  {
    wxFileName fnIn(sDirInput);
    wxFileName fnOut(sDirOutput);
    m_sDirInput = fnIn.GetFullPath();
    m_sDirOutput = fnOut.GetFullPath();
    m_sDirSave.Empty();
    m_sDirLoad.Empty();

    // for each input file, remove base input and last dir
    // append to output dir
    nwxFileUtil::EndWithSeparator(&m_sDirOutput);
    nwxFileUtil::NoEndWithSeparator(&m_sDirInput);
    m_sDirInputBase = fnIn.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
    nwxFileUtil::EndWithSeparator(&m_sDirInputBase);
    if(m_parmOsiris.GetTimeStampSubDir())
    {
      CreateFileName(true);
    }
    else
    {
      ClearTimeStamp();
    }
    wxDir dirIn(sDirInput);
    OnDir(sDirInput);
    dirIn.Traverse(*this,wxEmptyString,wxDIR_DIRS);
    m_nStatus = m_vpDir->empty() ? DIRLIST_EMPTY : DIRLIST_OK;
    m_setDirs.clear();
  }
  return IsOK();
};
Exemplo n.º 2
0
void OnCommand(HWND hWnd,WPARAM wParam){
	switch(LOWORD(wParam)){
	case 1001:
		if(HIWORD(wParam) == CBN_SELCHANGE){
			HWND hSimple = GetDlgItem(hWnd,1001);
			HWND hDropDown = GetDlgItem(hWnd,1002);
			HWND hDropList = GetDlgItem(hWnd,1003);
			LRESULT nRet = SendMessage(hSimple,CB_GETCURSEL,0,0);
			SendMessage(hDropDown,CB_SETCURSEL,nRet,0);
			SendMessage(hDropList,CB_SETCURSEL,nRet,0);
		}
		else if(HIWORD(wParam) == CBN_EDITCHANGE ){
			MessageBox(hWnd,"Keyboard Input changes","Info",MB_OK);
		}
		break;
	case ID_DATA:
		OnData(hWnd);
		break;
	case ID_DIR:
		OnDir(hWnd);
		break;
	case ID_TEXT:
		OnText(hWnd);
		break;
	case ID_FIND:
		OnFind(hWnd);
		break;
	case ID_ADD:
		OnAdd(hWnd);
		break;
	case ID_CLEAN:
		OnClean(hWnd);
		break;
	case ID_DELETE:
		OnDelete(hWnd);
		break;
	}
}