Subject |
Author |
Date |
|
Guillaume Provost
|
Sep 12, 2003 - 12:09 PM
|
Are you guys currently using the Command Identifier as a save tag for saving GUI Layout and Customization? If I’m dynamically allocating command identifiers within my application:
cmdItem = g_CmdManager->CmdAllocPtr(GetProfileName(), 0);
The actual command id for a given item becomes order dependant:
CExtCmdItem * CExtCmdProfile::CmdAllocPtr( UINT nCmdID // = 0 // 0 means any free in avail range ) { if( nCmdID != 0 && CmdIsRegistered(nCmdID) ) return NULL; if( nCmdID == 0 ) { // find free ID for new command nCmdID = 65534; if( !m_cmds.IsEmpty() ) { while( true ) { CExtCmdItem * pCmdItem = NULL; BOOL bExist = m_cmds.Lookup( nCmdID, pCmdItem ); if( bExist ) { ASSERT( pCmdItem != NULL ); nCmdID --; if( nCmdID == 0 ) { ASSERT( FALSE ); return NULL; } continue; } ASSERT( CExtCmdManager::IsCommand(nCmdID) ); break; } // while( true ) } // if( !m_cmds.IsEmpty() ) } // find free ID for new command
This is a significant problem: each time the allocation ordering changes (quite common an occurence in our case), the command Ids for given GUI items change. Should I use some kind of Name-based heuristic to generate a unique CommandID using a hash? Is there a way for me to change the keying mechanism you use to identify and store GUI layouts and customization information for a given GUI item? (ie: use names instead of CommandIds?)
Guillaume.
|
|
Technical Support
|
Sep 18, 2003 - 8:40 AM
|
Dear Guillaume,
We are sorry for the delay with replying to you.
Yes, we use command identifiers as unique tags. They all should be registered in the command manager. Furthermore, all the command tree nodes should also have identifiers which are registered in it. The best way for your task is to use pre-defined command ranges. For example, you can use command IDs in range 40000 - 60000 and store ID of the last allocated command. You should register these commands as well as their descriptions before restoring the command manager state and the customization subsystem state (and/or before constructing custom command trees). You should store the information about custom commands when you save the state of Prof-UIS subsystems. The CmdAllocPtr(nID=0) method allows you to allocate the command identifier with a specified nID value. We can help you code a simple class which will manage dynamic commands (allocation, serialization and command manager updating) and assign internal names to them.
|
|
Guillaume Provost
|
Sep 19, 2003 - 11:49 AM
|
I think that my original post may have been misconstrued. My issue was mainly that my command IDs for a given item may change each time I run the application, since I dynamically allocate command IDs to the GUI items. You guys already sent me everything I needed to do this (it actually runs and stuff, I’m just having some registry save/load issues between sessions). This seems to be going against the whole system, so instead of fighting it, I’ll assign a few key elements a static, persistent command ID that PROF-UIs can always refer to when storing/reloading the GUI state of these items. Here are additional questions regarding this:
- Is there a way to completely disable saving/restoring of GUI layouts for certain windows? I cannot guarantee the command ID assigned to certain windows will stay the same, and they are generally not windows for which the layout is very important.
- We internally pipe all our GUI commands through a script system. What’s the easiest way for me to modify the customization dialog page to have an ’Add Command’ option where the user can add a totally new command using a simple text script that gets executed? (I can handle the execution aspects of things).
This way I’d have: - Statically allocated GUI items (ie: Range 1000 - 5000) - Dynamically allocated GUI items - Since command IDs in this range can be reused for multiple, different GUI items, I need to disable Save/Restore GUI layout, and customization (ie: Range 65535-60000) - Think of these as temporary/intermediary data views. - Customized new GUI Commands created by the user (at run-time). These need to be serialized into the registry, and they are dynamically assigned a command ID at creation time. (ie: Range 50000 - 60000)
What I need from you guys:
- How do I add the ’new command’ option in the customization page - How do I disable all save/load operations for a given CExtCustomizeCmdTreeNode object
|
|
Technical Support
|
Sep 20, 2003 - 11:17 AM
|
Dear Guillaume,
You have a good task and we are especially interested in helping you because your project seems to fully use all customization features possible. This message describes the solution in general. We need some more additional information so that we would provide you with ready-to-use code snippets.
Is there a way to completely disable saving/restoring of GUI layouts for certain windows?
You should create any bars after restoring UI layouts and destroy them before saving both UI and customization states.
We internally pipe all our GUI commands through a script system. What’s the easiest way for me to modify the customization dialog page to have an "Add Command" option where the user can add a totally new command using a simple text script that gets executed? and How do I add the "new command" option in the customization page?
The CExtCustomizeSite::OnCreateCustomizeForm() virtual method creates a customization property sheet and initializes all the pages. It puts CExtCustomizePageCommands object onto the property sheet. You should override the code for form creation and implement your commands page. It can be derived from the CExtCustomizePageCommands class. You can use a dialog resource similar to the Prof-UIS commands page (you need to add buttons like "Add Command To Selected Category"). As for creation of a new command, you have to allocate a new command identifier and modify the command tree node associated with the category content. A set of CExtCustomizeSite::CategoryGet...() methods allow you to access category data. These methods maybe useful for initializing categories.
How do I disable all save/load operations for a given CExtCustomizeCmdTreeNode object?
There is no way and there is no reason to disable customization features for a particular command node because it can hold both standard and your dynamic commands inside. We think the task may be construed in a different way. Suppose you have a frame-based application which displays different kind of data inside (e.g. different documents like). Some parts of the UI (bars and/or commands) are specific for the currently displayed data. Why cannot we store the dynamically constructed UI commands (e.g. script commands) with the data (or documents)? It is possible with Prof-UIS and this technique is implemented in MS Office.
We think all the questions will be solved much faster and easier if we make a template project, which fully meet your requirements. It is not a problem for us.
|
|
Guillaume Provost
|
Sep 26, 2003 - 6:35 PM
|
"You should create any bars after restoring UI layouts and destroy them before saving both UI and customization states."
This makes it a bit too easy to cause regressions to occur. We are working with a reasonably large development team, and I can easily foresee windows getting created but not cleaned up before the UI layout is saved to the registry. PROF-UIs effectively crashes upon its UI State Load if it cannot find a Control Window with a specific Command ID. Given how large my system currently is, it would be much easier for me to be able to filter windows I want or do not want to save based on their command identifiers. If a command identifier is, say, above 0xf000, then I can simply conclude it was dynamically allocated and should not be saved (ie : I used AllocCmdPtr with a cmdId of 0). I don’t only have dynamically created/destroyed windows, I also have dynamic menu items that get temporarily appended to the ’view’ submenu, for example. The problem with these dynamic items is twofold:
- They may not exist at load time, PROF-UIs does not handle these situations very gracefully. (ie: it crashes) - Since they are generally dynamically allocated through user action (ie: user opens a document), certain GUI items may effectively swap their command ids depending on the order in which a user has performed certain actions.
- Perhaps I can simply browse through the list of items that PROF-UIs saves just before calling the save functions and simply destroy all objects with an ID > 0xf000?
"We think all the questions will be solved much faster and easier if we make a template project, which fully meet your requirements. It is not a problem for us."
That’s very thoughtful of you, but I am porting about 80 000 lines of GUI code. Just outlining what they do will take longer than figuring it all out on my own. :) Asking you the more specific questions that cause me problems is a little easier for me - I’m sorry if I’m a time sink.
|
|
Technical Support
|
Sep 29, 2003 - 1:10 AM
|
Dear Guillaume,
Your app should carefully track all the dynamic commands. Besides, we are sure your task will be much easier if you save a list of dynamic commands outside Prof-UIS Command Manager and Customize Site. In this case you need to restore dynamic commands before loading Prof-UIS states. Of course, this list should be saved when saving the UI state. This is a key to solve your task. If you need to make some toolbars specific for some UI state, create them programmatically as user-defined toolbars (they should be part of Customize Site). With this approach, you don’t need anything but your dynamic command list. Everything else Prof-UIS will manage automatically. You need to implement only one complicated piece of code that should add /remove a command both in the Command Manager and all the command tree nodes of the Customize Site (menubar/toolbars nodes and command categories).
|
|
Jonas Gauffin
|
Aug 24, 2003 - 2:12 AM
|
I’m trying to create a searchbar similiar to the one in windows (start -> search -> all files/folders).
I’ve taken a look at the PageContainer sample and created a similiar vertikal bar.
How do I add a search button below all pages? How do I make sure that page 1 is always visible (all over pages can be shown/hidden)?
|
|
Technical Support
|
Aug 27, 2003 - 12:10 AM
|
Dear Jonas,
Sorry for the delay with this answer. The exeplorer-like search window should be based on resizable bar without caption. It should contain one child form with single line edit and "Search" button in the middle and custom-drawn caption control at top (with "X" button). This design will also allow you to show or hide search window when needed. We can help you to code it.
|
|
Jonas Gauffin
|
Aug 28, 2003 - 10:44 AM
|
That is not exactly what I want. I want something similiar to the Custom-drawn page container in the PageContainer project.
In that example there are these pages: * A dialog page * custom-drawn shortcut * listview * web browser
I want a similiar container but in a resizable bar with the following pages:
* Main search (can not be minimized), got two edit controls: Artist/Title * Album, got one edit control: Album * Year, got two edit controls: from/to * Quality, four radio buttons: Low/Middle/High/All
And below those containers I want the search button.
Sorry for the bad explanation, hope you can help.
|
|
Technical Support
|
Aug 29, 2003 - 2:08 AM
|
Dear Jonas,
We have sent you an e-mail with a sample project attached. It should help you design your search bar.
|
|
Jonas Gauffin
|
Sep 4, 2003 - 12:11 PM
|
Excellent! Thank you very much for the help.
We are using BCGSoft ControlBarPro at my work. Prof-uis got much better design (both code and layout) and the support is better (code examples and more detailed answers)
This post can be summerized in three words: You guys rock! =)
|
|
Jonas Gauffin
|
Aug 21, 2003 - 11:52 AM
|
Why is only 1/4 options available in the integration wizard? I want the profuis application wizard :(
|
|
Neville Franks
|
Aug 22, 2003 - 1:08 AM
|
You need to hit "Back" and change the radio button and then "Next". Repeat this for each of the four options you want. I’ve already reported that this is quite silly and should be 4 check boxes, not radio buttons.
Neville
|
|
Jonas Gauffin
|
Aug 22, 2003 - 3:55 AM
|
Oh sorry, I must have been unclear. The options(checkboxes) are disabled.
|
|
Technical Support
|
Aug 22, 2003 - 4:21 AM
|
Dear gentlemen,
We are working on a new integration wizard that will have only two pages: The first page will allow you to set up multiply options and the second one will display applied settings and results.
|
|
Jonas Gauffin
|
Aug 21, 2003 - 10:38 AM
|
Hello
I’ve trying to create a dialog in a controlbar, i’ve followed the SDI example but cant get it to work. The bar is created ok, but the dialog is not shown.
if( !m_wndSearchBar.Create( "Searchbar", this, ID_VIEW_SEARCHBAR ) ) { TRACE0("Failed to create m_wndSearchBar\n"); return -1; // fail to create } if( !m_wndSearchDlg.Create(IDD_SEARCH, &m_wndSearchBar) ) { TRACE0("Failed to create m_wndSearchDlg\n"); return -1; // fail to create }
|
|
Guillaume Provost
|
Aug 21, 2003 - 11:09 PM
|
Just a stupid remark (I’m not tech sup, but I thought I’d pitch in if I could help).
I needed to add a <yourWindow>.ShowWindow(SW_SHOW); statement for some of my encapsulated windows to show up.
Also, you might want to delete your registry configuration often while you write your code. Most of the sample apps save all of their GUI status in the windows registry, so while you’re developing and adding windows, your code may be ’reverting’ your code changes by loading your last GUI setup from the registry.
The following lines are responsible for loading the GUI stat from the regs, I’d comment them out while you’re adding/modifying the GUI.
CExtControlBar::ProfileBarStateLoad(this,pApp->m_pszRegistryKey,pApp->m_pszProfileName,pApp->m_pszProfileName,&m_dataFrameWP);
and the following lines load back GUI customization features back up:
m_customSite.CustomizeStateLoad(pApp->m_pszRegistryKey,pApp->m_pszProfileName,pApp->m_pszProfileName);
Cheers!
Guillaume.
|
|
Jonas Gauffin
|
Aug 22, 2003 - 12:57 AM
|
Mkay. I thought that ShowWindow were handled by the library since it’s not used in the sample, but I’ll try that + cleaning the reg =)
thanks
|
|
Technical Support
|
Aug 22, 2003 - 4:20 AM
|
Dear Jonas,
Mr. Guillaume gave a good piece of advice. Besides, please verify the following when creating child dialogs:
- Any dialog resource has the Dialog Type property which should be set to Child (not Popup)
- The Visible property of your dialog resource should be set to true
|
|
Jonas Gauffin
|
Aug 23, 2003 - 1:35 AM
|
hehe... it was that simple! :) Thanks!
|
|
Neville Franks
|
Aug 20, 2003 - 11:30 PM
|
Using CExtPopupMenuWnd::TrackPopupMenu( , &nResultCmdID ) in a DEBUG Build with dwTrackFlags = TPMX_DO_MESSAGE_LOOP | TPMX_NO_WM_COMMAND | TPMX_NO_CMD_UI; returns 0xcccccccc on nResultCmdID when you click away from the menu to close it. If you press Escape it returns 0. I assume nResultCmdID is not being initialized, nor set in the click to close scenario.
|
|
Technical Support
|
Aug 21, 2003 - 7:11 AM
|
Dear Neville,
We confirm this bug. It can be easily fixed by adding two lines of code below at the beginning of CExtPopupMenuWnd::TrackPopupMenu() :
if( lpnResultCmdID != NULL )
*lpnResultCmdID = 0;
|
|
Neville Franks
|
Oct 19, 2003 - 6:38 PM
|
I just checked V2.23 and this bug still exists. Of course I can work around it in my code, but it should be added to the library.
Thanks, Neville
|
|
Neville Franks
|
Oct 19, 2003 - 6:42 PM
|
Sorry my mistake. I was looking in the V2.22 source, not 2.23. I can’t see how to delete a forum post?
|
|
Technical Support
|
Oct 19, 2003 - 7:28 PM
|
It’s ok, but ... forum messages currently can not be deleted.
|
|
Neville Franks
|
Aug 20, 2003 - 9:41 PM
|
Hi, I want to create a CExtPopupMenuWnd on the fly by building it from a set of strings. As in my previous post I don’t want messages handles by a parent window, and thus use: dwTrackFlags = TPMX_DO_MESSAGE_LOOP | TPMX_NO_WM_COMMAND | TPMX_NO_CMD_UI.
I tried using ItemInsert() without success. The only way I’ve found so far is to instantiate a CMenu, use AppendMenu() to add my items and then use UpdateFromMenu() with a dummy hWndCmdRecv param. This works but seems like quite a bit of extra work and overhead. Is there a better way? If not can we have functions like AppendMenu() added to CExtPopupMenuWnd - thanks.
PS. Is there a way to be notified by email when a reply is added to a forum post I’ve made? Various forum programs do this.
|
|
Technical Support
|
Aug 21, 2003 - 7:10 AM
|
Dear Neville,
We will think about how to enhance the menu construction procedures. In our projects we use preliminary constructed HMENU handles, which are passed as a parameter to CExtPopupMenuWnd::UpdateFromMenu() .
We have added the CExtPopupMenuWnd::ItemInsertCommand() method that should make creation of popup menus (with no reference to the command manager) much easier. You will receive an e-mail with library updates and a sample project. The project demonstrates how to use CExtPopupMenuWnd::ItemInsertCommand() and track a popup menu without mechanism of command updating.
As far as e-mail notifications are concerned, we are working on this now.
|
|
Neville Franks
|
Aug 22, 2003 - 12:54 AM
|
Hi Sergiy, Thanks for your prompt response. It sounds great.
Neville
|
|
Neville Franks
|
Aug 19, 2003 - 8:31 PM
|
I want to disable items on a popup menu and CExtPopupMenuWnd::EnableMenuItem() is udefined.
I’m using: dwTrackFlags = TPMX_DO_MESSAGE_LOOP | TPMX_NO_WM_COMMAND | TPMX_NO_CMD_UI; so I’m not doing any menu message handling in the parent window.
I can use ItemRemove() but that’s not what I want.
|
|
Technical Support
|
Aug 20, 2003 - 3:57 AM
|
Dear Neville,
This task can be done via CExtPopupMenuWnd::MENUITEMDATA type.
1) Get the menu item data for some item:
CExtPopupMenuWnd::MENUITEMDATA & _md = pPopup->ItemGetInfo ( nItemIndex );
2) Enable or disable it: _md.Enable ( false or true );
|
|
Neville Franks
|
Aug 20, 2003 - 9:33 PM
|
Thanks. ItemGetInfo() isn’t in the help. :(
It would nice to have the standard CMenu functions like this available as CExtPopupMenuWnd member functions.
|
|
Technical Support
|
Aug 21, 2003 - 7:08 AM
|
Dear Neville,
The CExtPopupMenuWnd class provides a set of features that are not available in the standard HMENU of Win32 API: color submenus, built-in text fields and combo fields (coming soon), and command delivery for a specified window. In most cases LoadMenu() is enough. When a menu is loading, only its command ID’s and submenu structure are analyzed. At this moment, text and icon properties should be already registered in the command manager. In other words, a popup menu is designed to work with the command collection in the command manager. That is why we did not make it absolutely similar to the Win32 HMENU .
We are rewriting the documentation for CExtPopupMenuWnd class right now. It should cover all the methods and features.
|
|
Guillaume Provost
|
Aug 18, 2003 - 4:49 AM
|
I’m currently porting a fully dynamic (ie: nothing comes from resources) GUI system to PROF-UIs. I found precious little example code for this in your samples. Here’s what I currently do - can you guys enlighten me as to whether there is a simpler (or safer) path to the current implementation?
- Create the CExtControlMenuBar - Dynamically add items into its underlying CMenu using InsertMenuItem - Calling g_CmdManager->UpdateFromMenu(myMenu) - Retrieving the CmdItem with g_CmdManager->CmdGetPtr(ID) - Set tooltips, create a CExtCmdIcon, assign a bitmap, set flags. - Calling CExtControlMenuBar::UpdateMenuBar( )
The problem with this approach is that it relies on talking to the underlying mfc class. So that, if I want to add a control button, I basically have to duplicate the code, and I can potentially get ID clashes occuring on command ids. Is there a way for me to do something like this:
- If it does not yet exist, register with the Command Manager - add bitmaps, text and so on - Add the resulting command to a toolbar or menu.
I was specifically a bit confused by the differences between CExtCmdManager::AllocCmdPtr( ) and the CmdSetup( ) path that is currently used internally inside your UpdateFromMenu( ) code. Please note that I’m also using the CCustomizeSite implementation. So changes that I make into the toolbars/menus need to be reflected (supported) when I setup the ’default’ customize state (using MenuInfoAdd( )).
Thanks! Guillaume.
|
|
Technical Support
|
Aug 18, 2003 - 10:20 AM
|
Dear Guillaume,
Of course, Prof-UIS allows you to solve all your tasks. The most appropriate way to do this is to use its customization subsystem. So, the following will be only related to the task solution based on the customizable features of the library.
Before we start, please note: Prof-UIS 2.22 is a first version that includes customization and only several basic methods of CExtCustomizeSite are covered in the help so far. But we have already finished full customization with support for keyboard and options pages, unified resizable text/combo fields in menus and toolbars, show/hide buttons menu for each bar etc. The full description of the customization subsystem is in work now. So, please consult with us to finish you work faster.
Let’s start with the architecture of the customization subsystem.
Both toolbars and menus are based on the Prof-UIS internal data type called command tree when the customization subsystem is on. The command tree is implemented in the CExtCustomizeCmdTreeNode class. It is also used for storing the command groups and document menus. This makes your task very easy. You should simply get the root command tree node pointer for any named document menu. Then you can modify this tree and update the visible menu bar. All the changes in the menu become visible. In the version 2.23 (to be released) each named document menu also holds the customizable accelerator table.
The command manager is still used to store initial information for all the commands. Each command tree node stores the current state of each command (customized icon, modified text etc.).
The CExtCustomizeSite class stores all the customization information about all toolbars and menus in a frame window. It is handy to use this class as a second base class of CMainFrame .
Now lets’ take a look at the customizable projects in details: There are two customizable samples in the library: MDI sample DrawCli and SDI sample Bitmap Editor.
If we have already created a new project and derived the main frame window from the customize site, then we need to add initialization code for customization features. The initialization is located in CMainFrame::OnCreate() before loading the bars state (the customization subsystem may create user-defined toolbars here). CExtCustomizeSite class stores a named collection of document menus for the menu bar (one for SDI, 2 or more for MDI). The DrawCli sample registers "Default" and "Document" menus. The BitmapEditor registers the "Default" menu only. You may see how CExtCustomizeSite::MenuInfoAdd() is invoked in these two samples. Then CExtCustomizeSite::EnableCustomization() enables customization in the frame window. Next step is to register command categories (displayed in the "Commands" tab). The CExtCustomizeSite::CategoryUpdate(ID_MENU_RESOURCE) registers several categories which are based on the top-level popup sub-menus. It is possible to setup categories without menu resources using other versions of CategoryUpdate . The CExtCustomizeSite::CategoryMakeAllCmdUnique() removes repeated command entries in each registered category. The CExtCustomizeSite::CategoryUpdateAllCommands() generates standard "All commands" category with the sorted list of commands (based on previously registered categories). The CExtCustomizeSite::CategoryAppenNewMenu() appends the standard "New menu" category. The final step is invoking of CExtCustomizeSite::CustomizeStateLoad() : it loads the command trees for all the menus and toolbars, creates user toolbars if any.
The Prof-UIS customization subsystem does not require de-initialization. You may find invoke of CExtCustomizeSite::CustomizeStateSave() in the CMainFrame::DestoyWindow() . It is required to store the last state for all the toolbars and menus.
How to initialize dynamic resources?
- In the
CMainFrame::OnCreate() , after registration of command profile and before creation of menubar and toolbars, please register all the commands in the command manager;
- Before
CExtCustomizeSite::EnableCustomization() : this is the valid point for initial construction of document menus via modification of their command trees;
How to get the command tree pointer for the named document menu? There are two command trees for each document menu. One is the initial command tree which is using for resetting menu state. Other is the current menu command tree. Initially these trees are equal. CExtCustomizeCmdTreeNode * pNodeInitial = CExtCustomizeSite::MenuInfoGetByName( _T("Document") )->GetNode(true); CExtCustomizeCmdTreeNode * pNodeCurrent = CExtCustomizeSite::MenuInfoGetByName( _T("Document") )->GetNode(false); If you have modified pNodeInitial , you need to copy it into the pNodeCurrent : *pNodeCurrent = *pNodeInitial; The CExtCustomizeCmdTreeNode class provides a set of methods for accessing command properties and tree navigation. Each command tree node should have a command identifier which is registered in the command manager. Please let us know if you have any questions.
|
|
Guillaume Provost
|
Aug 19, 2003 - 6:14 PM
|
This does’nt help me. I need to know how to construct and change the UI in *code*, not how to set it up for the user to change it at run-time. All your samples, wether they support the CExtCustomizeSite or not, take all their GUI definitions from resources, not actual code.
I can do this two ways. Either:
-----------------------------------------------------
#1 - Change the underlying MFC control items directly, and then refresh both the Command manager and the CustomizSite from it
CExtMenuControlBar menuBar;
menuBar.Create(NULL, this, ID_MYMENUBAR)
// Note the absence of any "LoadFromXXX"!
// Now add the items menu.GetMenu()->InsertMenuItem( ... ) menu.GetMenu()->InsertMenuItem( ... ) menu.GetMenu()->InsertMenuItem( ... )
// Update the command manager g_CmdManager->UpdateFromMenu(...,menu->GetSafeHmenu()));
// Setup extended PROF-UIs specific info: CExtCmdItem *pCmdItem = g_CmdManager->CmdGetPtr( ... ) pCmdItem->sToolBarText = ...; pCmdItem->sStatusText = ...; // etc...
pCmdItem = g_CmdManager->CmdGetPtr( ... ) pCmdItem->sToolBarText = ...; pCmdItem->sStatusText = ...; // etc...
pCmdItem = g_CmdManager->CmdGetPtr( ... ) pCmdItem->sToolBarText = ...; pCmdItem->sStatusText = ...; // etc...
// Assign an icon CExtCmdIcon *cmdIcon = g_CmdManager->CmdGetIconPtr(...); cmdIcon->AssignFromHBITMAP( ... )
// Update the GUI component myBar.UpdateMenuBar();
// Update the customize site CExtCustomizeSite::CategoryUpdate(myBar.GetMenu()->GetSafeHMENU());
----------------------------------------------------- or
#2 - Add the items into Prof-UIS directly, then insert them into the controls
<Add, register the items directly with the CExtCustomizeSite and the CExtCommandManager I need help on how to do this.>
CExtMenuControlBar menuBar; menuBar.Create(NULL, this, ID_MYMENUBAR)
<Update ’menuBar’, I’m guessing I’d do this using the CExtCustomizeSite (?), to insert my new commands in it>
------------------------------------------------------ My question is: - should I be doing #1 or #2? - if I should be doing #2, how do I add items directly into both the command manager and the CustomizeSite? - How do I use the CExtCustomizeSite to directly append Commands into menus and toolbars?
Thanks! Guillaume
|
|
Technical Support
|
Aug 20, 2003 - 4:14 AM
|
Dear Guillaume,
You have correct understanding of the dynamic menu building task. You should use the first way if you don’t need the customization features. You should use the second way in other case. The second way is similar to first one, but requires additional initialization of customize site data. To avoid the long and complicated messages here we decided to code an example for you. This should take less than a day. Example will use on-the-fly constructed menu-bar and support the customization. You should receive a letter with attached ZIP file today.
Best regards, Technical Support Team.
|
|
Guillaume Provost
|
Aug 21, 2003 - 10:57 PM
|
Hey! This is just a reminder on this. I don’t seem to have received a mail with a zip file yet. By the by, writing a sample is real nice of you guys, but we can compare notes as well (ie: I don’t want to suck up all of your time). If you guys can give me the general gist of operations to perform in what order, I don’t mind digging into your code to figure out the details. I just need a starting point on the architecture. Ie: Do I add to the Command manager first? Using AllocPtr( ) or CmdSetup( )? Or do I add directly to the CustomizeTreeNodes? Give me a place to start, and I can wing it from there.
Thanks! G.
|
|
Technical Support
|
Aug 22, 2003 - 4:15 AM
|
Dear Guillaume,
Please believe us, an e-mail has been sent to your address at guillaume@pseudointeractive.com. And we’ve received a delivery notification from your mail server! But we haven’t yet received a read notification from your e-mail client software. Anyway, we’ve sent one more e-mail on the safe side.
The TestDynRes sample attached is very simple. You need to take a look at the CMainFrame::OnCreate() method. All the required steps and comments can be found there. We think this is the most appropriate support for your current task. The e-mail also describes a sequence of operations for initialization of dynamic resources.
|
|
Guillaume Provost
|
Aug 18, 2003 - 4:35 AM
|
Is the only implementation path to assign an HBITMAP to a command through replacement? (see attached code snippet). I notice there does’nt seem to be any internal support for grabbing the new (winver > 0x500) MENUITEMINFO bitmap holder members.
// Assign a dummy icon HICON hIcon = CExtPaintManager::stat_GenerateColorIconBox(COLORREF(0)) ; ASSERT( hIcon != NULL );
VERIFY(g_CmdManager->CmdSetIcon( g_CmdManager->ProfileNameFromWnd( pFrame->GetSafeHwnd()),a_ID, hIcon,false));
CExtCmdIcon *cmdIcon = g_CmdManager->CmdGetIconPtr( g_CmdManager->ProfileNameFromWnd( pFrame->GetSafeHwnd()), a_ID);
RECT targetSize; targetSize.top = 0; targetSize.bottom = 16; targetSize.left = 0; targetSize.right = 16; // Replace the icon with the bitmap cmdIcon->AssignFromHBITMAP(a_bitmap, COLORREF(0));//, &targetSize);
|
|
Technical Support
|
Aug 18, 2003 - 7:33 AM
|
Yes. Prof-UIS is configured to be compatible with any version of Windows OS, not only 5.0 and higher. If we compile the code with winver >= 0x500 - it will crash inside GetMenuItemInfo() Win32 API function under Win NT 4.0. Strange thing, but this function requires the MENUITEMINFO structure with the size specific for current version of Windows. So, the single way to use the bitmap-based icons is to initialize them explicitly like in your source code.
|
|
Guillaume Provost
|
Aug 16, 2003 - 11:18 PM
|
This causes the libary to crash when it is compiled using the __fastcall calling convention.
Cheers! Guillaume.
|
|
Technical Support
|
Aug 17, 2003 - 9:50 AM
|
|
|
Guillaume Provost
|
Aug 16, 2003 - 10:57 PM
|
This causes the libary to crash when it is compiled using the __fastcall calling convention.
Cheers! Guillaume.
|
|
Daryl McMasters
|
Aug 13, 2003 - 9:45 PM
|
I’m having a great time with this product. It is the best investment I have made all year. The Tabbed MDI windows was my main reason for the purchase and I’m a little disappointed with it’s fuction. There is a lot of flicker on the tab control as well as extensive repainting going on as you click trough the tabs of open windows. Most notably is the ’RESTORED’ MDI Child frame flashing in the middle as you tab through the control. This happens even in your ProfStudio and Full Screen Demos. Is there somthing that can be done? P.S. with just a couple lines of code I have turned the Tool Tips Windows into Multi-Line "Hover Help"(c). My users love it!!.
|
|
Technical Support
|
Aug 13, 2003 - 10:49 PM
|
Dear Daryl,
We can not confirm the MDI tab window flicker bug (CExtTabMdiWnd class). But we can confirm the fact of MDI child frame flicker effect when switching between maximized MDI child frames. This bug occurs only on Windows XP and never on any other release versions of Windows OS. This is the bug of the standard MDI client window (a window which is parent of MDI child frames). You can see this bug on VC++ 6.0, Microsoft Photo Editor tool (a part of MS Office XP). This bug appears in any program which is based on the standard MDI interface. If you using Visual Studio .NET (2002 or 2003), you can invoke menu "Tools/Options", then select the "Environment/General" tree item and check the "MDI environment" radio button in the "Settings" page. After restarting Visual Studio .NET will use the standard MDI interface instead of its default "Tabbed documents" interface. If you open two (or more) maximized documents and try to switch between them via "Window" menu - you will see the discussed flicker effect which looks like quick window restoring and maximizing. You will see more ugly flicker effect if you try to jump between maximized windows using Ctrl+Tab keys. I’m not sure about necessity of fixing this problem via MDI client window hooks (subclassing its functionality). An alternative way is using of SDI frame window withing injected tab control which should fake the always maximized documents like Visual Studio .NET does. If this problem is critical for you - we can discuss detailed requirements of your project(s) and find an appropriate solution. It will be very interesting to see a screen short of your tooltips (or sample program).
|
|
Rajneesh
|
Jul 18, 2003 - 10:42 PM
|
I found a bug . Build your any sample caontaining resizable dockable controlbar in unicodedebug active configuration. Execute your application then. 1. Move your mainframe window in any where. 2. Drag out your resizable dockable controlbar up and down. 3. You found a assertion failure and application get closed.
|
|
Technical Support
|
Jul 19, 2003 - 9:51 AM
|
Dear Rajneesh,
We have already removed an unwanted assertion in the debug configuration. This assertion is not critical. We will release Prof-UIS 2.23 that is free of this bug soon.
Updated sources have been sent to you.
|
|
rajneesh
|
Jul 8, 2003 - 6:05 AM
|
Hi How can a toolbar control docked into resizable dockable window?
|
|
Technical Support
|
Jul 8, 2003 - 9:15 AM
|
Dear Rajneesh,
Prof-UIS implements the standard docking behavior of any toolbar in Microsoft products: a dockable toolbar can be docked to any side of the frame or it can be in the floating state. We haven’t come across any other behavior yet.
If you need non-standard docking behavior, please provide us with more details so that we can help you.
|
|
rajneesh
|
Jul 9, 2003 - 7:21 AM
|
Dear Our requirement is Fixed toolbar control should be docked with resizable dockable window.
|
|
Technical Support
|
Jul 10, 2003 - 4:10 AM
|
Hi,
What you need is not difficult to do. Please take a look at the CProfStudioSolutionExplorer class in the ProfStudio sample. It is a CExtResizableDialog-derived window in the child mode. This dialog has been inserted into a resizable bar and contains one toolbar (m_wndToolBar) which is always at the top side of the dialog. The m_wndToolBar object is created in CProfStudioSolutionExplorer::OnInitDialog(). In CProfStudioSolutionExplorer methods you can also find the following line (twice):
RepositionBars( 0, 0xFFFF, IDC_TREE_SE );
This line performs reposition of all the dialog childs to dialog borders (In our case we have only one toolbar at the dialog top). IDC_TREE_SE is an identifier of the tree control that occupies the rest of the dialog.
So what you will have to do is: 1) Create a child dialog inside your resizable bar 2) Create and initialize a toolbar in this dialog 3) Call CWnd::RepositionBars() twice: In CYourDlg::OnInitDialog() and in CYourDlg::OnSize()
That’s all.
|
|
rajneesh
|
Jul 15, 2003 - 11:49 PM
|
CProfStudioSolutionExplorer only create fixed toolbar into resizable toolbar control but we can not docked it with the mainframe window.
Our requirement is to docked the fixed toolbar with the mainframe window and same toolbar can be docked with the resizable toolbar control also.
we can dock fixed toolbar with main frame but can not dock same toolbar with resizable toolbar control.
|
|
rajneesh
|
Jul 16, 2003 - 12:15 AM
|
I am sending a sample in which docking sequence should be like this.
"Tree view bar" dockable window should be docked with mainframe only.
"Editor bar" ,"Dialog view bar" dockable window should be dock with "Tree view bar" dockable window only not with other.
"Empty bar " docked with mainframe window and "Color picker bar" docked with "Empty bar".
|
|
Technical Support
|
Jul 17, 2003 - 3:45 AM
|
Dear Rajneesh,
We have posted you a letter with your project modified. Please let us know whether it is what you need.
|
|
ragneesh
|
Jul 17, 2003 - 5:02 AM
|
I saw your sample.Dockable windows are docked with group1 and group2.Dockable window are fixed with group1 and group2 this is not our requirement. Our requirement is dockable window should be docked with specific group but not fixed.we should able to dragout each control from the group.
|
|
Technical Support
|
Jul 19, 2003 - 9:54 AM
|
Dear Rajneesh,
A new version of your project has been sent to you.
Do not hesitate to contact us if you have any questions. We are always happy to help you.
|
|
rajneesh
|
Jul 8, 2003 - 5:50 AM
|
Dear sir, Can I dock a dockable window only in a specific dockable window andd not in all dockable windows? If yes pls send send a sample So I can understand how to implement it.
|
|
Technical Support
|
Jul 10, 2003 - 4:24 AM
|
Dear Rajneesh,
This tricky task is possible with overriding of CExtControlBar::_DraggingUpdateState(...) method in your CExtControlBar-derived classes. The docking/dragging algorithm is complicated. Please send us your start project and description of a limitations for resizable bars in this application. We will modify the bar behaviours and post you an updated project.
|
|
rajneesh
|
Jun 25, 2003 - 1:41 AM
|
Hi, I would like to navigate the tabs through Keyboard i.e if i am on tab 2 than how i will move next to tab 3 and move back to tab 1 using key board.
My application has to be user friendly with Keyboard as well as mouse.
|
|
Technical Support
|
Jun 26, 2003 - 8:34 AM
|
Dear Rajneesh,
In the property sheet window you can use tab keys to switch between active dialog items including tab’s caption. You can also use Ctrl+PageUp or Ctrl+PageDown to jump to the next/previous page.
Our tab window is primarily designed to be similar to Visual Studio.NET. You cannot set the focus on a tab item. But it is possible to insert a piece of code into the overridden CFrameWnd::PreTranslateMessage() method in order to process Ctrl+PageUp or Ctrl+PageDown actions. It will detect whether the current window with the keyboard focus belongs to the dynamic tab container or not, and, if yes, will switch to the next/previous tab.
If this approach is suitable for you, we will write message pre-translating code of this kind.
|
|
Rajneesh
|
Jun 22, 2003 - 11:42 PM
|
Hi, I have created CExtControlBar Window. Whenvere i resize it slowly ...it paints my control window so slowly it shows flickring inside as well as outside window. How can in resolve this problem. This problem also persist on the samples given with prof UIS .
I am using ProfUis2.22 version.
Regards, Rajneesh
|
|
Technical Support
|
Jun 24, 2003 - 10:09 AM
|
Dear Rajneesh,
We have modified the docking algorithm including the code responsible for resizing floating bars. Resizing seems to work much faster ;-). Please let us know if you need the updated code right now.
|
|
rajneesh
|
Jun 25, 2003 - 1:32 AM
|
Also send me the updated help file. The help file that i have is of version 2.21 I have seen some parameter change in version 2.22. So please send me the updated help file along with updated code
|
|
Technical Support
|
Jun 26, 2003 - 8:44 AM
|
Dear Rajneesh,
The help file for version 2.22 is not assembled yet, we are working on it now and it will be available very soon.
|
|
rajneesh
|
Jun 24, 2003 - 11:28 PM
|
Ok, I need that updated code.
Regards, Rajneesh
|
|
Technical Support
|
Jun 26, 2003 - 8:45 AM
|
Dear Rajneesh,
The updated code will be sent to you today.
|
|
rajneesh
|
Jun 26, 2003 - 11:36 PM
|
The updated code that you have sent is not compiling. I have replaced Include files as well as Source files with your files. During compilation it gives me error.Below is the build log.
****************************************************
Deleting intermediate files and output files for project ’profuisdll - Win32 Unicode Debug’. --------------------Configuration: profuisdll - Win32 Unicode Debug-------------------- Compiling resources... Compiling... StdAfx.cpp Automatically linking with WinMM library (Windows Multimedia System) Multiply monitor support: build-in Compiling... exdlgbase.cpp ExtBtnOnFlat.cpp ExtButton.cpp ExtCmdIcon.cpp ExtCmdManager.cpp ExtColorCtrl.cpp Automatically linking with version.lib (Version info support) ExtColorDlg.cpp ExtColorPaletteWnd.cpp ExtComboBox.cpp ExtContentExpandWnd.cpp ExtControlBar.cpp ExtControlBarTabbedFeatures.cpp ExtDockBar.cpp C:\ProfUIS2.22\Src\ExtDockBar.cpp(232) : error C2065: ’ID_EXT_ADD_REMOVE_BUTTONS’ : undeclared identifier C:\ProfUIS2.22\Src\ExtDockBar.cpp(251) : error C2065: ’ID_EXT_CUSTOMIZE’ : undeclared identifier ExtEdit.cpp ExtHook.cpp ExtIconEditDlg.cpp ExtImageEditWnd.cpp ExtMenuControlBar.cpp ExtMiniDockFrameWnd.cpp ExtMouseCaptureSink.cpp Generating Code... Compiling... ExtPageContainerWnd.cpp ExtPaintManager.cpp C:\ProfUIS2.22\Src\ExtPaintManager.cpp(306) : error C2664: ’GetProcAddress’ : cannot convert parameter 2 from ’const unsigned short *’ to ’const char *’ Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast ExtPopupMenuWnd.cpp ExtResizableDialog.cpp ExtScrollWnd.cpp ExtShortcutListWnd.cpp ExtTabWnd.cpp ExtToolBoxWnd.cpp ExtToolControlBar.cpp profuisdll.cpp Generating Code... Error executing cl.exe.
ProfUIS222ud.dll - 3 error(s), 0 warning(s)
|
|
Technical Support
|
Jun 27, 2003 - 10:12 AM
|
Hi,
1) Please find this line in the Prof-UIS.h file and uncomment it:
//#define __EXT_MFC_NO_CUSTOMIZE
2) In the ExtPaintManager.cpp file before line 306 you can find the a big table which begins with:
struct { FARPROC * m_pFarProc; LPCTSTR m_strProcName; } arrUserExApi[] = { { (FARPROC*)&m_pUxApi_OpenThemeData, _T("OpenThemeData") }, { (FARPROC*)&m_pUxApi_CloseThemeData, _T("CloseThemeData") }, { (FARPROC*)&m_pUxApi_DrawThemeBackground, _T("DrawThemeBackground") }, ...
The function-name strings in this table should be always ANSI strings. Please remove the _T(...) macroses. Just select all table in the editor and perform two text replacements:
a) replace _T(" with "
b) replace ") with "
Also, please replace LPCTSTR m_strProcName with LPCSTR m_strProcName
|
|
Rajneesh
|
Jun 3, 2003 - 4:09 AM
|
Hi, I have created a MFC exe.To give XP look i have used ProfUIS 2.21. Now i have also created ActiveX control that has to be loaded in my MFC Exe .Here again i am using ProfUIS 2.21 for XP support.
In both of workspaces i have created separate profiles for g_CmdManager.
In Activex Control i have added these lines
#define __PROF_UIS_ActiveX_Profile_CMD_PROFILE_NAME "ActiveX Profile COntroll"
//in OnInitDialog of Activex Dialog
g_CmdManager->ProfileSetup(__PROF_UIS_ActiveX_Profile_CMD_PROFILE_NAME);
g_CmdManager->g_bDisableCmdIfNoHandler=FALSE;
g_CmdManager->ProfileWndAdd(__PROF_UIS_ActiveX_Profile_CMD_PROFILE_NAME, m_hWnd);//Handle of Activex Dialog
g_CmdManager->UpdateFromToolBar( __PROF_UIS_ActiveX_Profile_CMD_PROFILE_NAME, IDR_MENU_TOOLBAR,false); //Tried both with false and true options
//end of OnInitDialog in Activex Dialog
//In onDestroy of Activex Dialog i have written g_CmdManager->ProfileWndRemove( m_hWnd );
Now in On Right Click function of dialog i have written the code to show Menu. For that i have used CExtPopupMenuWnd class. //code is CExtPopupMenuWnd * pPopupWnd =NULL; pPopupWnd = new CExtPopupMenuWnd;
pPopupWnd->CreatePopupMenu(m_hWnd); VERIFY(pPopupWnd!=NULL);
pPopupWnd->LoadMenu(m_hWnd,IDR_LISTMENU)==FALSE
pPopupWnd->TrackPopupMenu(TPMX_OWNERDRAW_FIXED|TPMX_NO_CMD_UI|TPMX_NO_HIDE_RARELY,ptClicked.x,ptClicked.y); //End of code in OnightClick Menu.
In EXE where i am loading this Activex has separate Profile and Window handle.
Now when my control loaded in that dll with profuis docking style and user right click on Dialog of Activex Control,it shows me the menu that shows the list of already open docking windows. It does not show me Activex Menu that i have loaded in On Right click. It goes in that function but loads different menu.
But when i doubleclick on DockingControl bar of Window ,than after it on Rightclick it shows me my menu.
SO that is the problem no 1.
Problem No 2 is that Whenever a menu is shown whether Activex Control’s menu or Exe’s Opened Docking window menu,it hangs my MFC Exe when i click on Control bar menu command’s.
So help me in both of these matters.
|
|
Technical Support
|
Jun 3, 2003 - 9:04 AM
|
Dear Rajnesh,
We sent you two sample projects that, we hope, should answer your questions. If you encounter any problems, do not hesitate to contact us.
|
|
Rajneesh
|
Jun 22, 2003 - 11:55 PM
|
The sample that you have sent me creates Activex Control direclty in CChildView class that is derived from CWnd. What i want is to create in window that can be docked to my Mainframe class.For that i have used CExtControlBar class.I have created control in CExtControlBar derived class. So i have mutilple CExtControlBar window classes and each window host a activex control that has its own menu that was created from ProfUis Menu class. Now when i right click on my control that is docked with frame..first it shows me my menu and soon after that it show a menu that has list of all open CExtControlBar window.I don’t want this menu here. I only want my control,s own menu.
|
|
Technical Support
|
Jun 24, 2003 - 10:02 AM
|
Dear Rajneesh,
Today we’ll send you a letter with an updated sample project attached. We hope it will meet all your requirements.
|
|
Rajneesh
|
Jun 2, 2003 - 11:53 PM
|
When we dock any control bar horizontally at the bottom or top of the main frame, the title prints vertically.
|
|
Technical Support
|
Jun 3, 2003 - 9:07 AM
|
Dear Rajneesh,
We cannot confirm this bug. Please let us know more details (OS, the project type, etc.) or send us a test project.
|
|
Rajneesh
|
May 29, 2003 - 12:28 AM
|
Hi, I have to create MDI child windows with minimizebox and maximizebox but without closebox. For this i have removed the SC_CLOSE menu item from the MDIChild system menu. This disables the close box when the child windows are not maximized, but when the child windows are maximized the enabled close button is drawn on the mainframe menu (by prof-uis).
How to remove or disable this button?
regards, Rajneesh
|
|
Customer Support Team
|
Jun 2, 2003 - 1:30 AM
|
Dear Rajneesh,
We have already fixed this bug. You can request the library update at support@fossware.com
|