|
From: Emilien K. <cur...@us...> - 2005-02-22 16:24:23
|
Update of /cvsroot/wxdevcenter/wxDevCenter/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10533/src Modified Files: MainFrame.cpp Log Message: Passe des SashWindows à wxFrameLayout. Index: MainFrame.cpp =================================================================== RCS file: /cvsroot/wxdevcenter/wxDevCenter/src/MainFrame.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MainFrame.cpp 14 Jan 2005 14:34:59 -0000 1.4 --- MainFrame.cpp 22 Feb 2005 16:24:05 -0000 1.5 *************** *** 36,39 **** --- 36,58 ---- #include <wx/sashwin.h> + + + + // fl headers + #include <wx/fl/controlbar.h> // core API + // extra plugins + #include <wx/fl/barhintspl.h> // bevel for bars with "X"s and grooves + #include <wx/fl/rowdragpl.h> // NC-look with draggable rows + #include <wx/fl/cbcustom.h> // customization plugin + #include <wx/fl/hintanimpl.h> + + // beauty-care + #include <wx/fl/gcupdatesmgr.h> // smooth d&d + #include <wx/fl/antiflickpl.h> // double-buffered repaint of decorations + #include <wx/fl/dyntbar.h> // auto-layout toolbar + #include <wx/fl/dyntbarhnd.h> // control-bar dimension handler for it + + + using namespace wxDevCenter; *************** *** 72,77 **** BEGIN_EVENT_TABLE(MainFrame, TopFrame) EVT_CLOSE(MainFrame::OnClose) - EVT_SASH_DRAGGED(wxID_ANY , MainFrame::OnLeftSashDragged) - EVT_SIZE(MainFrame::OnSize) EVT_TREE_ITEM_ACTIVATED(wxID_ANY, MainFrame::OnFileSystemTreeCtrlItemActivate) EVT_TREE_BEGIN_DRAG(wxID_ANY, MainFrame::OnFileSystemTreeCtrlItemDrag) --- 91,94 ---- *************** *** 140,144 **** m_pGlobalSizer(NULL), m_pMDIFrame(NULL), - m_pLeftShashWindow(NULL), m_pStdFileSystemTree(NULL) { --- 157,160 ---- *************** *** 146,164 **** m_pMDIFrame = new MDIFrame(this, this, -1); ! m_pLeftShashWindow = new wxSashWindow(this, -1, wxDefaultPosition, wxSize(200, 30), wxCLIP_CHILDREN ); ! m_pLeftShashWindow->SetSashVisible(wxSASH_RIGHT, true); ! m_pLeftShashWindow->SetMinimumSizeX(24); ! ! m_pStdFileSystemTree = new FileSystemTreeCtrl(m_pLeftShashWindow, -1, wxGetApp().GetStandardFileSystem(), &wxGetApp().GetDocManager()); m_pStdFileSystemTree->OpenRoot(); - m_pGlobalSizer = new wxBoxSizer(wxHORIZONTAL); - m_pGlobalSizer->Add(m_pLeftShashWindow, 0, wxGROW); - m_pGlobalSizer->Add(m_pMDIFrame, 2, wxGROW); ! m_pGlobalSizer->SetItemMinSize(m_pLeftShashWindow, 200, 30); ! m_pGlobalSizer->SetItemMinSize(m_pMDIFrame, 48, 30); ! SetSizer(m_pGlobalSizer); // Création de la barre des menu puis réinitialisation de celle-ci --- 162,197 ---- m_pMDIFrame = new MDIFrame(this, this, -1); ! m_pStdFileSystemTree = new FileSystemTreeCtrl(this, -1, wxGetApp().GetStandardFileSystem(), &wxGetApp().GetDocManager()); m_pStdFileSystemTree->OpenRoot(); ! m_pFrameLayout = new wxFrameLayout(this, m_pMDIFrame); ! m_pFrameLayout->SetUpdatesManager( new cbGCUpdatesMgr() ); ! ! // setup plugins for testing ! m_pFrameLayout->PushDefaultPlugins(); ! m_pFrameLayout->AddPlugin( CLASSINFO( cbBarHintsPlugin ) ); // fancy "X"es and bevel for bars ! m_pFrameLayout->AddPlugin( CLASSINFO( cbAntiflickerPlugin ) ); ! 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 *************** *** 188,223 **** } - - - void MainFrame::OnSize(wxSizeEvent &event) - { - wxRect r = m_pLeftShashWindow->GetRect(); - wxSize s = event.GetSize(); - - m_pLeftShashWindow->SetMaximumSizeX(s.GetWidth()-24); - - if(r.width>=s.GetWidth()-24) - m_pGlobalSizer->SetItemMinSize(m_pLeftShashWindow, s.GetWidth()-24, r.height); - - Layout(); - } - - - void MainFrame::OnLeftSashDragged(wxSashEvent &event) - { - if(event.GetDragStatus()==wxSASH_STATUS_OK) - { - wxRect r = event.GetDragRect(); - wxSize s = GetClientSize(); - - if(r.width<s.GetWidth()-24) - m_pGlobalSizer->SetItemMinSize(m_pLeftShashWindow, r.width, r.height); - else - m_pGlobalSizer->SetItemMinSize(m_pLeftShashWindow, s.GetWidth()-24, r.height); - m_pGlobalSizer->Layout(); - } - } - - // Intercepte les changements pour la barre de status. void MainFrame::OnStatusChange(StatusEvent& event) --- 221,224 ---- |