| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 
 | 
[LEFT]int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    int        i;
    if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
        return -1;
    CSplashWnd::ShowSplashScreen(this);
 
    if (!m_wndMessageBar.Create(this, IDD_MESSAGE, 
        WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_SIZE_DYNAMIC | CBRS_HIDE_INPLACE,
        ID_VIEW_MESSAGE_BAR))
    {
        TRACE0("Impossible de créer messagebar\n");
        return -1;      // fail to create
    }
 
    if(!MessageBarInitialize()) {
        AfxMessageBox("Initialisation de la Zone Message impossible");
        return -1;
    }
    m_MessageListBox.AddString("");
 
    m_wndMessageBar.SetWindowText("Zone Message");
 
    // Create Menu toolbar
    
    if (!m_MenuToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP
        | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
        !m_MenuToolBar.LoadToolBar(IDR_TOOLBAR_MENU))
    {
        TRACE0("Impossible de créer menu toolbar\n");
        return -1;      // fail to create
    }
    // Create toolbar Système
    
    if (!m_ToolBarSystem.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP
        | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
        !m_ToolBarSystem.LoadToolBar(IDR_TOOLBAR_S))
    {
        TRACE0("Impossible de créer system toolbar\n");
        return -1;      // fail to create
    }
    m_ToolBarSystem.GetToolBarCtrl().SetExtendedStyle(TBSTYLE_EX_DRAWDDARROWS);
 
    m_ToolBarSystem.SetDropDown(IDR_TOOLBAR_Z);
    m_ToolBarSystem.SetDropDown(IDR_TOOLBAR_P);
    m_ToolBarSystem.SetDropDown(IDR_TOOLBAR_VIEW);
    m_ToolBarSystem.SetDropDown(IDR_TOOLBAR_SELECT);
    m_ToolBarSystem.SetDropDown(IDR_TOOLBAR_UNDO);
    
    m_MenuToolBar.SetWindowText("Modules");
    m_MenuToolBar.EnableDocking(CBRS_ALIGN_TOP);
  
    //ShowControlBar(&m_MenuToolBar, TRUE, FALSE); // je ne peux pas faire les ShowControlBar car ils plantent a l'execution aussi (meme chose que RecalcLayout)
 
    m_ToolBarSystem.SetWindowText("Systeme");
    m_ToolBarSystem.EnableDocking(CBRS_ALIGN_TOP);
   // Positionnement des toolbars
     EnableDocking(CBRS_ALIGN_ANY);
    DockControlBar(&m_MenuToolBar, AFX_IDW_DOCKBAR_TOP);
    DockControlBar(&m_ToolBarSystem,AFX_IDW_DOCKBAR_TOP);
    //DockControlBarLeftOf(&m_ToolBarSystem,&m_MenuToolBar); //meme fonction que precedemment qui contient un RecalcLayout()
    //ShowControlBar(&m_ToolBarSystem, TRUE, FALSE); | 
Partager