|
From: Emilien K. <cur...@us...> - 2005-03-17 16:18:48
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22044/src Modified Files: Application.cpp FileSystem.cpp Frame.cpp MainFrame.cpp WorkBar.cpp Log Message: Automontage des WorkBar pour les FileSystem. Index: Application.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Application.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Application.cpp 17 Mar 2005 14:37:41 -0000 1.18 --- Application.cpp 17 Mar 2005 16:18:37 -0000 1.19 *************** *** 92,96 **** // Initialise le gestionnaire de systèmes de fichiers m_pStandardFileSystem = new FileSystemStandard; ! m_FileSystemManager.Register(m_pStandardFileSystem); // Crée la fenetre principale --- 92,96 ---- // Initialise le gestionnaire de systèmes de fichiers m_pStandardFileSystem = new FileSystemStandard; ! m_FileSystemManager.Register(m_pStandardFileSystem, true); // Crée la fenetre principale *************** *** 104,108 **** m_pMainFrame->Show(true); ! // Test des worksbars. --- 104,109 ---- m_pMainFrame->Show(true); ! // Enregistre la fenêtre principale dans le WorkBarManager ! wxGetApp().GetWorkBarManager().RegisterFrame(m_pMainFrame); // Test des worksbars. Index: Frame.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/Frame.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Frame.cpp 17 Mar 2005 14:37:42 -0000 1.4 --- Frame.cpp 17 Mar 2005 16:18:37 -0000 1.5 *************** *** 86,90 **** m_bHasViewMenu(false) { - wxGetApp().GetWorkBarManager().RegisterFrame(this); } --- 86,89 ---- Index: WorkBar.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/WorkBar.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WorkBar.cpp 17 Mar 2005 14:56:00 -0000 1.2 --- WorkBar.cpp 17 Mar 2005 16:18:38 -0000 1.3 *************** *** 86,92 **** // Désenregistre un type de barre. ! void WorkBarManager::UnregisterWorkBar(wxClassInfo* pClassInfo) { ! int i = Find(pClassInfo); if(i!=-1) { --- 86,92 ---- // Désenregistre un type de barre. ! void WorkBarManager::UnregisterWorkBar(wxClassInfo* pClassInfo, wxObject* pExtraObj) { ! int i = Find(pClassInfo, pExtraObj); if(i!=-1) { *************** *** 129,132 **** --- 129,133 ---- WorkBar* pBar = CreateObject(nBar); pBar->m_pAttachedWindow = &(m_FrameManager[nFrame]); + pBar->m_pExtraObject = GetTemplate(nBar).GetExtraObject(); if(!m_FrameManager[nFrame].AddWorkBar(pBar, GetTemplate(nBar).GetName())) DestroyObject(pBar); Index: FileSystem.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/FileSystem.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileSystem.cpp 16 Mar 2005 14:27:37 -0000 1.2 --- FileSystem.cpp 17 Mar 2005 16:18:37 -0000 1.3 *************** *** 24,27 **** --- 24,28 ---- #include <wxDevCenter.h> #include <wxDevCenter/FileSystem.h> + #include <wxDevCenter/FileSystemCtrl.h> #include <wx/tokenzr.h> *************** *** 216,218 **** --- 217,260 ---- } + // Enregistre un système de fichier. + bool FileSystemManager::Register(FileSystem* pFileSystem, bool bMountWorkBar) + { + if(!InitializableObjectManager<FileSystem>::Register(pFileSystem)) + return false; + if(bMountWorkBar) + wxGetApp().GetWorkBarManager().RegisterWorkBar(CLASSINFO(FileSystemTreeWorkBar), wxT(""), wxT(""), pFileSystem); + return true; + } + + // Désenregistre un système de fichier. + bool FileSystemManager::Unregister(FileSystem* pFileSystem) + { + wxGetApp().GetWorkBarManager().UnregisterWorkBar(CLASSINFO(FileSystemTreeWorkBar), pFileSystem); + return InitializableObjectManager<FileSystem>::Unregister(pFileSystem); + } + + + ////////////////////////////////////////////////////////////////////// + // 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); + wxBoxSizer* pSizer = new wxBoxSizer(wxVERTICAL); + pSizer->Add(m_pFSTreeCtrl, 1, wxGROW); + SetSizer(pSizer); + m_pFSTreeCtrl->OpenRoot(); + return true; + } Index: MainFrame.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/MainFrame.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** MainFrame.cpp 17 Mar 2005 14:37:42 -0000 1.8 --- MainFrame.cpp 17 Mar 2005 16:18:38 -0000 1.9 *************** *** 156,169 **** TopFrame(WXDC_NAME, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN), m_pGlobalSizer(NULL), ! m_pMDIFrame(NULL), ! m_pStdFileSystemTree(NULL) { SetStatusBar(new StatusBar(this)); m_pMDIFrame = new MDIFrame(this, this, -1); - m_pStdFileSystemTree = new FileSystemTreeCtrl(this, -1, wxGetApp().GetStandardFileSystem()); - m_pStdFileSystemTree->OpenRoot(); - - m_pFrameLayout = new wxFrameLayout(this, m_pMDIFrame); m_pFrameLayout->SetUpdatesManager( new cbGCUpdatesMgr() ); --- 156,164 ---- TopFrame(WXDC_NAME, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN), m_pGlobalSizer(NULL), ! m_pMDIFrame(NULL) { SetStatusBar(new StatusBar(this)); m_pMDIFrame = new MDIFrame(this, this, -1); m_pFrameLayout = new wxFrameLayout(this, m_pMDIFrame); m_pFrameLayout->SetUpdatesManager( new cbGCUpdatesMgr() ); *************** *** 175,197 **** m_pFrameLayout->AddPlugin( CLASSINFO( cbHintAnimationPlugin ) ); - - - // drop in some bars - cbDimInfo sizes( 160, 220, // when docked horizontally - 220, 160, // when docked vertically - 160, 220, // when floated - FALSE, // the bar is not fixed-size - 4, // vertical gap (bar border) - 4 // horizontal gap (bar border) - ); - - m_pFrameLayout->AddBar( m_pStdFileSystemTree, // bar window - sizes, FL_ALIGN_LEFT, // alignment ( 0-top,1-bottom, etc) - 0, // insert into 0th row (vert. position) - 0, // offset from the start of row (in pixels) - "Standard File System", // name for reference in customization pop-ups - FALSE - ); - // Création de la barre des menu puis réinitialisation de celle-ci BuildMenu(); --- 170,173 ---- |