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 » Zoom(Combo) and FitWidth(button) boxes not working on using PROFUIS. Collapse All
Subject Author Date
SANKET DAS Aug 4, 2006 - 8:20 AM

We have a main application and also a separate reports application.The reports application is activated once we drag drop it on the workspace.Along with the reports come a separate tool bar which is loaded at runtime.The toolbar has features like "Zoom" combo box and "Fit Width" button just like any other document based application(Acrobat reader).These two buttons have stopped working after PROFUIS integration though they used to work earlier.
We are creating the zoom combo box in the following way:

nWidth = m_szBaseUnits.cx*(m_nMaxLenZoomItemDesc+2) +
GetSystemMetrics(SM_CXHSCROLL) + 2*GetSystemMetrics(SM_CXEDGE);
nPos = CommandToIndex(ID_ZOOM_COMBO);
ASSERT(nPos >= 0);

SetButtonInfo(nPos, ID_ZOOM_COMBO, TBBS_BUTTON);

rect.top = 2;
rect.left =7;
rect.right= rect.left + 116;
rect.bottom = rect.top + rect.Height()*nZoomComboDropDownLines;

// If edit controls are to be disabled, use CBS_DROPDOWNLIST.
DWORD dwStyle = CBS_DROPDOWN;

if (!m_comboZoom.Create(WS_VISIBLE|WS_VSCROLL|dwStyle, CRect(0,0,100,500), this, ID_ZOOM_COMBO))
{
TRACE0("Failed to create zoom combo-box\n");
return -1;
}

this->SetButtonCtrl(nPos,&m_comboZoom);

m_comboZoom.LimitText(nZoomMaxChars);
m_comboZoom.SetItemHeight(-1, rect.Height());

We are creating the FitWidth button in the same way.
This used to work earlier .But with the ProfUIS changes, they are disabled.

The other buttons in the tool bar are working but these two are not working.

Please suggest a solution.

Technical Support Aug 7, 2006 - 10:27 AM

The CExtToolControlBar class is based on MFC’s command updating mechanism. As you know, each menu/toolbar item (which is a user-interface object) needs to know whether it is enabled or disabled to display itself properly. If the framework does not find an ON_UPDATE_COMMAND_UI entry during command routing, it automatically enables the user-interface object if there is an ON_COMMAND entry somewhere for the same command ID. Otherwise, it disables the user-interface object. This mechanism is always used by CExtToolControlBar class in the frame windows or in the CExtResizableDialog windows.

So to ensure your combo boxes are enabled, provide an update or command handler for the commands ID. If it does not help, please send us some test project so that we can find out what’s wrong.