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 » ComboBox tooltips disabled when when combo gets enabled with OWNERDRAWFIXED flag. Collapse All
Subject Author Date
SANKET DAS Sep 20, 2006 - 7:36 AM

Please suggest a solution for our following problem.

We have a tool bar where we dyanamically add comboboxes using insert button as follows:

InsertButton(0, IDC_SAUT_TBFORMAT_CBOFONT, TRUE);

Then we enable the properties like tooltips and status text for the combo in the following
manner:

CString str;
str.LoadString(IDC_SAUT_TBFORMAT_CBOFONT);
UINT nCmdID = IDC_SAUT_TBFORMAT_CBOFONT;
LPCTSTR strProfileName = g_CmdManager->ProfileNameFromWnd(this->GetSafeHwnd());
ASSERT( strProfileName != NULL );
CExtCmdItem * pCmdItem = g_CmdManager->CmdAllocPtr(strProfileName,nCmdID);
ASSERT( pCmdItem != NULL );
int iIndex = str.Find("\n", 0);
CString strCopy(str);
strCopy.Truncate(iIndex);
str.Delete(0,iIndex);
pCmdItem->m_sTipTool = _T(str);
pCmdItem->m_sTipStatus =_T(strCopy);

After this we create the combo on the toolbar as follows:

if (!m_cboxOfficeFont.Create(CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT |
CBS_HASSTRINGS | CBS_DROPDOWN |WS_VSCROLL | WS_TABSTOP|WS_VISIBLE,
CRect(0,0,100,500), this, IDC_SAUT_TBFORMAT_CBOFONT))

The issue is when the combo are not enabled the tooltips and status text are appearing quite
properly but when the combo is getting activated in our application, the tooltips and status text dont appear any more.Please note that we have the flag CBS_OWNERDRAWFIXED, which when removed enables the tooltip but as you know this will result in the combo appearing very
flat i.e without the ususal icons accompanying the text.So this is not a way

We have tried with using UpdateFromToolBar()
VERIFY(g_CmdManager->UpdateFromMenu(pApp->m_pszProfileName,IDR_MAINFRAME));
VERIFY(g_CmdManager->UpdateFromToolBar(pApp->m_pszProfileName,IDS_TOOLBAR));
in our MainFrm class as we have done in thecase for menus also,but to no avail.

Please suggest a soln for this.

SANKET DAS Sep 25, 2006 - 6:31 AM

I had tried to implement these changes in my code by deriving the CMainFrame class from CExtCustomizeSite class also.
But it gives compilation error for undeclared CExtCustomizeSite class. As mentioned in your help file,it requires a CExtCustomizeSite.h
file which I could not find in the installed path ---C:\Program Files\FOSS Software Inc\Prof-UIS trial\Include. So could you suggest a resolution to this?

Also I have another query, that can we not implement this in any other way where we have the OWNERDRAW characteristic of the combo as well as the tooltip enabled when the combo is active?
Please suggest.
Please elaborate in your reply to avoid any communication gap in our exchange.

Thanks in advance.

Technical Support Sep 28, 2006 - 12:08 PM

The customize feature (CExtCustomizeSite class) are available only in Prof-UIS Trial/Commercial. We are sorry but Prof-UIS Freeware does not support it. If you are not a registered user of the full version, you may want to code your own combo box that is not be based on that availbel in Prof-UIS and supports the tooltips you need. Then you could use it in Prof-UIS toolbars.

SANKET DAS Oct 5, 2006 - 7:24 AM

We are authorized users of your product. So kindly suggest a resolution.

Technical Support Sep 21, 2006 - 11:26 AM

We always advise the developers to use built-in text/combo fields instead of standard edit or combo box controls. This provides the following benefits. These fields are fully compatible with customizable applications and you can even create several copies of a particular field (in the Customize mode). The main feature of the built-in edit and combo fields is that the CExtCustomizeSite class automatically synchronizes their content, i.e. if you create a second copy of a field and change the value of one of them, then the second is updated automatically. This is done via a set of the OnTextField...() and OnPopupListBox...() virtual methods provided by the CExtCustomizeSite class. The StyleEditor sample demonstrates how to override and implement them. The built-in combo field is designed as a kind of built-in text field with a combo box like drop-down button displaying a pop-up list box. The built-in combo field is also described by the command item in the command manager.
So, the main advantages of the built-in text/combo fields are:
- built-in text/combo fields can be drag-and-dropped in the customize mode
- built-in text/combo fields allow to change their width in the customize mode
- built-in text/combo fields can be used in popup menus (for example, popup items in the menu bar and popup menu invoked with the toolbar’s chevron button (or the Toolbar Options button))
- the CExtCustomizeSite</cod> class provides automatic synchronization of multiple copies of a text/combo field anywhere
- using the built-in combo field, you are not need to keep all list box string values in the control’s memory.

Please take a look how the font combo field is initialized in the <code>CMainFrame::OnCreate()
method of the StyleEditor sample:

   pCmdItem =
        g_CmdManager->CmdGetPtr(
            pApp->m_pszProfileName,
            ID_SE_FONT_LIST );
    pCmdItem->StateSetCombo();
    pCmdItem->StateSetResizable();
    pCmdItem->m_nTextFieldWidth =
        pCmdItem->m_nDropDownWidth = 150;