Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Problem with combobox and other buttons on the toobar... Collapse All
Subject Author Date
Saroj Acharya Nov 12, 2004 - 11:32 AM

Hi,


I am trying to create a toobar with a Combobox and few buttons on it so that I could type in a Text on the combobox and the place/remove the text on my View when certain buttons on the same toolbar is clicked. I have been able to create the Combo box along with the buttons on the same toobar using the following lines of code. But the problem is that the Combobox is not fully visible and the toolbar is too small to fit all the buttons. I cannot make this bar longer and when I increase the size in Y-direction, I could see the other buttons but Combobox is clipped. Can you help me to get this problem solved ?


Thanks,


Saroj


Code used to create the toolbar:



CExtComboBox m_wndComboWebLoaction;



CExtToolControlBar  m_wndToolBarWeb;


BOOL CMainFrame::OnCreate(..)


{



:


CreateTextAnnotationToolBar();


m_wndToolBarWeb.EnableDocking(CBRS_ALIGN_ANY);


:


DockControlBar(&m_wndToolBarWeb);


:


}



BOOL CMainFrame::CreateTextAnnotationToolBar()


{



static const UINT arrWebTbBtns[] =


{


ID_ANNOTATION_DEFINE_TEXT,


ID_SEPARATOR,


ID_ANNOTATION_DEFINE_TEXT,


};


if( !m_wndToolBarWeb.Create(_T("Text Annotation Toolbar"), this, ID_VIEW_TEXT_ANNOTATION_TOOLBAR )


|| !m_wndToolBarWeb.SetButtons( arrWebTbBtns, sizeof(arrWebTbBtns)/sizeof(arrWebTbBtns[0]) )


)


{


TRACE0("Failed to create m_wndToolBarWeb\n");


return(FALSE); // fail to create


}


if( !m_wndComboWebLoaction.Create(


WS_CHILD | WS_VISIBLE | CBS_DROPDOWN,


CRect(0,0, 300, 500),


&m_wndToolBarWeb,


ID_ANNOTATION_DEFINE_TEXT


)


)


{


TRACE0("Failed to create ID_WEB_URL\n");


return(FALSE); // fail to create


}


VERIFY(m_wndToolBarWeb.SetButtonCtrl(m_wndToolBarWeb.CommandToIndex(m_wndComboWebLoaction.GetDlgCtrlID()),&m_wndComboWebLoaction) );


m_wndComboWebLoaction.SetFont(CFont::FromHandle((HFONT)::GetStockObject(DEFAULT_GUI_FONT)) );


m_wndComboWebLoaction.SetItemHeight(-1, m_wndComboWebLoaction.GetItemHeight(-1) - 1 );


return(TRUE);


}


 

Technical Support Nov 15, 2004 - 2:16 AM

The source code in your message is correct. To clarify the issue, we need a screenshot or source code of your application.