You can subscribe to this list here.
| 2005 |
Jan
(98) |
Feb
(101) |
Mar
(60) |
Apr
(38) |
May
(26) |
Jun
|
Jul
|
Aug
(159) |
Sep
(78) |
Oct
(31) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(6) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Emilien K. <cur...@us...> - 2005-08-17 16:33:25
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src/unix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28502/src/unix Modified Files: FileSystemStandard.cpp Log Message: Use of wxInput/OutputStream instead of Archive to serialize documents and projects. Index: FileSystemStandard.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/unix/FileSystemStandard.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileSystemStandard.cpp 16 Mar 2005 14:27:38 -0000 1.2 --- FileSystemStandard.cpp 17 Aug 2005 16:33:18 -0000 1.3 *************** *** 41,48 **** } - Archive* FileSystemStandardUnix::GetFileArchive(FilePath strPath, unsigned int nMode) - { - return new ArchiveFile(strPath.GetFilePath(), (Archive::ARCHIVE_OPEN_MODE)nMode); - } wxString FileSystemStandardUnix::FindFirst(FilePath strPath, int iFlags) --- 41,44 ---- |
|
From: Emilien K. <cur...@us...> - 2005-08-17 15:01:15
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4385/src Modified Files: FileSystemListCtrl.cpp FileSystem.cpp FileSystemTreeCtrl.cpp FileSystemCtrl.cpp Log Message: Make all FileSystem controls using FileDescription for manipulating files. Make FileSystemDialog use the default wxBookCtrl instead of wxListbook beacause wxListbook looks buggy on linux. Index: FileSystemTreeCtrl.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/FileSystemTreeCtrl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileSystemTreeCtrl.cpp 13 Aug 2005 16:27:34 -0000 1.1 --- FileSystemTreeCtrl.cpp 17 Aug 2005 15:01:06 -0000 1.2 *************** *** 26,58 **** using namespace wxDevCenter; ! ////////////////////////////////////////////////////////////////////// ! // ! // FileSystemTreeItemData ! // ! ////////////////////////////////////////////////////////////////////// ! FileSystemTreeItemData::FileSystemTreeItemData(wxString &Path, int iType, int iState): ! wxTreeItemData(), ! m_strPath(Path), ! m_iType(iType), ! m_iState(iState) ! { ! } ! ! wxString FileSystemTreeItemData::GetPath()const ! { ! return m_strPath; ! } ! ! int FileSystemTreeItemData::GetType()const ! { ! return m_iType; ! } ! ! int FileSystemTreeItemData::GetState()const ! { ! return m_iState; ! } ! ! --- 26,30 ---- using namespace wxDevCenter; ! #define WXDC_FSTC_EXPAND_MARKER wxT("...") *************** *** 70,84 **** ! FileSystemTreeCtrl::FileSystemTreeCtrl(wxWindow* parent, wxWindowID id, ! wxDevCenter::FileSystem *pFileSystem, ! const wxPoint& pos, const wxSize& size, long style): wxTreeCtrl(parent, id, pos, size, style), ! m_pFileSystem(pFileSystem), m_nMode(WXDC_FSTC_MODE_NORMAL), m_strRootPath() { - if((m_pFileSystem!=NULL)&&(style&WXDC_FSTC_PROCESS_EVENT)!=0) - PushEventHandler(m_pFileSystem); - SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_TREE_ICON_SIZE)); } --- 42,51 ---- ! FileSystemTreeCtrl::FileSystemTreeCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style): wxTreeCtrl(parent, id, pos, size, style), ! m_pFileSystem(NULL), m_nMode(WXDC_FSTC_MODE_NORMAL), m_strRootPath() { } *************** *** 103,107 **** } ! void FileSystemTreeCtrl::Open(FilePath strRootPath, unsigned int nMode) { --- 70,74 ---- } ! // Ouvre l'arbre en précisant une racine autre que la base du système de fichiers. void FileSystemTreeCtrl::Open(FilePath strRootPath, unsigned int nMode) { *************** *** 115,120 **** m_strRootPath = strRootPath; m_nMode = nMode; ! SetItemData(Id, new FileSystemTreeItemData( m_strRootPath , CalcItemType(m_strRootPath))); ! AppendItem(Id, "..."); Expand(GetRootItem()); --- 82,87 ---- m_strRootPath = strRootPath; m_nMode = nMode; ! SetItemData(Id, new FileSystemTreeItemData(m_pFileSystem->GetFileDescription(m_strRootPath))); ! AppendItem(Id, WXDC_FSTC_EXPAND_MARKER); Expand(GetRootItem()); *************** *** 125,145 **** } ! void FileSystemTreeCtrl::OpenRoot(unsigned int nMode) { ! wxTreeItemId Id; ! m_nMode = nMode; ! DeleteAllItems(); ! m_strRootPath = m_pFileSystem->GetRootPath(); ! FileSystemTreeItemData *pItemData = new FileSystemTreeItemData(m_strRootPath, CalcItemType(FilePath(m_strRootPath))); ! Id = AddRoot(m_pFileSystem->GetRoot(), pItemData->GetType(), -1, pItemData); ! AppendItem(Id, "..."); ! Expand(GetRootItem()); ! SelectItem(GetRootItem()); } // Etend l'arbre pour afficher le fichier/répertoire demandé. wxTreeItemId FileSystemTreeCtrl::ExpandTo(FilePath strPath) --- 92,142 ---- } + // Interception de l'évènement de déroulement d'une branche. + void FileSystemTreeCtrl::OnTreeItemExpanding(wxTreeEvent &event) + { + RefreshContent(event.GetItem()); + event.Skip(); + } ! // Rafraichi le contenu d'un répertoire. ! void FileSystemTreeCtrl::RefreshContent(wxTreeItemId idItem) { ! FileSystemTreeItemData *pItemData; ! wxTreeItemId NewId; ! wxString FP; ! wxString str; ! ! DeleteChildren(idItem); ! // Insertion des répertoires ! if(m_nMode&WXDC_FSTC_MODE_DIR) ! { ! str = ((FileSystemTreeItemData*)GetItemData(idItem))->GetFilePath(); ! FP = m_pFileSystem->FindFirst( str, wxDIR_DIRS); ! while(FP!="") ! { ! pItemData = new FileSystemTreeItemData(m_pFileSystem->GetCurrentFileDescription()); ! NewId = AppendItem(idItem, FP, pItemData->GetType(), -1, pItemData); ! AppendItem(NewId, WXDC_FSTC_EXPAND_MARKER); ! FP = m_pFileSystem->FindNext(); ! } ! } ! // Insertion des fichiers ! if(m_nMode&WXDC_FSTC_MODE_FILE) ! { ! str = ((FileSystemTreeItemData*)GetItemData(idItem))->GetFilePath(); ! FP = m_pFileSystem->FindFirst( str, wxDIR_FILES); ! while(FP!="") ! { ! pItemData = new FileSystemTreeItemData(m_pFileSystem->GetCurrentFileDescription()); ! NewId = AppendItem(idItem, FP, pItemData->GetType(), -1, pItemData); ! FP = m_pFileSystem->FindNext(); ! } ! } } + // Etend l'arbre pour afficher le fichier/répertoire demandé. wxTreeItemId FileSystemTreeCtrl::ExpandTo(FilePath strPath) *************** *** 164,168 **** while(idChild.IsOk()) { ! FilePath strChildPath = ((FileSystemTreeItemData*) GetItemData(idChild))->GetPath(); if(strPath.StartsWith(strChildPath)) { --- 161,165 ---- while(idChild.IsOk()) { ! FilePath strChildPath = ((FileSystemTreeItemData*) GetItemData(idChild))->GetFilePath(); if(strPath.StartsWith(strChildPath)) { *************** *** 179,188 **** - void FileSystemTreeCtrl::OnTreeItemExpanding(wxTreeEvent &event) - { - RefreshContent(event.GetItem()); - event.Skip(); - } - // Retourne le type associé au chemin spécifié. // Le type retourné est le type étendu (cad type de répertoire pris en compte) --- 176,179 ---- *************** *** 219,264 **** void FileSystemTreeCtrl::OnGetTooltip(wxTreeEvent& event) { ! event.SetToolTip( ((FileSystemTreeItemData*)GetItemData(event.GetItem()))->GetPath() ); } ! // Rafraichi le contenu d'un répertoire. ! void FileSystemTreeCtrl::RefreshContent(wxTreeItemId idItem) { ! FileSystemTreeItemData *pItemData; ! wxTreeItemId NewId; ! wxString FP; ! wxString str; ! DeleteChildren(idItem); - // Insertion des répertoires - if(m_nMode&WXDC_FSTC_MODE_DIR) - { - str = ((FileSystemTreeItemData*)GetItemData(idItem))->GetPath(); - FP = m_pFileSystem->FindFirst( str, wxDIR_DIRS); - while(FP!="") - { - str = m_pFileSystem->GetCurrentFilePath(); - pItemData = new FileSystemTreeItemData(str, CalcItemType(str)); - NewId = AppendItem(idItem, FP, pItemData->GetType(), -1, pItemData); - AppendItem(NewId, "..."); - FP = m_pFileSystem->FindNext(); - } - } - // Insertion des fichiers - if(m_nMode&WXDC_FSTC_MODE_FILE) - { - str = ((FileSystemTreeItemData*)GetItemData(idItem))->GetPath(); - FP = m_pFileSystem->FindFirst( str, wxDIR_FILES); - while(FP!="") - { - str = m_pFileSystem->GetCurrentFilePath(); - pItemData = new FileSystemTreeItemData(str, CalcItemType(str)); - NewId = AppendItem(idItem, FP, pItemData->GetType(), -1, pItemData); - FP = m_pFileSystem->FindNext(); - } - } - } --- 210,246 ---- void FileSystemTreeCtrl::OnGetTooltip(wxTreeEvent& event) { ! event.SetToolTip( ((FileSystemTreeItemData*)GetItemData(event.GetItem()))->GetFilePath() ); } ! ! ! ////////////////////////////////////////////////////////////////////// ! // Barre de travail des systèmes de fichiers automontés. ! ////////////////////////////////////////////////////////////////////// ! ! IMPLEMENT_DYNAMIC_CLASS(FileSystemTreeWorkBar, WorkBar); ! ! // Fonction de création effective de la fenetre. ! bool FileSystemTreeWorkBar::Create(wxWindow* parent) { ! if(m_pExtraObject==NULL) ! return false; ! if(!m_pExtraObject->IsKindOf(CLASSINFO(FileSystem))) ! return false; ! if(!WorkBar::Create(parent)) ! return false; ! ! m_pFSTreeCtrl = new FileSystemTreeCtrl(this, -1, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_ROW_LINES|wxTR_FULL_ROW_HIGHLIGHT|wxTR_ROW_LINES|wxTR_SINGLE|WXDC_FSTC_PROCESS_EVENT); ! wxBoxSizer* pSizer = new wxBoxSizer(wxVERTICAL); ! pSizer->Add(m_pFSTreeCtrl, 1, wxGROW); ! SetSizer(pSizer); ! m_pFSTreeCtrl->SetFileSystem((FileSystem*)m_pExtraObject); ! m_pFSTreeCtrl->OpenRoot(); ! return true; ! } ! Index: FileSystemListCtrl.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/FileSystemListCtrl.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileSystemListCtrl.cpp 13 Aug 2005 16:27:34 -0000 1.1 --- FileSystemListCtrl.cpp 17 Aug 2005 15:01:06 -0000 1.2 *************** *** 38,51 **** // Constructeur. ! FileSystemListCtrl::FileSystemListCtrl(wxWindow* parent, wxWindowID id, FileSystem *pFileSystem, const wxPoint& pos, const wxSize& size, long style): wxListCtrl(parent, id, pos, size, style), ! m_pFileSystem(pFileSystem), m_nMode(WXDC_FSLC_MODE_NORMAL), m_strPath(), m_strWild("*.*") { - SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_LIST_BIG_ICON_SIZE), wxIMAGE_LIST_NORMAL); - SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_LIST_LITTLE_ICON_SIZE), wxIMAGE_LIST_SMALL); - OpenRoot(); } --- 38,48 ---- // Constructeur. ! FileSystemListCtrl::FileSystemListCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style): wxListCtrl(parent, id, pos, size, style), ! m_pFileSystem(NULL), m_nMode(WXDC_FSLC_MODE_NORMAL), m_strPath(), m_strWild("*.*") { } *************** *** 64,94 **** } - // Supprime tous les éléments de la liste. - bool FileSystemListCtrl::DeleteAllItems() - { - long item =-1; - for(;;) - { - item = GetNextItem(item); - if(item==-1) - break; - delete (wxString*) GetItemData(item); - } - return wxListCtrl::DeleteAllItems(); - } ! // Met à jour la liste. ! void FileSystemListCtrl::UpdateList() { ! DeleteAllItems(); ! ! wxString str = m_pFileSystem->FindFirst(m_strPath, m_nMode&0x0003); ! long item = 0; while(!str.IsEmpty()) { ! FilePath strFilePath = m_pFileSystem->GetCurrentFilePath(); ! ! if(!m_pFileSystem->IsDirectory(strFilePath)) ! if(!FileSystem::TestWildcard(strFilePath, m_strWild)) { str = m_pFileSystem->FindNext(); --- 61,79 ---- } ! // Parcours un répertoire et met en cache son contenu. ! void FileSystemListCtrl::DoCacheDirectory(FilePath strPath, wxString strWild, unsigned int nMode) { ! // Efface le cache. ! m_mapFiles.clear(); ! ! // Parcours le répertoire ! wxString str = m_pFileSystem->FindFirst(strPath, nMode&0x0003); while(!str.IsEmpty()) { ! FileDescription FD = m_pFileSystem->GetCurrentFileDescription(); ! ! if(!FD.IsDirectory()) ! if(!FileSystem::TestWildcard(str, strWild)) { str = m_pFileSystem->FindNext(); *************** *** 96,103 **** } ! item = InsertItem(item+1, str, CalcItemType(strFilePath)); ! SetItemData(item, (long)(void*)new wxString(strFilePath)); ! ! //SetItem(item, 1, strFilePath); str = m_pFileSystem->FindNext(); } --- 81,85 ---- } ! m_mapFiles[str] = FD; str = m_pFileSystem->FindNext(); } *************** *** 105,108 **** --- 87,146 ---- + + + // Compare deux items. + int FileSystemListCtrl::CompareItems(FileDescription* pItem1, FileDescription* pItem2) + { + if((pItem1==NULL)||(pItem2==NULL)) + return 0; + + if(pItem1->IsDirectory() && !pItem2->IsDirectory()) + return -1; + if(!pItem1->IsDirectory() && pItem2->IsDirectory()) + return 1; + + return pItem1->GetFilePath().GetFileName().CmpNoCase(pItem2->GetFilePath().GetFileName()); + } + + int wxCALLBACK CompareTwoListItems(long item1, long item2, long sortData) + { + FileSystemListCtrl* pFSListCtrl = wxDynamicCast((FileSystemListCtrl*)sortData, FileSystemListCtrl); + if(pFSListCtrl) + return pFSListCtrl->CompareItems((FileDescription*)item1, (FileDescription*)item2); + else + return 0; + } + + + // Met à jour la liste pour correspondre à la cache. + void FileSystemListCtrl::UpdateListView() + { + // Vide la vue. + DeleteAllItems(); + + // Pour chaque item de la cache, l'insérer. + long lNum = 0; + FileDescriptionMap::iterator it; + for( it = m_mapFiles.begin(); it != m_mapFiles.end(); ++it ) + { + const FileDescription* pFD = &it->second; + long lItem = InsertItem(lNum++, it->first, pFD->GetType()); + SetItemData(lItem, (long)pFD); + } + + // Tri par ordre alphabetique. + SortItems((wxListCtrlCompare)CompareTwoListItems, (long)this); + } + + + + // Met à jour la liste. + void FileSystemListCtrl::UpdateList() + { + DoCacheDirectory(m_strPath, m_strWild, m_nMode); + UpdateListView(); + } + + // Ouvre la liste dans un répertoire spécifique. void FileSystemListCtrl::Open(FilePath strPath, wxString strWild, unsigned int nMode) *************** *** 164,171 **** if (item==-1) break; ! FilePath path = wxString(*((wxString*)GetItemData(item))); ! if(!m_pFileSystem->IsDirectory(path)) { ! files.Add(path); } } --- 202,210 ---- if (item==-1) break; ! FileDescription* pFD = ((FileDescription*)GetItemData(item)); ! if(pFD!=NULL) { ! if(!pFD->IsDirectory()) ! files.Add(pFD->GetFilePath()); } } *************** *** 184,192 **** { file = files[0]; ! strList = file.GetFileName(); for(unsigned int n=1; n<files.GetCount(); n++) { ! file = files[n]; ! strList += ";" + file.GetFileName(); } } --- 223,230 ---- { file = files[0]; ! strList = file; for(unsigned int n=1; n<files.GetCount(); n++) { ! strList += wxT(";") + files[n]; } } Index: FileSystem.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/FileSystem.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** FileSystem.cpp 2 Aug 2005 12:50:54 -0000 1.6 --- FileSystem.cpp 17 Aug 2005 15:01:06 -0000 1.7 *************** *** 32,35 **** --- 32,41 ---- using namespace wxDevCenter; + ////////////////////////////////////////////////////////////////////// + // Descripteur de fichier + ////////////////////////////////////////////////////////////////////// + + IMPLEMENT_CLASS(FileDescription, wxObject) + *************** *** 67,70 **** --- 73,93 ---- } + // Retourne un descripteur du fichier courant. + FileDescription FileSystem::GetCurrentFileDescription() + { + return GetFileDescription(GetCurrentFilePath()); + } + + // Retorune le descripteur du répertoire racine du système de fichiers. + FileDescription FileSystem::GetRootDescription() + { + return GetFileDescription(GetRootPath()); + } + + // Retorune le descripteur d'un fichier. + FileDescription FileSystem::GetFileDescription(FilePath strPath) + { + return FileDescription(strPath, IsDirectory(strPath), GetFileType(strPath)); + } *************** *** 82,86 **** { FileSystemTreeItemData* pItemData = (FileSystemTreeItemData*)pTree->GetItemData(event.GetItem()); ! FilePath str = pItemData->GetPath(); if(!pTree->GetFileSystem()->IsDirectory(str)) Application::GetApp().OpenDocument(str); --- 105,109 ---- { FileSystemTreeItemData* pItemData = (FileSystemTreeItemData*)pTree->GetItemData(event.GetItem()); ! FilePath str = pItemData->GetFilePath(); if(!pTree->GetFileSystem()->IsDirectory(str)) Application::GetApp().OpenDocument(str); *************** *** 98,102 **** { FileSystemTreeItemData* pItemData = (FileSystemTreeItemData*) pTree->GetItemData(event.GetItem()); ! FilePath str = pItemData->GetPath(); if(!pTree->GetFileSystem()->IsDirectory(str)) { --- 121,125 ---- { FileSystemTreeItemData* pItemData = (FileSystemTreeItemData*) pTree->GetItemData(event.GetItem()); ! FilePath str = pItemData->GetFilePath(); if(!pTree->GetFileSystem()->IsDirectory(str)) { *************** *** 281,306 **** - ////////////////////////////////////////////////////////////////////// - // Barre de travail des systèmes de fichiers automontés. - ////////////////////////////////////////////////////////////////////// - - IMPLEMENT_DYNAMIC_CLASS(FileSystemTreeWorkBar, WorkBar); - - // Fonction de création effective de la fenetre. - bool FileSystemTreeWorkBar::Create(wxWindow* parent) - { - if(m_pExtraObject==NULL) - return false; - if(!m_pExtraObject->IsKindOf(CLASSINFO(FileSystem))) - return false; - if(!WorkBar::Create(parent)) - return false; - - m_pFSTreeCtrl = new FileSystemTreeCtrl(this, -1, (FileSystem*)m_pExtraObject, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS|wxTR_ROW_LINES|wxTR_FULL_ROW_HIGHLIGHT|wxTR_ROW_LINES|wxTR_SINGLE|WXDC_FSTC_PROCESS_EVENT); - wxBoxSizer* pSizer = new wxBoxSizer(wxVERTICAL); - pSizer->Add(m_pFSTreeCtrl, 1, wxGROW); - SetSizer(pSizer); - m_pFSTreeCtrl->OpenRoot(); - return true; - } - --- 304,305 ---- Index: FileSystemCtrl.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/FileSystemCtrl.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** FileSystemCtrl.cpp 13 Aug 2005 16:27:34 -0000 1.10 --- FileSystemCtrl.cpp 17 Aug 2005 15:01:06 -0000 1.11 *************** *** 53,77 **** // Constructeur. ! FileSystemPanel::FileSystemPanel(wxWindow* parent, wxWindowID id, FileSystem* pFileSystem, wxString strWild): wxPanel(parent, id), m_pFileSystem(pFileSystem), m_pSplitter(NULL), m_pTree(NULL), ! m_pList(NULL) { m_pSplitter = new wxSplitterWindow(this, -1); ! m_pTree = new FileSystemTreeCtrl(m_pSplitter, ID_TREE, m_pFileSystem); ! m_pList = new FileSystemListCtrl(m_pSplitter, ID_LIST, m_pFileSystem); - m_pSplitter->SplitVertically(m_pTree, m_pList, 128); - m_pSplitter->SetMinimumPaneSize(64); ! m_pTree->OpenRoot(WXDC_FSTC_MODE_DIR); ! m_pList->OpenRoot(strWild, WXDC_FSLC_MODE_FILE|WXDC_FSLC_MODE_DIR); wxSizer *pGlobalSizer = new wxBoxSizer(wxVERTICAL); pGlobalSizer->Add(m_pSplitter, 1, wxGROW); SetSizer(pGlobalSizer); } --- 53,81 ---- // Constructeur. ! FileSystemPanel::FileSystemPanel(wxWindow* parent, wxWindowID id, FileSystem* pFileSystem): wxPanel(parent, id), m_pFileSystem(pFileSystem), m_pSplitter(NULL), m_pTree(NULL), ! m_pList(NULL), ! m_strCurrentPath(wxT("")), ! m_strWildcard(wxT("")) { m_pSplitter = new wxSplitterWindow(this, -1); ! m_pTree = new FileSystemTreeCtrl(m_pSplitter, ID_TREE); ! m_pList = new FileSystemListCtrl(m_pSplitter, ID_LIST); ! m_pTree->SetFileSystem(m_pFileSystem); ! m_pList->SetFileSystem(m_pFileSystem); ! m_pSplitter->SplitVertically(m_pTree, m_pList, 0); ! m_pSplitter->SetMinimumPaneSize(64); wxSizer *pGlobalSizer = new wxBoxSizer(wxVERTICAL); pGlobalSizer->Add(m_pSplitter, 1, wxGROW); SetSizer(pGlobalSizer); + + OpenRootDirectory(); } *************** *** 82,87 **** // Ouvre un répertoire et affiche son contenu. ! bool FileSystemPanel::OpenDirectory(FilePath strDir) { wxTreeItemId item = m_pTree->ExpandTo(strDir); if(item.IsOk()) --- 86,94 ---- // Ouvre un répertoire et affiche son contenu. ! bool FileSystemPanel::OpenDirectory(FilePath strDir, wxString strWild) { + m_strCurrentPath = strDir; + m_strWildcard = strWild; + wxTreeItemId item = m_pTree->ExpandTo(strDir); if(item.IsOk()) *************** *** 89,102 **** m_pTree->Expand(item); m_pTree->SelectItem(item); ! m_pList->ReOpen(strDir); } return true; } // Demande le répertoire actuellement ouvert. wxString FileSystemPanel::GetCurrentDirectory() { ! FileSystemTreeItemData *pData = (FileSystemTreeItemData *)m_pTree->GetItemData(m_pTree->GetSelection()); ! return pData!=NULL?pData->GetPath():""; } --- 96,120 ---- m_pTree->Expand(item); m_pTree->SelectItem(item); ! m_pList->Open(strDir, strWild, WXDC_FSLC_MODE_FILE|WXDC_FSLC_MODE_DIR); } return true; } + // Ouvre le répertoire racine du système de fichier. + bool FileSystemPanel::OpenRootDirectory(wxString strWild) + { + m_strCurrentPath = m_pFileSystem->GetRootPath(); + m_strWildcard = strWild; + m_pTree->OpenRoot(WXDC_FSTC_MODE_DIR); + m_pList->OpenRoot(strWild, WXDC_FSLC_MODE_FILE|WXDC_FSLC_MODE_DIR); + return true; + } + + + // Demande le répertoire actuellement ouvert. wxString FileSystemPanel::GetCurrentDirectory() { ! return m_strCurrentPath; } *************** *** 117,121 **** wxString FileSystemPanel::GetSelectedFiles() { ! return m_pList!=NULL?m_pList->GetSelectedFiles():""; } --- 135,139 ---- wxString FileSystemPanel::GetSelectedFiles() { ! return m_pList!=NULL?m_pList->GetSelectedFiles():wxT(""); } *************** *** 139,149 **** { long lItem = m_pList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); ! FilePath str = *((wxString*) m_pList->GetItemData(lItem)); ! if(m_pFileSystem->IsDirectory(str)) { ! OpenDirectory(str); } ! else ! event.Skip(); } --- 157,170 ---- { long lItem = m_pList->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); ! FileDescription* pFD = (FileDescription*)m_pList->GetItemData(lItem); ! if(pFD!=NULL) { ! if(pFD->IsDirectory()) ! { ! OpenDirectory(pFD->GetFilePath()); ! return; ! } } ! event.Skip(); } *************** *** 152,156 **** { FileSystemTreeItemData *pData = (FileSystemTreeItemData *)m_pTree->GetItemData(event.GetItem()); ! wxString str = pData->GetPath(); m_pList->ReOpen(str); event.Skip(); --- 173,177 ---- { FileSystemTreeItemData *pData = (FileSystemTreeItemData *)m_pTree->GetItemData(event.GetItem()); ! wxString str = pData->GetFilePath(); m_pList->ReOpen(str); event.Skip(); *************** *** 191,196 **** /** Panneau de navigation.*/ ! m_pListbook = new wxListbook(this, -1); ! pGlobalSizer->Add(m_pListbook, 1, wxGROW|wxALL, 4); wxSizer* pBottomSizer = new wxBoxSizer(wxHORIZONTAL); --- 212,217 ---- /** Panneau de navigation.*/ ! m_pBook = new WXDC_CLASSBOOK(this, -1); ! pGlobalSizer->Add(m_pBook, 1, wxGROW|wxALL, 4); wxSizer* pBottomSizer = new wxBoxSizer(wxHORIZONTAL); *************** *** 227,231 **** /** Liste d'image.*/ m_pImageList = new wxImageList(48, 48); ! m_pListbook->SetImageList(m_pImageList); /** Fin de l'initialisation.*/ --- 248,252 ---- /** Liste d'image.*/ m_pImageList = new wxImageList(48, 48); ! m_pBook->SetImageList(m_pImageList); /** Fin de l'initialisation.*/ *************** *** 252,257 **** FileSystemPanel* pPanel = NULL; ! if(m_pListbook->GetSelection()!=wxNOT_FOUND) ! pPanel = (FileSystemPanel*) m_pListbook->GetPage(m_pListbook->GetSelection()); if(pPanel!=NULL) --- 273,278 ---- FileSystemPanel* pPanel = NULL; ! if(m_pBook->GetSelection()!=wxNOT_FOUND) ! pPanel = (FileSystemPanel*) m_pBook->GetPage(m_pBook->GetSelection()); if(pPanel!=NULL) *************** *** 263,272 **** { wxString strProtocol = strPath.GetFileProtocol(); ! for(unsigned int n=0; n<m_pListbook->GetPageCount(); n++) { ! FileSystemPanel* pPanel = (FileSystemPanel*) m_pListbook->GetPage(n); if(pPanel->GetProtocol()==strProtocol) { ! m_pListbook->SetSelection(n); pPanel->OpenDirectory(strPath); break; --- 284,293 ---- { wxString strProtocol = strPath.GetFileProtocol(); ! for(unsigned int n=0; n<m_pBook->GetPageCount(); n++) { ! FileSystemPanel* pPanel = (FileSystemPanel*) m_pBook->GetPage(n); if(pPanel->GetProtocol()==strProtocol) { ! m_pBook->SetSelection(n); pPanel->OpenDirectory(strPath); break; *************** *** 276,284 **** // Ajoute un système de fichiers à la liste des systèmes de fichiers attachés. ! void FileSystemDialog::AttachFileSystem(FileSystem *pFileSystem, wxString strTitle, wxBitmap& bmp) { ! FileSystemPanel *pPanel = new FileSystemPanel(m_pListbook, -1, pFileSystem); ! m_pImageList->Add(bmp); ! m_pListbook->AddPage(pPanel, strTitle, true, m_pImageList->GetImageCount()-1); } --- 297,305 ---- // Ajoute un système de fichiers à la liste des systèmes de fichiers attachés. ! void FileSystemDialog::AttachFileSystem(FileSystem *pFileSystem) { ! FileSystemPanel *pPanel = new FileSystemPanel(m_pBook, -1, pFileSystem); ! m_pImageList->Add(wxArtProvider::GetBitmap(pFileSystem->GetIconName(), wxART_OTHER, wxSize(48, 48))); ! m_pBook->AddPage(pPanel, pFileSystem->GetFileSystemName(), true, m_pImageList->GetImageCount()-1); } *************** *** 288,294 **** for(unsigned int n=0; n<pFSM->GetCount(); n++) { ! wxBitmap bmp = wxArtProvider::GetBitmap(pFSM->Item(n).GetIconName(), wxART_OTHER, wxSize(16, 16)); ! // wxBitmap bmp = pFSM->Item(n).GetIconBundle().GetIcon(48); ! AttachFileSystem(&(pFSM->Item(n)), pFSM->Item(n).GetFileSystemName(), bmp); } } --- 309,313 ---- for(unsigned int n=0; n<pFSM->GetCount(); n++) { ! AttachFileSystem(&(pFSM->Item(n))); } } *************** *** 320,325 **** { unsigned int n; ! for(n=0; n<m_pListbook->GetPageCount(); n++) ! ((FileSystemPanel*)m_pListbook->GetPage(n))->SetWildcard(strWild); for(n=0; n<m_arWildcard.GetCount(); n++) --- 339,344 ---- { unsigned int n; ! for(n=0; n<m_pBook->GetPageCount(); n++) ! ((FileSystemPanel*)m_pBook->GetPage(n))->SetWildcard(strWild); for(n=0; n<m_arWildcard.GetCount(); n++) *************** *** 331,338 **** FileSystemPanel* FileSystemDialog::GetActualPanel() { ! int i = m_pListbook->GetSelection(); if(i==-1) return NULL; ! return (FileSystemPanel*) m_pListbook->GetPage(i); } --- 350,357 ---- FileSystemPanel* FileSystemDialog::GetActualPanel() { ! int i = m_pBook->GetSelection(); if(i==-1) return NULL; ! return (FileSystemPanel*) m_pBook->GetPage(i); } *************** *** 350,354 **** void FileSystemDialog::GetSelectedFileList(wxArrayString& files) { ! if(m_pListbook->GetPageCount()>0) GetActualPanel()->GetSelectedFilesList(files); if(files.GetCount()==0) --- 369,373 ---- void FileSystemDialog::GetSelectedFileList(wxArrayString& files) { ! if(m_pBook->GetPageCount()>0) GetActualPanel()->GetSelectedFilesList(files); if(files.GetCount()==0) *************** *** 382,387 **** { // Retourne le répertoire demandé ! int iPanelSel = m_pListbook->GetSelection(); ! FileSystemPanel* pPanel = iPanelSel!=-1?(FileSystemPanel*) m_pListbook->GetPage(iPanelSel):NULL; if(pPanel!=NULL) m_strPath = pPanel->GetCurrentDirectory(); --- 401,406 ---- { // Retourne le répertoire demandé ! int iPanelSel = m_pBook->GetSelection(); ! FileSystemPanel* pPanel = iPanelSel!=-1?(FileSystemPanel*) m_pBook->GetPage(iPanelSel):NULL; if(pPanel!=NULL) m_strPath = pPanel->GetCurrentDirectory(); |
|
From: Emilien K. <cur...@us...> - 2005-08-17 15:01:15
|
Update of /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4385/include/wxDevCenter Modified Files: FileSystem.h FileSystemStandard.h FileSystemListCtrl.h FileSystemCtrl.h FileSystemTreeCtrl.h Log Message: Make all FileSystem controls using FileDescription for manipulating files. Make FileSystemDialog use the default wxBookCtrl instead of wxListbook beacause wxListbook looks buggy on linux. Index: FileSystemTreeCtrl.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileSystemTreeCtrl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileSystemTreeCtrl.h 13 Aug 2005 16:27:34 -0000 1.1 --- FileSystemTreeCtrl.h 17 Aug 2005 15:01:06 -0000 1.2 *************** *** 33,51 **** /** Structure permettant de manipuler des fichiers via un FileSystemTreeCtrl.*/ ! class WXDC_DLL_BASE FileSystemTreeItemData : public wxTreeItemData { - friend class wxDevCenter::FileSystem; - protected: - /** Chemin du fichier.*/ - wxString m_strPath; - /** Type de fichier.*/ - int m_iType; - /** Etat du fichier.*/ - int m_iState; public: ! FileSystemTreeItemData(wxString &Path, int iType=0, int iState=0); ! wxString GetPath()const; ! int GetType()const; ! int GetState()const; }; --- 33,40 ---- /** Structure permettant de manipuler des fichiers via un FileSystemTreeCtrl.*/ ! class WXDC_DLL_BASE FileSystemTreeItemData : public wxTreeItemData, public FileDescription { public: ! FileSystemTreeItemData(const FileDescription& FD):wxTreeItemData(), FileDescription(FD){} }; *************** *** 75,80 **** --- 64,85 ---- */ FilePath m_strRootPath; + public: + /** Constructeur. + * Appeler Open ou OpenRoot après sinon, una assertion se déclenchera. + * @param parent Fenetre parente (non NULL). + * @param id Identifiant de filiation. + * @param pos Position. + * @param size Taille. + * @param style Style de l'arbre. + */ + FileSystemTreeCtrl(wxWindow* parent, wxWindowID id, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxTR_HAS_BUTTONS|wxTR_ROW_LINES|wxTR_FULL_ROW_HIGHLIGHT|wxTR_ROW_LINES|wxTR_SINGLE); + /** Destructeur.*/ + virtual ~FileSystemTreeCtrl(); + + /** Ouvre l'arbre en précisant une racine autre que la base du système de fichiers. * @param strRootPath Chemin virtuel de la racine. *************** *** 82,89 **** */ void Open(FilePath strRootPath, unsigned int nMode=WXDC_FSTC_MODE_NORMAL); /** Ouvre l'arbre à la base du système de fichiers. * @param nMode Mode d'ouverture. */ ! void OpenRoot(unsigned int nMode=WXDC_FSTC_MODE_NORMAL); /** Etend l'arbre pour afficher le fichier/répertoire demandé. --- 87,95 ---- */ void Open(FilePath strRootPath, unsigned int nMode=WXDC_FSTC_MODE_NORMAL); + /** Ouvre l'arbre à la base du système de fichiers. * @param nMode Mode d'ouverture. */ ! void OpenRoot(unsigned int nMode=WXDC_FSTC_MODE_NORMAL){Open(m_pFileSystem->GetRootPath(), nMode);} /** Etend l'arbre pour afficher le fichier/répertoire demandé. *************** *** 109,128 **** * @return Id du noeud de l'arbre correspondant au fichier. Invalide si non trouvé.*/ wxTreeItemId FindChild(wxTreeItemId idParent, wxString strFileName); - - /** Constructeur. - * Appeler Open ou OpenRoot après sinon, una assertion se déclenchera. - * @param parent Fenetre parente (non NULL). - * @param id Identifiant de filiation. - * @param pFileSystem Système de fichier. - * @param pos Position. - * @param size Taille. - * @param style Style de l'arbre. - */ - FileSystemTreeCtrl(wxWindow* parent, wxWindowID id, - FileSystem *pFileSystem, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxTR_HAS_BUTTONS|wxTR_ROW_LINES|wxTR_FULL_ROW_HIGHLIGHT|wxTR_ROW_LINES|wxTR_SINGLE ); - /** Destructeur.*/ - virtual ~FileSystemTreeCtrl(); protected: /** Interception de l'évènement de déroulement d'une branche.*/ --- 115,118 ---- *************** *** 145,148 **** --- 135,156 ---- + /** WorkBar spécifique aux FileSystemTreeCtrl. + * Utilisé pour l'automontage de workbar de systèmez de fichiers.*/ + class WXDC_DLL_BASE FileSystemTreeWorkBar : public WorkBar + { + DECLARE_DYNAMIC_CLASS(FileSystemTreeWorkBar); + protected: + /** Arbre du système de fichier.*/ + FileSystemTreeCtrl* m_pFSTreeCtrl; + public: + FileSystemTreeWorkBar(void):WorkBar(){} + virtual ~FileSystemTreeWorkBar(void){} + + /** Fonction de création effective de la fenetre.*/ + virtual bool Create(wxWindow* parent); + }; + + + } #endif /*__WXDEVCENTER_FILESYSTEMTREECTRL*/ Index: FileSystemListCtrl.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileSystemListCtrl.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileSystemListCtrl.h 13 Aug 2005 16:27:34 -0000 1.1 --- FileSystemListCtrl.h 17 Aug 2005 15:01:06 -0000 1.2 *************** *** 25,32 **** #include <wx/listctrl.h> namespace wxDevCenter { - class FileSystem; class DocManager; class FilePath; --- 25,33 ---- #include <wx/listctrl.h> + #include <wxDevCenter/FileSystem.h> + namespace wxDevCenter { class DocManager; class FilePath; *************** *** 58,61 **** --- 59,75 ---- /** Chaine de filtrage des noms de fichiers.*/ wxString m_strWild; + /** Map des descripteurs de fichiers contenus dans la liste.*/ + FileDescriptionMap m_mapFiles; + protected: + /** Parcours un répertoire et met en cache son contenu. + * @param strPath Chemin du répertoire à ouvrir. + * @param strWild Filtrage des noms de fichiers à afficher. + * @param nMode Mode d'ouverture du répertoire. + */ + virtual void DoCacheDirectory(FilePath strPath, wxString strWild = wxT("*.*"), unsigned int nMode=WXDC_FSLC_MODE_NORMAL); + + /** Met à jour la liste pour correspondre à la cache.*/ + virtual void UpdateListView(); + public: /** Constructeur. *************** *** 69,73 **** */ FileSystemListCtrl(wxWindow* parent, wxWindowID id, - FileSystem *pFileSystem, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_ICON|wxLC_ALIGN_TOP|wxLC_AUTOARRANGE); --- 83,86 ---- *************** *** 119,125 **** long CalcItemType(FilePath path); ! /** Supprime tous les éléments de la liste. ! * @return True si OK.*/ ! bool DeleteAllItems(); protected: --- 132,141 ---- long CalcItemType(FilePath path); ! /** Compare deux items. ! * @param pItem1 Descripteur du premier fichier. ! * @param pItem2 Descripteur du second fichier. ! * @return indice de comparaison. ! */ ! static int CompareItems(FileDescription* pItem1, FileDescription* pItem2); protected: Index: FileSystemStandard.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileSystemStandard.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** FileSystemStandard.h 13 Aug 2005 14:07:37 -0000 1.12 --- FileSystemStandard.h 17 Aug 2005 15:01:06 -0000 1.13 *************** *** 63,67 **** virtual wxString GetIconName()const{return wxT("desktop");} ! wxString GetProtocoleName()const{return "file";} bool CreateDirectory(FilePath strDir); bool RemoveDirectory(FilePath strDir); --- 63,67 ---- virtual wxString GetIconName()const{return wxT("desktop");} ! wxString GetProtocoleName()const{return wxT("file");} bool CreateDirectory(FilePath strDir); bool RemoveDirectory(FilePath strDir); Index: FileSystemCtrl.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileSystemCtrl.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FileSystemCtrl.h 13 Aug 2005 16:27:34 -0000 1.9 --- FileSystemCtrl.h 17 Aug 2005 15:01:06 -0000 1.10 *************** *** 33,37 **** --- 33,44 ---- #include <wx/dialog.h> #include <wx/filedlg.h> + + #include <wx/notebook.h> #include <wx/listbook.h> + #include <wx/choicebk.h> + + + #define WXDC_CLASSBOOK wxBookCtrl + #include <wxDevCenter/FileSystemListCtrl.h> *************** *** 67,70 **** --- 74,82 ---- /** Liste des fichiers.*/ FileSystemListCtrl *m_pList; + + /** Répertoire courant.*/ + FilePath m_strCurrentPath; + /** Wildcard courant.*/ + wxString m_strWildcard; public: *************** *** 73,79 **** * @param id Identifiant de filiation. * @param pFileSystem SYsteme de fichiers à attacher. - * @param strWild Filtrage de listage des fichiers. */ ! FileSystemPanel(wxWindow* parent, wxWindowID id, FileSystem* pFileSystem, wxString strWild="*.*"); /** Destructeur.*/ ~FileSystemPanel(); --- 85,90 ---- * @param id Identifiant de filiation. * @param pFileSystem SYsteme de fichiers à attacher. */ ! FileSystemPanel(wxWindow* parent, wxWindowID id, FileSystem* pFileSystem); /** Destructeur.*/ ~FileSystemPanel(); *************** *** 81,87 **** /** Ouvre un répertoire et affiche son contenu. * @param strDir Chemin du répertoire à ouvrir, vide pour le répertoire racine. * @return Vrai si OK. */ ! bool OpenDirectory(FilePath strDir=""); /** Demande le répertoire actuellement ouvert. --- 92,106 ---- /** Ouvre un répertoire et affiche son contenu. * @param strDir Chemin du répertoire à ouvrir, vide pour le répertoire racine. + * @param strWild Wildcard à appliquer. * @return Vrai si OK. */ ! bool OpenDirectory(FilePath strDir=wxT(""), wxString strWild=wxT("*.*")); ! ! /** Ouvre le répertoire racine du système de fichier. ! * @param strWild Wildcard à appliquer. ! * @return Vrai si OK. ! */ ! bool OpenRootDirectory(wxString strWild=wxT("*.*")); ! /** Demande le répertoire actuellement ouvert. *************** *** 130,135 **** DECLARE_EVENT_TABLE() ! /** ListBook.*/ ! wxListbook* m_pListbook; /** Liste d'images des systèmes de fichiers.*/ wxImageList* m_pImageList; --- 149,154 ---- DECLARE_EVENT_TABLE() ! /** Book.*/ ! WXDC_CLASSBOOK* m_pBook; /** Liste d'images des systèmes de fichiers.*/ wxImageList* m_pImageList; *************** *** 180,187 **** /** Ajoute un système de fichiers à la liste des systèmes de fichiers attachés. * @param pFileSystem Nouveau système de fichiers. - * @param strTitle Nom du système de fichier. - * @param bmp Image représentant le système de fichier. */ ! void AttachFileSystem(FileSystem *pFileSystem, wxString strTitle, wxBitmap& bmp); /** Ajoute l'ensemble des systèmes de fichiers enregistrés dans un gestionnaire de systèmes de fichiers. --- 199,204 ---- /** Ajoute un système de fichiers à la liste des systèmes de fichiers attachés. * @param pFileSystem Nouveau système de fichiers. */ ! void AttachFileSystem(FileSystem *pFileSystem); /** Ajoute l'ensemble des systèmes de fichiers enregistrés dans un gestionnaire de systèmes de fichiers. Index: FileSystem.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileSystem.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FileSystem.h 13 Aug 2005 14:07:37 -0000 1.9 --- FileSystem.h 17 Aug 2005 15:01:06 -0000 1.10 *************** *** 43,46 **** --- 43,48 ---- #include <wx/image.h> #include <wx/treectrl.h> + #include <wx/hashmap.h> + *************** *** 104,107 **** --- 106,170 ---- + WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxString, FileDescriptorExtPropMap, class WXDC_DLL_BASE); + + /** Classe des données de description d'un fichier. + */ + class WXDC_DLL_BASE FileDescriptorData : public wxObjectRefData + { + public: + /** Chemin complet du fichier.*/ + FilePath strPath; + /** Flag de répertoire (Vrai si répertoire).*/ + bool bIsDirectory; + /** Identifiant du type de fichier (ou de répertoire).*/ + long lType; + /** Dicctionnaire des propriétés étendues.*/ + FileDescriptorExtPropMap MapExtProperties; + }; + + /** Classe de description d'un fichier. + */ + class WXDC_DLL_BASE FileDescription : public wxObject + { + DECLARE_CLASS(FileDescription); + private: + FileDescriptorData& GetFileDescriptorData(){return (FileDescriptorData&) *GetRefData();} + const FileDescriptorData& GetFileDescriptorData()const{return (const FileDescriptorData&) *GetRefData();} + + public : + FileDescription():wxObject(){SetRefData(new FileDescriptorData);} + FileDescription(const FileDescription& FileDesc):wxObject(FileDesc){} + FileDescription(const FilePath& strPath, bool bIsDirectory, long lType):wxObject() + { + SetRefData(new FileDescriptorData); + SetFilePath(strPath); + SetIsDirectory(bIsDirectory); + SetType(lType); + } + + FileDescription& operator=(const FileDescription& FD){Ref(FD);return *this;} + + void SetFilePath(const FilePath& strPath){GetFileDescriptorData().strPath = strPath;} + void SetIsDirectory(bool bIsDirectory){GetFileDescriptorData().bIsDirectory = bIsDirectory;} + void SetType(long lType){GetFileDescriptorData().lType = lType;} + void SetExtedndedProperty(const wxString& strName, const wxString& strValue){GetFileDescriptorData().MapExtProperties[strName] = strValue;} + + FilePath GetFilePath()const{return GetFileDescriptorData().strPath;} + bool IsDirectory()const{return GetFileDescriptorData().bIsDirectory;} + long GetType()const{return GetFileDescriptorData().lType;} + wxString GetExtendedProperty(const wxString& strName)const + { + FileDescriptorExtPropMap::const_iterator it = GetFileDescriptorData().MapExtProperties.find(strName); + if(it==GetFileDescriptorData().MapExtProperties.end()) + return wxEmptyString; + else + it->second; + } + wxString operator[](const wxString& strName)const{return GetExtendedProperty(strName);} + }; + + WX_DECLARE_STRING_HASH_MAP_WITH_DECL( FileDescription, FileDescriptionMap, class WXDC_DLL_BASE); + + /** Classe abstraite représentant un système de fichier. * Elle autorise la manipulation de fichier et leur ennumération. *************** *** 136,139 **** --- 199,210 ---- * @return Chemin vers la racine.*/ virtual FilePath GetRootPath()const=0; + /** Retorune le descripteur du répertoire racine du système de fichiers. + * @return Descripteur du dossier du répertoire racine. */ + virtual FileDescription GetRootDescription(); + /** Retorune le descripteur d'un fichier. + * @param strPath Chemin du fichier. + * @return Descripteur du fichier. */ + virtual FileDescription GetFileDescription(FilePath strPath); + /** Crée une recherche de fichier/répertoire et retourne le premier rencontré. * @param strPath Chemin des fichiers/répertoires à rechercher. *************** *** 148,151 **** --- 219,225 ---- * @return Chemin du dernier fichier/répertoire.*/ virtual FilePath GetCurrentFilePath()=0; + /** Retourne un descripteur du fichier courant. + * @return Descripteur du fichier courant. */ + virtual FileDescription GetCurrentFileDescription(); /** @} */ *************** *** 215,218 **** --- 289,294 ---- + + /** Gestionnaire de systèmes de fichiers (virtuels). * Fait le lien entre les noms de fichiers, les systèmes de fichiers et les archives. *************** *** 247,270 **** }; - - class FileSystemTreeCtrl; - - /** WorkBar spécifique aux FileSystemTreeCtrl. - * Utilisé pour l'automontage de workbar de systèmez de fichiers.*/ - class WXDC_DLL_BASE FileSystemTreeWorkBar : public WorkBar - { - DECLARE_DYNAMIC_CLASS(FileSystemTreeWorkBar); - protected: - /** Arbre du système de fichier.*/ - FileSystemTreeCtrl* m_pFSTreeCtrl; - public: - FileSystemTreeWorkBar(void):WorkBar(){} - virtual ~FileSystemTreeWorkBar(void){} - - /** Fonction de création effective de la fenetre.*/ - virtual bool Create(wxWindow* parent); - }; - - } // Fin du namespace #endif --- 323,326 ---- |
|
From: Emilien K. <cur...@us...> - 2005-08-17 15:01:14
|
Update of /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/unix In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4385/include/wxDevCenter/unix Modified Files: FileSystemStandard.h Log Message: Make all FileSystem controls using FileDescription for manipulating files. Make FileSystemDialog use the default wxBookCtrl instead of wxListbook beacause wxListbook looks buggy on linux. Index: FileSystemStandard.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/unix/FileSystemStandard.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileSystemStandard.h 26 Jan 2005 16:11:45 -0000 1.1 --- FileSystemStandard.h 17 Aug 2005 15:01:06 -0000 1.2 *************** *** 53,57 **** FileSystemStandardUnix(); wxString GetRoot()const{return wxT("/");} ! FilePath GetRootPath()const{return wxT("file:");} wxString FindFirst(FilePath strPath, int iFlags); wxString FindNext(); --- 53,57 ---- FileSystemStandardUnix(); wxString GetRoot()const{return wxT("/");} ! FilePath GetRootPath()const{return wxT("file:/");} wxString FindFirst(FilePath strPath, int iFlags); wxString FindNext(); |
|
From: Emilien K. <cur...@us...> - 2005-08-13 16:27:43
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4954/src Modified Files: FileSystemCtrl.cpp Added Files: FileSystemListCtrl.cpp FileSystemTreeCtrl.cpp Log Message: Separate FileSystemListCtrl and FileSystemTreeCtrl in two distinct files. --- NEW FILE: FileSystemTreeCtrl.cpp --- /** * @file FileSystemTreeCtrl.cpp * @author Cursor */ // // wxDevCenter // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; only version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. #include <wxDevCenter.h> #include <wxDevCenter/FileSystemTreeCtrl.h> #include <wxDevCenter/FileSystem.h> using namespace wxDevCenter; ////////////////////////////////////////////////////////////////////// // // FileSystemTreeItemData // ////////////////////////////////////////////////////////////////////// FileSystemTreeItemData::FileSystemTreeItemData(wxString &Path, int iType, int iState): wxTreeItemData(), m_strPath(Path), m_iType(iType), m_iState(iState) { } wxString FileSystemTreeItemData::GetPath()const { return m_strPath; } int FileSystemTreeItemData::GetType()const { return m_iType; } int FileSystemTreeItemData::GetState()const { return m_iState; } ////////////////////////////////////////////////////////////////////// // // FileSystemTreeCtrl // ////////////////////////////////////////////////////////////////////// BEGIN_EVENT_TABLE(FileSystemTreeCtrl, wxTreeCtrl) EVT_TREE_ITEM_EXPANDING(wxID_ANY, FileSystemTreeCtrl::OnTreeItemExpanding) EVT_TREE_ITEM_GETTOOLTIP(wxID_ANY, FileSystemTreeCtrl::OnGetTooltip) END_EVENT_TABLE() FileSystemTreeCtrl::FileSystemTreeCtrl(wxWindow* parent, wxWindowID id, wxDevCenter::FileSystem *pFileSystem, const wxPoint& pos, const wxSize& size, long style): wxTreeCtrl(parent, id, pos, size, style), m_pFileSystem(pFileSystem), m_nMode(WXDC_FSTC_MODE_NORMAL), m_strRootPath() { if((m_pFileSystem!=NULL)&&(style&WXDC_FSTC_PROCESS_EVENT)!=0) PushEventHandler(m_pFileSystem); SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_TREE_ICON_SIZE)); } FileSystemTreeCtrl::~FileSystemTreeCtrl() { } // Fixe un nouveau système de fichier. void FileSystemTreeCtrl::SetFileSystem(wxDevCenter::FileSystem *pFileSystem) { DeleteAllItems(); // Retire l'ancien passage des évènements au système de fichier. if((GetWindowStyle()&WXDC_FSTC_PROCESS_EVENT)!=0 && m_pFileSystem!=NULL) PopEventHandler(false); m_pFileSystem = pFileSystem; // Ajoute le nouveau passage des évènements au système de fichier. if((GetWindowStyle()&WXDC_FSTC_PROCESS_EVENT)!=0) PushEventHandler(m_pFileSystem); SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_TREE_ICON_SIZE)); } void FileSystemTreeCtrl::Open(FilePath strRootPath, unsigned int nMode) { wxTreeItemId Id; wxString str; if(m_pFileSystem->IsDirectory(strRootPath)) { DeleteAllItems(); Id = AddRoot(strRootPath.GetFileName()); m_strRootPath = strRootPath; m_nMode = nMode; SetItemData(Id, new FileSystemTreeItemData( m_strRootPath , CalcItemType(m_strRootPath))); AppendItem(Id, "..."); Expand(GetRootItem()); SelectItem(GetRootItem()); } else OpenRoot(nMode); } void FileSystemTreeCtrl::OpenRoot(unsigned int nMode) { wxTreeItemId Id; m_nMode = nMode; DeleteAllItems(); m_strRootPath = m_pFileSystem->GetRootPath(); FileSystemTreeItemData *pItemData = new FileSystemTreeItemData(m_strRootPath, CalcItemType(FilePath(m_strRootPath))); Id = AddRoot(m_pFileSystem->GetRoot(), pItemData->GetType(), -1, pItemData); AppendItem(Id, "..."); Expand(GetRootItem()); SelectItem(GetRootItem()); } // Etend l'arbre pour afficher le fichier/répertoire demandé. wxTreeItemId FileSystemTreeCtrl::ExpandTo(FilePath strPath) { wxTreeItemId idParent, idChild; wxTreeItemIdValue cookie; FilePath strParentPath = strPath; strParentPath.RemoveFilename(); if(strPath == strParentPath) // Répertoire racine { idChild = GetRootItem(); SelectItem(idChild); } else { idParent = ExpandTo(strParentPath); if(idParent.IsOk()) { idChild = GetFirstChild(idParent, cookie); while(idChild.IsOk()) { FilePath strChildPath = ((FileSystemTreeItemData*) GetItemData(idChild))->GetPath(); if(strPath.StartsWith(strChildPath)) { RefreshContent(idChild); SelectItem(idChild); break; } idChild = GetNextChild(idParent, cookie); } } } return idChild; } void FileSystemTreeCtrl::OnTreeItemExpanding(wxTreeEvent &event) { RefreshContent(event.GetItem()); event.Skip(); } // Retourne le type associé au chemin spécifié. // Le type retourné est le type étendu (cad type de répertoire pris en compte) long FileSystemTreeCtrl::CalcItemType(FilePath path) { return m_pFileSystem->GetFileType(path); } // Recherche un fils direct d'un noeud. wxTreeItemId FileSystemTreeCtrl::FindChild(wxTreeItemId idParent, wxString strFileName) { bool bIsExpand = IsExpanded(idParent); if(!bIsExpand) Expand(idParent); wxTreeItemIdValue cookie; wxTreeItemId idChild; idChild = GetFirstChild(idParent, cookie); while(idChild.IsOk()) { if(GetItemText(idChild)==strFileName) break; idChild = GetNextChild(idParent, cookie); } if(!bIsExpand) Collapse(idParent); return idChild; } // Interception de l'évènement de demande de tooltip. void FileSystemTreeCtrl::OnGetTooltip(wxTreeEvent& event) { event.SetToolTip( ((FileSystemTreeItemData*)GetItemData(event.GetItem()))->GetPath() ); } // Rafraichi le contenu d'un répertoire. void FileSystemTreeCtrl::RefreshContent(wxTreeItemId idItem) { FileSystemTreeItemData *pItemData; wxTreeItemId NewId; wxString FP; wxString str; DeleteChildren(idItem); // Insertion des répertoires if(m_nMode&WXDC_FSTC_MODE_DIR) { str = ((FileSystemTreeItemData*)GetItemData(idItem))->GetPath(); FP = m_pFileSystem->FindFirst( str, wxDIR_DIRS); while(FP!="") { str = m_pFileSystem->GetCurrentFilePath(); pItemData = new FileSystemTreeItemData(str, CalcItemType(str)); NewId = AppendItem(idItem, FP, pItemData->GetType(), -1, pItemData); AppendItem(NewId, "..."); FP = m_pFileSystem->FindNext(); } } // Insertion des fichiers if(m_nMode&WXDC_FSTC_MODE_FILE) { str = ((FileSystemTreeItemData*)GetItemData(idItem))->GetPath(); FP = m_pFileSystem->FindFirst( str, wxDIR_FILES); while(FP!="") { str = m_pFileSystem->GetCurrentFilePath(); pItemData = new FileSystemTreeItemData(str, CalcItemType(str)); NewId = AppendItem(idItem, FP, pItemData->GetType(), -1, pItemData); FP = m_pFileSystem->FindNext(); } } } --- NEW FILE: FileSystemListCtrl.cpp --- /** * @file FileSystemListCtrl.cpp * @author Cursor */ // // wxDevCenter // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; only version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. #include <wxDevCenter.h> #include <wxDevCenter/FileSystemListCtrl.h> #include <wxDevCenter/FileSystem.h> using namespace wxDevCenter; ////////////////////////////////////////////////////////////////////// // // FileSystemListCtrl // ////////////////////////////////////////////////////////////////////// BEGIN_EVENT_TABLE(FileSystemListCtrl, wxListCtrl) EVT_LIST_ITEM_ACTIVATED(wxID_ANY, FileSystemListCtrl::OnItemActived) END_EVENT_TABLE() // Constructeur. FileSystemListCtrl::FileSystemListCtrl(wxWindow* parent, wxWindowID id, FileSystem *pFileSystem, const wxPoint& pos, const wxSize& size, long style): wxListCtrl(parent, id, pos, size, style), m_pFileSystem(pFileSystem), m_nMode(WXDC_FSLC_MODE_NORMAL), m_strPath(), m_strWild("*.*") { SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_LIST_BIG_ICON_SIZE), wxIMAGE_LIST_NORMAL); SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_LIST_LITTLE_ICON_SIZE), wxIMAGE_LIST_SMALL); OpenRoot(); } // Destructeur. FileSystemListCtrl::~FileSystemListCtrl() { } // Fixe un nouveau système de fichier. void FileSystemListCtrl::SetFileSystem(FileSystem *pFileSystem) { DeleteAllItems(); m_pFileSystem = pFileSystem; SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_LIST_BIG_ICON_SIZE), wxIMAGE_LIST_NORMAL); SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_LIST_LITTLE_ICON_SIZE), wxIMAGE_LIST_SMALL); } // Supprime tous les éléments de la liste. bool FileSystemListCtrl::DeleteAllItems() { long item =-1; for(;;) { item = GetNextItem(item); if(item==-1) break; delete (wxString*) GetItemData(item); } return wxListCtrl::DeleteAllItems(); } // Met à jour la liste. void FileSystemListCtrl::UpdateList() { DeleteAllItems(); wxString str = m_pFileSystem->FindFirst(m_strPath, m_nMode&0x0003); long item = 0; while(!str.IsEmpty()) { FilePath strFilePath = m_pFileSystem->GetCurrentFilePath(); if(!m_pFileSystem->IsDirectory(strFilePath)) if(!FileSystem::TestWildcard(strFilePath, m_strWild)) { str = m_pFileSystem->FindNext(); continue; } item = InsertItem(item+1, str, CalcItemType(strFilePath)); SetItemData(item, (long)(void*)new wxString(strFilePath)); //SetItem(item, 1, strFilePath); str = m_pFileSystem->FindNext(); } } // Ouvre la liste dans un répertoire spécifique. void FileSystemListCtrl::Open(FilePath strPath, wxString strWild, unsigned int nMode) { wxString str; FilePath strFilePath; m_strWild = strWild; if(m_pFileSystem->IsDirectory(strPath)) { m_strPath = strPath; m_nMode = nMode; UpdateList(); } else OpenRoot(strWild, nMode); } // Ouvre la liste dans le répertoire racine. void FileSystemListCtrl::OpenRoot(wxString strWild, unsigned int nMode) { Open(m_pFileSystem->GetRootPath(), strWild, nMode); } // Fixe la chaine de filtrage de listage des fichier. void FileSystemListCtrl::SetWildcard(wxString strWild) { Open(m_strPath, strWild, m_nMode); } // Calcule le type d'un élément de l'arborescence. long FileSystemListCtrl::CalcItemType(FilePath path) { return m_pFileSystem->GetFileType(path); } // Intercepte les évènements de double-clic et d'entrée. void FileSystemListCtrl::OnItemActived(wxListEvent& event) { if(m_nMode&WXDC_FSLC_MODE_PROCESSCHANGE) { long lItem = event.GetIndex(); FilePath str = *((wxString*) GetItemData(lItem)); if(m_pFileSystem->IsDirectory(str)) ReOpen(str); } event.Skip(); } // Demande le ou les fichiers sélectionnées. void FileSystemListCtrl::GetSelectedFilesList(wxArrayString& files) { long item = -1; for(;;) { item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (item==-1) break; FilePath path = wxString(*((wxString*)GetItemData(item))); if(!m_pFileSystem->IsDirectory(path)) { files.Add(path); } } } // Demande le ou les fichiers sélectionnées. wxString FileSystemListCtrl::GetSelectedFiles() { FilePath file; wxArrayString files; wxString strList; GetSelectedFilesList(files); if(files.GetCount()>0) { file = files[0]; strList = file.GetFileName(); for(unsigned int n=1; n<files.GetCount(); n++) { file = files[n]; strList += ";" + file.GetFileName(); } } return strList; } Index: FileSystemCtrl.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/FileSystemCtrl.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** FileSystemCtrl.cpp 13 Aug 2005 14:07:37 -0000 1.9 --- FileSystemCtrl.cpp 13 Aug 2005 16:27:34 -0000 1.10 *************** *** 35,442 **** using namespace wxDevCenter; - ////////////////////////////////////////////////////////////////////// - // - // FileSystemTreeItemData - // - ////////////////////////////////////////////////////////////////////// - FileSystemTreeItemData::FileSystemTreeItemData(wxString &Path, int iType, int iState): - wxTreeItemData(), - m_strPath(Path), - m_iType(iType), - m_iState(iState) - { - } - - wxString FileSystemTreeItemData::GetPath()const - { - return m_strPath; - } - - int FileSystemTreeItemData::GetType()const - { - return m_iType; - } - - int FileSystemTreeItemData::GetState()const - { - return m_iState; - } - - - - - ////////////////////////////////////////////////////////////////////// - // - // FileSystemTreeCtrl - // - ////////////////////////////////////////////////////////////////////// - - BEGIN_EVENT_TABLE(FileSystemTreeCtrl, wxTreeCtrl) - EVT_TREE_ITEM_EXPANDING(wxID_ANY, FileSystemTreeCtrl::OnTreeItemExpanding) - EVT_TREE_ITEM_GETTOOLTIP(wxID_ANY, FileSystemTreeCtrl::OnGetTooltip) - END_EVENT_TABLE() - - - - FileSystemTreeCtrl::FileSystemTreeCtrl(wxWindow* parent, wxWindowID id, - wxDevCenter::FileSystem *pFileSystem, - const wxPoint& pos, const wxSize& size, long style): - wxTreeCtrl(parent, id, pos, size, style), - m_pFileSystem(pFileSystem), - m_nMode(WXDC_FSTC_MODE_NORMAL), - m_strRootPath() - { - if((m_pFileSystem!=NULL)&&(style&WXDC_FSTC_PROCESS_EVENT)!=0) - PushEventHandler(m_pFileSystem); - SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_TREE_ICON_SIZE)); - } - - - FileSystemTreeCtrl::~FileSystemTreeCtrl() - { - - } - - // Fixe un nouveau système de fichier. - void FileSystemTreeCtrl::SetFileSystem(wxDevCenter::FileSystem *pFileSystem) - { - DeleteAllItems(); - // Retire l'ancien passage des évènements au système de fichier. - if((GetWindowStyle()&WXDC_FSTC_PROCESS_EVENT)!=0 && m_pFileSystem!=NULL) - PopEventHandler(false); - m_pFileSystem = pFileSystem; - // Ajoute le nouveau passage des évènements au système de fichier. - if((GetWindowStyle()&WXDC_FSTC_PROCESS_EVENT)!=0) - PushEventHandler(m_pFileSystem); - SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_TREE_ICON_SIZE)); - } - - - void FileSystemTreeCtrl::Open(FilePath strRootPath, unsigned int nMode) - { - wxTreeItemId Id; - wxString str; - - if(m_pFileSystem->IsDirectory(strRootPath)) - { - DeleteAllItems(); - Id = AddRoot(strRootPath.GetFileName()); - m_strRootPath = strRootPath; - m_nMode = nMode; - SetItemData(Id, new FileSystemTreeItemData( m_strRootPath , CalcItemType(m_strRootPath))); - AppendItem(Id, "..."); - - Expand(GetRootItem()); - SelectItem(GetRootItem()); - } - else - OpenRoot(nMode); - } - - - void FileSystemTreeCtrl::OpenRoot(unsigned int nMode) - { - wxTreeItemId Id; - m_nMode = nMode; - DeleteAllItems(); - - m_strRootPath = m_pFileSystem->GetRootPath(); - FileSystemTreeItemData *pItemData = new FileSystemTreeItemData(m_strRootPath, CalcItemType(FilePath(m_strRootPath))); - Id = AddRoot(m_pFileSystem->GetRoot(), pItemData->GetType(), -1, pItemData); - AppendItem(Id, "..."); - - Expand(GetRootItem()); - SelectItem(GetRootItem()); - } - - - // Etend l'arbre pour afficher le fichier/répertoire demandé. - wxTreeItemId FileSystemTreeCtrl::ExpandTo(FilePath strPath) - { - wxTreeItemId idParent, idChild; - wxTreeItemIdValue cookie; - - FilePath strParentPath = strPath; - strParentPath.RemoveFilename(); - - if(strPath == strParentPath) // Répertoire racine - { - idChild = GetRootItem(); - SelectItem(idChild); - } - else - { - idParent = ExpandTo(strParentPath); - if(idParent.IsOk()) - { - idChild = GetFirstChild(idParent, cookie); - while(idChild.IsOk()) - { - FilePath strChildPath = ((FileSystemTreeItemData*) GetItemData(idChild))->GetPath(); - if(strPath.StartsWith(strChildPath)) - { - RefreshContent(idChild); - SelectItem(idChild); - break; - } - idChild = GetNextChild(idParent, cookie); - } - } - } - return idChild; - } - - void FileSystemTreeCtrl::OnTreeItemExpanding(wxTreeEvent &event) - { - RefreshContent(event.GetItem()); - event.Skip(); - } - - // Retourne le type associé au chemin spécifié. - // Le type retourné est le type étendu (cad type de répertoire pris en compte) - long FileSystemTreeCtrl::CalcItemType(FilePath path) - { - return m_pFileSystem->GetFileType(path); - } - - // Recherche un fils direct d'un noeud. - wxTreeItemId FileSystemTreeCtrl::FindChild(wxTreeItemId idParent, wxString strFileName) - { - bool bIsExpand = IsExpanded(idParent); - if(!bIsExpand) - Expand(idParent); - - wxTreeItemIdValue cookie; - wxTreeItemId idChild; - idChild = GetFirstChild(idParent, cookie); - - while(idChild.IsOk()) - { - if(GetItemText(idChild)==strFileName) - break; - idChild = GetNextChild(idParent, cookie); - } - - if(!bIsExpand) - Collapse(idParent); - - return idChild; - } - - // Interception de l'évènement de demande de tooltip. - void FileSystemTreeCtrl::OnGetTooltip(wxTreeEvent& event) - { - event.SetToolTip( ((FileSystemTreeItemData*)GetItemData(event.GetItem()))->GetPath() ); - } - - - // Rafraichi le contenu d'un répertoire. - void FileSystemTreeCtrl::RefreshContent(wxTreeItemId idItem) - { - FileSystemTreeItemData *pItemData; - wxTreeItemId NewId; - wxString FP; - wxString str; - - DeleteChildren(idItem); - - // Insertion des répertoires - if(m_nMode&WXDC_FSTC_MODE_DIR) - { - str = ((FileSystemTreeItemData*)GetItemData(idItem))->GetPath(); - FP = m_pFileSystem->FindFirst( str, wxDIR_DIRS); - while(FP!="") - { - str = m_pFileSystem->GetCurrentFilePath(); - pItemData = new FileSystemTreeItemData(str, CalcItemType(str)); - NewId = AppendItem(idItem, FP, pItemData->GetType(), -1, pItemData); - AppendItem(NewId, "..."); - FP = m_pFileSystem->FindNext(); - } - } - - // Insertion des fichiers - if(m_nMode&WXDC_FSTC_MODE_FILE) - { - str = ((FileSystemTreeItemData*)GetItemData(idItem))->GetPath(); - FP = m_pFileSystem->FindFirst( str, wxDIR_FILES); - while(FP!="") - { - str = m_pFileSystem->GetCurrentFilePath(); - pItemData = new FileSystemTreeItemData(str, CalcItemType(str)); - NewId = AppendItem(idItem, FP, pItemData->GetType(), -1, pItemData); - FP = m_pFileSystem->FindNext(); - } - } - } - - - ////////////////////////////////////////////////////////////////////// - // - // FileSystemListCtrl - // - ////////////////////////////////////////////////////////////////////// - - BEGIN_EVENT_TABLE(FileSystemListCtrl, wxListCtrl) - EVT_LIST_ITEM_ACTIVATED(wxID_ANY, FileSystemListCtrl::OnItemActived) - END_EVENT_TABLE() - - // Constructeur. - FileSystemListCtrl::FileSystemListCtrl(wxWindow* parent, wxWindowID id, FileSystem *pFileSystem, const wxPoint& pos, const wxSize& size, long style): - wxListCtrl(parent, id, pos, size, style), - m_pFileSystem(pFileSystem), - m_nMode(WXDC_FSTC_MODE_NORMAL), - m_strPath(), - m_strWild("*.*") - { - SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_LIST_BIG_ICON_SIZE), wxIMAGE_LIST_NORMAL); - SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_LIST_LITTLE_ICON_SIZE), wxIMAGE_LIST_SMALL); - OpenRoot(); - } - - // Destructeur. - FileSystemListCtrl::~FileSystemListCtrl() - { - } - - // Fixe un nouveau système de fichier. - void FileSystemListCtrl::SetFileSystem(FileSystem *pFileSystem) - { - DeleteAllItems(); - m_pFileSystem = pFileSystem; - SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_LIST_BIG_ICON_SIZE), wxIMAGE_LIST_NORMAL); - SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_LIST_LITTLE_ICON_SIZE), wxIMAGE_LIST_SMALL); - } - - // Supprime tous les éléments de la liste. - bool FileSystemListCtrl::DeleteAllItems() - { - long item =-1; - for(;;) - { - item = GetNextItem(item); - if(item==-1) - break; - delete (wxString*) GetItemData(item); - } - return wxListCtrl::DeleteAllItems(); - } - - // Met à jour la liste. - void FileSystemListCtrl::UpdateList() - { - DeleteAllItems(); - - wxString str = m_pFileSystem->FindFirst(m_strPath, m_nMode&0x0003); - long item = 0; - while(!str.IsEmpty()) - { - FilePath strFilePath = m_pFileSystem->GetCurrentFilePath(); - - if(!m_pFileSystem->IsDirectory(strFilePath)) - if(!FileSystem::TestWildcard(strFilePath, m_strWild)) - { - str = m_pFileSystem->FindNext(); - continue; - } - - item = InsertItem(item+1, str, CalcItemType(strFilePath)); - SetItemData(item, (long)(void*)new wxString(strFilePath)); - - SetItem(item, 2, strFilePath); - str = m_pFileSystem->FindNext(); - } - } - - - // Ouvre la liste dans un répertoire spécifique. - void FileSystemListCtrl::Open(FilePath strPath, wxString strWild, unsigned int nMode) - { - wxString str; - FilePath strFilePath; - - m_strWild = strWild; - - if(m_pFileSystem->IsDirectory(strPath)) - { - m_strPath = strPath; - m_nMode = nMode; - UpdateList(); - } - else - OpenRoot(strWild, nMode); - } - - // Ouvre la liste dans le répertoire racine. - void FileSystemListCtrl::OpenRoot(wxString strWild, unsigned int nMode) - { - Open(m_pFileSystem->GetRootPath(), strWild, nMode); - } - - // Fixe la chaine de filtrage de listage des fichier. - void FileSystemListCtrl::SetWildcard(wxString strWild) - { - Open(m_strPath, strWild, m_nMode); - } - - - // Calcule le type d'un élément de l'arborescence. - long FileSystemListCtrl::CalcItemType(FilePath path) - { - return m_pFileSystem->GetFileType(path); - } - - // Intercepte les évènements de double-clic et d'entrée. - void FileSystemListCtrl::OnItemActived(wxListEvent& event) - { - if(m_nMode&WXDC_FSLC_MODE_PROCESSCHANGE) - { - long lItem = event.GetIndex(); - FilePath str = *((wxString*) GetItemData(lItem)); - if(m_pFileSystem->IsDirectory(str)) - ReOpen(str); - } - event.Skip(); - } - - // Demande le ou les fichiers sélectionnées. - void FileSystemListCtrl::GetSelectedFilesList(wxArrayString& files) - { - long item = -1; - for(;;) - { - item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); - if (item==-1) - break; - FilePath path = wxString(*((wxString*)GetItemData(item))); - if(!m_pFileSystem->IsDirectory(path)) - { - files.Add(path); - } - } - } - - - // Demande le ou les fichiers sélectionnées. - wxString FileSystemListCtrl::GetSelectedFiles() - { - FilePath file; - wxArrayString files; - wxString strList; - GetSelectedFilesList(files); - - if(files.GetCount()>0) - { - file = files[0]; - strList = file.GetFileName(); - for(unsigned int n=1; n<files.GetCount(); n++) - { - file = files[n]; - strList += ";" + file.GetFileName(); - } - } - return strList; - } --- 35,39 ---- |
|
From: Emilien K. <cur...@us...> - 2005-08-13 16:27:43
|
Update of /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4954/include/wxDevCenter Modified Files: FileSystemCtrl.h Added Files: FileSystemListCtrl.h FileSystemTreeCtrl.h Log Message: Separate FileSystemListCtrl and FileSystemTreeCtrl in two distinct files. --- NEW FILE: FileSystemTreeCtrl.h --- /** * @file wxDevCenter/FileSystemTreeCtrl.h * @author Cursor */ // // wxDevCenter // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; only version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. #ifndef __WXDEVCENTER_FILESYSTEMTREECTRL #define __WXDEVCENTER_FILESYSTEMTREECTRL #include <wx/treectrl.h> namespace wxDevCenter { class FileSystem; class DocManager; class FilePath; /** Structure permettant de manipuler des fichiers via un FileSystemTreeCtrl.*/ class WXDC_DLL_BASE FileSystemTreeItemData : public wxTreeItemData { friend class wxDevCenter::FileSystem; protected: /** Chemin du fichier.*/ wxString m_strPath; /** Type de fichier.*/ int m_iType; /** Etat du fichier.*/ int m_iState; public: FileSystemTreeItemData(wxString &Path, int iType=0, int iState=0); wxString GetPath()const; int GetType()const; int GetState()const; }; #define WXDC_FSTC_MODE_FILE 0x0001 #define WXDC_FSTC_MODE_DIR 0x0002 #define WXDC_FSTC_MODE_HIDDEN 0x0004 #define WXDC_FSTC_MODE_NORMAL 0x0007 /** Demande au controle de faire passer les évènements au système de fichiers.*/ #define WXDC_FSTC_PROCESS_EVENT 0x8000 /** Controle d'arborescence gérant directement le contenu d'un système de fichier * @see wxDevCenter::FileSystem */ class WXDC_DLL_BASE FileSystemTreeCtrl : public wxTreeCtrl { DECLARE_EVENT_TABLE(); protected: /** Système de fichier attaché au controle.*/ FileSystem *m_pFileSystem; /** Mode d'ouverture du controle.*/ unsigned int m_nMode; /** Chemin virtuel de la racine de l'arborescence. * Utilisée pour avoir un arbre partiel du système de fichier. */ FilePath m_strRootPath; public: /** Ouvre l'arbre en précisant une racine autre que la base du système de fichiers. * @param strRootPath Chemin virtuel de la racine. * @param nMode Mode d'ouverture. */ void Open(FilePath strRootPath, unsigned int nMode=WXDC_FSTC_MODE_NORMAL); /** Ouvre l'arbre à la base du système de fichiers. * @param nMode Mode d'ouverture. */ void OpenRoot(unsigned int nMode=WXDC_FSTC_MODE_NORMAL); /** Etend l'arbre pour afficher le fichier/répertoire demandé. * @param strPath Chemin du fichier demandé. * @return L'item du fichier demandé. */ wxTreeItemId ExpandTo(FilePath strPath); /** Fixe un nouveau système de fichier. * Vide l'arborescence et fixe un nouveau système de fichier. * @param pFileSystem Le nouveau système de fichier. */ void SetFileSystem(FileSystem *pFileSystem); /** Retourne le système de fichier. * @return Système de fichier attaché.*/ wxDevCenter::FileSystem* GetFileSystem(){return m_pFileSystem;} /** Recherche un fils direct d'un noeud. * @param idParent Noeud dont on recherche un fils. * @param strFileName Nom du fichier fils à rechercher. * @return Id du noeud de l'arbre correspondant au fichier. Invalide si non trouvé.*/ wxTreeItemId FindChild(wxTreeItemId idParent, wxString strFileName); /** Constructeur. * Appeler Open ou OpenRoot après sinon, una assertion se déclenchera. * @param parent Fenetre parente (non NULL). * @param id Identifiant de filiation. * @param pFileSystem Système de fichier. * @param pos Position. * @param size Taille. * @param style Style de l'arbre. */ FileSystemTreeCtrl(wxWindow* parent, wxWindowID id, FileSystem *pFileSystem, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTR_HAS_BUTTONS|wxTR_ROW_LINES|wxTR_FULL_ROW_HIGHLIGHT|wxTR_ROW_LINES|wxTR_SINGLE ); /** Destructeur.*/ virtual ~FileSystemTreeCtrl(); protected: /** Interception de l'évènement de déroulement d'une branche.*/ void OnTreeItemExpanding(wxTreeEvent &event); /** Interception de l'évènement de demande de tooltip.*/ void OnGetTooltip(wxTreeEvent& event); /** Calcule le type d'un élément de l'arborescence. * @param path Chemin du fichier/répertoire à tester. * @return Type de l'élément testé. */ long CalcItemType(FilePath path); /** Rafraichi le contenu d'un répertoire.*/ void RefreshContent(wxTreeItemId idItem); }; } #endif /*__WXDEVCENTER_FILESYSTEMTREECTRL*/ Index: FileSystemCtrl.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileSystemCtrl.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FileSystemCtrl.h 17 Mar 2005 17:51:24 -0000 1.8 --- FileSystemCtrl.h 13 Aug 2005 16:27:34 -0000 1.9 *************** *** 6,11 **** * * Déclaration des classes de - * - Arborescence (wxDevCenter::FileSystemTreeCtrl) - * - Liste (wxDevCenter::FileSYstemListCtrl) * - Panneau : un arbre à gauche d'une liste affichant le répertoire sélectionné dans l'arbre (wxDevCenter::FileSystemPanel) * - Boite de dialogue de sélection de fichier(s) (wxDevCenter::FileSystemDialog) --- 6,9 ---- *************** *** 32,41 **** #define __WXDEVCENTER_FILESYSTEMCTRL ! #include <wx/treectrl.h> ! #include <wx/listctrl.h> #include <wx/dialog.h> #include <wx/filedlg.h> #include <wx/listbook.h> class wxToolBar; --- 30,41 ---- #define __WXDEVCENTER_FILESYSTEMCTRL ! #include <wx/dialog.h> #include <wx/filedlg.h> #include <wx/listbook.h> + #include <wxDevCenter/FileSystemListCtrl.h> + #include <wxDevCenter/FileSystemTreeCtrl.h> + class wxToolBar; *************** *** 53,263 **** class FilePath; - /** Structure permettant de manipuler des fichiers via un FileSystemTreeCtrl.*/ - class WXDC_DLL_BASE FileSystemTreeItemData : public wxTreeItemData - { - friend class wxDevCenter::FileSystem; - protected: - /** Chemin du fichier.*/ - wxString m_strPath; - /** Type de fichier.*/ - int m_iType; - /** Etat du fichier.*/ - int m_iState; - public: - FileSystemTreeItemData(wxString &Path, int iType=0, int iState=0); - wxString GetPath()const; - int GetType()const; - int GetState()const; - }; - - - #define WXDC_FSTC_MODE_FILE 0x0001 - #define WXDC_FSTC_MODE_DIR 0x0002 - #define WXDC_FSTC_MODE_HIDDEN 0x0004 - - #define WXDC_FSTC_MODE_NORMAL 0x0007 - - /** Demande au controle de faire passer les évènements au système de fichiers.*/ - #define WXDC_FSTC_PROCESS_EVENT 0x8000 - - /** Controle d'arborescence gérant directement le contenu d'un système de fichier - * @see wxDevCenter::FileSystem - */ - class WXDC_DLL_BASE FileSystemTreeCtrl : public wxTreeCtrl - { - DECLARE_EVENT_TABLE(); - protected: - /** Système de fichier attaché au controle.*/ - FileSystem *m_pFileSystem; - /** Mode d'ouverture du controle.*/ - unsigned int m_nMode; - /** Chemin virtuel de la racine de l'arborescence. - * Utilisée pour avoir un arbre partiel du système de fichier. - */ - FilePath m_strRootPath; - - public: - /** Ouvre l'arbre en précisant une racine autre que la base du système de fichiers. - * @param strRootPath Chemin virtuel de la racine. - * @param nMode Mode d'ouverture. - */ - void Open(FilePath strRootPath, unsigned int nMode=WXDC_FSTC_MODE_NORMAL); - /** Ouvre l'arbre à la base du système de fichiers. - * @param nMode Mode d'ouverture. - */ - void OpenRoot(unsigned int nMode=WXDC_FSTC_MODE_NORMAL); - - /** Etend l'arbre pour afficher le fichier/répertoire demandé. - * @param strPath Chemin du fichier demandé. - * @return L'item du fichier demandé. - */ - wxTreeItemId ExpandTo(FilePath strPath); - - - /** Fixe un nouveau système de fichier. - * Vide l'arborescence et fixe un nouveau système de fichier. - * @param pFileSystem Le nouveau système de fichier. - */ - void SetFileSystem(FileSystem *pFileSystem); - - /** Retourne le système de fichier. - * @return Système de fichier attaché.*/ - wxDevCenter::FileSystem* GetFileSystem(){return m_pFileSystem;} - - /** Recherche un fils direct d'un noeud. - * @param idParent Noeud dont on recherche un fils. - * @param strFileName Nom du fichier fils à rechercher. - * @return Id du noeud de l'arbre correspondant au fichier. Invalide si non trouvé.*/ - wxTreeItemId FindChild(wxTreeItemId idParent, wxString strFileName); - - /** Constructeur. - * Appeler Open ou OpenRoot après sinon, una assertion se déclenchera. - * @param parent Fenetre parente (non NULL). - * @param id Identifiant de filiation. - * @param pFileSystem Système de fichier. - * @param pos Position. - * @param size Taille. - * @param style Style de l'arbre. - */ - FileSystemTreeCtrl(wxWindow* parent, wxWindowID id, - FileSystem *pFileSystem, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxTR_HAS_BUTTONS|wxTR_ROW_LINES|wxTR_FULL_ROW_HIGHLIGHT|wxTR_ROW_LINES|wxTR_SINGLE ); - /** Destructeur.*/ - virtual ~FileSystemTreeCtrl(); - protected: - /** Interception de l'évènement de déroulement d'une branche.*/ - void OnTreeItemExpanding(wxTreeEvent &event); - - /** Interception de l'évènement de demande de tooltip.*/ - void OnGetTooltip(wxTreeEvent& event); - - - /** Calcule le type d'un élément de l'arborescence. - * @param path Chemin du fichier/répertoire à tester. - * @return Type de l'élément testé. - */ - long CalcItemType(FilePath path); - - /** Rafraichi le contenu d'un répertoire.*/ - void RefreshContent(wxTreeItemId idItem); - }; - - - - #define WXDC_FSLC_MODE_FILE 0x0001 - #define WXDC_FSLC_MODE_DIR 0x0002 - #define WXDC_FSLC_MODE_HIDDEN 0x0004 - #define WXDC_FSLC_MODE_DOT 0x0008 - #define WXDC_FSLC_MODE_PROCESSCHANGE 0x0010 - #define WXDC_FSLC_MODE_NORMAL 0x0017 - - - /** Contrôle de liste d'un répertoire d'un système de fichier. - * @see wxDevCenter::FileSystem - */ - class WXDC_DLL_BASE FileSystemListCtrl : public wxListCtrl - { - DECLARE_EVENT_TABLE(); - protected: - /** Système de fichier attaché au controle.*/ - FileSystem *m_pFileSystem; - /** Mode d'ouverture du controle.*/ - unsigned int m_nMode; - /** Chemin virtuel du répertoire à lister.*/ - FilePath m_strPath; - /** Chaine de filtrage des noms de fichiers.*/ - wxString m_strWild; - public: - /** Constructeur. - * Appeler Open ou OpenRoot après sinon, une assertion se déclenchera. - * @param parent Adresse de la fenêtre parente. - * @param id Identifiant de filliation. - * @param pFileSystem Système de fichier à parcourir. - * @param pos Position de la liste. - * @param size Taille de la liste. - * @param style style de la liste. - */ - FileSystemListCtrl(wxWindow* parent, wxWindowID id, - FileSystem *pFileSystem, - const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxLC_ICON|wxLC_ALIGN_TOP|wxLC_AUTOARRANGE); - /** Destructeur.*/ - virtual ~FileSystemListCtrl(); - - /** Ouvre la liste dans un répertoire spécifique. - * @param strPath Chemin du répertoire à ouvrir. - * @param strWild Filtrage des noms de fichiers à afficher. - * @param nMode Mode d'ouverture du répertoire. - */ - void Open(FilePath strPath, wxString strWild = wxT("*.*"), unsigned int nMode=WXDC_FSLC_MODE_NORMAL); - /** Ouvre la liste dans le répertoire racine. - * @param strWild Filtrage des noms de fichiers à afficher. - * @param nMode Mode d'ouverture du répertoire. - */ - void OpenRoot(wxString strWild = wxT("*.*"), unsigned int nMode=WXDC_FSLC_MODE_NORMAL); - - /** Ouvre la liste dans un répertoire en conservant les infos de listages. - * @param strPath Chemin du répertoire à ouvrir. - */ - void ReOpen(wxString strPath){Open(strPath, m_strWild, m_nMode);} - - /** Fixe un nouveau système de fichier. - * Vide l'arborescence et fixe un nouveau système de fichier. - * @param pFileSystem Le nouveau système de fichier. - */ - void SetFileSystem(FileSystem *pFileSystem); - - /** Demande le ou les fichiers sélectionnées. - * @return liste des fichiers sélectionnées séparés par des point-virgules ';'.*/ - wxString GetSelectedFiles(); - /** Demande le ou les fichiers sélectionnées. - * @param files Tableau des fichiers sélectionnés.*/ - void GetSelectedFilesList(wxArrayString& files); - - /** Met à jour la liste.*/ - void UpdateList(); - - /** Fixe la chaine de filtrage de listage des fichier. - * @param strWild Chaine de filtrage. - */ - void SetWildcard(wxString strWild); - - /** Calcule le type d'un élément de l'arborescence. - * @param path Chemin du fichier/répertoire à tester. - * @return Type de l'élément testé. - */ - long CalcItemType(FilePath path); - - /** Supprime tous les éléments de la liste. - * @return True si OK.*/ - bool DeleteAllItems(); - - protected: - /** Intercepte les évènements de double-clic et d'entrée.*/ - void OnItemActived(wxListEvent& event); - }; - - /** Paneau de parcours de système de fichier.*/ class WXDC_DLL_BASE FileSystemPanel : public wxPanel --- 53,56 ---- --- NEW FILE: FileSystemListCtrl.h --- /** * @file wxDevCenter/FileSystemListCtrl.h * @author Cursor */ // // wxDevCenter // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; only version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. #ifndef __WXDEVCENTER_FILESYSTEMLISTCTRL #define __WXDEVCENTER_FILESYSTEMLISTCTRL #include <wx/listctrl.h> namespace wxDevCenter { class FileSystem; class DocManager; class FilePath; #define WXDC_FSLC_MODE_FILE 0x0001 #define WXDC_FSLC_MODE_DIR 0x0002 #define WXDC_FSLC_MODE_HIDDEN 0x0004 #define WXDC_FSLC_MODE_DOT 0x0008 #define WXDC_FSLC_MODE_PROCESSCHANGE 0x0010 #define WXDC_FSLC_MODE_NORMAL 0x0017 /** Contrôle de liste d'un répertoire d'un système de fichier. * @see wxDevCenter::FileSystem */ class WXDC_DLL_BASE FileSystemListCtrl : public wxListCtrl { DECLARE_EVENT_TABLE(); protected: /** Système de fichier attaché au controle.*/ FileSystem *m_pFileSystem; /** Mode d'ouverture du controle.*/ unsigned int m_nMode; /** Chemin virtuel du répertoire à lister.*/ FilePath m_strPath; /** Chaine de filtrage des noms de fichiers.*/ wxString m_strWild; public: /** Constructeur. * Appeler Open ou OpenRoot après sinon, une assertion se déclenchera. * @param parent Adresse de la fenêtre parente. * @param id Identifiant de filliation. * @param pFileSystem Système de fichier à parcourir. * @param pos Position de la liste. * @param size Taille de la liste. * @param style style de la liste. */ FileSystemListCtrl(wxWindow* parent, wxWindowID id, FileSystem *pFileSystem, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxLC_ICON|wxLC_ALIGN_TOP|wxLC_AUTOARRANGE); /** Destructeur.*/ virtual ~FileSystemListCtrl(); /** Ouvre la liste dans un répertoire spécifique. * @param strPath Chemin du répertoire à ouvrir. * @param strWild Filtrage des noms de fichiers à afficher. * @param nMode Mode d'ouverture du répertoire. */ void Open(FilePath strPath, wxString strWild = wxT("*.*"), unsigned int nMode=WXDC_FSLC_MODE_NORMAL); /** Ouvre la liste dans le répertoire racine. * @param strWild Filtrage des noms de fichiers à afficher. * @param nMode Mode d'ouverture du répertoire. */ void OpenRoot(wxString strWild = wxT("*.*"), unsigned int nMode=WXDC_FSLC_MODE_NORMAL); /** Ouvre la liste dans un répertoire en conservant les infos de listages. * @param strPath Chemin du répertoire à ouvrir. */ void ReOpen(wxString strPath){Open(strPath, m_strWild, m_nMode);} /** Fixe un nouveau système de fichier. * Vide l'arborescence et fixe un nouveau système de fichier. * @param pFileSystem Le nouveau système de fichier. */ void SetFileSystem(FileSystem *pFileSystem); /** Demande le ou les fichiers sélectionnées. * @return liste des fichiers sélectionnées séparés par des point-virgules ';'.*/ wxString GetSelectedFiles(); /** Demande le ou les fichiers sélectionnées. * @param files Tableau des fichiers sélectionnés.*/ void GetSelectedFilesList(wxArrayString& files); /** Met à jour la liste.*/ void UpdateList(); /** Fixe la chaine de filtrage de listage des fichier. * @param strWild Chaine de filtrage. */ void SetWildcard(wxString strWild); /** Calcule le type d'un élément de l'arborescence. * @param path Chemin du fichier/répertoire à tester. * @return Type de l'élément testé. */ long CalcItemType(FilePath path); /** Supprime tous les éléments de la liste. * @return True si OK.*/ bool DeleteAllItems(); protected: /** Intercepte les évènements de double-clic et d'entrée.*/ void OnItemActived(wxListEvent& event); }; } #endif /*__WXDEVCENTER_FILESYSTEMLISTCTRL*/ |
|
From: Emilien K. <cur...@us...> - 2005-08-13 16:27:43
|
Update of /cvsroot/wxdevcenter/wxDevCenter/build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4954/build Modified Files: wxDevCenter.bkl install.bkl Log Message: Separate FileSystemListCtrl and FileSystemTreeCtrl in two distinct files. Index: install.bkl =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/build/install.bkl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** install.bkl 13 Aug 2005 14:07:37 -0000 1.4 --- install.bkl 13 Aug 2005 16:27:34 -0000 1.5 *************** *** 20,23 **** --- 20,25 ---- wxDevCenter/FileSystem.h wxDevCenter/FileSystemCtrl.h + wxDevCenter/FileSystemListCtrl.h + wxDevCenter/FileSystemTreeCtrl.h wxDevCenter/FileSystemStandard.h wxDevCenter/FileTools.h Index: wxDevCenter.bkl =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/build/wxDevCenter.bkl,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxDevCenter.bkl 13 Aug 2005 14:07:37 -0000 1.10 --- wxDevCenter.bkl 13 Aug 2005 16:27:34 -0000 1.11 *************** *** 59,62 **** --- 59,64 ---- src/FileSystem.cpp src/FileSystemCtrl.cpp + src/FileSystemListCtrl.cpp + src/FileSystemTreeCtrl.cpp src/FileSystemStandard.cpp src/FileTools.cpp |
|
From: Emilien K. <cur...@us...> - 2005-08-13 16:27:43
|
Update of /cvsroot/wxdevcenter/wxDevCenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4954 Modified Files: GNUmakefile Log Message: Separate FileSystemListCtrl and FileSystemTreeCtrl in two distinct files. Index: GNUmakefile =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/GNUmakefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GNUmakefile 13 Aug 2005 14:07:38 -0000 1.4 --- GNUmakefile 13 Aug 2005 16:27:34 -0000 1.5 *************** *** 81,84 **** --- 81,86 ---- ./build/$(BUILD)/wxDevCenterLib_FileSystem.o \ ./build/$(BUILD)/wxDevCenterLib_FileSystemCtrl.o \ + ./build/$(BUILD)/wxDevCenterLib_FileSystemListCtrl.o \ + ./build/$(BUILD)/wxDevCenterLib_FileSystemTreeCtrl.o \ ./build/$(BUILD)/wxDevCenterLib_FileSystemStandard.o \ ./build/$(BUILD)/wxDevCenterLib_FileTools.o \ *************** *** 170,174 **** install: all install_wxDevCenterLib install_wxDevCenter $(INSTALL) -d $(prefix)/include ! for f in wxDevCenter.h wxDevCenterPlugin.h wxDevCenter/AboutBox.h wxDevCenter/Application.h wxDevCenter/ArtProvider.h wxDevCenter/Config.h wxDevCenter/DocView.h wxDevCenter/Element.h wxDevCenter/FileSystem.h wxDevCenter/FileSystemCtrl.h wxDevCenter/FileSystemStandard.h wxDevCenter/FileTools.h wxDevCenter/Frame.h wxDevCenter/language.h wxDevCenter/MainFrame.h wxDevCenter/Manager.h wxDevCenter/MDIFrame.h wxDevCenter/Plugin.h wxDevCenter/Project.h wxDevCenter/setup.h wxDevCenter/StatusBar.h wxDevCenter/WorkBar.h wxDevCenter/unix/Config.h wxDevCenter/unix/FileSystemStandard.h; do \ if test ! -d $(prefix)/include/`dirname $$f` ; then \ $(INSTALL) -d $(prefix)/include/`dirname $$f`; \ --- 172,176 ---- install: all install_wxDevCenterLib install_wxDevCenter $(INSTALL) -d $(prefix)/include ! for f in wxDevCenter.h wxDevCenterPlugin.h wxDevCenter/AboutBox.h wxDevCenter/Application.h wxDevCenter/ArtProvider.h wxDevCenter/Config.h wxDevCenter/DocView.h wxDevCenter/Element.h wxDevCenter/FileSystem.h wxDevCenter/FileSystemCtrl.h wxDevCenter/FileSystemListCtrl.h wxDevCenter/FileSystemTreeCtrl.h wxDevCenter/FileSystemStandard.h wxDevCenter/FileTools.h wxDevCenter/Frame.h wxDevCenter/language.h wxDevCenter/MainFrame.h wxDevCenter/Manager.h wxDevCenter/MDIFrame.h wxDevCenter/Plugin.h wxDevCenter/Project.h wxDevCenter/setup.h wxDevCenter/StatusBar.h wxDevCenter/WorkBar.h wxDevCenter/unix/Config.h wxDevCenter/unix/FileSystemStandard.h; do \ if test ! -d $(prefix)/include/`dirname $$f` ; then \ $(INSTALL) -d $(prefix)/include/`dirname $$f`; \ *************** *** 256,259 **** --- 258,267 ---- $(CXX) -c -o $@ $(WXDEVCENTERLIB_CXXFLAGS) $(CPPDEPS) $< + ./build/$(BUILD)/wxDevCenterLib_FileSystemListCtrl.o: ./src/FileSystemListCtrl.cpp + $(CXX) -c -o $@ $(WXDEVCENTERLIB_CXXFLAGS) $(CPPDEPS) $< + + ./build/$(BUILD)/wxDevCenterLib_FileSystemTreeCtrl.o: ./src/FileSystemTreeCtrl.cpp + $(CXX) -c -o $@ $(WXDEVCENTERLIB_CXXFLAGS) $(CPPDEPS) $< + ./build/$(BUILD)/wxDevCenterLib_FileSystemStandard.o: ./src/FileSystemStandard.cpp $(CXX) -c -o $@ $(WXDEVCENTERLIB_CXXFLAGS) $(CPPDEPS) $< |
|
From: Emilien K. <cur...@us...> - 2005-08-13 14:07:46
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10072/src Modified Files: FileSystemStandard.cpp FileSystemCtrl.cpp MainFrame.cpp Application.cpp DocManager.cpp Added Files: ArtProvider.cpp Log Message: Modify icon querying system to use wxArtProvider. --- NEW FILE: ArtProvider.cpp --- (This appears to be a binary file; contents omitted.) Index: FileSystemStandard.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/FileSystemStandard.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FileSystemStandard.cpp 14 May 2005 12:15:56 -0000 1.15 --- FileSystemStandard.cpp 13 Aug 2005 14:07:37 -0000 1.16 *************** *** 27,30 **** --- 27,31 ---- #include <wx/utils.h> + #include <wx/artprov.h> using namespace wxDevCenter; *************** *** 74,108 **** wxImageList* pIL = new wxImageList(width, width, true, WXDC_STDFS_FILETYPES + Application::GetApp().GetDocManager().GetDocTemplateCount()); ! wxIconBundle IB; ! IB = Application::GetApp().LoadAppIconBundle(wxT("none")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("unknow")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("dir")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("desktop")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("desktop")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("docs")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("computer")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("floppy")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("harddrive")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("cd-dvd")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("ramdisk")); ! pIL->Add(IB.GetIcon(width)); ! IB = Application::GetApp().LoadAppIconBundle(wxT("remote")); ! pIL->Add(IB.GetIcon(width)); for(unsigned long l=0; l<Application::GetApp().GetDocManager().GetDocTemplateCount(); l++) ! { ! IB = Application::GetApp().LoadAppIconBundle(Application::GetApp().GetDocManager().GetDocTemplate(l).GetViewTemplate(0).strIcons); ! pIL->Add(IB.GetIcon(width)); ! } return pIL; } --- 75,94 ---- wxImageList* pIL = new wxImageList(width, width, true, WXDC_STDFS_FILETYPES + Application::GetApp().GetDocManager().GetDocTemplateCount()); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(none), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(unknow), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(dir), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(desktop), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(desktop), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(docs), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(computer), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(floppy), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(harddrive), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(cd-dvd), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(ramdisk), wxART_FRAME_ICON, wxSize(width, width))); ! pIL->Add(wxArtProvider::GetIcon(wxART_MAKE_ART_ID(remote), wxART_FRAME_ICON, wxSize(width, width))); for(unsigned long l=0; l<Application::GetApp().GetDocManager().GetDocTemplateCount(); l++) ! pIL->Add(wxArtProvider::GetIcon(Application::GetApp().GetDocManager().GetDocTemplate(l).GetViewTemplate(0).strIcons, wxART_FRAME_ICON, wxSize(width, width))); ! return pIL; } Index: FileSystemCtrl.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/FileSystemCtrl.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FileSystemCtrl.cpp 17 Mar 2005 17:51:24 -0000 1.8 --- FileSystemCtrl.cpp 13 Aug 2005 14:07:37 -0000 1.9 *************** *** 31,34 **** --- 31,35 ---- #include <wx/splitter.h> #include <wx/tokenzr.h> + #include <wx/artprov.h> using namespace wxDevCenter; *************** *** 690,694 **** for(unsigned int n=0; n<pFSM->GetCount(); n++) { ! wxBitmap bmp = pFSM->Item(n).GetIconBundle().GetIcon(48); AttachFileSystem(&(pFSM->Item(n)), pFSM->Item(n).GetFileSystemName(), bmp); } --- 691,696 ---- for(unsigned int n=0; n<pFSM->GetCount(); n++) { ! wxBitmap bmp = wxArtProvider::GetBitmap(pFSM->Item(n).GetIconName(), wxART_OTHER, wxSize(16, 16)); ! // wxBitmap bmp = pFSM->Item(n).GetIconBundle().GetIcon(48); AttachFileSystem(&(pFSM->Item(n)), pFSM->Item(n).GetFileSystemName(), bmp); } Index: Application.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Application.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Application.cpp 12 Aug 2005 15:50:00 -0000 1.29 --- Application.cpp 13 Aug 2005 14:07:37 -0000 1.30 *************** *** 34,37 **** --- 34,38 ---- #include <wxDevCenter/FileTools.h> #include <wxDevCenter/Project.h> + #include <wxDevCenter/ArtProvider.h> #include <wx/dynlib.h> *************** *** 69,72 **** --- 70,75 ---- m_ConfigManager.LogConfig(); + + wxArtProvider::PushProvider(new ArtProvider); // Initialise les gestionnaires *************** *** 135,140 **** Application::Application(void): wxApp(), ! m_pStandardFileSystem(NULL), ! m_IconBundleCache(40) { ms_pTheApp = this; --- 138,142 ---- Application::Application(void): wxApp(), ! m_pStandardFileSystem(NULL) { ms_pTheApp = this; *************** *** 404,465 **** - - wxIcon Application::LoadAppIcon(wxString strIcon, wxSize size) - { - if(!IconIsInCache(strIcon)) - DoCahceIcon(strIcon); - return m_IconBundleCache[strIcon].GetIcon(size); - } - - // Charge un ensemble d'icones de l'application. - wxIconBundle Application::LoadAppIconBundle(wxString strIcon) - { - if(!IconIsInCache(strIcon)) - DoCahceIcon(strIcon); - return m_IconBundleCache[strIcon]; - } - - // Charge une icone dans le cache. - bool Application::DoCahceIcon(wxString strIcon) - { - long l; - wxIconBundle IB; - wxString strPathRoot, strPath, strName; - wxArrayString arFiles; - - l=0; - while(strPathRoot = GetConfig().GetDataPath(l++),!strPathRoot.IsEmpty()) - { - strPathRoot << wxT("/icons/") << strIcon; - strPathRoot.Replace(wxT("\\"), wxT("/")); - strPath = strPathRoot.BeforeLast(wxT('/')); - strName = strPathRoot.AfterLast(wxT('/')); - if(wxDir::Exists(strPath)) - { - wxDir::GetAllFiles(strPath, &arFiles, strName + wxT("*.gif"), wxDIR_FILES); - wxDir::GetAllFiles(strPath, &arFiles, strName + wxT("*.png"), wxDIR_FILES); - wxDir::GetAllFiles(strPath, &arFiles, strName + wxT(".ico"), wxDIR_FILES); - } - } - - wxBitmap EmptyBitmap(16, 16, 24); - wxIcon EmptyIcon; - EmptyIcon.CopyFromBitmap(EmptyBitmap); - IB.AddIcon(EmptyIcon); - - for(unsigned int n=0; n<arFiles.GetCount(); n++) - IB.AddIcon(arFiles[n], wxBITMAP_TYPE_ANY); - - m_IconBundleCache[strIcon] = IB; - return true; - } - - // Teste si une icone est en cache. - bool Application::IconIsInCache(wxString strIcon)const - { - return (m_IconBundleCache.find(strIcon)!=m_IconBundleCache.end()); - } - - wxBitmap Application::LoadAppBitmap(wxString strBmp, long type) { --- 406,409 ---- Index: MainFrame.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/MainFrame.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MainFrame.cpp 2 Aug 2005 17:13:01 -0000 1.17 --- MainFrame.cpp 13 Aug 2005 14:07:37 -0000 1.18 *************** *** 32,38 **** #include <wxDevCenter/WorkBar.h> #include <wx/dataobj.h> #include <wx/dnd.h> - #include <wx/sashwin.h> // wxdockit includes --- 32,38 ---- #include <wxDevCenter/WorkBar.h> + #include <wx/artprov.h> #include <wx/dataobj.h> #include <wx/dnd.h> // wxdockit includes *************** *** 111,115 **** // Chargement de l'icone de l'application. ! m_Icon = Application::GetApp().LoadAppIcon("wxDevCenter", wxSize(16, 16)); SetIcon(m_Icon); --- 111,115 ---- // Chargement de l'icone de l'application. ! m_Icon = wxArtProvider::GetIcon(wxART_MAKE_ART_ID(wxDevCenter), wxART_FRAME_ICON, wxSize(16, 16)); SetIcon(m_Icon); *************** *** 369,382 **** void MainFrame::OnCurrentViewChanged(ViewEvent &event) { - wxString str; View *pNewView = event.GetNewView(); if(pNewView!=NULL) { InsertViewMenu(pNewView); ! SetIcons(Application::GetApp().LoadAppIconBundle(pNewView->GetViewTemplate()->strIcons)); ! str.Append(WXDC_NAME).Append(wxT(" - ")).Append(pNewView->GetDocument()->GetDocumentName()); if(pNewView->GetDocument()->GetModifiedFlag()) ! str.Append(wxT("*")); ! SetTitle(str); } UpdateWindowUI(); --- 369,388 ---- void MainFrame::OnCurrentViewChanged(ViewEvent &event) { View *pNewView = event.GetNewView(); if(pNewView!=NULL) { InsertViewMenu(pNewView); ! wxString strIconName = pNewView->GetViewTemplate()->strIcons; ! wxIconBundle IB; ! IB.AddIcon(wxArtProvider::GetIcon(strIconName, wxART_FRAME_ICON, wxSize(16, 16))); ! IB.AddIcon(wxArtProvider::GetIcon(strIconName, wxART_FRAME_ICON, wxSize(32, 32))); ! IB.AddIcon(wxArtProvider::GetIcon(strIconName, wxART_FRAME_ICON, wxSize(48, 48))); ! IB.AddIcon(wxArtProvider::GetIcon(strIconName, wxART_FRAME_ICON, wxSize(64, 64))); ! SetIcons(IB); ! wxString strName; ! strName.Append(WXDC_NAME).Append(wxT(" - ")).Append(pNewView->GetDocument()->GetDocumentName()); if(pNewView->GetDocument()->GetModifiedFlag()) ! strName.Append(wxT("*")); ! SetTitle(strName); } UpdateWindowUI(); Index: DocManager.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/DocManager.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** DocManager.cpp 12 Aug 2005 15:50:00 -0000 1.11 --- DocManager.cpp 13 Aug 2005 14:07:37 -0000 1.12 *************** *** 28,31 **** --- 28,32 ---- #include <wx/arrimpl.cpp> + #include <wx/artprov.h> using namespace wxDevCenter; *************** *** 408,422 **** for(unsigned int n=0; n<GetDocTemplateCount(); n++) ! { ! wxIconBundle IB = Application::GetApp().LoadAppIconBundle(GetDocTemplate(n).GetViewTemplate(0).strIcons); ! pIL->Add(IB.GetIcon(iSize)); ! } return pIL; } // Retourne le bundle d'icones associé à un identifiant de type de document. ! wxIconBundle* DocManager::GetIconBundle(unsigned int nDocType, unsigned int nViewType) { ! return new wxIconBundle(Application::GetApp().LoadAppIconBundle(GetDocTemplate(nDocType).GetViewTemplate(nViewType).strIcons)); } --- 409,420 ---- for(unsigned int n=0; n<GetDocTemplateCount(); n++) ! pIL->Add(wxArtProvider::GetIcon(GetDocTemplate(n).GetViewTemplate(0).strIcons, wxART_OTHER, wxSize(iSize, iSize))); return pIL; } // Retourne le bundle d'icones associé à un identifiant de type de document. ! wxString DocManager::GetIconName(unsigned int nDocType, unsigned int nViewType)const { ! return GetDocTemplate(nDocType).GetViewTemplate(nViewType).strIcons; } |
|
From: Emilien K. <cur...@us...> - 2005-08-13 14:07:46
|
Update of /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10072/include/wxDevCenter Modified Files: DocView.h FileSystem.h FileSystemStandard.h Application.h Added Files: ArtProvider.h Log Message: Modify icon querying system to use wxArtProvider. Index: DocView.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/DocView.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** DocView.h 12 Aug 2005 15:50:00 -0000 1.18 --- DocView.h 13 Aug 2005 14:07:37 -0000 1.19 *************** *** 747,756 **** * @return Adresse de la liste d'image.*/ wxImageList* GetImageList(int iSize); ! /** Retourne le bundle d'icones associé à un identifiant de type de document. * @param nDocType Index du type de document. * @param nViewType Index du type de vue. ! * @return Adresse du bundle et NULL si aucun. */ ! wxIconBundle* GetIconBundle(unsigned int nDocType, unsigned int nViewType); /** @}*/ }; --- 747,756 ---- * @return Adresse de la liste d'image.*/ wxImageList* GetImageList(int iSize); ! /** Retourne le nom de l'icone associée à un identifiant de type de document. * @param nDocType Index du type de document. * @param nViewType Index du type de vue. ! * @return Nom de l'icone, nom de l'icone du type de document inconnu ("unknow") sinon. */ ! wxString GetIconName(unsigned int nDocType, unsigned int nViewType)const; /** @}*/ }; --- NEW FILE: ArtProvider.h --- (This appears to be a binary file; contents omitted.) Index: FileSystemStandard.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileSystemStandard.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FileSystemStandard.h 14 May 2005 12:15:54 -0000 1.11 --- FileSystemStandard.h 13 Aug 2005 14:07:37 -0000 1.12 *************** *** 61,65 **** public: virtual wxString GetFileSystemName()const{return WXDC_SYSTEM_STDFS_NAME;} ! virtual wxIconBundle GetIconBundle()const{return Application::GetApp().LoadAppIconBundle("desktop");} wxString GetProtocoleName()const{return "file";} --- 61,65 ---- public: virtual wxString GetFileSystemName()const{return WXDC_SYSTEM_STDFS_NAME;} ! virtual wxString GetIconName()const{return wxT("desktop");} wxString GetProtocoleName()const{return "file";} Index: Application.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/Application.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Application.h 11 Aug 2005 09:58:17 -0000 1.13 --- Application.h 13 Aug 2005 14:07:37 -0000 1.14 *************** *** 48,55 **** class FileSystemManager; - /** Dictionnaire de jeux d'icones. - * Utilisé pour implémenter une cache d'icones. - */ - WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxIconBundle, IconBundleMap, class WXDC_DLL_BASE); /** Classe application. --- 48,51 ---- *************** *** 87,93 **** FileSystem *m_pStandardFileSystem; - /** Cache des icones.*/ - IconBundleMap m_IconBundleCache; - /** Fenêtre cadre principale.*/ MainFrame *m_pMainFrame; --- 83,86 ---- *************** *** 128,157 **** /** @name Données ! * Gestion des données de l'applications comme les images, les icones. * @{*/ - public: - /** Charge une icone de l'application. - * @param strIcon Nom de l'icone. - * @param size Taille de l'icone. - * @return Icone. - */ - wxIcon LoadAppIcon(wxString strIcon, wxSize size); - /** Charge un ensemble d'icones de l'application. - * @param strIcon Nom de l'icone. - * @return Jeu d'icone. - */ - wxIconBundle LoadAppIconBundle(wxString strIcon); - private: - /** Charge une icone dans le cache. - * @param strIcon Nom de l'icone. - * @return Vrai si l'icone a été mise en cache. - */ - bool DoCahceIcon(wxString strIcon); - /** Teste si une icone est en cache. - * @param strIcon Nom de l'icone. - * @return Vrai si l'icone est en cache. - */ - bool IconIsInCache(wxString strIcon)const; - public: /** Charge un dessin (bitmap) de l'application. * @param strBmp Nom de l'image à charger. --- 121,126 ---- /** @name Données ! * Gestion des données de l'applications comme les images. * @{*/ /** Charge un dessin (bitmap) de l'application. * @param strBmp Nom de l'image à charger. Index: FileSystem.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/FileSystem.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** FileSystem.h 2 Aug 2005 12:50:54 -0000 1.8 --- FileSystem.h 13 Aug 2005 14:07:37 -0000 1.9 *************** *** 121,126 **** * Le nom n'est qu'une donnée de présentation est en aucun cas une clef unique.*/ virtual wxString GetFileSystemName()const{return wxT("");} ! /** Retourne le bundle d'icones du système de fichier.*/ ! virtual wxIconBundle GetIconBundle()const{return wxIconBundle();} /** @} */ --- 121,126 ---- * Le nom n'est qu'une donnée de présentation est en aucun cas une clef unique.*/ virtual wxString GetFileSystemName()const{return wxT("");} ! /** Retourne le nom de l'icone représentative du système de fichier.*/ ! virtual wxString GetIconName()const{return wxT("");} /** @} */ |
|
From: Emilien K. <cur...@us...> - 2005-08-13 14:07:46
|
Update of /cvsroot/wxdevcenter/wxDevCenter/build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10072/build Modified Files: install.bkl wxDevCenter.bkl Log Message: Modify icon querying system to use wxArtProvider. Index: install.bkl =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/build/install.bkl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** install.bkl 11 Aug 2005 16:08:22 -0000 1.3 --- install.bkl 13 Aug 2005 14:07:37 -0000 1.4 *************** *** 14,17 **** --- 14,18 ---- wxDevCenter/AboutBox.h wxDevCenter/Application.h + wxDevCenter/ArtProvider.h wxDevCenter/Config.h wxDevCenter/DocView.h Index: wxDevCenter.bkl =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/build/wxDevCenter.bkl,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wxDevCenter.bkl 10 Aug 2005 14:36:52 -0000 1.9 --- wxDevCenter.bkl 13 Aug 2005 14:07:37 -0000 1.10 *************** *** 51,54 **** --- 51,55 ---- src/AboutBox.cpp src/Application.cpp + src/ArtProvider.cpp src/Config.cpp src/DocManager.cpp |
|
From: Emilien K. <cur...@us...> - 2005-08-13 14:07:46
|
Update of /cvsroot/wxdevcenter/wxDevCenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10072 Modified Files: GNUmakefile Log Message: Modify icon querying system to use wxArtProvider. Index: GNUmakefile =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/GNUmakefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GNUmakefile 11 Aug 2005 16:08:23 -0000 1.3 --- GNUmakefile 13 Aug 2005 14:07:38 -0000 1.4 *************** *** 73,76 **** --- 73,77 ---- ./build/$(BUILD)/wxDevCenterLib_AboutBox.o \ ./build/$(BUILD)/wxDevCenterLib_Application.o \ + ./build/$(BUILD)/wxDevCenterLib_ArtProvider.o \ ./build/$(BUILD)/wxDevCenterLib_Config.o \ ./build/$(BUILD)/wxDevCenterLib_DocManager.o \ *************** *** 169,173 **** install: all install_wxDevCenterLib install_wxDevCenter $(INSTALL) -d $(prefix)/include ! for f in wxDevCenter.h wxDevCenterPlugin.h wxDevCenter/AboutBox.h wxDevCenter/Application.h wxDevCenter/Config.h wxDevCenter/DocView.h wxDevCenter/Element.h wxDevCenter/FileSystem.h wxDevCenter/FileSystemCtrl.h wxDevCenter/FileSystemStandard.h wxDevCenter/FileTools.h wxDevCenter/Frame.h wxDevCenter/language.h wxDevCenter/MainFrame.h wxDevCenter/Manager.h wxDevCenter/MDIFrame.h wxDevCenter/Plugin.h wxDevCenter/Project.h wxDevCenter/setup.h wxDevCenter/StatusBar.h wxDevCenter/WorkBar.h wxDevCenter/unix/Config.h wxDevCenter/unix/FileSystemStandard.h; do \ if test ! -d $(prefix)/include/`dirname $$f` ; then \ $(INSTALL) -d $(prefix)/include/`dirname $$f`; \ --- 170,174 ---- install: all install_wxDevCenterLib install_wxDevCenter $(INSTALL) -d $(prefix)/include ! for f in wxDevCenter.h wxDevCenterPlugin.h wxDevCenter/AboutBox.h wxDevCenter/Application.h wxDevCenter/ArtProvider.h wxDevCenter/Config.h wxDevCenter/DocView.h wxDevCenter/Element.h wxDevCenter/FileSystem.h wxDevCenter/FileSystemCtrl.h wxDevCenter/FileSystemStandard.h wxDevCenter/FileTools.h wxDevCenter/Frame.h wxDevCenter/language.h wxDevCenter/MainFrame.h wxDevCenter/Manager.h wxDevCenter/MDIFrame.h wxDevCenter/Plugin.h wxDevCenter/Project.h wxDevCenter/setup.h wxDevCenter/StatusBar.h wxDevCenter/WorkBar.h wxDevCenter/unix/Config.h wxDevCenter/unix/FileSystemStandard.h; do \ if test ! -d $(prefix)/include/`dirname $$f` ; then \ $(INSTALL) -d $(prefix)/include/`dirname $$f`; \ *************** *** 231,234 **** --- 232,238 ---- $(CXX) -c -o $@ $(WXDEVCENTERLIB_CXXFLAGS) $(CPPDEPS) $< + ./build/$(BUILD)/wxDevCenterLib_ArtProvider.o: ./src/ArtProvider.cpp + $(CXX) -c -o $@ $(WXDEVCENTERLIB_CXXFLAGS) $(CPPDEPS) $< + ./build/$(BUILD)/wxDevCenterLib_Config.o: ./src/Config.cpp $(CXX) -c -o $@ $(WXDEVCENTERLIB_CXXFLAGS) $(CPPDEPS) $< |
|
From: Emilien K. <cur...@us...> - 2005-08-12 15:50:13
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23627/src Modified Files: Application.cpp Document.cpp DocManager.cpp Log Message: Fix document creation. Index: Application.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Application.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Application.cpp 12 Aug 2005 10:05:32 -0000 1.28 --- Application.cpp 12 Aug 2005 15:50:00 -0000 1.29 *************** *** 234,240 **** return false; } if(!pDoc->OnNewDocument()) { ! delete pDoc; return false; } --- 234,241 ---- return false; } + if(!pDoc->OnNewDocument()) { ! pDoc->Destroy(); return false; } *************** *** 243,252 **** if(pView==NULL) { ! delete pDoc; return false; } - - m_pMainFrame->AddView(pView); - pView->OnInitialUpdate(); return true; --- 244,250 ---- if(pView==NULL) { ! pDoc->Destroy(); return false; } return true; Index: Document.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Document.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Document.cpp 2 Aug 2005 12:50:54 -0000 1.12 --- Document.cpp 12 Aug 2005 15:50:00 -0000 1.13 *************** *** 62,68 **** return false; ! if(!Application::GetApp().GetDocManager().RegisterDocument(this)) ! return false; ! return true; } --- 62,67 ---- return false; ! Application::GetApp().GetDocManager().RegisterDocument(this); ! return true; } Index: DocManager.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/DocManager.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DocManager.cpp 2 Aug 2005 12:50:54 -0000 1.10 --- DocManager.cpp 12 Aug 2005 15:50:00 -0000 1.11 *************** *** 24,27 **** --- 24,28 ---- #include <wxDevCenter.h> #include <wxDevCenter/DocView.h> + #include <wxDevCenter/MainFrame.h> #include <wxDevCenter/MDIFrame.h> *************** *** 296,299 **** --- 297,303 ---- pView->Hide(); pView->OnCreate(); + + Application::GetApp().GetMainFrame().AddView(pView); + pView->OnInitialUpdate(); pView->Show(); |
|
From: Emilien K. <cur...@us...> - 2005-08-12 15:50:10
|
Update of /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23627/include/wxDevCenter Modified Files: DocView.h Manager.h Log Message: Fix document creation. Index: Manager.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/Manager.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Manager.h 3 Aug 2005 19:21:22 -0000 1.6 --- Manager.h 12 Aug 2005 15:50:00 -0000 1.7 *************** *** 184,188 **** /** Enregistrement d'un objet. * @param pObj Adresse de l'objet. ! * @return Vrai si correctement enregistré.*/ bool Register(ItemType* pObj){if(Find(pObj)!=-1)return false;Add(pObj);return true;} /** Enregistrement d'un objet. --- 184,188 ---- /** Enregistrement d'un objet. * @param pObj Adresse de l'objet. ! * @return Vrai si correctement enregistré, faux si déjà enregistré.*/ bool Register(ItemType* pObj){if(Find(pObj)!=-1)return false;Add(pObj);return true;} /** Enregistrement d'un objet. Index: DocView.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/DocView.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** DocView.h 3 Aug 2005 19:21:22 -0000 1.17 --- DocView.h 12 Aug 2005 15:50:00 -0000 1.18 *************** *** 605,609 **** protected: ! /** Fenêtre conteneur par défaut des vues.*/ wxWindow *m_pDefaultViewContainer; --- 605,610 ---- protected: ! /** Fenêtre conteneur par défaut des vues. ! * Ne sert que pour la création et ne doit pas être utilisé pour autre chose.*/ wxWindow *m_pDefaultViewContainer; *************** *** 637,641 **** * @return Vrai si le document est correctement enregistré. */ ! bool RegisterDocument(Document* pDoc){return m_DocumentManager.Register(pDoc);} /** Désenregistre un document. * @param pDoc Adresse du document.*/ --- 638,642 ---- * @return Vrai si le document est correctement enregistré. */ ! void RegisterDocument(Document* pDoc){m_DocumentManager.Register(pDoc);} /** Désenregistre un document. * @param pDoc Adresse du document.*/ |
|
From: Emilien K. <cur...@us...> - 2005-08-12 15:49:31
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23276/src Modified Files: Plugin.cpp Log Message: Fix some state flags settings. Add some debug output to say if features/plugins/modules are loaded. Index: Plugin.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Plugin.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Plugin.cpp 12 Aug 2005 09:25:19 -0000 1.8 --- Plugin.cpp 12 Aug 2005 15:49:23 -0000 1.9 *************** *** 52,56 **** { wxString str; ! str << m_strPath << wxT(" : ") << m_Elements.GetCount() << wxT(" objects registered.") << wxT("\n"); return str; } --- 52,59 ---- { wxString str; ! if(m_flagState==Error) ! str << m_strPath << wxT(" not loaded.\n"); ! else ! str << m_strPath << wxT(" : ") << m_Elements.GetCount() << wxT(" objects registered.") << wxT("\n"); return str; } *************** *** 70,74 **** long l=0; wxString strPath; ! while(strPath = Application::GetApp().GetConfig().GetPluginsPath(), !strPath.IsEmpty()) { strPath += wxT("/") + m_strPath; --- 73,77 ---- long l=0; wxString strPath; ! while(strPath = Application::GetApp().GetConfig().GetPluginsPath(l++), !strPath.IsEmpty()) { strPath += wxT("/") + m_strPath; *************** *** 84,94 **** --- 87,105 ---- Element::s_pElementManager = pOldBEM; if(flag) + { + m_flagState |= Loaded; wxLogDebug(wxT("Module %s loaded"), strLongName.GetData()); + } else + { + m_flagState = Error; wxLogDebug(wxT("Module %s loading error"), strLongName.GetData()); + } return flag; } } + m_flagState = Error; wxLogDebug(wxT("Module %s not found"), strLongName.GetData()); + return false; } *************** *** 111,114 **** --- 122,129 ---- bOK &= m_Elements[l].Initialize(); } + if(bOK) + m_flagState |= Initialized; + else + m_flagState = Error; return bOK; } *************** *** 117,120 **** --- 132,136 ---- bool ModuleRefData::Finalize() { + /** @todo Finalize all dependant elements.*/ return false; } *************** *** 213,223 **** { wxString str; ! str << m_strName << wxT(" (") << m_Version.ToString() << wxT(")") << wxT(" : ") << m_strDescript << wxT("\n"); ! str << wxT("Used plugins : ") << m_arrstrPlugins.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrPlugins.GetCount(); l++) ! str << wxT(" - ") << m_arrstrPlugins[l] << wxT("\n"); ! str << wxT("Used modules : ") << m_arrstrModules.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrModules.GetCount(); l++) ! str << wxT(" - ") << m_arrstrModules[l] << wxT("\n"); return str; } --- 229,244 ---- { wxString str; ! if((m_Status&ErrMask)!=0) ! str << m_strName << wxT(" not loaded.\n"); ! else ! { ! str << m_strName << wxT(" (") << m_Version.ToString() << wxT(")") << wxT(" : ") << m_strDescript << wxT("\n"); ! str << wxT("Used plugins : ") << m_arrstrPlugins.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrPlugins.GetCount(); l++) ! str << wxT(" - ") << m_arrstrPlugins[l] << wxT("\n"); ! str << wxT("Used modules : ") << m_arrstrModules.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrModules.GetCount(); l++) ! str << wxT(" - ") << m_arrstrModules[l] << wxT("\n"); ! } return str; } *************** *** 261,265 **** File.FillModuleArray(m_arrstrModules); File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status = PreLoaded; return true; } --- 282,286 ---- File.FillModuleArray(m_arrstrModules); File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status |= PreLoaded; return true; } *************** *** 286,290 **** bOk &= m_pLoader->LoadModule(strName + wxT("/") + m_arrstrModules[l])!=NULL; ! m_Status = Loaded | (bOk?0:Partial); return bOk; --- 307,311 ---- bOk &= m_pLoader->LoadModule(strName + wxT("/") + m_arrstrModules[l])!=NULL; ! m_Status |= Loaded | (bOk?0:Partial); return bOk; *************** *** 330,341 **** { wxString str; ! str << m_strName << wxT(" (") << m_Version.ToString() << wxT(")") << wxT(" : ") << m_strDescript << wxT("\n"); ! str << wxT("Used features : ") << m_arrstrFeatures.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrFeatures.GetCount(); l++) ! str << wxT(" - ") << m_arrstrFeatures[l] << wxT("\n"); ! str << wxT("Used plugins : ") << m_arrstrPlugins.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrPlugins.GetCount(); l++) ! str << wxT(" - ") << m_arrstrPlugins[l] << wxT("\n"); ! return str; } ) --- 351,367 ---- { wxString str; ! if((m_Status&ErrFlag)!=0) ! str << m_strName << wxT(" not loaded.\n"); ! else ! { ! str << m_strName << wxT(" (") << m_Version.ToString() << wxT(")") << wxT(" : ") << m_strDescript << wxT("\n"); ! str << wxT("Used features : ") << m_arrstrFeatures.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrFeatures.GetCount(); l++) ! str << wxT(" - ") << m_arrstrFeatures[l] << wxT("\n"); ! str << wxT("Used plugins : ") << m_arrstrPlugins.GetCount() << wxT("\n"); ! for(long l=0; l<(long)m_arrstrPlugins.GetCount(); l++) ! str << wxT(" - ") << m_arrstrPlugins[l] << wxT("\n"); ! } ! return str; } ) *************** *** 377,381 **** File.FillDependantFeatureArray(m_arrstrFeatures); File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status = PreLoaded; return true; } --- 403,407 ---- File.FillDependantFeatureArray(m_arrstrFeatures); File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status |= PreLoaded; return true; } *************** *** 402,406 **** bOk &= m_pLoader->LoadPlugin(m_arrstrPlugins[l])!=NULL; ! m_Status = Loaded | (bOk?0:Partial); return bOk; --- 428,432 ---- bOk &= m_pLoader->LoadPlugin(m_arrstrPlugins[l])!=NULL; ! m_Status |= Loaded | (bOk?0:Partial); return bOk; *************** *** 545,549 **** str << wxT("Plugin loader : ") << wxT("\n"); ! str << wxT("Features : ") << m_FeatureMap.size() << wxT("\n"); FeatureMap::iterator it1; for( it1 = m_FeatureMap.begin(); it1 != m_FeatureMap.end(); ++it1 ) --- 571,575 ---- str << wxT("Plugin loader : ") << wxT("\n"); ! str << wxT("*** Features : ") << m_FeatureMap.size() << wxT(" ***\n"); FeatureMap::iterator it1; for( it1 = m_FeatureMap.begin(); it1 != m_FeatureMap.end(); ++it1 ) *************** *** 553,557 **** } ! str << wxT("Plugins : ") << m_PluginMap.size() << wxT("\n"); PluginMap::iterator it2; for( it2 = m_PluginMap.begin(); it2 != m_PluginMap.end(); ++it2 ) --- 579,583 ---- } ! str << wxT("*** Plugins : ") << m_PluginMap.size() << wxT(" ***\n"); PluginMap::iterator it2; for( it2 = m_PluginMap.begin(); it2 != m_PluginMap.end(); ++it2 ) *************** *** 561,565 **** } ! str << wxT("Modules : ") << m_ModuleMap.size() << wxT("\n"); ModuleMap::iterator it3; for( it3 = m_ModuleMap.begin(); it3 != m_ModuleMap.end(); ++it3 ) --- 587,591 ---- } ! str << wxT("*** Modules : ") << m_ModuleMap.size() << wxT(" ***\n"); ModuleMap::iterator it3; for( it3 = m_ModuleMap.begin(); it3 != m_ModuleMap.end(); ++it3 ) |
|
From: Emilien K. <cur...@us...> - 2005-08-12 10:05:43
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22985/src Modified Files: Application.cpp Log Message: Fix icon loading system. Little bug in name construction. Index: Application.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Application.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Application.cpp 11 Aug 2005 11:02:47 -0000 1.27 --- Application.cpp 12 Aug 2005 10:05:32 -0000 1.28 *************** *** 427,431 **** long l; wxIconBundle IB; ! wxString strPathRoot; wxArrayString arFiles; --- 427,431 ---- long l; wxIconBundle IB; ! wxString strPathRoot, strPath, strName; wxArrayString arFiles; *************** *** 435,444 **** strPathRoot << wxT("/icons/") << strIcon; strPathRoot.Replace(wxT("\\"), wxT("/")); ! ! if(wxDir::Exists(strPathRoot)) { ! wxDir::GetAllFiles(strPathRoot.BeforeLast(wxT('/')), &arFiles, strPathRoot.AfterLast(wxT('/')) + wxT("*.gif"), wxDIR_FILES); ! wxDir::GetAllFiles(strPathRoot.BeforeLast(wxT('/')), &arFiles, strPathRoot.AfterLast(wxT('/')) + wxT("*.png"), wxDIR_FILES); ! wxDir::GetAllFiles(strPathRoot.BeforeLast(wxT('/')), &arFiles, strPathRoot.AfterLast(wxT('/')) + wxT(".ico"), wxDIR_FILES); } } --- 435,445 ---- strPathRoot << wxT("/icons/") << strIcon; strPathRoot.Replace(wxT("\\"), wxT("/")); ! strPath = strPathRoot.BeforeLast(wxT('/')); ! strName = strPathRoot.AfterLast(wxT('/')); ! if(wxDir::Exists(strPath)) { ! wxDir::GetAllFiles(strPath, &arFiles, strName + wxT("*.gif"), wxDIR_FILES); ! wxDir::GetAllFiles(strPath, &arFiles, strName + wxT("*.png"), wxDIR_FILES); ! wxDir::GetAllFiles(strPath, &arFiles, strName + wxT(".ico"), wxDIR_FILES); } } *************** *** 450,454 **** for(unsigned int n=0; n<arFiles.GetCount(); n++) ! IB.AddIcon(arFiles[n], wxBITMAP_TYPE_ANY); m_IconBundleCache[strIcon] = IB; --- 451,455 ---- for(unsigned int n=0; n<arFiles.GetCount(); n++) ! IB.AddIcon(arFiles[n], wxBITMAP_TYPE_ANY); m_IconBundleCache[strIcon] = IB; |
|
From: Emilien K. <cur...@us...> - 2005-08-12 09:26:13
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16859/src Modified Files: Plugin.cpp Log Message: Modify module loading process. Decorate name with "lib .so" or ".dll" Now correctly load them. Index: Plugin.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Plugin.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Plugin.cpp 11 Aug 2005 16:19:25 -0000 1.7 --- Plugin.cpp 12 Aug 2005 09:25:19 -0000 1.8 *************** *** 58,75 **** // Charge le module. ! bool ModuleRefData::Load(wxString strPath) { ! wxLogDebug(wxT("Loading module %s"), strPath.GetData()); ! ! BaseElementManager* pOldBEM = Element::s_pElementManager; ! Element::s_pElementManager = &m_Elements; ! ! m_strPath = strPath; ! ! bool flag = m_DLL.Load(strPath, wxDL_VERBATIM); ! Element::s_pElementManager = pOldBEM; ! return flag; } --- 58,95 ---- // Charge le module. ! bool ModuleRefData::Load(wxString strLongName) { ! wxString strFileName; ! ! /** Validate name.*/ ! strFileName = strLongName.AfterLast('/'); ! strLongName = strLongName.BeforeLast('/'); ! m_strPath = strLongName + wxT("/") + m_DLL.CanonicalizeName(strFileName); ! /** Find the good direcotry.*/ ! long l=0; ! wxString strPath; ! while(strPath = Application::GetApp().GetConfig().GetPluginsPath(), !strPath.IsEmpty()) ! { ! strPath += wxT("/") + m_strPath; ! if(wxFile::Exists(strPath)) ! { ! m_strPath = strPath; ! ! wxLogDebug(wxT("Loading module %s"), m_strPath.GetData()); ! BaseElementManager* pOldBEM = Element::s_pElementManager; ! Element::s_pElementManager = &m_Elements; ! bool flag = m_DLL.Load(strPath, wxDL_VERBATIM); ! Element::s_pElementManager = pOldBEM; ! if(flag) ! wxLogDebug(wxT("Module %s loaded"), strLongName.GetData()); ! else ! wxLogDebug(wxT("Module %s loading error"), strLongName.GetData()); ! return flag; ! } ! } ! wxLogDebug(wxT("Module %s not found"), strLongName.GetData()); ! return false; } *************** *** 220,241 **** bool Plugin::PreLoad(wxString strName) { ! wxString strFilePath = Application::GetApp().GetConfig().GetPluginsPath() + wxT("/") + strName + wxT("/plugin.xml"); ! PluginDescriptionFile File(strFilePath); ! if(File.IsValid()) ! { ! m_strName = File.GetName(); ! m_strDescript = File.GetDescript(); ! m_Version = File.GetVersion(); ! m_strAuthor = File.GetAuthor(); ! m_strLicence = File.GetLicence(); ! m_strNotes = File.GetNotes(); ! m_strURL = File.GetURL(); ! File.FillModuleArray(m_arrstrModules); ! File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status = PreLoaded; ! return true; ! } m_Status = ErrDescript; ! wxLogDebug("Invalid feature description file"); return false; } --- 240,270 ---- bool Plugin::PreLoad(wxString strName) { ! long l=0; ! wxString strFilePath; ! ! while(strFilePath = Application::GetApp().GetConfig().GetPluginsPath(l++), !strFilePath.IsEmpty()) ! { ! strFilePath << wxT("/") << strName << wxT("/plugin.xml"); ! PluginDescriptionFile File(strFilePath); ! wxLogDebug(wxT(" - %s tested"), strFilePath.GetData()); ! if(File.IsValid()) ! { ! wxLogDebug(wxT(" - %s loaded"), strFilePath.GetData()); ! SetDescriptorFilePath(strFilePath); ! m_strName = File.GetName(); ! m_strDescript = File.GetDescript(); ! m_Version = File.GetVersion(); ! m_strAuthor = File.GetAuthor(); ! m_strLicence = File.GetLicence(); ! m_strNotes = File.GetNotes(); ! m_strURL = File.GetURL(); ! File.FillModuleArray(m_arrstrModules); ! File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status = PreLoaded; ! return true; ! } ! } m_Status = ErrDescript; ! wxLogDebug(" - Invalid feature description file"); return false; } *************** *** 327,347 **** bool Feature::PreLoad(wxString strName) { ! wxString strFilePath = Application::GetApp().GetConfig().GetFeaturesPath() + wxT("/") + strName + wxT("/feature.xml"); ! FeatureDescriptionFile File(strFilePath); ! if(File.IsValid()) { ! m_strName = File.GetName(); ! m_strDescript = File.GetDescript(); ! m_Version = File.GetVersion(); ! m_strAuthor = File.GetAuthor(); ! m_strLicence = File.GetLicence(); ! m_strNotes = File.GetNotes(); ! m_strURL = File.GetURL(); ! File.FillDependantFeatureArray(m_arrstrFeatures); ! File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status = PreLoaded; ! return true; } ! wxLogDebug("Invalid feature description file"); m_Status = ErrDescript; return false; --- 356,385 ---- bool Feature::PreLoad(wxString strName) { ! wxString strFilePath; ! long l; ! ! l=0; ! while(strFilePath = Application::GetApp().GetConfig().GetFeaturesPath(l++), !strFilePath.IsEmpty()) { ! strFilePath << wxT("/") << strName << wxT("/feature.xml"); ! FeatureDescriptionFile File(strFilePath); ! if(File.IsValid()) ! { ! wxLogDebug(wxT(" - %s loaded"), strFilePath.GetData()); ! SetDescriptorFilePath(strFilePath); ! m_strName = File.GetName(); ! m_strDescript = File.GetDescript(); ! m_Version = File.GetVersion(); ! m_strAuthor = File.GetAuthor(); ! m_strLicence = File.GetLicence(); ! m_strNotes = File.GetNotes(); ! m_strURL = File.GetURL(); ! File.FillDependantFeatureArray(m_arrstrFeatures); ! File.FillDependantPluginArray(m_arrstrPlugins); ! m_Status = PreLoaded; ! return true; ! } } ! wxLogDebug(" - No description file found"); m_Status = ErrDescript; return false; *************** *** 445,449 **** wxDir dir; ! wxLogDebug("Preload feature descriptions :"); l = 0; while(strPath=Application::GetApp().GetConfig().GetFeaturesPath(l++), !strPath.IsEmpty()) --- 483,487 ---- wxDir dir; ! wxLogDebug(wxT("Preload feature descriptions :")); l = 0; while(strPath=Application::GetApp().GetConfig().GetFeaturesPath(l++), !strPath.IsEmpty()) *************** *** 454,458 **** while(bCont) { ! wxLogDebug(wxT(" -> %s"), str.GetData()); PreLoadFeature(str); bCont = dir.GetNext(&str); --- 492,496 ---- while(bCont) { ! wxLogDebug(wxT(" Looking for %s"), str.GetData()); PreLoadFeature(str); bCont = dir.GetNext(&str); *************** *** 462,466 **** ! wxLogDebug("Preload plugin descriptions :"); l = 0; while(strPath=Application::GetApp().GetConfig().GetPluginsPath(l++), !strPath.IsEmpty()) --- 500,504 ---- ! wxLogDebug(wxT("Preload plugin descriptions :")); l = 0; while(strPath=Application::GetApp().GetConfig().GetPluginsPath(l++), !strPath.IsEmpty()) *************** *** 471,475 **** while(bCont) { ! wxLogDebug(wxT(" -> %s"), str.GetData()); PreLoadPlugin(str); bCont = dir.GetNext(&str); --- 509,513 ---- while(bCont) { ! wxLogDebug(wxT(" Looking for %s"), str.GetData()); PreLoadPlugin(str); bCont = dir.GetNext(&str); *************** *** 541,546 **** wxLogDebug(wxT("Loading module %s"), strPath.GetData()); - strPath.Prepend(Application::GetApp().GetConfig().GetPluginsPath() + wxT("/")); - Module& module = m_ModuleMap[strPath]; if(module.IsLoaded()) --- 579,582 ---- |
|
From: Emilien K. <cur...@us...> - 2005-08-12 09:26:13
|
Update of /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16859/include/wxDevCenter Modified Files: Plugin.h Log Message: Modify module loading process. Decorate name with "lib .so" or ".dll" Now correctly load them. Index: Plugin.h =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/include/wxDevCenter/Plugin.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Plugin.h 3 Aug 2005 19:21:22 -0000 1.4 --- Plugin.h 12 Aug 2005 09:25:19 -0000 1.5 *************** *** 157,163 **** /** Charge le module. ! * @param strPath Chemin du module. * @return Vrai si chargement réussi.*/ ! bool Load(wxString strPath); /** Teste si le module est chargé. * @return Vrai si le module est chargé.*/ --- 157,163 ---- /** Charge le module. ! * @param strLongName Nom long du module. * @return Vrai si chargement réussi.*/ ! bool Load(wxString strLongName); /** Teste si le module est chargé. * @return Vrai si le module est chargé.*/ *************** *** 214,219 **** /** Charge le module et enregistre son contenu. ! * @param strPath Chemin absolu du module à charger.*/ ! bool Load(wxString strPath); /** Décharge le module.*/ bool Unload(); --- 214,220 ---- /** Charge le module et enregistre son contenu. ! * @param strLongName Nom long du module. ! * @return Vrai si chargement réussi.*/ ! bool Load(wxString strLongName); /** Décharge le module.*/ bool Unload(); *************** *** 255,258 **** --- 256,261 ---- /** Nom de la fonctionnalité.*/ wxString m_strName; + /** Chemin du fichier de description.*/ + wxString m_strDescriptFilePath; /** Description de la fonctionnalité.*/ wxString m_strDescript; *************** *** 287,290 **** --- 290,298 ---- bool IsInitialized()const{return (m_Status&Initialized)!=0;} + /** Fixe le chemin du fichier de description.*/ + void SetDescriptorFilePath(wxString strPath){m_strDescriptFilePath=strPath;} + /** Retourne le chemin du fichier de description.*/ + wxString GetDescriptorFilePath()const{return m_strDescriptFilePath;} + /** Acces sur le nom.*/ wxString GetName()const{return m_strName;} *************** *** 339,342 **** --- 347,352 ---- /** Nom de la fonctionnalité.*/ wxString m_strName; + /** Chemin du fichier de description.*/ + wxString m_strDescriptFilePath; /** Description de la fonctionnalité.*/ wxString m_strDescript; *************** *** 395,398 **** --- 405,414 ---- Version GetVersion()const{return m_Version;} + /** Fixe le chemin du fichier de description.*/ + void SetDescriptorFilePath(wxString strPath){m_strDescriptFilePath=strPath;} + /** Retourne le chemin du fichier de description.*/ + wxString GetDescriptorFilePath()const{return m_strDescriptFilePath;} + + /** Retourne une image représentant le logo du plugin. * @return Logo du plugin.*/ |
|
From: Emilien K. <cur...@us...> - 2005-08-11 16:19:34
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1633/src Modified Files: Plugin.cpp Log Message: Prevent assert if description file is not found on directory. Index: Plugin.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Plugin.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Plugin.cpp 11 Aug 2005 11:02:47 -0000 1.6 --- Plugin.cpp 11 Aug 2005 16:19:25 -0000 1.7 *************** *** 656,661 **** m_bOk(false) { ! if(m_Doc.Load(strPath)) ! Parse(); } --- 656,662 ---- m_bOk(false) { ! if(wxFile::Exists(strPath)) ! if(m_Doc.Load(strPath)) ! Parse(); } *************** *** 752,757 **** m_bOk(false) { ! if(m_Doc.Load(strPath)) ! Parse(); } --- 753,759 ---- m_bOk(false) { ! if(wxFile::Exists(strPath)) ! if(m_Doc.Load(strPath)) ! Parse(); } |
|
From: Emilien K. <cur...@us...> - 2005-08-11 16:08:33
|
Update of /cvsroot/wxdevcenter/wxDevCenter/build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30198/build Modified Files: install.bkl Log Message: Add freedesktop menu item for wxDevCenter. Index: install.bkl =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/build/install.bkl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** install.bkl 14 May 2005 12:15:53 -0000 1.2 --- install.bkl 11 Aug 2005 16:08:22 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- <using module="datafiles" /> + <using module="datafilesng" /> <!-- Install headers. --> *************** *** 63,65 **** --- 64,82 ---- </data-files-tree> + <!-- Install freedesktop menu info. --> + <set var="FREEDESKTOP_MENU_FILE"> + <if cond="BUILD=='release'">data/wxdevcenter.desktop</if> + <if cond="BUILD=='debug'">data/wxdevcenterd.desktop</if> + </set> + <copy-file-to-file id="freedesktop_menu_test"> + <src>$(FREEDESKTOP_MENU_FILE)</src> + <dst>$(DATADIR)/applications/wxdevcenter.desktop</dst> + </copy-file-to-file> + + <!-- Install freedesktop menu info. --> + <copy-file-to-file id="freedesktop_menu_icon"> + <src>data/img/wxDevCenter.png</src> + <dst>$(DATADIR)/pixmaps/wxDevCenter.png</dst> + </copy-file-to-file> + </makefile> |
|
From: Emilien K. <cur...@us...> - 2005-08-11 16:08:33
|
Update of /cvsroot/wxdevcenter/wxDevCenter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30198 Modified Files: GNUmakefile Log Message: Add freedesktop menu item for wxDevCenter. Index: GNUmakefile =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/GNUmakefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GNUmakefile 6 Aug 2005 20:55:51 -0000 1.2 --- GNUmakefile 11 Aug 2005 16:08:23 -0000 1.3 *************** *** 125,128 **** --- 125,134 ---- endif ifeq ($(BUILD),debug) + FREEDESKTOP_MENU_FILE = data/wxdevcenterd.desktop + endif + ifeq ($(BUILD),release) + FREEDESKTOP_MENU_FILE = data/wxdevcenter.desktop + endif + ifeq ($(BUILD),debug) __WARNINGS = -W -Wall endif *************** *** 207,210 **** --- 213,222 ---- install -c ./bin/wxDevCenter$(SUFFIX) $(prefix)/bin + $(prefix)/share/applications/wxdevcenter.desktop: $(FREEDESKTOP_MENU_FILE) + cp -pf $(FREEDESKTOP_MENU_FILE) $(prefix)/share/applications/wxdevcenter.desktop + + $(prefix)/share/pixmaps/wxDevCenter.png: data/img/wxDevCenter.png + cp -pf data/img/wxDevCenter.png $(prefix)/share/pixmaps/wxDevCenter.png + ./build/$(BUILD)/specific_Config.o: ./src/unix/Config.cpp $(CXX) -c -o $@ $(SPECIFIC_CXXFLAGS) $(CPPDEPS) $< |
|
From: Emilien K. <cur...@us...> - 2005-08-11 15:48:53
|
Update of /cvsroot/wxdevcenter/wxDevCenter/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25132/data Added Files: wxdevcenter.desktop wxdevcenterd.desktop Log Message: Add freedesktop menu item for wxDevCenter. --- NEW FILE: wxdevcenterd.desktop --- [Desktop Entry] Name=wxDevCenter Comment=wxDevCenter (debug mode) GenericName=wxDevCenter Exec=wxDevCenterD Icon=wxDevCenter.png Terminal=false Type=Application Categories=Application;Utility; StartupNotify=true --- NEW FILE: wxdevcenter.desktop --- [Desktop Entry] Name=wxDevCenter Comment=wxDevCenter GenericName=wxDevCenter Exec=wxDevCenter Icon=wxDevCenter.png Terminal=false Type=Application Categories=Application;Utility; StartupNotify=true |
|
From: Emilien K. <cur...@us...> - 2005-08-11 14:44:37
|
Update of /cvsroot/wxdevcenter/StdPlugin/plugins/StdPlugin.Bitmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11285/plugins/StdPlugin.Bitmap Added Files: plugin.xml Log Message: Add plugin descriptors. --- NEW FILE: plugin.xml --- <?xml version="1.0" encoding="UTF-8"?> <plugin id="StdPlugin.Bitmap" version="0.3.0" label="StdPlugin.Bitmap" provider-name="Arcallians"> <description>Standard plugin. Used to edit bitmaps.</description> <copyright>Notes</copyright> <license>Licence</license> <requires> <module name="Bitmap-0.3.0" /> </requires> </plugin> |
|
From: Emilien K. <cur...@us...> - 2005-08-11 14:44:37
|
Update of /cvsroot/wxdevcenter/StdPlugin/plugins/StdPlugin.Text In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11285/plugins/StdPlugin.Text Added Files: plugin.xml Log Message: Add plugin descriptors. --- NEW FILE: plugin.xml --- <?xml version="1.0" encoding="UTF-8"?> <plugin id="StdPlugin.Text" version="0.3.0" label="StdPlugin.Text" provider-name="Arcallians"> <description>Standard plugin. Used to edit texts.</description> <copyright>Notes</copyright> <license>Licence</license> <requires> <module name="Text-0.3.0" /> </requires> </plugin> |
|
From: Emilien K. <cur...@us...> - 2005-08-11 14:44:36
|
Update of /cvsroot/wxdevcenter/StdPlugin/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11253/plugins Log Message: Directory /cvsroot/wxdevcenter/StdPlugin/plugins added to the repository |