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 » Thanks, now OK, but another problem Collapse All
Subject Author Date
Wilhelm Falkner May 12, 2005 - 10:35 AM

Thanks, now I added RUNTIME_CLASS of document and the menu is switching right! Thnaks for your fast help!!!!
But now I have got another problem: All menuentries, where I have an Icon, there is no menutext displayed. Menuentries without Icon are display right with text. What have I done wrong ???
TIA Willi

Technical Support May 13, 2005 - 8:17 AM

Fist of all, please make sure you have invoked the g_CmdManager->UpdateFromMenu() and g_CmdManager->UpdateFromToolbar() methods for all document menu resources and toolbars used in your application. This should be done at the beginning of the CMainFrame::OnCreate() method. If you add these methods, do not forget to clear the system registry before run it again. If some commands do still have only icons in menu and no text, then these commands have been added to in toolbar resources and not been added to menu resources. The solution is to add a new menu resource and update the command manager from it.

Wilhelm Falkner May 13, 2005 - 10:56 AM

Can’t do that in this way, because I have to create the CMainframe, but at this moment I’mnot able to know, what documents are included. Next I load a lot of DLL, which add - according to customer licence - different document types. These DLLs need then Mainframe for adding toolbars. So I added at the end of my InitInstance a call to mainframe, where I use the doctemplate manager, so see what documents are added and call from there the MenuInfoAdd for each document. I solved the problem by g_CmdManager->CmdAllocPtr / g_CmdManager->CmdGetPtr for each missing text. This produce a lot of code. Is there a more easy way to get all texts?
TIA Willi

Technical Support May 13, 2005 - 1:25 PM

We may guess that the easiest way to control built-in text/combo fields of the Prof-UIS customization system in the application with an extensible architecture like yours it to teach each document control the text fields. This requires each document to support some interface which can be called from overridden methods of the customize site. We can discuss this idea in details and try to analyze how really easy it is to use it in your application.

Wilhelm Falkner May 16, 2005 - 4:28 PM

Sounds great! What functions do I have to overwrite? Mostly that I can call MenuInfoAdd past start of customisation with EnableCustomization??
TIA Willi

Technical Support May 17, 2005 - 8:55 AM

Basically you need to do the following three things with your external documents and views:
1) Let them initialize the customization subsystem, i.e. register menus and etc.
2) Let the active document view detect its menu information’s object name. You should override the CExtCustomizeSite::MenuInfoFindForMenuBar() virtual method in your main frame window like as follows:

CExtCustomizeSite::CCmdMenuInfo * CMainFrame::MenuInfoFindForMenuBar()
{
    ASSERT_VALID( this );
 
    // check special cases
int nMenuInfoCount = MenuInfoGetCount();
    if( nMenuInfoCount == 0 )
        return NULL;
    if(  GetSafeHwnd() == NULL ) 
        return CExtCustomizeSite::MenuInfoGetDefault();
 
    // check whether we are in the cusomize mode
CExtCustomizeSite::CCmdMenuInfo *
        pMenuInfoActiveCustomize =
            CExtCustomizeSite::MenuInfoActiveGet();
    if( pMenuInfoActiveCustomize != NULL )
        return pMenuInfoActiveCustomize;
 
    // ask the active document/view for its menu name
LPCTSTR strMenuName = ...
CExtCustomizeSite::CCmdMenuInfo * pMenuInfo = 
        CExtCustomizeSite::MenuInfoGetByName(
            strMenuName
            );
     ASSERT( pMenuInfo != NULL );
    return pMenuInfo; 
}

3) Optionally let them provide the customization subsystem with data for built-in text fields and combo fields. This can be done by overriding several OnTextField...() and OnPopupListBox...() virtual methods of the CExtCustomizeSite class in your main frame window and passing these invocations to your document/view objects.

Wilhelm Falkner May 13, 2005 - 12:48 AM

this message belongs to
CExtCustomizeSite do not display right menu
below
TIA Willi