|
From: Emilien K. <cur...@us...> - 2005-02-25 20:58:17
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9183/src Modified Files: Application.cpp FileSystemCtrl.cpp MainFrame.cpp Log Message: Suppression des arguments DocManager pour les controles de systèmes de fichiers car a pu besoin (ca passe par le système de fichiers). Index: FileSystemCtrl.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/FileSystemCtrl.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FileSystemCtrl.cpp 15 Jan 2005 14:05:17 -0000 1.5 --- FileSystemCtrl.cpp 25 Feb 2005 20:58:04 -0000 1.6 *************** *** 81,93 **** FileSystemTreeCtrl::FileSystemTreeCtrl(wxWindow* parent, wxWindowID id, wxDevCenter::FileSystem *pFileSystem, - wxDevCenter::DocManager *pDocManager, const wxPoint& pos, const wxSize& size, long style): wxTreeCtrl(parent, id, pos, size, style), m_pFileSystem(pFileSystem), - m_pDocManager(pDocManager), m_nMode(WXDC_FSTC_MODE_NORMAL), m_strRootPath() { ! SetImageList(m_pDocManager->GetImageList(WXDC_SETUP_TREE_ICON_SIZE)); } --- 81,91 ---- 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() { ! SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_TREE_ICON_SIZE)); } *************** *** 101,106 **** void FileSystemTreeCtrl::SetFileSystem(wxDevCenter::FileSystem *pFileSystem) { - m_pFileSystem = pFileSystem; DeleteAllItems(); } --- 99,105 ---- void FileSystemTreeCtrl::SetFileSystem(wxDevCenter::FileSystem *pFileSystem) { DeleteAllItems(); + m_pFileSystem = pFileSystem; + SetImageList(m_pFileSystem->GetImageList(WXDC_SETUP_TREE_ICON_SIZE)); } *************** *** 191,204 **** long FileSystemTreeCtrl::CalcItemType(FilePath path) { ! long type; ! if(path.IsEmpty()) ! return -1; ! if(m_pFileSystem->IsDirectory(path)) ! type = m_pFileSystem->GetDirectorySystemType(path); ! else ! type = m_pDocManager->GetDocTemplateID(path.GetFileExt()); ! if(type==-1) ! type = WXDC_DOCMANAGER_TYPE_UNKNOW; ! return type; } --- 190,194 ---- long FileSystemTreeCtrl::CalcItemType(FilePath path) { ! return m_pFileSystem->GetFileType(path); } *************** *** 286,299 **** // Constructeur. ! FileSystemListCtrl::FileSystemListCtrl(wxWindow* parent, wxWindowID id, FileSystem *pFileSystem, DocManager *pDocManager, const wxPoint& pos, const wxSize& size, long style): wxListCtrl(parent, id, pos, size, style), m_pFileSystem(pFileSystem), - m_pDocManager(pDocManager), m_nMode(WXDC_FSTC_MODE_NORMAL), m_strPath(), m_strWild("*.*") { ! SetImageList(m_pDocManager->GetImageList(WXDC_SETUP_LIST_BIG_ICON_SIZE), wxIMAGE_LIST_NORMAL); ! SetImageList(m_pDocManager->GetImageList(WXDC_SETUP_LIST_LITTLE_ICON_SIZE), wxIMAGE_LIST_SMALL); OpenRoot(); } --- 276,288 ---- // 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(); } *************** *** 307,312 **** void FileSystemListCtrl::SetFileSystem(FileSystem *pFileSystem) { - m_pFileSystem = pFileSystem; DeleteAllItems(); } --- 296,303 ---- 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); } *************** *** 386,401 **** long FileSystemListCtrl::CalcItemType(FilePath path) { ! long type; ! if(path.IsEmpty()) ! return -1; ! if(m_pFileSystem->IsDirectory(path)) ! type = m_pFileSystem->GetDirectorySystemType(path); ! else ! { ! type = m_pDocManager->GetDocTemplateID(path.GetFileExt()); ! if(type==-1) ! type = WXDC_DOCMANAGER_TYPE_UNKNOW; ! } ! return type; } --- 377,381 ---- long FileSystemListCtrl::CalcItemType(FilePath path) { ! return m_pFileSystem->GetFileType(path); } *************** *** 468,474 **** // Constructeur. ! FileSystemPanel::FileSystemPanel(wxWindow* parent, wxWindowID id, DocManager* pDocManager, FileSystem* pFileSystem, wxString strWild): wxPanel(parent, id), - m_pDocManager(pDocManager), m_pFileSystem(pFileSystem), m_pSplitter(NULL), --- 448,453 ---- // Constructeur. ! FileSystemPanel::FileSystemPanel(wxWindow* parent, wxWindowID id, FileSystem* pFileSystem, wxString strWild): wxPanel(parent, id), m_pFileSystem(pFileSystem), m_pSplitter(NULL), *************** *** 478,483 **** m_pSplitter = new wxSplitterWindow(this, -1); ! m_pTree = new FileSystemTreeCtrl(m_pSplitter, ID_TREE, m_pFileSystem, m_pDocManager); ! m_pList = new FileSystemListCtrl(m_pSplitter, ID_LIST, m_pFileSystem, m_pDocManager); m_pSplitter->SplitVertically(m_pTree, m_pList, 128); --- 457,462 ---- 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); *************** *** 596,602 **** // Constructeur classique des FileDialog. ! FileSystemDialog::FileSystemDialog(wxWindow* parent, wxWindowID id, DocManager* pDocManager, const wxString& message, const wxString& defaultDir, const wxString& defaultFile, const wxString& wildcard, long style, const wxPoint& pos): ! wxDialog(parent, id, message, pos, wxSize(600,400), style), ! m_pDocManager(pDocManager) { wxSizer *pGlobalSizer = new wxBoxSizer(wxVERTICAL); --- 575,580 ---- // Constructeur classique des FileDialog. ! FileSystemDialog::FileSystemDialog(wxWindow* parent, wxWindowID id, const wxString& message, const wxString& defaultDir, const wxString& defaultFile, const wxString& wildcard, long style, const wxPoint& pos): ! wxDialog(parent, id, message, pos, wxSize(600,400), style) { wxSizer *pGlobalSizer = new wxBoxSizer(wxVERTICAL); *************** *** 695,699 **** void FileSystemDialog::AttachFileSystem(FileSystem *pFileSystem, wxString strTitle, wxBitmap& bmp) { ! FileSystemPanel *pPanel = new FileSystemPanel(m_pListbook, -1, m_pDocManager, pFileSystem); m_pImageList->Add(bmp); m_pListbook->AddPage(pPanel, strTitle, true, m_pImageList->GetImageCount()-1); --- 673,677 ---- 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); Index: Application.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Application.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Application.cpp 23 Feb 2005 14:11:45 -0000 1.11 --- Application.cpp 25 Feb 2005 20:58:04 -0000 1.12 *************** *** 298,302 **** bool Application::OpenDocument() { ! FileSystemDialog FD(NULL, -1, &m_DocManager, WXDC_DOCUMENT_REQUEST_OPEN, WXDC_SYSTEM_DEFAULT_PATH); FD.AttachFileSystems(&m_FileSystemManager); FD.SetWildcard(m_DocManager.GetAllWildcard()); --- 298,302 ---- bool Application::OpenDocument() { ! FileSystemDialog FD(NULL, -1, WXDC_DOCUMENT_REQUEST_OPEN, WXDC_SYSTEM_DEFAULT_PATH); FD.AttachFileSystems(&m_FileSystemManager); FD.SetWildcard(m_DocManager.GetAllWildcard()); *************** *** 332,336 **** if(path.IsEmpty() || bForceChooseName) // Sélection du fichier. { ! FileSystemDialog FD(NULL, -1, &m_DocManager, WXDC_DOCUMENT_REQUEST_SAVE, WXDC_SYSTEM_DEFAULT_PATH, path); FD.AttachFileSystems(&m_FileSystemManager); FD.SetWildcard(pDoc->GetDocTemplate()->GetDocWildcard(true)); --- 332,336 ---- if(path.IsEmpty() || bForceChooseName) // Sélection du fichier. { ! FileSystemDialog FD(NULL, -1, WXDC_DOCUMENT_REQUEST_SAVE, WXDC_SYSTEM_DEFAULT_PATH, path); FD.AttachFileSystems(&m_FileSystemManager); FD.SetWildcard(pDoc->GetDocTemplate()->GetDocWildcard(true)); Index: MainFrame.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/MainFrame.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MainFrame.cpp 22 Feb 2005 16:24:05 -0000 1.5 --- MainFrame.cpp 25 Feb 2005 20:58:04 -0000 1.6 *************** *** 162,167 **** m_pMDIFrame = new MDIFrame(this, this, -1); ! m_pStdFileSystemTree = new FileSystemTreeCtrl(this, -1, ! wxGetApp().GetStandardFileSystem(), &wxGetApp().GetDocManager()); m_pStdFileSystemTree->OpenRoot(); --- 162,166 ---- m_pMDIFrame = new MDIFrame(this, this, -1); ! m_pStdFileSystemTree = new FileSystemTreeCtrl(this, -1, wxGetApp().GetStandardFileSystem()); m_pStdFileSystemTree->OpenRoot(); |