Subject |
Author |
Date |
|
Sergio Buonanno
|
Mar 2, 2006 - 6:39 AM
|
My MDI application uses toolbars inside the MDI child windows. Each MDI child window is different from one another and so the toolbar. When the application starts it loads the toobars state from a disk file using g_CmdManager->SerializeState, but this function fails with an exception. It looks like Command Manager is trying to load the state of the MDI child windows’ toolbar that do not exist at application startup. Is there the possibility to avoid this problem ? Or to skip serialization for a particular toolbar ?
Thanks
|
|
Technical Support
|
Mar 2, 2006 - 10:48 AM
|
The CExtCmdManager::SerializeState() loads/saves the info relating to non-basic commands stored in the command manager. This method has nothing to do with any control bar. The CExtControlBar::ProfileBarStateLoad() loads the state of bars. So, the problem does not relate to toolbars and control bars. We may guess you should check how your application updates the command manager with command descriptions. If there is only one command profile in your project and it is initialized in the main frame window, then please check that this command profile is updated from all the menu and toolbar resources used in your application including menus and toolbars from the main frame window and all the MDI child frame windows. If the problem persists, the last ditch resort to let us review your project.
|
|
Sergio Buonanno
|
Mar 3, 2006 - 12:55 AM
|
Unfortunately that is. If I open more MDI child windows (that in their turn load their own toolbar from resources by calling LoadToolBar), then I close the application; next time I run it again CExtCmdManager::SerializeState fails and launches an exception. The exception is launched from line 1818 of extcmdmanager.cpp because CmdGetPtr(nCmdId) returns a NULL CExtCmdItem pointer. I don’t know why but that happens only when I open some MDI child windows each with a different toolbar.
|
|
Technical Support
|
Mar 4, 2006 - 4:23 AM
|
We are still guessing that you update the command manager partially in the main frame and partially in your child frame windows. This explains why the number of command descriptions depends on whether you have opened some MDI child frames or not. Moving the code that updates the command manager to the main frame window should fix the problem. Some methods can update the command manager automatically (CExtPopupMenuWnd::TrackPopupMenu() , CExtToolControlBar::LoadToolBar() ). Your MDI application needs to update the command manager with all the resources used in all the MDI child frames in the CMainFrame::OnCreate() method, with the g_CmdManager->UpdateFrom...(...) code being invoked explicitly for all the toolbar and menu resources. We can review your (test) project if you send it to us.
|
|
YS Jang
|
Mar 1, 2006 - 9:44 PM
|
Hi!
In your sample prof-uis controls..
Buttons, Hiperlinks, Tabwindow, TabContainers....
I clicked tabcontainers.
TabContainers have ColorCtrl, ListBox, TreeCtrl... If i click ListBox, then I move the Buttons(or Hiperlinks...Other List) and I reclick the TabContainers... Then ListBox is opend...But I want to see first tab(ColorCtrl) whenever I click the TabContainers...
|
|
Technical Support
|
Mar 2, 2006 - 7:35 AM
|
The selection of the tab page container does not change because we do not destroy pages when you are going through these pages. Of course, the selection remains unchanged. If you need to change the selection yourself, please use the CExtTabPageContainerWnd::PageSelectionSet method.
|
|
Hristo Inkiov
|
Feb 28, 2006 - 12:43 PM
|
Hello, I’m using the Integration Wizard and when the Library building begins the process it never ends and occassionally appears an error for a file being read-only. After a check none of these files are read-only. In the end I have to kill the process in order to terminate the Integration Wizard. Without having the libraries built I receive error for not finding prof-uis library when I try to build my project. Please help!
|
|
Technical Support
|
Mar 1, 2006 - 3:07 AM
|
This problem with the integration wizard sometimes occurs on some machines and it may happen with any version of Visual Studio. We will fix this issue in the next major release. Here is how you can resolve this problem now : - remove all the .NCB files in Prof-UIS folder and compile the library with the wizard again; - OR open the ProfUIS_600.dsw/ ProfUIS_700.sln/ ProfUIS_710.sln/ ProfUIS_800_x64.sln file depending on which VS you are using, open the Batch Build dialog, and compile profuisdll and/or profuislib projects directly in Visual Studio.
|
|
Raffaele Cappelli
|
Feb 27, 2006 - 10:21 AM
|
In order to switch between tabbed interface and mdi interface at run time, I am using the following code:
void CMainFrame::MDITabsEnable(bool bEnable) { if (bEnable!=IsMDITabsEnabled()) { if (bEnable) { m_pMDITabs = new CExtTabMdiWnd(); VERIFY(m_pMDITabs->Create(this)); CWnd *pWnd = MDIGetActive(); if (pWnd) MDIMaximize(pWnd); } else { m_pMDITabs->RemoveAllWndHooks(); VERIFY(m_pMDITabs->DestroyWindow()); m_pMDITabs->m_hWnd = NULL; delete m_pMDITabs; m_pMDITabs = NULL; } RecalcLayout(); } }
I obtained such code by try and error (in particular for the RemoveAllWndHooks() call); it seems to work, but maybe there is a simpler or better way, which I have not noted in the samples or in the help. Please let me know your advices.
Thank you.
|
|
Technical Support
|
Feb 28, 2006 - 3:55 AM
|
Please take a look at the ProfStudio sample, which implements exactly what you need. Standard MDI (ID_UI_STD) and Tabbed MDI (ID_UI_TABBED) menu items in the View menu (accessible from the menu bar) allows you to switch the interface type on the fly. These menu commands are handled and updated in the CMainFrame::OnUiStd(), CMainFrame::OnUpdateUiStd(), CMainFrame::OnUiTabbed() and CMainFrame::OnUpdateUiTabbed() methods. The CProfStudioMdiTabSwitcher class implements the MDI tab control which is auto hidable when the interface is not tabbed (the OnTabWndSyncVisibility() virtual method does this work). The CProfStudioMenuControlBar class implements a menu bar which does not show document buttons when the interface is tabbed (the IsDisplayMdiDocumentButtons() virtual method does this work, all other methods are needed to make the menu bar not be able for re-docking like in Visual Studio .NET/2005). Both classes refer to the CMainFrame::m_bStandardMDI property which indicates the currently used interface type. This flag is also used in CMainFrame::PreTranslateMessage() for preventing the keyboard based activation of MDI child frame’s system menu and in the CMainFrame::OnPreparePopupMenu() handler method of the CExtPopupMenuWnd::g_nMsgPrepareMenu registered windows message for modifying some un-needed commands in the menu bar’s Windows menu when using the tabbed interface.
|
|
Raffaele Cappelli
|
Mar 1, 2006 - 1:21 PM
|
It works very well, the only additional change I made with respect to your sample, was to override GetDetectedUiType(), to make dynamic control bars menu show "Tabbed document" or "MDI document" according to the current configuration.
|
|
Technical Support
|
Mar 2, 2006 - 2:09 AM
|
Yes, your improvement is correct.
|
|
Raffaele Cappelli
|
Mar 1, 2006 - 12:58 PM
|
Thank you very much, I missed that feature in the ProfStudio sample.
|
|
Mike Van Duzee
|
Feb 27, 2006 - 6:12 AM
|
Our application depends heavily on idle time processing for things such as draws and screen refreshes. Since moving to prof-uis we have noticed that when the mouse is hovering over most of the GUI components (toolbar buttons, controlbar borders when resizing them in MDI app, popup menus in view) we almost never receive any free idle time. CWinApp::OnIdle() almost always return TRUE leaving us no idle processing time. Do you know why this would be happening (does prof-uis control updating scheme post a high number of messages, therefore interrupting any further idle processing)? If so is there anything we can do to get around this?
Thanks
|
|
Technical Support
|
Feb 28, 2006 - 3:28 AM
|
We have received a lot of comments about the idle time processing from Prof-UIS customers. Some of them want the idle processing to be enabled and some not. By default, it is turned off. The following code turns it on: CExtControlBar::g_bEnableOnIdleCalls = true;
CExtGridWnd::g_bEnableOnIdleCalls = true;
CExtPopupBaseWnd::g_bEnableOnIdleCalls = true;
CExtTabWnd::g_bEnableOnIdleCalls = true;
|
|
Mike Van Duzee
|
Mar 1, 2006 - 6:00 AM
|
Setting those flags didn’t really seem to improve our idle time processing, but we’ve been able to reproduce our problem with one of your sample applications. When running ProfStudio it uses 0% of the CPU when it is just sitting there idle. But when you hover the mouse over one of the toolbar buttons, the CPU usage increases to 41% - 56% and it will stay there until the mouse is moved away from the toolbar. We’ve run other sample applications (BitmapEditor, DRAWCLI) that don’t do this. Do you know what could be causing this?
Thanks
|
|
Technical Support
|
Mar 1, 2006 - 12:13 PM
|
We noticed the following: if you comment the ID_TIMER_DELAY_KILL timer processing in the CExtPopupMenuTipWnd::OnTimer() method in the ExtPopupMenuWnd.cpp file, then you cannot not see CPU time eating in the ProfStudio sample at all. This code tracks the mouse movement when a tooltip is visible over a menu item or a toolbar button. In fact, the ::GetCursorPos() Win32 API gets slower in applications with a large number of HWND handles being created. You can alleviate the problem with CPU eating by modifying definitions of the ID_PERIOD_DELAY_KILL and ID_PERIOD_LIFE_STEP preprocessor variables at the beginning of the ExtPopupMenuWnd.cpp file. Both variables should be set to 200.
|
|
Mike Van Duzee
|
Mar 2, 2006 - 7:50 AM
|
That seems to have fixed it. We are still testing, but it looks good.
Thanks a lot for your quick reply.
|
|
jb lee
|
Feb 27, 2006 - 1:02 AM
|
Can I change main menu at runtime? The scenario is :- I have three main menus : ID_MENU_1, ID_MENU_2, and ID_MENU_3 Three menus has menu item for current menu selection. When a menu is selected, toolbar and some windows should reflect the change.
Do I have to regist all IDs to the statBasicCommands[] ? Best regards,
jb.
ps, Search result page of prof-uis forum return error when I select other page.
|
|
Technical Support
|
Feb 28, 2006 - 3:12 AM
|
If you need to change only popup menu items, simply handle the CExtPopupMenuWnd::g_nMsgPrepareMenu registered windows message in your main frame window: afx_msg LRESULT OnExtMenuPrepare(WPARAM wParam, LPARAM lParam);
ON_REGISTERED_MESSAGE(
CExtPopupMenuWnd::g_nMsgPrepareMenu,
OnExtMenuPrepare
)
LRESULT CMainFrame::OnExtMenuPrepare(WPARAM wParam, LPARAM lParam)
{
lParam;
CExtPopupMenuWnd::MsgPrepareMenuData_t * pData =
reinterpret_cast
< CExtPopupMenuWnd::MsgPrepareMenuData_t * >
( wParam );
ASSERT( pData != NULL );
CExtPopupMenuWnd * pPopup = pData->m_pPopup;
ASSERT( pPopup != NULL );
// MODIFY pPopup MENU HERE
return 1;
} You can insert some items with pre-defined command identifiers into your menu resource. This will allow the CMainFrame::OnExtMenuPrepare() method to find them and replace with other needed menu items: INT nItemPos = pPopup->ItemFindPosForCmdID( ID_WELL_KNOWN_MENU_ITEM );
if( nItemPos > 0 )
{
pPopup->ItemRemove( nItemPos );
pPopup->ItemInsert( . . . );
. . .
} It is also possible to rebuild the top level of the menu bar. The menu bar ( CExtMenuControlBar) is based on a toolbar ( CExtToolControlBar). The CExtMenuControlBar::UpdateMenuBar() method invokes an algorithm that rebuilds the menu bar’s toolbar buttons. You can implement your own algorithm of filling the menu bar with buttons ( CExtBarButton). Create your own CExtMenuControlBar -derived class and override the CExtMenuControlBar::_UpdateMenuBar() internal virtual method. Your method can be either based on the original method (you only embed needed buttons) or completely rebuild an array of buttons in your own manner. All the commands inside the menus attached to the menu bar buttons should be registered in the command manager. The top level buttons in the menu bar also have their unique command identifiers and should be allocated exactly like it is done in the CExtMenuControlBar::_UpdateMenuBar() method. We fixed the search feature available in our forums, thank you for the bug report.
|
|
eric guez
|
Feb 26, 2006 - 2:26 AM
|
Hi,
How can i add or remove CExtControlBar buttons in the caption ?
I want to remove the autohide buttons in the CExtControlBar caption (prof-uis 252) and add some new buttons also.
Thanks
|
|
Technical Support
|
Feb 26, 2006 - 11:33 AM
|
Any button in the caption of the control bar and floating toolbar is instance of a CExtBarNcAreaButton -derived class. It is initialized in the CExtControlBar::OnNcAreaButtonsReinitialize() virtual method which you can override in your CExtControlBar -derived class. Your class can create any of the default buttons and/or your custom buttons. The CMyTaskAreaBar::CBarNcTaskAreaBtn class in the MDI sample application can be used as an example of how this can be done. The Task Area bar implemented in the CMyTaskAreaBar class in this sample has custom caption buttons. You can also find custom caption buttons in the FixedSizePanels sample where the CMyResizableInFixedModeBar class uses CMyResizableInFixedModeBar::CNcBackForwardNavigationBtn buttons for navigating an Internet Explorer control inside a control bar.
|
|
Suhai Gyorgy
|
Feb 24, 2006 - 7:10 AM
|
Dear Support,
I have our application installed on 4 different PCs, all with Windows XP OS. In two of the cases the application looks fine but on the other two PCs the icons in the application’s toolbars and popup menus have gray background instead of invisible. Is there a Windows setting that would affect this behaviour?
Thank you, Chris
|
|
Technical Support
|
Feb 26, 2006 - 11:29 AM
|
We have just fixed a bug (in Prof-UIS 2.52) related to an invalid non-transparent background when running the app on a desktop with 15 or 16 bit color mode. We can provide you with this source code update. Besides, Prof-UIS 2.53 features the completely renewed CExtCmdIcon class (in fact, it is rewritten from scratch). There no more HICON handles used in it. The new icon is based on a PNG-like bitmap with alpha channel and features the Windows Vista/XP icon quality on any Windows OS starting from 95 and NT4.
|
|
Mark Walsen
|
Mar 15, 2006 - 10:26 AM
|
I’m using the new CExtCmdIcon class in 2.5.3. The clrTransparent parameter for CExtCmdIcon::AssignFromHBITMAP isn’t quite working for me. The icon prepares the transparent background without regard to a background that I’ve painted with a gradient.
The CExtCmdIcon, which is the m_icon member of a CExtButton, is drawn on top of a CExtResizableDialog. The CExtResizableDialog handles WM_ERASEBKGND by calling CExtPaintManagerOffice2003::OnPaintToolBarGradient. I expect that the transparent portion of the icon will show through to the gradient background. Instead, the icon shows through to a solid blue background. The clrTransparent RGB(192,192,192) is correctly replaced, but incorrectly replaced with the solid blue instead of gradient background.
I tried postponing the call to CExtCmdIcon::AssignFromHBITMAP until the parent CExtResizableDialog’s first WM_PAINT, after the gradient background is painted by WM_ERASEBKGND, but that doesn’t work. It doesn’t surprise me that this doesn’t work, because I doubt that CExtCmdIcon::AssignFromHBITMAP is copying pixels from the screen to fill in the transparent pixels for the cached CExtCmdIcon bitmap.
Can you recommend a way for me to get the CExtButton’s CExtCmdIcon to apply the transparency to the gradient background drawn by the parent CExtResizableDialog’s WM_ERASEBKGND handler?
Cheers -- Mark
|
|
Technical Support
|
Mar 15, 2006 - 12:07 PM
|
The problem is that you are using the WM_ERASEBKGND message which should not be used at all if you want to avoid flickering. Why don’t you use WM_PAINT instead? You will never have any invalid background anywhere. The visual appearance of the CExtResizableDialog class is implemented in the CExtWS template class. Both messages are handled in the CExtWS::WindowProc() virtual method which looks up the message map tables for presence of the WM_PAINT and WM_ERASEBKGND handler methods. This is done to allow you to implement a custom background in resizable dialogs. But we strongly recommend you check your CExtResizableDialog -derived classes and remove all the OnPaint() and OnEraseBkgnd() handler methods from them. We think it is these methods that cause an invalid icon background in your dialog.
|
|
Suhai Gyorgy
|
Feb 26, 2006 - 3:05 PM
|
|
|
Arkin Terli
|
Feb 23, 2006 - 6:24 AM
|
Hi,
I want to use many custom dialogs with page container but also handle all events in container’s class... Is it possible? if yes, how can i do?
Thank you
// Arkin
|
|
Technical Support
|
Feb 23, 2006 - 11:52 AM
|
It is possible to override the PreTranslateMessage() and/or OnCmdMsg() virtual methods in each dialog page and invoke the same methods in the container where you can analyze and handle all the possible messages and/or commands and command updating requests. But we think this way is much less convenient than handling events separately in each page window.
|
|
Mark Walsen
|
Feb 22, 2006 - 12:03 PM
|
Although VC6 is installed on my machine, the Integration Wizard won’t run because it can’t find VC6. I suspect this is because I have installed and uninstall Visual .NET. I’ve manually added the appropriate Include, Source, and Lib paths in VC6. But I’d also like to use the Prof-UIS Application Wizard. Is there some registry entry I should add so that the Prof-UIS Integration Wizard will agree that VC6 is installed? Or, is there a manual way that I can install the Prof-UIS Application Wizard in VC6? Cheers -- Mark
|
|
Technical Support
|
Feb 22, 2006 - 12:42 PM
|
The Prof-UIS Application Wizard for Visual C++ 6.0 is a ProfUisAppWizard.awx file in the ../Prof-UIS/Support folder. Just copy it into the Visual C++ sub folder in which other .awx files can be found. You do not even need to restart the IDE. This folder is typically located at: C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin\IDE\
|
|
Mark Walsen
|
Mar 10, 2006 - 3:03 PM
|
That was just what I needed to know. It only took a minute to follow your instructions so that I could start using the Prof-UIS Application Wizard in the Visual C++ IDE.
I was a fool for not getting this to work from the beginning. I had been trying to learn how to use Prof-UIS from the many source code examples. That works, but it is even easier to generate an approximate app with the Prof-UIS Application Wizard, and see how it uses the library.
This Prof-UIS Application Wizard is great.
Cheers -- Mark
|
|
jb lee
|
Feb 22, 2006 - 11:55 AM
|
I’m new to the library. In my project, I need a page which use CExtPageNaviatorWnd. I wanna arrange a combobox and dialogs in it. Making UI is a piece of cake. But, I don’t know how to process the events. for example, when the combobox item changes, the dialog is changed to other dialog and menu, toolbar too. Would you please give me some advice?
|
|
Technical Support
|
Feb 23, 2006 - 10:29 AM
|
Could you send us some screenshots or a sample project which describes where the combo box is placed and which dialogs need to be changed, which menu, which toolbars, and etc.?
|
|
Technical Support
|
Feb 27, 2006 - 10:47 AM
|
Here is the project that implements the page navigator you need. The solution is based on inserting a dialog into the page container. This dialog is used just as a container for the anchored combo box and tab page container controls. The tab page container control contains two pages with different dialogs which can be selected with the PageSelectionSet() method. The tabs are removed so that it looks like you requested.
|
|
Massimo Germi
|
Feb 22, 2006 - 5:18 AM
|
Hi, although I downloaded and compiled new ExtComboBox files, as your post, I cannot handle CBN_DROPDOWN message yet. I’ve tried to add CBN_DROPDOWN in your sample project (ProfUIS_Controls -> CPagePopupMenus -> ON_CBN_DROPDOWN(IDC_MENU_ANIMATION, ...) but it doesn’t work. tx
|
|
Massimo Germi
|
Feb 22, 2006 - 6:32 AM
|
This problem occurs only in debug mode, in release it runs ok.
|
|
Technical Support
|
Feb 22, 2006 - 11:42 AM
|
Please let us know which version you are using and whether the problem is present in version 2.52.
|
|
Massimo Germi
|
Feb 22, 2006 - 11:59 AM
|
First of all thanks for your faster response. 1) I’ve tried to download ExtComboBox.zip that you notified few days ago, but I met compiling problems. 2) Today I’ve downloaded and installed 2.52 package , from your site, but I can’t handle CBN_DROPDOWN in Debug mode. I’m using VS2005 and Prof-uis 2.52. thanks again for your help
|
|
Technical Support
|
Feb 23, 2006 - 4:08 AM
|
We added the CBN_DROPDOWN message handler for the IDC_MENU_ANIMATION combo box and it works. So we can guess that the problem somewhere on your side. Here the latest version of CExtComboBox. Please check which version of combo box you are using. You can also simply download the latest version of Prof-UIS from our ftp site.
|
|
Massimo Germi
|
Feb 23, 2006 - 5:13 AM
|
OK. with latest version of CExtComboBox I solved the problem. tx
|
|
Dmitry Kostromin
|
Feb 22, 2006 - 2:36 AM
|
also not work virtual function OnGridCellInplaceControlTextInputVerify i just override it, but it not calling.What must i to do in this situation.
|
|
Technical Support
|
Feb 22, 2006 - 11:39 AM
|
We cannot confirm this bug. You can setup a break point at the beginning of the CExtGridWnd::OnGridCellInplaceControlTextInputVerify() method in ExtGridWnd.cpp, run the SimpleGrids sample, select the Products tab and edit the cell text there. You will see how the method is invoked. Please check the declaration of your overridden method first: virtual bool OnGridCellInplaceControlTextInputVerify(
const CExtGridCell & _cell,
HWND hWndInplaceControl,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
__EXT_MFC_SAFE_LPCTSTR sTextInitial,
__EXT_MFC_SAFE_LPCTSTR sTextPrevious,
CExtSafeString & sTextNew,
bool bEndEdit
); Please also let us know which kind of cell are you trying to edit in your application when the CExtGridWnd::OnGridCellInplaceControlTextInputVerify() method not invoked.
|
|
Raffaele Cappelli
|
Feb 19, 2006 - 3:18 AM
|
It seems a bug: steps to reproduce the behaviour: 1) Modify the MDI sample by adding two buttons in CChildView: CExtButton m_wndButton1; CButton m_wndButton2; 2) Create the two controls at the end of CChildView::OnCreate:
m_wndButton1.Create("test",WS_CHILD|WS_VISIBLE,CRect(10,10,200,30), this,1001);
m_wndButton2.Create("test",WS_CHILD|WS_VISIBLE,CRect(10,40,200,60), this,1002); 3)
|
|
Raffaele Cappelli
|
Feb 19, 2006 - 3:21 AM
|
3) Run the app and open two MDI child wnd: if you click on the traditional cbutton of the non-active child, it is activated as expected, but if you click on the cextbutton, the mdi child is not activated. The same happens with other controls (toolbar, tabwnd, ...)
|
|
Technical Support
|
Feb 19, 2006 - 11:00 AM
|
We tried to reproduce the problem with buttons inside the CChidView window of the MDI sample application in the way you desscribed. Here are the source code and executable of this modified app. We did not come across the problem with activating the inactive MDI child frame window by clicking any button. We confirm the problems with MDI child frame activation when clicking a toolbar button or a tab item. To fix this, please update the source code of the CExtControlBar::_ActivateOnClick() method in the ExtControlBar.cpp file and the source code of the CExtTabWnd::_ProcessMouseClick() method in the ExtTabWnd.cpp file: void CExtControlBar::_ActivateOnClick()
{
ASSERT_VALID( this );
HWND hWndOwn = GetSafeHwnd();
if( hWndOwn == NULL
|| (! ::IsWindow(hWndOwn) )
)
return;
HWND hWndActivate = NULL;
if( m_bPresubclassDialogMode )
hWndActivate = ::GetParent( hWndOwn );
else
hWndActivate = _GetDockingFrameImpl()->GetSafeHwnd();
if( hWndActivate == NULL )
{
::SetFocus( hWndOwn );
return;
}
CWnd * pWndPermanent = CWnd::FromHandlePermanent( hWndActivate );
if( pWndPermanent != NULL )
{
CMDIChildWnd * pWndMDIChild =
DYNAMIC_DOWNCAST( CMDIChildWnd, pWndPermanent );
if( pWndMDIChild != NULL )
{
CFrameWnd * pWndFrame =
pWndMDIChild->GetParentFrame();
if( pWndFrame != NULL )
{
CMDIFrameWnd * pWndMDIFrame =
DYNAMIC_DOWNCAST( CMDIFrameWnd, pWndFrame );
if( pWndMDIFrame != NULL )
{
CMDIChildWnd * pActive =
pWndMDIFrame->MDIGetActive();
if( pWndMDIChild != pActive )
pWndMDIChild->MDIActivate();
return;
}
}
}
}
HWND hWndFocus = ::GetFocus();
if( hWndFocus == NULL )
{
::SetFocus( hWndActivate );
return;
}
if( hWndActivate != hWndFocus
|| (! ::IsChild( hWndActivate, hWndFocus ) )
)
{
if( ! CExtPopupMenuWnd::TestHoverEnabledFromActiveHWND( hWndOwn ) )
::SetFocus( hWndActivate );
}
}
bool CExtTabWnd::_ProcessMouseClick(
CPoint point,
bool bButtonPressed,
INT nMouseButton, // MK_... values
UINT nMouseEventFlags
)
{
ASSERT_VALID( this );
if( GetSafeHwnd() == NULL )
return false;
if( bButtonPressed )
{
CWnd * pWndTestChildFrame = GetParentFrame();
if( pWndTestChildFrame != NULL
&& pWndTestChildFrame->IsKindOf( RUNTIME_CLASS( CMDIChildWnd ) )
)
{
CFrameWnd * pWndFrame =
pWndTestChildFrame->GetParentFrame();
if( pWndFrame != NULL )
{
CMDIFrameWnd * pWndMDIFrame =
DYNAMIC_DOWNCAST( CMDIFrameWnd, pWndFrame );
if( pWndMDIFrame != NULL )
{
CMDIChildWnd * pActive =
pWndMDIFrame->MDIGetActive();
if( pWndTestChildFrame != pActive )
((CMDIChildWnd*)pWndTestChildFrame)->MDIActivate();
}
}
}
} // if( bButtonPressed )
LONG nHitTest = ItemHitTest( point );
switch( nHitTest )
{
case __ETWH_BUTTON_LEFTUP:
case __ETWH_BUTTON_RIGHTDOWN:
case __ETWH_BUTTON_SCROLL_HOME:
case __ETWH_BUTTON_SCROLL_END:
case __ETWH_BUTTON_HELP:
case __ETWH_BUTTON_CLOSE:
case __ETWH_BUTTON_TAB_LIST:
return
OnTabWndClickedButton(
nHitTest,
bButtonPressed,
nMouseButton,
nMouseEventFlags
);
default:
if( nHitTest < __ETWH_TAB_FIRST )
{
OnTabWndMouseTrackingPushedStop();
Invalidate();
UpdateWindow();
return false; //true;
}
break;
}
ASSERT( nHitTest >= 0 && nHitTest < ItemGetCount() );
if( bButtonPressed )
m_ptStartDrag = point;
return
OnTabWndClickedItem(
nHitTest,
bButtonPressed,
nMouseButton,
nMouseEventFlags
);
}
|
|
Raffaele Cappelli
|
Feb 19, 2006 - 5:10 PM
|
Thank you for the prompt reply. Yes, in the modified MDI sample you provided the problem does not occur, but you created the two buttons in the CChildFrm and not in the CChildView, please try to create the buttons in the CChildView (at the end of OnCreate() ).
|
|
Technical Support
|
Feb 20, 2006 - 9:34 AM
|
Your report is really interesting. We have modified the CExtButton::OnLButtonDown() method in the ExtButton.cpp file to let the parent MDI child frame window be activated when the CExtButton window is clicked: void CExtButton::OnLButtonDown(UINT nFlags, CPoint point)
{
if( m_bKeyTracking )
return;
CButton::OnLButtonDown( nFlags, point );
HWND hWndOwn = m_hWnd;
if( IsWindowEnabled() )
{
CFrameWnd * pParentFrame = GetParentFrame();
if( pParentFrame != NULL
&& pParentFrame->IsKindOf( RUNTIME_CLASS(CMDIChildWnd) )
)
{
CFrameWnd * pMDIFrame = pParentFrame->GetParentFrame();
if( pMDIFrame != NULL
&& pMDIFrame->IsKindOf( RUNTIME_CLASS(CMDIFrameWnd) )
)
{
CMDIChildWnd * pActive = ((CMDIFrameWnd*)pMDIFrame)->MDIGetActive();
if( LPVOID(pParentFrame) != LPVOID(pActive) )
((CMDIChildWnd*)pParentFrame)->MDIActivate();
}
}
if( ! ::IsWindow( hWndOwn ) )
return;
if( ::GetFocus() != hWndOwn )
::SetFocus( hWndOwn );
} // if( IsWindowEnabled() )
if( ! ::IsWindow( hWndOwn ) )
return;
_DoClick();
}
|
|
Raffaele Cappelli
|
Feb 20, 2006 - 10:46 AM
|
Thank you for being so quick in providing the fix. However, I have a question: why instead of manually handling the activation for the MDIChild case, don’t you send the WM_MOUSEACTIVATE message as normal controls do? Is there any side effect that you want to avoid, or any other problem that may prevent the normal approach from working?
|
|
Technical Support
|
Feb 21, 2006 - 1:24 AM
|
There are several types of button types supported by the button common control. The most often used are the push button, default push button, check box and radio button. When the CExtButton (or CExtColorButton or CExtCheckBox or CExtRadioButton or CExtHyperlink) class subclasses the button common control, it remembers the type of the subclassed button for further behavior and appearance implementation and changes the real type of the button common control to the owner draw button. This is the single way to redraw any type of the button correctly. The owner drawn button type is the absolutely stand alone mode of the button common control which have no predefined appearance nor behavior implementation. As you can see, the CExtButton::OnLButtonDown() method invokes the CButton::OnLButtonDown() method. This means the WM_LBUTTONDOWN standard Windows message is delivered to the original window procedure of the button common control. The WM_MOUSEACTIVATE standard Windows message is also delivered to there. We guess, the buggy MDI child frame activation is caused by undefined behavior implementation of the owner draw button type.
|
|
Raffaele Cappelli
|
Feb 21, 2006 - 1:13 PM
|
I made some tests and it seems that the problem is related to the mouse capture. In OnMouseMove you capture the mouse (I guess to detect the mouse leave) and it seems that the default button implementation does not send WM_MOUSEACTIVATE when there is a capture active (which may be reasonable): if you comment out
CExtMouseCaptureSink::SetCapture( GetSafeHwnd() ); in OnMouseMove, it should work. Of course this is not a fix, I will keep the one you proposed, unless you find something better with this further information.
|
|
Technical Support
|
Feb 22, 2006 - 11:36 AM
|
Thank you for the information but you are comparing the standard push button with the owner draw button (the CExtButton class). These two types cannot be compared directly.
|
|
George Ross
|
Feb 19, 2006 - 2:42 AM
|
Hi
i have the ASSERT problem when my application starts caused by CExtControlBar::ProfileBarStateLoad
The program asserts in 3 different states
1. CExtControlBar::ProfileBarStateSerialize LIne 3924 2. CExtControlBar::ProfileBarStateSerialize LIne 3928 CExtControlBar::ProfileBarStateSerialize LIne 3938 Actually throws an exception. Any help i am using ver 2.51 in UNICODE build static library regards George
|
|
Technical Support
|
Feb 19, 2006 - 10:49 AM
|
Line 3924 is an ASSERT( FALSE ) assertion inside a catch() statement which rethrows the caught exception. Line 3928 is similar to the previous but inside the outer try/catch statement. Line 3938 is the final ASSERT( bRetVal ) assertion in CExtControlBar::ProfileBarStateSerialize() and it does not throw any exception. Please provide us with the correct location of the code which really throws the exception. Typically CExtControlBar::ProfileBarStateSerialize() is invoked from the CExtControlBar::ProfileBarStateLoad() or CExtControlBar::ProfileBarStateSave() method and it never fails. The state loading algorithm requires all the bars, which are described by serialized data stored in the registry or in a file, have been created. If not, this leads to exceptions and assertions when the state is loaded. For example, it can occur if you changed the identifier of some control bar when developing your app and forgot to clean old serialized data in the registry.
|
|
Ed Kennedy
|
Feb 18, 2006 - 3:18 PM
|
I have a project in VS2003 that I embeded a property grid into a control bar. In VS2005 it is crashing. Straight from the wizard I’m changing the edit into a property grid and below is the code I’m using: In MainFrame.h CExtControlBar m_wndResizableBarEdit; //CExtEdit m_wndDockedCtrlEdit; CExtPropertyGridCtrl m_PGC; In MainFrame.cpp
m_wndResizableBarEdit.SetInitDesiredSizeVertical(
CSize( 200, 400 )
);
m_wndResizableBarEdit.SetInitDesiredSizeHorizontal(
CSize( 400, 200 )
); if( !m_wndResizableBarEdit.Create(
NULL, // _T("Optional control bar caption"), this,
ID_VIEW_RESIZABLEBAR_EDIT,
WS_CHILD|WS_VISIBLE|CBRS_TOP|CBRS_GRIPPER
|CBRS_TOOLTIPS
|CBRS_FLYBY
|CBRS_SIZE_DYNAMIC
|CBRS_HIDE_INPLACE
)
)
{
TRACE0( "Failed to create m_wndResizableBarEdit\n"); return -1; // fail to create
} // property grid if( !m_PGC.Create(
&m_wndResizableBarEdit,
m_wndResizableBarEdit.GetDlgCtrlID(),
CRect(0,0,0,0)
)
)
{
TRACE0( "Failed to create m_PGC\n"); return -1; // fail to create
}
Thanks!!
ed
|
|
Technical Support
|
Feb 19, 2006 - 10:33 AM
|
An SDI sample, which comes with Prof-UIS, was generated with the wizard. We modified it as you described and come across no crashes. Here are its source code and executable. Besides, nobody reported problems about using the property grid control inside resizable control bars before, though we know that some of our customers use this design. Would you send us your a test project that demonstrates the problem?
|
|
Ed Kennedy
|
Feb 19, 2006 - 5:36 PM
|
Sent. Let me know if it doesn’t come through! Many Thanks!
|
|
Technical Support
|
Feb 20, 2006 - 9:31 AM
|
|
|
Raffaele Cappelli
|
Feb 18, 2006 - 1:54 PM
|
#define __EXT_MFC_NO_RESOURCES_BELARUSSIAN does not work: it should to be __EXT_MFC_NO_RESOURCES_BELARUSIAN (only one ’S’)
|
|
Technical Support
|
Feb 19, 2006 - 10:12 AM
|
Thank you for this info. We fixed this typo.
|
|
Mike Van Duzee
|
Feb 17, 2006 - 8:41 AM
|
I am creating 4 CExtControlBar and docking them all together (using DockControlBarInnerOuter for the first, and DockControlBarIntoTabbedContainer for the other 3), then I hide 2 of the control bars (using bar.m_pDockSite->ShowControlBar). This works fine, I only see tabs for the two visible control bars. If I then turn on Auto Hide and then turn it back off, I can see tabs for all 4 control bars.
|
|
Technical Support
|
Feb 18, 2006 - 2:49 AM
|
Would you provide us with a sample project in which the four resizable bars are docked as you described. For example, you can modify our sample like SDI, that should let you reproduce the problem quickly. This application creates five control bars. Just apply your initial docking algorithm for four of them to demonstrate the problem.
|
|
Massimo Germi
|
Feb 14, 2006 - 6:59 AM
|
Hi, I have a dialog with a CExtComboBox member. I want to capture the drop down message, in the dialog class. I have declared in .h CExtComboBox m_cmb_database; afx_msg void OnDropdownComboDatabase(); in .cpp BEGIN_MESSAGE_MAP(CDlgConfiguration, CDialog) //{{AFX_MSG_MAP(CDlgConfiguration) ON_CBN_DROPDOWN(IDC_COMBO_DATABASE, OnDropdownComboDatabase) //}}AFX_MSG_MAP END_MESSAGE_MAP()
When program ran the execution of the program doesn’t pass in thr function OnDropdownComboDatabase(). There is e way to solve this? TX
|
|
Technical Support
|
Feb 14, 2006 - 10:17 AM
|
Yes, we found this bug. We will fix it as soon as possible and notify about this by e-mail.
|
|
Massimo Germi
|
Feb 14, 2006 - 11:50 AM
|
OK, I have to release a patch for my program, so, if possible, I would want to be informed, by email, when this bug is solved. thanks
|
|
Technical Support
|
Feb 16, 2006 - 10:12 AM
|
We fixed the bug. Please replace the old ExtComboBox.h and ExtComboBox.cpp files with those in this update and recompile the library.
|
|
Massimo Germi
|
Feb 21, 2006 - 10:33 AM
|
Hi, I have some problem compiling new version of ExtComboBox.(h-cpp), __EXT_MFC_(U)INT_PTR seems not to be defined. I’m using VS2005. tx
|
|
Technical Support
|
Feb 22, 2006 - 11:35 AM
|
We are sorry for any inconvenience. We sent you the version of the combo box from Prof-UIS 2.53 which introduces new compatibility with the C++ runtime library of Visual Studio 2005 and MFC 8.0. Please contact us by e-mail so we can tell you how to download the latest source code of Prof-UIS 2.53.
|
|
Massimo Germi
|
Feb 16, 2006 - 12:58 PM
|
Thanks, as always your support works fine.
|
|
Mike Van Duzee
|
Feb 13, 2006 - 2:37 PM
|
I have a combo box in one of my toolbars and it works fine until I dock it on either side of my application. The combo box turns into a button, which I would expect, but the command handler for that button is never called. Am I doing something wrong? Should this work?
Thanks
|
|
Technical Support
|
Feb 14, 2006 - 6:25 AM
|
The command handler should be invoked if you correctly handle the button command. Please note that you can use a flag indicating whether the window associated with the button on the vertically docked toolbar should be visible. You can do this with CExtBarButton::SetCtrlVisibleVertically() : pTBB->SetCtrlVisibleVertically( true ) Please take a look at the ProfStudio sample and find two toolbars Standard and Web. In the first toolbar the Find edit box is visible when the toolbar is docked vertically. In the second toolbar the URL combo box is not visible when it is docked vertically but the command handler works OK.
|