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 General Discussion » Resizable CExtComboBox in the CExtToolControlBar Collapse All
Subject Author Date
Eugene Wineblat Aug 15, 2006 - 11:36 AM

I have inserted object that derives from the CExtComboBox like button to the CExtToolControlBar (InsertButton and then SetButtonCtrl ).
What should I do to make my "CExtComboBox button" resized corresponding to the ToolBar, I want my ComboBox to have fixed percent of ToolBar width.

Thank you.

Technical Support Mar 5, 2008 - 1:20 PM

You should not perform toolbar combo box resizing in the CFileServView::OnSize() method. Instead of this, create your own CExtToolControlBar-derived class and override the CExtToolControlBar::_RecalcPositionsImpl() internal virtual method. Your method should invoke the parent method and then re-compute size of the child combo box.

Technical Support Feb 28, 2008 - 8:08 AM

The combo boxes inside toolbars are non-resizable. If you use dockable and customizable toolbars like in the StyleEditor sample, the combo/edit built-in fields can be resized by the user in the customize mode. The combo boxes in a toolbar are never resized automatically when toolbar’s size changes. If you use a combo box or any other window attached to the toolbar window, the toolbar button’s size is the same as the size of the attached window.

Georgy Vostrikov Mar 3, 2008 - 2:00 AM

I trying resize combo box inside toolbar this way:

void CFileServView::OnSize(UINT nType, int cx, int cy)
{ RepositionBars(0,0xFFFF,AFX_IDW_PANE_FIRST);

int ButtonsCount = Toolbar.GetButtonsCount();
CRect rcButton;

ASSERT(ButtonsCount > 0);
Toolbar.GetButtonRect(ButtonsCount - 1, &rcButton);

int const DriveListHeight = 20;
int const DriveListWidth = max(0, cx - rcButton.left - __EXT_TB_BUTTON_OUTER_MARGIN);

DriveList.SetWindowPos(
0, 0, 0
, DriveListWidth, DriveListHeight
, SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW
);

RepositionBars(0,0xFFFF,AFX_IDW_PANE_FIRST);
CView::OnSize(nType, cx, cy);
}

In this case combo box blinking while parent window resize; How to reduce combo box blinking?

Eugene Wineblat Aug 17, 2006 - 3:34 AM

Thank you!
That was exactly what I need!

Technical Support Aug 16, 2006 - 10:37 AM

Here is a sample project that shows how to implement what you are looking for.

Georgy Vostrikov Feb 27, 2008 - 7:36 AM

Hello,
I have non dockable toolbar. Why I may resize ComboBox while resizing parent window without EnableDocking, FrameEnableDocking etc.
Thank you.

Suhai Gyorgy Aug 16, 2006 - 1:32 AM

I’m not sure if the answer is correct, but I’d check out CExtWA template class in Prof-UIS help. It says:

"By applying the template class to any window, you can easily create and manage auto-resizable controls inside that window."

So if you make a class derived from CExtWA < CExtToolControlBar > , then you can call AddAnchor for the ComboBox when initializing toolbar.

I hope that helps some. Regards:
Chris.