Subject |
Author |
Date |
|
Vrinda Savargaonkar
|
Apr 20, 2007 - 9:01 AM
|
Dear Sir
I am using CExtResizableDialog & CExtTabPageContainerWnd for developing propertysheet application.
So in that which method i use similar to CPropertyPage::SetModified(); when user changes any combobox item or edit something in dialog of property sheet.
thanks.
|
|
Technical Support
|
Apr 20, 2007 - 10:15 AM
|
You should add the m_bModifed , GetModifed() and SetModifed() methods to your CExtResizableDialog -derived methods and use them in page dialogs.
|
|
Chris Thomas
|
Apr 20, 2007 - 8:50 AM
|
Hello, I am having a problem with keyboard customization. I have been comparing my app with the BitmapEditor example, and I can’t figure out what is missing from my app. My app has customization enabled and I am able to do things like create and save user defined control bars, so I think the basic customization is correct.
The specific feature that isn’t working is the keyboard customization page on the customization dialog. My app shows all 3 tabs ("toolbars", "commands", "keyboard"):
if( !CExtCustomizeSite::EnableCustomization( this, __ECSF_BARS |__ECSF_COMMANDS | __ECSF_USER_BARS | __ECSF_ACCELERATORS | __ECSF_PARMS_DISABLE_PERSONALIZED ))
But when I go to the keyboard page, I am unable to view any key bindings (I know they exist - you can see them on the menu. ie, File|New has an accelerator but the keyboard page doesn’t show it). You can’t type in a new binding, and the "Reset All" button is always disabled.
I did debug it some and the CExtCustomize.cpp code is having trouble getting the customization information tree from the command ID. I don’t know why.
More background: Our app is using the default MFC menu, not the prof-uis menu. I don’t know if that matters.
Am I missing something really fundamental here?
|
|
Chris Thomas
|
Apr 26, 2007 - 2:22 PM
|
Thanks, that worked great!
|
|
Chris Thomas
|
Apr 25, 2007 - 1:18 PM
|
I found it!!! The entire keyboard part is disabled if you are not using the Prof-uis CExtMenuControlBar menu. Our app isn’t using CExtMenuControlBar, instead uses regular MFC menu. I can’t get our app to work with CExtMenuControlBar, but that is our problem (there is an #ifdef to use CExtMenuControlBar or not, so I’ll have to look into that).
Anyway if you take one of the samples that has customization, say BitmapEditor, and comment out all CExtMenuControlBar references, recompile, run, then try the customize dialog, you’ll see the disabled controls on the keyboard page.
It is because this code in CExtCustomizeSite::OnRegisterToolBar(): if( pToolBar->IsKindOf(RUNTIME_CLASS(CExtMenuControlBar)) ) { ASSERT( m_pWndMenuBar == NULL ); // should be one! m_pWndMenuBar = (CExtMenuControlBar *)pToolBar; ....
doesn’t execute because it isn’t using the prof-uis menu. That leaves m_pWndMenuBar to be NULL, so MenuInfoActiveSet() doesn’t get called, which leaves m_pMenuInfoActiveCustomize = NULL. So later MenuInfoActiveGet() returns NULL, so this code in CExtCustomizePageKeyboard::_OnSyncContent() ends up setting m_wndComboAccelGroup.SetCurSel(-1):
INT nMenuCount = pSite->MenuInfoGetCount(); if( nMenuCount >= 1 ) { for( INT i = 0; i < nMenuCount; i++ ) { CExtCustomizeSite::CCmdMenuInfo * pCmdMenuInfo = pSite->MenuInfoGetAt( i ); ASSERT( pCmdMenuInfo != NULL ); ASSERT( pCmdMenuInfo->IsInitialized() ); ASSERT( pCmdMenuInfo->GetName() != NULL ); m_wndComboAccelGroup.AddString( pCmdMenuInfo->GetName() ); } // for( INT i = 0; i < nMenuCount; i++ ) int nCurSel = -1; CExtCustomizeSite::CCmdMenuInfo * pCmdMenuInfo = pSite->MenuInfoActiveGet(); if( pCmdMenuInfo != NULL ) { nCurSel = pSite->MenuInfoFindIndex( pCmdMenuInfo ); ASSERT( 0 <= nCurSel && nCurSel < nMenuCount ); } // if( pCmdMenuInfo != NULL ) m_wndComboAccelGroup.SetCurSel( nCurSel ); OnSelendOkAccelGroupCombo(); } // if( nMenuCount >= 1 )
And since wndComboAccelGroup current selection is -1, then this code in CExtCustomizePageKeyboard::_UpdateCmdButtons() disables buttons: if( m_pMenuInfo != NULL ) { if( !m_wndBtnResetAll.IsWindowEnabled() ) m_wndBtnResetAll.EnableWindow( TRUE ); } else { if( m_wndBtnResetAll.IsWindowEnabled() ) m_wndBtnResetAll.EnableWindow( FALSE ); }
That explains why the "Reset All" button is always disabled. I’m assuming, but I haven’t debugged it, that there are no keys displaying because there is m_pMenuInfo object to get the keys from.
In any event, it looks like keyboard customization requires use of the prof-uis menu.
We aren’t using the prof-uis menu because our app has a feature that displays tooltips for disabled menu items. The tooltip is provided on-the-fly based on why the item is disabled, rather than static text from the RC file. This is done by catching these messages, but I’m not 100% sure on the details. ON_WM_MENUSELECT() ON_WM_ENTERIDLE() ON_WM_ENTERMENULOOP() ON_WM_EXITMENULOOP() ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTW, 0, 0xFFFF, OnToolTipText) ON_NOTIFY_EX_RANGE(TTN_NEEDTEXTA, 0, 0xFFFF, OnToolTipText)
I haven’t tried this with the prof-uis menu.
The other strange thing we do is add/remove menu items in CCmdUI update handlers. I noticed that with the prof-uis menu, the CCmdUI menu pointer is always NULL.
Thanks for the suggestions!
|
|
Technical Support
|
Apr 26, 2007 - 1:21 PM
|
To fix this problem in SDI applications based on the standard window menu line, please update the source code for the following method: CExtCustomizeSite::CCmdMenuInfo * CExtCustomizeSite::MenuInfoActiveGet()
{
ASSERT( this != NULL );
if( m_pMenuInfoActiveCustomize == NULL )
return MenuInfoGetDefault();
return m_pMenuInfoActiveCustomize;
} The MDI applications will use only one default accelerator table after that.
|
|
Chris Thomas
|
Apr 20, 2007 - 10:56 AM
|
Yes, I’m already calling MenuInfoAdd(). Not only am I unable to determine why my app’s keyboard customization doesn’t work, but I am unable to change the BitmapEditor example to show the same behavior.
I do agree that it appears like a missing menu tree and accelerator table, but I can’t see why.
Anyway thanks for the reply and I’ll keep on looking.
This is my code: VERIFY( g_CmdManager->UpdateFromMenu( ::AfxGetApp()->m_pszProfileName, IDR_MAINFRAME ) );
//setup profUIS customization VERIFY( CExtCustomizeSite::MenuInfoAdd( this, _T("Default"), IDR_MAINFRAME, true ) );
VERIFY( CExtCustomizeSite::MenuInfoLoadAccelTable( _T("Default"), IDR_MAINFRAME ) );
//enable customization, but don’t include __ECSF_PARMS (locks out the menu/toolbar customization page) if( !CExtCustomizeSite::EnableCustomization( this, __ECSF_BARS |__ECSF_COMMANDS | __ECSF_USER_BARS | __ECSF_ACCELERATORS | __ECSF_PARMS_DISABLE_PERSONALIZED )) { ASSERT( FALSE ); return -1; }
CExtCustomizeSite::CategoryUpdate( IDR_MAINFRAME ); CExtCustomizeSite::CategoryMakeAllCmdsUnique(); CExtCustomizeSite::CategoryAppendAllCommands();
|
|
Technical Support
|
Apr 22, 2007 - 8:57 AM
|
If your application is MDI, please try to reproduce the problem using the DRAWCLI sample, which is also MDI. In any case, you can send us the source code of the main frame window or the entire project so we can find out what’s wrong.
|
|
Technical Support
|
Apr 20, 2007 - 10:11 AM
|
The customize site allows you to register one or more named menu lines. You can do this with the CExtCustomizeSite::MenuInfoAdd() method. Each menu line includes a menu tree and an accelerator table. Even if you are not using the menu control bar, you should register at least one menu line. Otherwise the accelerator customization page will not work at all because it cannot find any registered menu line with an accelerator table to customize.
|
|
Offer Har
|
Apr 20, 2007 - 8:34 AM
|
Dear Support,
When adding a row, and setting the focus to it (the last row), it is just under the last row of the grid always, and it not visible. This is the piece of code for reproducing the problem (make sure you have horizontal scroll-bar...):
RowAdd(1, false); LONG nRowCount = RowCountGet(); // Here i do some cells manipulation FocusSet(CPoint(0, nRowCount-1), true, true, true, false); OnSwUpdateScrollBars(); OnSwDoRedraw();
Please fix for coming version.
Regards, Ron.
|
|
Technical Support
|
Apr 20, 2007 - 10:01 AM
|
Ron, you would agree with us that it is unfair to label a question that arises with the word bug off hand. We cannot yet confirm that it is a bug. Please swap some lines in the code you provided OnSwUpdateScrollBars();
FocusSet(CPoint(0, nRowCount-1), true, true, true, false);
OnSwDoRedraw(); The focus change method is unable to scroll the grid window because the scroll bars are not initialized properly.
|
|
Offer Har
|
Apr 20, 2007 - 10:28 AM
|
Thanks,
Problem (not a bug) solved!
|
|
Chris Anderson
|
Apr 19, 2007 - 6:58 PM
|
Hi, When I add the following block of code to the ProfStudio sample
if( !CExtCustomizeSite::EnableCustomization( this, __ECSF_DEFAULT ) ) { ASSERT( FALSE ); return -1; } CExtCustomizeSite::CategoryUpdate( IDR_MAINFRAME ); CExtCustomizeSite::CategoryMakeAllCmdsUnique(); CExtCustomizeSite::CategoryAppendAllCommands(); CExtCustomizeSite::CategoryAppendNewMenu();
the m_wndComboWebLoaction combo in the m_wndToolBarWeb toolbar doesnt show up.
Is there something different that needs to be done in this case for the combo to showup correctly? Thanks
|
|
Chris Anderson
|
Apr 25, 2007 - 9:23 AM
|
I have no problems with it! I noticed the ASSERTs when adding customization support to my existing application as part of moving to Prof UIS. Its just that the ASSERTs are pretty annoying in the debug build.
|
|
Chris Anderson
|
Apr 23, 2007 - 9:25 AM
|
Yes I am using customizable toolbars and menus. As I mentioned in my previous post, I did some minor modifications to the StyleEditor sample and couple reproduce the problem. Add the ID_SEPARATOR to the resource file for the ID_VIEW_STANDARD_BAR toolbar and run the application after cleaning up the Prof UIS registry settings. Then run the app twice and you will see the problem.
|
|
Technical Support
|
Apr 24, 2007 - 11:49 AM
|
In non-customizable toolbars and menus, there can be a separator as the first menu item or toolbar button. The separator is implemented as a standalone UI item with command identifier equal to zero.
Customizable toolbars and menus are based on command tree nodes and there are no nodes which correspond to a separator UI item. But there is a "group start" property in each node, which means a separator should be displayed before the toolbar button/menu item. You can see the appropriate command in the context menu displayed over toolbar buttons and menu items in the customize mode. The "group start" option is disabled for the first button in each toolbar and for first item in each menu. This is defined by the design of MS Office customizable toolbars and menus. It is a limitation for customizable toolbars and menus in Prof-UIS and we do not see any problems with this.
Could you please explain us why you need a separator as the first item? What is the reason for having a separator between toolbar gripper and first button?
|
|
Chris Anderson
|
Apr 20, 2007 - 2:07 PM
|
There seems to be some issue in loading the state when the separator is the first item in a toolbar. Add a separator to the ID_VIEW_STANDARD_BAR toolbar of the StyleEditor Sample. Prof UIS throws an ASSERT.
|
|
Technical Support
|
Apr 22, 2007 - 9:08 AM
|
Please let us know if you are using customizable toolbars and menus? Could you reproduce the problem using any of our sample applications and send it to us?
|
|
Technical Support
|
Apr 20, 2007 - 8:36 AM
|
You should not use the combo box common control nor edit common control in customizable toolbars and menus. Please use built-in Prof-UIS combo/edit fields. The user can drag-and-drop any combo/edit fields between customizable toolbars and menus. As result, several copies of one field may appear. The CExtCustomizeSite class provides automatic data synchronization between several copies of one field and this is the main reason not to use combo/edit common controls in customizable toolbars and menus. Please take a closer look at the StyleEditor sample application. It is very simple application which demonstrates how to work with built-in combo fields in customizable toolbars and menus. A set of CExtCustomizeSite class virtual methods are overridden in the CMainFrame class for implementing editor and popup list box event handling of the built in combo fields.
|
|
Suhai Gyorgy
|
Apr 20, 2007 - 2:28 AM
|
StyleEditor sample uses customization and has combo boxes in toolbar. I found these commands that I think you are missing: CExtCmdItem * pCmdItem;
pCmdItem = g_CmdManager->CmdGetPtr( pApp->m_pszProfileName, ID_SE_STYLE_LIST );
pCmdItem->StateSetCombo();
pCmdItem->StateSetResizable();
pCmdItem->m_nTextFieldWidth = pCmdItem->m_nDropDownWidth = 120;
//pCmdItem->StateSetTextFieldNotEditable();
|
|
Chris Anderson
|
Apr 19, 2007 - 6:54 PM
|
Hi, I have crated a standard button using CExtButton. At runtime, I need to change the style to BS_OWNERDRAW. I am using SetWindowLongPtr(hWnd, GWL_STYLE, lStyle ). After this change I am expecting WM_DRAWITEM to receive. But this is not hapening. Any issue in doing this? Please suggest.
Thanks
|
|
Chris Anderson
|
Apr 30, 2007 - 3:01 PM
|
Thanks. I will try using this method
|
|
Chris Anderson
|
Apr 26, 2007 - 10:22 AM
|
Please provide your feedback. I am waiting for your response.
Thanks
|
|
Technical Support
|
Apr 27, 2007 - 9:01 AM
|
Actually as we said earlier the CExtButton has BS_OWNERDRAW applied by default and you won’t be able to handle WM_DRAWITEM . But instead you can perform any custom painting in the CExtButton::_RenderImpl() virtual method. Please let us know if you tried this method.
|
|
Chris Anderson
|
Apr 20, 2007 - 12:09 PM
|
We are using CreateWindow() to create the normal button and then subclassed using CExtButton. After the button is shown, then user could change the style to BS_OWNERDRAW using SetWindowLongPtr(). In this scenario, does CExtButton will have BS_OWNERDRAW after subclassing?
|
|
Technical Support
|
Apr 20, 2007 - 9:21 AM
|
The CExtButton has BS_OWNERDRAW applied by default. If you need to repaint the button in some specific way, you can override the CExtButton::_RenderImpl() virtual method.
|
|
Chris Anderson
|
Apr 19, 2007 - 2:46 PM
|
Hi, Does Prof UIS support themes for the title bar of a MDI child similar to to the MDI parent? It doesnt seem to be supported at present. Is this correct? If yes, when would you be likely to address this issue.
|
|
Chris Anderson
|
Apr 20, 2007 - 9:13 AM
|
How would I go about implementing the same for the MDI child frame?
|
|
Technical Support
|
Apr 20, 2007 - 10:14 AM
|
The CExtNCW template class can be used with CMDIChildWnd , but several issues are not fixed yet.
|
|
Technical Support
|
Apr 20, 2007 - 8:23 AM
|
The MDI child frame skinning is supported and you can use it, but several issues are not fixed yet. That is why we do not use skinned MDI child frames in our samples at the moment.
|
|
Chris Anderson
|
Apr 19, 2007 - 2:39 PM
|
Hi, We have code which creates the mail application window using SDK API CreateWindow(). So to port to prof-UI, I have subclassed using CExtNCW<CWnd> (Due to the code complexity, I could not use CFrameWnd). Then I have added status bar using CExtStatusControlBar() with standard indicators (CAPS, NUM, and SCROLL). The window is displayed correctly with status bar. However the keyboard status are not reflected in the status bar. Please let me know if I need to do any other initialization.
|
|
Chris Anderson
|
Apr 23, 2007 - 11:16 AM
|
Thanks. Do I have to inherit like CExtNCW < CExtWS<CWnd> > ? With this I am not seeing the thick frame though!.
|
|
Technical Support
|
Apr 24, 2007 - 11:51 AM
|
You should recompute the window’s non-client area after subclassing. Alternatively you can change the paint manager after that.
|
|
Chris Anderson
|
Apr 20, 2007 - 10:22 AM
|
Thanks. If I use CFrameWnd, then status bar shows the keyboard status. But with this I have a side effect. We create a form (using CreateWindow)having the controls and I am subclasing this window using CWnd. This form is then attached to CFrameWnd. Now when I resize, the whole view flickers very badly!. Hence I went with CExtNCW<CWnd> for the main frame also. Having CExtNCW<CWnd> as main frame works fine, but the status bar does not show the key status(may be due to focus is not set correctly?). Please advice.
|
|
Technical Support
|
Apr 22, 2007 - 8:53 AM
|
If in the case of a non-CFrameWnd -based window (e.g., CWnd , CDialog ), please implement the following:
1) Make sure that WS_CLIPCHILDREN|WS_CLIPSIBLINGS are set for this window. These styles are essential form removing any flickering.
2) To position the status bar at the bottom, invoke CWnd::RepositionBars( 0, 0xFFFF, 0 ); both when the window is created and resized. This is the same as CFrameWnd::RecalcLayout() in frame windows. The ProfUIS_Controls sample is a dialog-based application with a status bar. So you can use it as an example.
3) You wrote you were using CExtNCW < CWnd > . This type provides a skinned non-client window area if the currently installed paint manager supports it. We guess you should also use a CExtWS template decorator class which provides a skinned window client area like in CExtResizableDialog -based windows.
|
|
Technical Support
|
Apr 20, 2007 - 8:41 AM
|
Please also note that even if you use the CFrameWnd class, the main thread’s message loop should be controlled by MFC’s CWinApp -derived class and this frame window should be the main window in the thread (i.e. the CWinApp::m_pMainWnd pointer should be not NULL and point to this frame window) or, alternatively, you should pre-translate all the messages through this frame.
|
|
Technical Support
|
Apr 20, 2007 - 8:19 AM
|
You can use the CFrameWnd class exactly like the CWnd class. We have described this issue in one of our previous answers. Believe or not, the keyboard state will be displayed correctly. We will be with you until the problem gone. Just some additional notes: the HWND handle can be created as it is, but without the WS_VISIBLE standard window style. Then subclass it with CFrameWnd object and remember it should be allocated dynamically using C++ new operator and it will delete itself automatically when the window handle will be destroyed. If you need non-dynamic CFrameWnd window, then you should override its PostNcDestroy() virtual method with empty body. Then you should invoke some method of your subclassed frame - this method should create menu bar, status bar and do anything else what typically the CMainFrame::OnCreate() method do.
Such approach is used in our FrameFeatures ActiveX control. It uses such phantom frame window and it successfully subclasses .NET Windows Forms popup form windows, Visual Basic 6.0 popup form windows, Microsoft Visual J++ 6.0 AWT library’s popup form windows, Internet Explorer server windows and we have reports about other ActiveX form containers were very friendly with this control. If we do this successfully, then you should have 100% chance for success in converting your application.
|
|
Chris Anderson
|
Apr 19, 2007 - 2:31 PM
|
Hi, We have a module which creates the window menu at run time using Windows SDK API’s. Now I have changed the Main window to use the prof-UI theme. After this, the menubar has got dis-appeared and found that they were overlapped on Window caption!. Is there a simple solution to overcome with this issue? Or Do I have to use CExtMenuControlBar()? if so How to associate the hMenu to this CExtMenuControlBar object?
Thanks
|
|
Technical Support
|
Apr 29, 2007 - 9:49 AM
|
We haven’t still received the sample. It may have been filtered out somewhere. Would you send it to profuis at gmail.com?
|
|
Chris Anderson
|
Apr 27, 2007 - 4:36 PM
|
I have sent you the sample through e-mail provide the clear pitcure on the issue
|
|
Chris Anderson
|
Apr 27, 2007 - 12:57 PM
|
I do not want the status. I need the menu item at the top level to be enabled without frame having the message map. So without adding any message handler is there a way to set the menu item to be always enabled?
|
|
Chris Anderson
|
Apr 26, 2007 - 6:09 PM
|
I cannot add the MFC menu handler as the menu is populated at runtime using the SDK functions. Is there an alternate way to make sure that the "Test" menu item in the menubar is enabled?
|
|
Technical Support
|
Apr 27, 2007 - 11:42 AM
|
Let us suppose your application knows exactly the menu structure. In this case it is not a problem to find any menu item by its index and nested location in the menu tree and check its disabled state. In the case of Prof-UIS, you have a pointer to the CExtPopupMenuWnd object representing one menu level and an index of the menu item in the menu level. So you can use the CExtPopupMenuWnd::ItemEnabledGet() method to check if menu item is enabled.
|
|
Chris Anderson
|
Apr 25, 2007 - 4:35 PM
|
This approch cannot be used in our application. We provide the IDE tool which allows user to create the menu at runtime and associate the action. So we have our own mapping and use Window API to create the menus. There would be lots of effort to migrate and test these code to fit the Prof-UI architecture for Menubar.
In the mean time I have figured a way to make the code to work by handling the message CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel and with the follwoing code:
... CExtPopupMenuWnd * pPopup = pData->m_pPopup; ASSERT( pPopup != NULL );
HMENU hMenuPopup = pPopup->ExportToMenu(TRUE);
// Follwoing code would go through each menu items to enable / disable using the windows API // This function call was earlier placed in WM_INITPOPUPMENU FesMenuInitPopup(GetMenuOwner(), hMenuPopup, 0, FALSE);
CMenu menuPopup; menuPopup.Attach(hMenuPopup); pPopup->UpdateFromMenu(m_hWnd, &menuPopup, FALSE);
The above stuff works fine for the poupup menu in menu bar. Suppose if a menuitem (command) exist in menu bar then I cannot enable/disable. E.g., The menu bar as "File" a poup menu, "Edit" a poup menu, and "Test" a command menu item. Now The "Test" menu item is always disabled!. How could I atleast force this menu item "Test" to be enabled?
Thanks
|
|
Technical Support
|
Apr 26, 2007 - 1:28 PM
|
The menu bar (CExtMenuControlBar ) is an extended version of the toolbar (CExtToolControlBar ). So the top menu is not based on popup menus (CExtPopupMenuWnd ) but rather on toolbar button objects (CExtBarButton ). The buttons are built in CExtMenuControlBar::_UpdateMenuBar() , which is an internal virtual method. The menu bar has a simple implementation. It keeps HMENU of the window menu and resets the real window menu to NULL . The top level menu items contain HMENU handles of top level HMENU kept in the menu bar. Yes, these menu bar buttons are always enabled and never updated using the MFC’s command updating mechanism. We do not think this is a real problem if each command is updated correctly according to each state in your application.
|
|
Chris Anderson
|
Apr 23, 2007 - 6:01 PM
|
Thanks.
The menu bar was not displayed with CWnd. After changing the frame to CFrameWnd, the menu bar was displayed. In our code we trap WM_INITMENUPOPUP and then enable or displae the menu items. After using CExtMenuControlBar, the window was not getting the message. Please suggest on how to trap this message for enabling / disabling of the menu items.
|
|
Technical Support
|
Apr 25, 2007 - 3:42 AM
|
There is an article Constructing Menus Dynamically at Run Time that answers your question. Please note that in Prof-UIS, the state of all menu items and toolbar buttons is controlled by the MFC’s command updating mechanism. So to enable/disable a menu item, you need to add the command updating method for the command associated with this menu item to your CMainFrame class. You can generate this method using Visual Studio. // method declaration:
afx_msg void OnUpdateMyCmd(CCmdUI* pCmdUI);
// message map entry
ON_UPDATE_COMMAND_UI(ID_MY_CMD, OnUpdateMyCmd)
// method body
void CMainFrame::OnUpdateMyCmd(CCmdUI* pCmdUI)
{
pCmdUI->Enable( FALSE );
}
|
|
Technical Support
|
Apr 20, 2007 - 8:16 AM
|
If you create the standard menu line only once at startup, then you can simply subclass its parent window with CFrameWnd and create the menu bar in it. If you create the menu line more than once, you should use the CMenu object returned by the CExtMenuControlBar::GetMenu() method and invoke the CExtMenuControlBar::UpdateMenuBar() method each time the menu is modified. Please note that if you want to assign a menu handle to the window, you should not use the ::SetMenu() Win32 API at all. Just assign some menu initially and then use that returned by the menu bar.
|
|
Offer Har
|
Apr 19, 2007 - 11:32 AM
|
Dear Support,
I have a function which adds a row to a grid, as follows:
void CMyGrid::AddRow() { RowAdd(1, false); // Here I do my manipulations.. OnSwDoRedraw(); }
The problem is that the scroll-bar is not displayed when needed or adjusted with the extra line unless I resize the grid. What am I missing?
Thanks, Ron.
|
|
Technical Support
|
Apr 20, 2007 - 8:08 AM
|
Please invoke OnSwUpdateScrollBars() before OnSwDoRedraw() .
|
|
Suhai Gyorgy
|
Apr 20, 2007 - 1:42 AM
|
Place these before OnSwDoRedraw():
OnSwRecalcLayout( true ); OnSwUpdateScrollBars();
|
|
Paul Cowan
|
Apr 19, 2007 - 7:34 AM
|
Is there a standalone checked combobox control in the library like the CheckedComboBox cell in the Grid in the ProfUIS controls demo?
|
|
Technical Support
|
Apr 20, 2007 - 8:20 AM
|
Unfortunately there is no such a control in Prof-UIS.
|
|
Chris Anderson
|
Apr 18, 2007 - 3:39 PM
|
Hi, I would like to remove a couple of popup menus from the top-level menu bar. This needs to be done as soon as as the application is invoked. Since Prof UIS menubar is based on the toolbar, how would I go about removing/inserting specific popup menu based on some application logic? Thanks
|
|
Technical Support
|
Apr 19, 2007 - 5:43 AM
|
Because the CExtMenuControlBar class is derived from CExtToolControlBar , the menu bar is kind of toolbar and the top menu level is based on toolbar buttons. The menu bar builds its own list of toolbar buttons in the CExtMenuControlBar::_UpdateMenuBar() internal virtual method which you can override and build the menus you need. This method is invoked once at startup in the SDI application. It is invoked many times in the MDI application: when MDI child frame is created or destroyed and when the active MDI child frame changes. This method is also invoked when your code invokes the CExtMenuControlBar::LoadMenuBar() or CExtMenuControlBar::UpdateMenuBar() methods.
|
|
Suhai Gyorgy
|
Apr 19, 2007 - 1:55 AM
|
You can use RemoveButton method of CExtToolControlBar to remove top-level menuitems. The method accepts an index as parameter, so to remove 3rd button, you can call m_wndMenuBar.RemoveButton(2);
|
|
Burak Petekkaya
|
Apr 18, 2007 - 8:35 AM
|
Hi,
I have trouble with adding a public member to CExtRibbonNodeClass..If I add a member to the class, dll is compiled succesfully but at runtime my application does not work although I do not use that member..How should I add a member?
here the code...
in CExtRibbonbar.h,
class __PROF_UIS_API CExtRibbonNode : public CExtCustomizeCmdTreeNode { public: DECLARE_SERIAL( CExtRibbonNode ); protected: INT m_nRIL_VisualCurrent, m_nRIL_VisualMin, m_nRIL_VisualMax, m_nRIL_Effective, m_nRIL_EffectiveCollapsed; CArray < DWORD, DWORD > m_arrILEtoILV; virtual void _InitMembers(); public: UINT m_nTpmxAdditionalFlags; CExtCmdIcon m_iconBig, m_iconSmall; UINT m_nMyMember; // member I try to add CExtRibbonNode( ...... -------------------------------- in CExtRibbonBar.cpp,
void CExtRibbonNode::_InitMembers() { ASSERT_VALID( this ); m_nTpmxAdditionalFlags = TPMX_RIBBON_MODE; m_nMyMember = 0; ModifyFlags( __ECTN_RGA_DEFAULT ); ........... -----
Can you help me about this?
|
|
Technical Support
|
Apr 18, 2007 - 11:35 AM
|
Such code modification in big projects often requires the project (and all projects that depend on it) to be completely rebuilt. Please also ensure your application using exactly the same modified and just compiled DLL (not any other).
You have no reason to code such Prof-UIS modifications in any cases. Please create your classes derived from Prof-UIS classes in scope of your project(s).
|
|
Vrinda Savargaonkar
|
Apr 18, 2007 - 8:19 AM
|
Dear Sir/Madam
I am using CExtGridWnd class. Using this class i derive a class .I then inserted some column . In one of the column i am inserting some names using
CExtGridCellString * pCellString0 =STATIC_DOWNCAST(CExtGridCellString, GridCellGet( 0, iLoop )); pCellString0->TextSet( _T(szFullName) );
I am using style .BseModifyStyle( __EGWS_BSE_SORT_COLUMNS,0,FALSE);
After inserting data when i click on column header having text data not sorted properly i.e. not in alphabetical order either ascending or descending. When arrow on column header shown upword the sorting order is like this Ganesh Rai Hitesh Kiran Ramesh Vasant arm enov
etc... Why not names like , arm then enov & then Ganesh like this are sorted when ascending order or when arrow upword.
where is problem. Please suggest quickly some solution . Thanks.
|
|
Technical Support
|
Apr 18, 2007 - 11:33 AM
|
Here is the sequence of character codes that grows: 0...9...A...Z...a...z. The CExtGridWnd class compares grid cells while sorting using CExtGridCell::Compare() virtual method invocations. All the string cells compare themselves with others using the case sensitive string comparison. If you need the case insensitive comparison, then you should implement and use a custom CExtGridCellString -derived class which should have the Compare() virtual method.
|
|
Vincent Lin
|
Apr 17, 2007 - 7:22 PM
|
Dear Support Team,
I modify your sample project "ProfStudio" to add a dialog with scrollbar. but the scrollbar don’t appear. the added code as below, what is wrong ?
// m_wnd_CM_FLOW_Child is a dialog derived from CExtResizableDialog // m_wndCMBar is a CExtControlBar object
if( !m_wndCMBar.Create( _T("CM FLOW"), this, ID_CM_WINDOW_BAR ) || !m_wnd_CM_FLOW_Child.Create( CCM_FLOW::IDD, &m_wndCMBar ) ) { TRACE0("Failed to create ID_VIEW_BAR_RESOURCE_VIEW\n"); return -1; // fail to create } CProfStudioThinFrame * pWndThinFrame2 = new CProfStudioThinFrame; if( !pWndThinFrame2->CreateDynamicThinFrame(&m_wnd_CM_FLOW_Child) ) { TRACE0("Failed to create thin frame for ID_VIEW_BAR_RESOURCE_VIEW\n"); return -1; // fail to create }
m_wnd_CM_FLOW_Child.ShowWindow( SW_NORMAL );
|
|
Technical Support
|
Apr 18, 2007 - 9:21 AM
|
Please remove m_wnd_CM_FLOW_Child.ShowWindow( SW_NORMAL ); and set the Visible, Horizontal Scrollbar and Vertical Scrollbar properties of the dialog template resource to true.
Additionally please note that the scrolling in not provide in dialogs as in form views. The following sample demonstrates how to implement the scrollable dialog container with skinned scrollbars and dialog anchoring mechanism.
|
|
Vincent Lin
|
Apr 17, 2007 - 6:54 PM
|
Hi, I creates a MDI program and adds below code to MainFrame constructor, but the theme don’t changed. do I miss something ?
VERIFY( g_PaintManager.InstallPaintManager( new CExtPaintManagerStudio2005 ) );
|
|
Vincent Lin
|
Apr 18, 2007 - 8:28 PM
|
I can build project successfully, but the theme not be changed. I use
Visual Studio 2005 V8.0.50727 Prof-UIS V2.64
|
|
Technical Support
|
Apr 19, 2007 - 6:45 AM
|
Would you send us this project so we can test here?
|
|
Technical Support
|
Apr 20, 2007 - 9:11 AM
|
Thank you for the test project. However it is a basic MFC application without any Prof-UIS components added. So just adding the paint manager cannot change the application look. There is a good article that describes how to start using Prof-UIS Getting Started with Prof-UIS. Please let us know if you read it.
|
|
Vincent Lin
|
Apr 18, 2007 - 2:37 AM
|
Dear Suhai, I don’t use PaintManagerStateLoad in my program. I just create a new MDI project and add above code.
|
|
Suhai Gyorgy
|
Apr 18, 2007 - 3:48 AM
|
I tried to do the same, create a new MDI project with all the default settings, except that I use static unicode library of ProfUIS. Unfortunately AppWizard generated a project which cannot be compiled, due to unresolved external symbols, so I couldn’t regenerate the problem.
Anyway, I saw that in the generated project, PaintManager is set in the SetupUiAdvancedOptions method of the application class. By default, it is set to install CExtPaintManagerXP. Try to change that code, installing different PaintManager there. And does the theme change with any other kind of PaintManager?
|
|
Technical Support
|
Apr 18, 2007 - 9:44 AM
|
Please let us know which versions of Visual Studio and Prof-UIS App Wizard were used for generating the project that cannot be compiled? We changed the application wizards for all supported versions of Visual Studio versions in v.2.63.
|
|
Suhai Gyorgy
|
Apr 19, 2007 - 1:51 AM
|
I’m using Visual Studio .NET 2003. In its About... dialog it says: Microsoft Development Environment 2003 Version 7.1.3088. Installed products: Microsoft Visual C++ .NET I’m using latest ProfUIS, v2.64, with files updated from profuis2641.zip file downloaded March 21st of 2007. As I mentioned in previous post, I’ve used default settings provided by AppWizard, except that in AppWizard I switched to use MFC and ProfUIS statically, and after that in project properties I changed to use Unicode character set. Rebuilt Debug version of project, here are the errors I got: - MDITest error LNK2001: unresolved external symbol "public: virtual int __thiscall CExtResDlg::Create(wchar_t const *,class CWnd *)" (?Create@CExtResDlg@@UAEHPB_WPAVCWnd@@@Z) - MDITest error LNK2001: unresolved external symbol "public: virtual wchar_t const * __thiscall CExtNcFrameImpl::NcFrameImpl_GetScTipText(unsigned int)const " (?NcFrameImpl_GetScTipText@CExtNcFrameImpl@@UBEPB_WI@Z) - MDITest error LNK2001: unresolved external symbol "public: virtual wchar_t const * __thiscall CExtResizableDialog::OnQuerySkinnedFontParmName(void)const " (?OnQuerySkinnedFontParmName@CExtResizableDialog@@UBEPB_WXZ) - MDITest error LNK2019: unresolved external symbol "public: bool __thiscall CExtCmdManager::ProfileSetup(wchar_t const *,struct HWND__ *,class CExtCmdProfile *)" (?ProfileSetup@CExtCmdManager@@QAE_NPB_WPAUHWND__@@PAVCExtCmdProfile@@@Z) referenced in function "public: void __thiscall CMDITestApp::SetupUiAdvancedOptions(void)" (?SetupUiAdvancedOptions@CMDITestApp@@QAEXXZ) - MDITest error LNK2019: unresolved external symbol "public: bool __thiscall CExtCmdManager::ProfileWndAdd(wchar_t const *,struct HWND__ *)" (?ProfileWndAdd@CExtCmdManager@@QAE_NPB_WPAUHWND__@@@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z) - MDITest error LNK2019: unresolved external symbol "public: bool __thiscall CExtCmdManager::SerializeState(wchar_t const *,wchar_t const *,wchar_t const *,bool,struct HKEY__ *,bool)" (?SerializeState@CExtCmdManager@@QAE_NPB_W00_NPAUHKEY__@@1@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z) - MDITest error LNK2019: unresolved external symbol "public: bool __thiscall CExtCmdManager::SetBasicCommands(wchar_t const *,unsigned int *,bool)" (?SetBasicCommands@CExtCmdManager@@QAE_NPB_WPAI_N@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z) - MDITest error LNK2019: unresolved external symbol "public: bool __thiscall CExtCmdManager::UpdateFromMenu(wchar_t const *,unsigned int,bool,bool)" (?UpdateFromMenu@CExtCmdManager@@QAE_NPB_WI_N1@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z) - MDITest error LNK2019: unresolved external symbol "public: static bool __cdecl CExtControlBar::ProfileBarStateLoad(class CFrameWnd *,wchar_t const *,wchar_t const *,wchar_t const *,struct tagWINDOWPLACEMENT *,bool,bool,struct HKEY__ *,bool)" (?ProfileBarStateLoad@CExtControlBar@@SA_NPAVCFrameWnd@@PB_W11PAUtagWINDOWPLACEMENT@@_N3PAUHKEY__@@3@Z) referenced in function "protected: int __thiscall CMainFrame::OnCreate(struct tagCREATESTRUCTW *)" (?OnCreate@CMainFrame@@IAEHPAUtagCREATESTRUCTW@@@Z) - MDITest error LNK2019: unresolved external symbol "public: static bool __cdecl CExtControlBar::ProfileBarStateSave(class CFrameWnd *,wchar_t const *,wchar_t const *,wchar_t const *,struct tagWINDOWPLACEMENT *,bool,bool,struct HKEY__ *,bool)" (?ProfileBarStateSave@CExtControlBar@@SA_NPAVCFrameWnd@@PB_W11PAUtagWINDOWPLACEMENT@@_N3PAUHKEY__@@3@Z) referenced in function "public: virtual int __thiscall CMainFrame::DestroyWindow(void)" (?DestroyWindow@CMainFrame@@UAEHXZ) - MDITest error LNK2019: unresolved external symbol "public: static bool __cdecl CExtControlBar::stat_LoadWindowRect(struct HWND__ *,wchar_t const *,wchar_t const *,bool)" (?stat_LoadWindowRect@CExtControlBar@@SA_NPAUHWND__@@PB_W1_N@Z) referenced in function "public: virtual void __thiscall CExtWS<class CExtADLG<class CExtResDlg>,301>::LoadWindowRect(bool)" (?LoadWindowRect@?$CExtWS@V?$CExtADLG@VCExtResDlg@@@@$0BCN@@@UAEX_N@Z) - MDITest error LNK2019: unresolved external symbol "public: static bool __cdecl CExtControlBar::stat_SaveWindowRect(struct HWND__ *,wchar_t const *,wchar_t const *)" (?stat_SaveWindowRect@CExtControlBar@@SA_NPAUHWND__@@PB_W1@Z) referenced in function "public: virtual void __thiscall CExtWS<class CExtADLG<class CExtResDlg>,301>::SaveWindowRect(void)const " (?SaveWindowRect@?$CExtWS@V?$CExtADLG@VCExtResDlg@@@@$0BCN@@@UBEXXZ) - MDITest error LNK2019: unresolved external symbol "public: virtual wchar_t const * __thiscall CExtNcFrameImpl::NcFrameImpl_GetScTipText(unsigned int)const " (?NcFrameImpl_GetScTipText@CExtNcFrameImpl@@UBEPB_WI@Z) referenced in function "public: __thiscall CMainFrame::CMainFrame(void)" (??0CMainFrame@@QAE@XZ) - MDITest fatal error LNK1120: 12 unresolved externals
|
|
Technical Support
|
Apr 20, 2007 - 10:17 AM
|
It seems the Prof-UIDS Application Wizard creates the project with Treat wchar_t as Built-in Type turned on. But for the library projects, it is turned off. We will fix this issue in the next version. Thank you.
|
|
Suhai Gyorgy
|
Apr 18, 2007 - 1:30 AM
|
Do you use PaintManagerStateLoad method anywhere in your code? That could override the setting of paintmanager in constructor.
|
|
Offer Har
|
Apr 17, 2007 - 1:45 PM
|
Dear Support,
I need to move a row in a grid up or down when a user clicks on a button. How can this be done?
Thanks, Ron.
|
|
Technical Support
|
Apr 18, 2007 - 11:44 AM
|
There is a SwapDroppedSeries method in the CExtGridDataProvider class which moves the column or row to a new position and returns true if succeeded. CExtGridDataProvider & _DataProvider = m_wndGrid.OnGridQueryDataProvider();
VERIFY(
_DataProvider.SwapDroppedSeries(
false,
nRowColNoSrc,
nRowColNoDropBefore,
&m_wndGrid
)
);
|
|
Offer Har
|
Apr 18, 2007 - 12:18 PM
|
Dear Support,
I am trying to move the selected row down, this is what I wrote:
CPoint pt = FocusGet(); CExtGridDataProvider& dataProvider = OnGridQueryDataProvider(); dataProvider.SwapDroppedSeries(false, pt.y, pt.y+1, this); OnSwDoRedraw();
And nothing happened. What am I don’t wrong? What are the value I need to pass at the nRowColNoSrc and nRowColNoDropBefore?
Thanks, Ron.
|
|
Technical Support
|
Apr 19, 2007 - 2:22 AM
|
Let’s assume Yg is a zero-based row number in the grid control which has Yt header rows at the top and Yb header rows at the bottom. Then the data provider index should be as follows: Ydp = Yt + Yb + Yg
|
|
Burak Petekkaya
|
Apr 17, 2007 - 5:53 AM
|
Hi,
My Mainframe Class derived from CMDIFrameWnd (implemented like below)
class CMainFrame : public CExtNCW < CMDIFrameWnd > { .... }
After I derived my mainframe class;
when run The application and opens a formview whose width or height is bigger than mainframe , mainframe’s scrollbar isn’t appear.So,I can’t see formview all.
What can I do?
|
|
Burak Petekkaya
|
Apr 17, 2007 - 10:07 AM
|
Dear Sir/Madam,
Thank you for your interest, but the problem is not related with the inside windows or with their scrollbars. Let me explain the problem clearly. When the size of the inside window is greater than the main frame, or when I slide the inside window out of it, I want to see a scroll bar in the main frame that will help to see the child frame (inside window) completely. Although I could see the scroll bar before, after the derivation of the main frame class as stated below I cannot.
class CMainFrame
: public CExtNCW < CMDIFrameWnd >
{
....
}
Please inform me about the solution.
Best regards.
|
|
Technical Support
|
Apr 18, 2007 - 11:46 AM
|
As we already said the main frame window cannot affect the scroll bars of any other child window inside it. This is not supported. If it is not what you mean, would you send us some screenshots that demonstrate what you need?
|
|
Technical Support
|
Apr 17, 2007 - 8:31 AM
|
The main frame window cannot affect the scroll bars of any other window inside it. We guess you may have forgotten to specify the WS_HSCROLL|WS_VSCROLL properties (Horizontal Scrollbar, Vertical Scrollbar) of the dialog template resource used in your form view.
|
|
Burak Petekkaya
|
Apr 17, 2007 - 2:31 AM
|
Hi,
I have a visual c++ 6.0 mfc project.
I can handle the theme changed with using Pm_bridge, I set grid colors in my color class acording to theme I call my color class function where my custom grid I created.So,if a window opened for the first time ,Grid’s color can be set where the function call.
But ,if there are an opened page and I change Theme at runtime ,I can’t refresh page ’s grid’s color.
I think I must access my child frame(opened window) over my main frame
How can I do this?
|
|
Technical Support
|
Apr 17, 2007 - 4:38 AM
|
You can implement the paint manager bridge interface in several classes. I.e. in each class where the theme changing notification is required and the window should be repainted. We guess you should implement this interface in your grid class.
|
|
Christoph Luedi
|
Apr 17, 2007 - 1:42 AM
|
I noted that all toolbars are automaticall added to the "Show or Hide Panels" system menu. But I have not found out how I can influence the order of the menu items, I want to have them in a different order. And how are the separators added? I know that I can create the menu myself with the CExtControlBar::g_nMsgConstructPopupMenu message, but since I only want to change the order, I hope there is an easier alternative.
|
|
Christoph Luedi
|
Apr 26, 2007 - 3:02 PM
|
Aha, the constructors! Thanks, as i hoped that’s much simpler to change the order than implementing the said function! :-)
|
|
Technical Support
|
Apr 17, 2007 - 2:31 AM
|
We would also like to add the following. By default, the order of control bars corresponds to the order in which the constructors of control bars are called. You can change this order by handling the CExtControlBar::g_nMsgConstructPopupMenu registered message, which allows you to construct any built-in menu displayed over control bars and floating mini frames. Fo r example, there is a CMainFrame::OnConstructPopupMenuCB() method in the ProfStudio sample that rebuilds most of the build-in menus and you can see toolbar commands put into a separate sub menu and control bar commands into a set of menu trees.
|
|
Suhai Gyorgy
|
Apr 17, 2007 - 1:56 AM
|
Snippets from same FAQ: "The CExtControlBar::g_nMsgConstructPopupMenu registered windows message is sent twice to the main frame window for each of built-in pop-up menus." ... "When it is sent for the second time, you can modify the pop-up menu created by default." From code: if( p_pmed->m_bPostNotification )
{
// p_pmed->m_pPopupMenuWnd contains default items
// you can change this menu here
}
|
|
Offer Har
|
Apr 16, 2007 - 2:36 PM
|
Dear Support,
I would like to add a tool-tip with a text which is not the cell’s content, but a comment field of each cell (like in excel for example).
How can this be done? Please advise.
Regards, Ron.
|
|
Offer Har
|
Jul 19, 2007 - 4:45 PM
|
Dear Support,
Please find below a part from a thread regarding tooltip for cells - Is there any progress with this feature?
Regards, Ron.
Author: Technical Support Subject: Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Tooltip for cells Apr 20, 2007 - 8:50 AM This feature seems to be worth to be added to the library. Please give us some time so we can add it as a standard feature in one of the next versions. Author: Offer Har Subject: Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Tooltip for cells Apr 20, 2007 - 8:55 AM OK...
Will be waiting...
Regards, Ron. Author: Technical Support Subject: Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Tooltip for cells Apr 20, 2007 - 10:43 AM The next version is being tested and will be released approximately within a week. So we will add it in the version that follows (within one, maximum two months). Author: Offer Har Subject: Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Re:Tooltip for cells Apr 20, 2007 - 11:19 AM Great.
Will be waiting...
|
|
Technical Support
|
Apr 17, 2007 - 12:46 PM
|
To set a custom tooltip text for the cell, you can override the CExtGridCell::OnInitToolTip() method in the cell class like as follows: // DECLARATION
class CExtGridCellTooltip : public CExtGridCell
{
public:
DECLARE_SERIAL( CExtGridCellTooltip );
IMPLEMENT_ExtGridCell_Clone( CExtGridCellTooltip, CExtGridCell );
CExtGridCellTooltip(
CExtGridDataProvider * pDataProvider = NULL
);
// virtual methods
virtual bool OnInitToolTip(
CExtGridWnd & wndGrid,
const CExtGridHitTestInfo & htInfo,
CToolTipCtrl & wndToolTip,
UINT nToolNo,
const RECT & rcTool
);
}; // class CExtGridCellTooltip
//IMPLEMENTATION
/////////////////////////////////////////////////////////////////////////////
// CExtGridCellTooltip
IMPLEMENT_SERIAL( CExtGridCellTooltip, CExtGridCell, VERSIONABLE_SCHEMA|1 );
CExtGridCellTooltip::CExtGridCellTooltip(
CExtGridDataProvider * pDataProvider // = NULL
)
: CExtGridCell ( pDataProvider )
{
}
bool CExtGridCellTooltip::OnInitToolTip(
CExtGridWnd & wndGrid,
const CExtGridHitTestInfo & htInfo,
CToolTipCtrl & wndToolTip,
UINT nToolNo,
const RECT & rcTool
)
{
ASSERT_VALID( this );
ASSERT_VALID( (&wndGrid) );
ASSERT( ! htInfo.IsHoverEmpty() );
ASSERT( htInfo.IsValidRect() );
htInfo;
bool bRetVal = false;
CExtSafeString strText( _T("Tooltip Text") );
if( strText.GetLength() > 0 )
{
wndToolTip.AddTool(
&wndGrid,
(LPCTSTR)strText,
&rcTool,
nToolNo
);
bRetVal = true;
}
if( ! bRetVal )
{
wndToolTip.DelTool( &wndGrid, nToolNo );
CWnd::CancelToolTips();
} // if( ! bRetVal )
return bRetVal;
} Here is how you can use it: CExtGridCellTooltip * pCellTooltip =
STATIC_DOWNCAST(
CExtGridCellTooltip,
m_wndGrid.GridCellGet(
4,
nRowNo,
0,
0,
RUNTIME_CLASS(CExtGridCellTooltip)
)
); Please note you should disable the content pop-up window for grid cells. Such a tooltip-like window shows the cell content for a cell which is partially visible m_wndGrid.EnableTooltips(
true,
true,
true,
true,
true
);
m_wndGrid.EnableExpanding(
false,
false,
false,
false,
false
);
|
|
Offer Har
|
Apr 17, 2007 - 1:02 PM
|
Few questions: 1) Will it obscure the cell, or can I control the location of the tool-tip (in excel it appears top-right of the cell) 2) I still want other cells to use the normal tool-tip when they are too long. 3) Can I use of the nice tooltips that are implemented in Prof-UIS and not the yellow square?
Thanks, Ron.
|
|
Technical Support
|
Apr 18, 2007 - 11:39 AM
|
You should not use the tooltip common control at all. The CExtContentExpandWnd class in Prof-UIS implements the popup window for several tasks:
1) Custom painted popup window for implementing the drag-n-dropped items such as grid/report-grid header cells.
2) Custom painted window for displaying the entire content of partially visible and hovered by mouse UI items such as grid cells, page captions in then page container or group captions in the toolbox.
3) Non rectangular window in form of red arrows and/or dots for highlighting drop target location such as position between header cells in grids.
Your control should have the CExtContentExpandWnd property, invoke its CExtContentExpandWnd::Activate() and CExtContentExpandWnd::Deactivate() methods and handle its CExtContentExpandWnd::g_nMsgPaintItemContent notification message for painting content of the content expand window. You will have entire control over location and appearance of this window.
|
|
Offer Har
|
Apr 18, 2007 - 1:13 PM
|
Dear Support,
Thank you for the information. Can you please explain how to add CExtContentExpandWnd to a cell? Should I derive a cell type and add a member of that type? How do I know when to activate the member etc.?
Regards, Ron.
|
|
Technical Support
|
Apr 19, 2007 - 5:56 AM
|
The content expand window is one for the entire grid and it is specified as the CExtGridWnd::m_wndContentExpand property. You should override the CExtGridWnd::OnGbwExpand() virtual method if you want to implement a custom content expand window. You can paint it by overriding CExtGridWnd::OnGbwPaintExpandedItemContent() or CExtGridCell:: OnPaintExpandedContent() (use these methods as an example of how you can paint it). Although the grid window positions the content expand window exactly over grid cell areas, you can position it anywhere you need. You will not need to track any mouse/keyboard events. The grid itself hides the content expand window when necessary (e.g. when the hovered cell changed, mouse wheel event, Windows active process changed). You really need only to reposition and, optionally, repaint the content expand window.
|
|
Offer Har
|
Apr 19, 2007 - 7:37 AM
|
Dear Support,
I am still confused... What i need is that when the mouse is over a specific cell (not all cells, but cells that have some extra data), a tool-tip or balloon box will appear to the right of the cell, or above the cell with this extra information.
Please advise how this can be achieved.
Thanks, Ron.
|
|
Technical Support
|
Apr 20, 2007 - 8:06 AM
|
It is understandable that you need an Excel-like tooltip for particular cells and this tooltip should display some info associated with these cells. At the same time, you want other cells to display the content expand window if the cell’s content does not fit the cell area (which is supported in Prof-UIS for all cells).
This dual functionality is not supported in Prof-UIS by default. So you should implement this yourself. This should not be difficult as we described above. If you want us to do this work for you, please contact our sales manager at sales@prof-uis.com.
|
|
Offer Har
|
Apr 20, 2007 - 8:25 AM
|
Dear Support,
I am willing to drop the tool-tip for the popup, if there is no other choice... Your explanations were a little to theoretical - what functions do I need to change, and what objects do I need to introduce?
Thanks, Ron.
|
|
Technical Support
|
Apr 20, 2007 - 8:34 AM
|
We would have provided such a sample if we had it. Unfortunately, we do not have a ready to use solution. So it is a custom project.
|
|
Offer Har
|
Apr 20, 2007 - 8:41 AM
|
Dear Support,
Other grids I used had this feature in them, this is why i’m puzzled with the lack of this feature (for example syncfusion grid).
Can you please give me some guidelines as to how this can be implemented, how to catch the mouse entering a cell, leaving the cell etc. and what class implements the popup balloon in the library.
Best Regards, Ron.
|
|
Technical Support
|
Apr 20, 2007 - 8:50 AM
|
This feature seems to be worth to be added to the library. Please give us some time so we can add it as a standard feature in one of the next versions.
|
|
Offer Har
|
Apr 20, 2007 - 8:55 AM
|
OK...
Will be waiting...
Regards, Ron.
|
|
Technical Support
|
Apr 20, 2007 - 10:43 AM
|
The next version is being tested and will be released approximately within a week. So we will add it in the version that follows (within one, maximum two months).
|
|
Offer Har
|
Apr 20, 2007 - 11:19 AM
|
|