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 » CExtMdiTabWnd problem Collapse All
Subject Author Date
Ulrich Heinicke May 22, 2008 - 1:41 PM

Hi,


i have a problem when i open a document in my MDI program. The filename is not displayed in the MDI tab and in the view menu, but in the small menu into the tab bar the filename will be displayed.


see


Please tell my how to solve the problem.


Thanks


Ulrich

Ulrich Heinicke May 25, 2008 - 11:08 AM

Hi,


in my program i load the doc/views form a dll (like www.codeproject.com/KB/docview/docviewfromdll.aspx ). Could you tell me how i can set the tab text and the menu point directly?


Thanks


Ulrich

Technical Support May 26, 2008 - 12:28 PM

Both MFC and Prof-UIS do not distinct if a document template (a document, a view or a frame object) is created as an instance of an EXE-based class or a DLL-based one. The Prof-UIS MDI tab control does not use statically assigned text strings. It finds tab item texts automatically. Please let us describe some more details. Any tab window in Prof-UIS uses the CExtTabWnd::OnTabWndQueryItemText() virtual method for querying tab item text. The generic tab windows return the text stored in each tab item from this virtual method. The MDI tabs are based on the CExtTMWI template class which implements the OnTabWndQueryItemText() virtual method and it does not return text stored in tab items. It tries to find appropriate MDI child frame windows and associated document objects. If the document is found, the tab item uses its document title. If document is not found, the MDI child frame window’s caption is used. You should implement the OnTabWndQueryItemText() virtual method for providing tab items with required custom text. Please see CExtTMWI::OnTabWndQueryItemText() virtual method’s source code for details.

Ulrich Heinicke Jun 4, 2008 - 2:17 PM

Hi,

the first i do when i open a document is to set the title of the document. So the method OnTabWndQueryItemText() must get the title. After that i copy the source into a new class and use the tracetool from CodeProject to look into the method. I find out that the method retrieve the title from the document. There is a preculiar behaviour, when the opening document will be the first TabWnd the text will not shown, but when i create a new document at first the title form the opening document will be displayed. So if there is an tab then it display the title. If you want i can send you my TabWnd-class.


Please tell me what’s going wrong.


Ulrich


 

Technical Support Jun 5, 2008 - 11:51 AM

If would be helpful to take a look at your tab window class.

Ulrich Heinicke Jun 10, 2008 - 6:43 AM

Hi,

i find out that happend. There is a bug into the function OnTabWndDrawItem. If the text has only one character then the variable bDrawText will be false. See screenshot and class www.ibh-software.org/ibhtabwnd.zip:



The workaround for standard and whidbey tabs is to add a space chracter to the string. Then is will be display. For OneNoteTab this will not be working. But maybe i find a solution later.


Ulrich

Technical Support Jun 19, 2008 - 6:08 AM

We have fixed the problem with not showing a single character tab caption. If you need the update now, please contact us via email.

Ulrich Heinicke Jun 19, 2008 - 6:14 AM

Please send me the update now.


Ulrich

Technical Support Jun 22, 2008 - 1:23 PM

We have just sent it to you by email.

Technical Support May 23, 2008 - 6:42 AM

v.2.70 or an earlier one contains an issue when a short text in tab items like "1" did not show correctly. It was fixed in later versions. This issue in your project depends on whether it’s based on MFC’s document/view architecture or not. The CExtTMWI::OnTabWndQueryItemText() method provides MDI tab control’s items with text strings displayed in its tab items. This method tries to get document objects asscociated with MDI child frames and get the titles of the found documents to display them in the tab items of the MDI tab control. If a document is not found for a particular MDI child frame, it is the window text of this frame that will be used in the tab item. The problem described in your message can potentially occur if you use the MFC’s document/view based MDI environment and some code in it invokes the SetWindowText() API for MDI child frame windows what makes tab item’s text de-synchronized with document titles in the MDI interface. We need more details.