MFC Ribbon - alignment issue(s)

Discussion in 'MFC' started by OReubens, Sep 9, 2010.

  1. OReubens

    OReubens New Member

    Joined:
    Sep 9, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Create a standard App with ribbon, then add this to the CMainFrame::InitializeRibbon() at the appropriate place.

    Code:
    // Create panel
    CMFCRibbonPanel* pMyPanel = pCategory->AddPanel(L"Test", m_PanelImages.ExtractIcon(27));
    // Add wide combobox with short label to panel
    m_pMyCombo = new CMFCRibbonComboBox(ID_MYCOMBO, false, 150, L"Short:");
    m_pMyCombo->AddItem(L"Just some test data");
    pMyPanel->Add(m_pMyCombo);
    
    // Add narrow edit with longer label to panel.
    CMFCRibbonEdit* pMyEdit = new CMFCRibbonEdit(ID_MYEDIT, 50, L"Longer label:");
    pMyPanel->Add(pMyEdit); 
    
    Issue 1:
    The combobox 'sticks' to the top of the panel.
    The edit control 'sticks' to the combobox
    There is abouto 1/3rd of the height unused.

    Is there a way to make these 2 controls use the full height ? I can use pMyPanel->SetCenterColumnVert(); But the 2 controls are still stuck together although they're now vertically centered. What I'm really after is that there is more or less even spacing above and below the controls.


    Issue 2:
    this looks as
    Code:
    Short: [______________________|_v_]
    Longer label: [___] 
    
    which isn't really looking nice.

    I can call SetJustifyColums() but this results in
    Code:
    Short: [______________________|_v_]
    Longer label:                 [___] 
    
    which may seem ok enough, but if the length of the labels reverses it gives:
    Code:
    Longer label: [______________________|_v_]
    Short:                               [___] 
    
    which isn't really looking ok

    I'd really like to get this to like you'd normally make a dialog. Labels left aligned and controls left aligned also.
    Code:
    Short:        [______________________|_v_]
    Longer label: [___] 
    
    How can these issues be solved ?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice