Subject |
Author |
Date |
|
Suhai Gyorgy
|
Feb 22, 2007 - 6:27 AM
|
Dear Support,
I’d like to refresh an older bug-report I posted middle of January this year in the subject mentioned above. You wrote back to me that you would fix it, but version 2.64 still has the bug. I’d like to find out an approximate date on the fix.
Thank you! Chris
|
|
Technical Support
|
Feb 22, 2007 - 12:26 PM
|
We can offer a beta solution in this regard. You can download the latest source code from our ftp site (Prof-UIS 2.64.1).
|
|
Suhai Gyorgy
|
Feb 23, 2007 - 4:31 AM
|
As we don’t think this is a very disturbing mistake, we would rather wait for the alpha solution. Just please make it appear in the bug fix section of the version history or drop me an e-mail about it, when a new version with alpha solution is released. Thank you!
|
|
Hans Bergmeister
|
Feb 22, 2007 - 2:31 AM
|
Hello,
many thanks for releasing version 2.64. It seems to contain many great new features and improvements.
However, the following bugs, that have been reported earlier, still persist in Version 2.64:
1. Gradient control bar backgrounds are not always painted correctly. CExtPaintManagerOffice2003::PaintDockerBkgnd() stopps filling of the gradient at x-position 686 and continues painting a solid rectangle up to the right border of the background. Depending on the display settings the solid color may not match the rightmost gradient color, which causes the display of a vertical "edge" in the background.
This effect can be reproduced with the MDI_DynamicBars sample and the Office 2007 (Release 2) Silver theme. On displays with lower color depth (16 bit) the effect can be seen better, but it is also there on true color displays. A screenshot, that shows the effect, has been sent by email to the Prof-UIS support team.
2. Start the MDI_DynamicBars sample and make Dynamic Bar 8, Dynamic Bar 9 and Dynamic Bar 10 floating. Then dock Bar 9 and then Bar 10 together with bar 8 side by side in a row within the same floating container. Bar 8 to the left, Bar 9 in the middle, Bar 10 to the right, visible side by side in a row (not tabbed !!) within the same floating container. Now hide the floating container together with all three bars by clicking the X in the container’s NC area. Now select the menu entry View->Dynamic Resizable Bars->Dynamic Bar 10. Dynamic Bar 10 should become visible now - but nothing happens instead.
3. Start the MDI_DynamicBars sample and make Dynamic Bar 8, Dynamic Bar 9 and Dynamic Bar 10 floating. Then dock Bar 9 and then Bar 10 together with bar 8 side by side in a row within the same floating container. Bar 8 to the left, Bar 9 in the middle, Bar 10 to the right, visible side by side in a row (not tabbed !!) within the same floating container (let’s call this "Figure 1"). Now hide the floating container together with all three bars by clicking the X in the container’s NC area. Now select the menu entry View->Dynamic Resizable Bars->Dynamic Bar 8. Dynamic Bar 8 appears as expected. Now select View->Dynamic Resizable Bars->Dynamic Bar 9. Dynamic Bar 9 appears as expected right of Dynamic Bar 8. Now select View->Dynamic Resizable Bars->Dynamic Bar 10. Dynamic Bar 10 appears, too, but the sizes of the bars, i.e. the ratio of their particular widths, does not match the original ratio of "Figure 1". In our case Bar 9 ends as a very narrow window with a width of a few pixels. In other words: the three bars are not restored with their previous width.
|
|
Technical Support
|
Feb 25, 2007 - 11:32 AM
|
Regarding items 2 and 3 in your message, please update the source code for the CExtControlBar::DelayShow() method in ../Prof-UIS/Src/ExtControlBar.cpp file: void CExtControlBar::DelayShow( BOOL bShow )
{
ASSERT_VALID( this );
CMiniDockFrameWnd * pMiniFrame =
DYNAMIC_DOWNCAST( CMiniDockFrameWnd, GetParentFrame() );
if( IsFloating()
&& (! IsVisible() )
&& (! IsFixedMode() )
)
{
if( pMiniFrame != NULL )
{
ASSERT_VALID( pMiniFrame );
pMiniFrame->ModifyStyle( 0, FWS_SNAPTOBARS );
}
}
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
else
if( m_bAutoHideMode )
bShow = FALSE;
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
if( pMiniFrame != NULL && bShow && m_pDockBar->GetSafeHwnd() != NULL )
{
CControlBar::DelayShow( bShow );
CControlBar * pParentBar = DYNAMIC_DOWNCAST( CControlBar, m_pDockBar->GetParent() );
if( pParentBar != NULL )
pParentBar->DelayShow( bShow );
else
{
pMiniFrame->RecalcLayout();
pMiniFrame->ShowWindow( SW_SHOWNA );
}
return;
}
CControlBar::DelayShow( bShow );
} This should fix the problem.
|
|
Hans Bergmeister
|
Feb 26, 2007 - 2:18 AM
|
I can commit, that item 2 seems to be is solved now. Many thanks for taking care.
Item 3, however, still persists. The source update does NOT fix the problem!
|
|
Technical Support
|
Feb 22, 2007 - 11:21 AM
|
Thank you for the kind words and reporting the problems.
1) As we mentioned earlier, in regard with this issue, we implemented a design similar to that available in Microsoft. To eliminate the transition effect, we changed the code a bit.
2,3) We reproduced the problem. It is the highest possible priority for us. We hope to fix this issue in a few days. We will notify as it is ready.
|
|
Hans Bergmeister
|
Feb 22, 2007 - 11:50 AM
|
Hello,
1) in the meantime I verified the code change and can commit, that the transition effect is gone now in all themes and different display settings. Many thanks for the fast response.
2,3) I will be happy to verify your fix, if you like, when it is available. Many thanks for taking care here, too.
|
|
Offer Har
|
Feb 21, 2007 - 7:19 PM
|
Dear Support,
I am using in my application the CExtPaintManagerOffice2007_R3_Obsidian as my installed paint manager. I need to make minor modifications to it (change the default font color, use s different shade of gray as the dialogs background color) What is the simplest way to achieve these goals? Is there any tutorial on how to do it?
Thanks, Ron.
|
|
Technical Support
|
Feb 22, 2007 - 10:59 AM
|
The most Prof-UIS classes use the g_PaintManager->m_FontNormal font stored in the global paint manager. This allows you to easily change the entire GUI font (see the FunnyBars sample for details).
You can see how all the color constants are initialized in the CExtPaintManager::InitTranslatedColors() method and it is overridden in other paint managers . You can change any of them according to your requirements. As for the background gradient colors, simply override InitTranslatedColors() and modify the _2003CLR_GRADIENT_DARK and _2003CLR_GRADIENT_LIGHT constants.
You can set a custom paint manager in this way: g_PaintManager.InstallPaintManager( new CYourPaintManager );
|
|
Offer Har
|
Feb 22, 2007 - 11:03 AM
|
Are there any guidelines for deriving my own paint manager? Can I derive my custom paint from any existing paint class? Is there minimal function set i must implement?
Thanks, Ron.
|
|
Technical Support
|
Feb 23, 2007 - 2:22 AM
|
We implemented these paint manager classes as an internal and ready-to-use part of the framework. Actually to create a new paint manager, you would have to override most of the virtual methods. So the easiest way to create a new theme is to override InitTranslatedColors() method of an existing paint manager and set new custom colors.
|
|
Offer Har
|
Feb 23, 2007 - 9:46 AM
|
Dear Support,
Is there any documentation of all the various values of the enums e_2003_colors_t , e_xp_colors_t and e_translated_colors_t ?
There are so me values...
Thanks, Ron.
|
|
Technical Support
|
Feb 24, 2007 - 12:25 PM
|
The color constants are internal parts of different Prof-UIS paint managers which also have the status of internal parts of the library.
|
|
Offer Har
|
Feb 23, 2007 - 8:36 AM
|
SO, if i derive a class from CExtPaintManagerOffice2007_R3_Obsidian , implement the virtual InitTranslatedColors , call the base class implementation and then do some color changes it should be fine?
Thanks, Ron.
|
|
Technical Support
|
Feb 24, 2007 - 12:08 PM
|
First of all the Office 2007 theme is colorizable only partially because it is partially based on bitmaps. We recommend to use the Office 2003 theme if you want to colorize everything like you can see in the ThemeColorizer sample application. The Office 2007 themes in fact is a colorized version of the Office 2003 theme plus a set of bitmap based painting algorithms for such UI items as push/check/radio buttons, combo boxes and non client window areas. The colorization is based on two colors: accent color and background color. All the other colors are computed from these two base colors in the InitTranslatedColors() method. If you choose the colorization based on the InitTranslatedColors() method, then we recommend you copy its body from the base class and compute all the colors like you wish. A simpler way is based on the meant above two colors only and the CColorizedThemeOffice2003 class from the ThemeColorizer sample application is a ready to use solution where custom accent/background colors are provided by the OnQueryThemeColors() virtual method.
|
|
Borremans Pierre
|
Nov 7, 2009 - 12:30 AM
|
How to modify only the statusbar color ?
|
|
Borremans Pierre
|
Nov 7, 2009 - 12:41 AM
|
How to modify only the background color of the statusbar and the mainframe menu ?
|
|
Technical Support
|
Nov 8, 2009 - 10:43 AM
|
|
|
Offer Har
|
Feb 21, 2007 - 4:11 PM
|
Dear Support,
I have a button I attached a menu to. I would like the menu to have the exact same width as the button has, so it will look as an integral part of the button when the menu is opened. How can this be done?
Thanks, Ron.
|
|
Technical Support
|
Feb 22, 2007 - 10:43 AM
|
There is no direct way to do this. But there is a workaround. First, create a CExtPopupMenuWnd -derived class and overridde the _CalcTrackSize method in it: call the mehod of the base class and then change the width in the returned CSize value as you want. Then create a CExtButton -derived class and override the _OnTrackPopup method. Leave the default method’s code but this line: CExtPopupMenuWnd * pPopup = new CExtPopupMenuWnd; In this line create your CExtPopupMenuWnd -derived class.
|
|
Offer Har
|
Feb 22, 2007 - 11:00 AM
|
Dear Support,
Currently for creating a button with menu, all I do is:
CMenu menu; menu.LoadMenu(IDR_MENU); m_btn.m_menu.Attach(menu.Detach());
Should I leave these 3 lines as-is?
Thanks, Ron.
|
|
Technical Support
|
Feb 22, 2007 - 11:08 AM
|
Yes, you don’t need to change these lines.
|
|
Offer Har
|
Feb 22, 2007 - 11:15 AM
|
It works fine... There is one problem - when in item is highlighted in the menu, the highlight does not go the whole way. It seems that there is another place in the menu that tells the menu to highlight the item only up to the original width, and not the width that i specified in _CalcTrackSize. How to solve this problem? Thanks, Ron.
|
|
Technical Support
|
Feb 23, 2007 - 2:28 AM
|
Please place a call of CExtPopupMenuWnd::_SyncItems() before returning the execution control from the overridden _CalcTrackSize() method.
|
|
Offer Har
|
Feb 23, 2007 - 8:39 AM
|
Does not work. Stil the highlight item does not go all the way. This is the code:
virtual CSize _CalcTrackSize() { CSize sz = CExtPopupMenuWnd::_CalcTrackSize(); CRect rc; m_pParentButton->GetWindowRect(rc); sz.cx = rc.Width(); CExtPopupMenuWnd::_SyncItems(); return sz; }
|
|
Technical Support
|
Feb 24, 2007 - 12:18 PM
|
Here is a newer version of the popup menu class with the custom menu width adjustment: class CMyPopup : public CExtPopupMenuWnd
{
virtual CSize _CalcTrackSize()
{
CSize _sizeDefault = CExtPopupMenuWnd::_CalcTrackSize();
CRect rc;
m_pParentButton->GetWindowRect( &rc );
CSize _sizeNew = _sizeDefault;
_sizeNew.cx = rc.Width();
m_sizeFullItems.cx += _sizeNew.cx - _sizeDefault.cx;
return _sizeNew;
}
}; Additionally we would like to ask you to comment out the following assertion in the CExtPopupMenuWnd::_DoExpand() method in the ../Prof-UIS/Src/ExtPopupMenuWnd.cpp file: // ASSERT(
// m_sizeFullItems.cx >= m_sizeFullItems2.cx
// && m_sizeFullItems.cy >= m_sizeFullItems2.cy
// );
|
|
Offer Har
|
Feb 25, 2007 - 8:58 AM
|
Thanks. I didn’t comment the lines and it still works. Are you sure i need to comment these lines out?
|
|
Technical Support
|
Feb 25, 2007 - 10:38 AM
|
These lines should be commented out. Otherwise this would certainly produce the assertion failure when the Expand button is present at the bottom of the menu (relating to the rarely/frequently commands feature).
|
|
Brian Horn
|
Feb 21, 2007 - 2:40 PM
|
We are getting a following error. did any one know why is this coming?
Automatically linking with Prof-UIS library: ProfUIS262u.lib (Professional User Interface Suite) Prof-UIS native unicode character type support: disabled (symbol __EXT_MFC_ENABLE_TEMPLATED_CHARS is not defined) c:\Program_Files\Microsoft_Visual_Studio_.NET_2003\Vc7\atlmfc\src\mfc\occimpl.h(35) : error C2011: ’IDataSourceListener’ : ’struct’ type redefinition c:\Program_Files\Microsoft_Visual_Studio_.NET_2003\Vc7\atlmfc\src\mfc\occimpl.h(35) : see declaration of ’IDataSourceListener’ c:\Program_Files\Microsoft_Visual_Studio_.NET_2003\Vc7\atlmfc\src\mfc\occimpl.h(43) : error C2011: ’IDataSource’ : ’struct’ type redefinition c:\Program_Files\Microsoft_Visual_Studio_.NET_2003\Vc7\atlmfc\src\mfc\occimpl.h(43) : see declaration of ’IDataSource’ c:\Program_Files\Microsoft_Visual_Studio_.NET_2003\Vc7\atlmfc\src\mfc\occimpl.h(59) : error C2011: ’CDataSourceControl’ : ’class’ type redefinition c:\Program_Files\Microsoft_Visual_Studio_.NET_2003\Vc7\atlmfc\src\mfc\occimpl.h(59) : see declaration of ’CDataSourceControl’ c:\Program_Files\Microsoft_Visual_Studio_.NET_2003\Vc7\atlmfc\src\mfc\occimpl.h(111) : error C2011: ’CDataBoundProperty’ : ’class’ type redefinition c:\Program_Files\Microsoft_Visual_Studio_.NET_2003\Vc7\atlmfc\src\mfc\occimpl.h(111) : see declaration of ’CDataBoundProperty’ f:\seelan\Prof-UIS\Include\ExtColorDlg.h(86) : fatal error C1903: unable to recover from previous error(s); stopping compilation
|
|
Brian Horn
|
Mar 12, 2007 - 7:25 PM
|
here is my StdAfx.h
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently //
#if !defined(AFX_STDAFX_H__117DAA7D_792C_11D2_A69F_0008C7B2F515__INCLUDED_) #define AFX_STDAFX_H__117DAA7D_792C_11D2_A69F_0008C7B2F515__INCLUDED_
#if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components #include <afxext.h> // MFC extensions
//RIBBONBAR SN - ONLY BELOW LINE #ifdef PROF_UIS #include <prof-uis.h> #include <../ProfSkin/ProfSkin.h> #endif
#include <afxole.h> // MFC OLE classes #include <afxodlgs.h> // MFC OLE dialog classes #include <afxdisp.h> // MFC Automation classes #include <afxctl.h> // MFC OLE Control Support #include <afxdocob.h>
#ifndef _AFX_NO_DB_SUPPORT #include <afxdb.h> // MFC ODBC database classes #endif // _AFX_NO_DB_SUPPORT
#ifndef _AFX_NO_DAO_SUPPORT #include <afxdao.h> // MFC DAO database classes #endif // _AFX_NO_DAO_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls #ifndef _AFX_NO_AFXCMN_SUPPORT #include <afxcmn.h> // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxsock.h> // MFC socket extensions
#include "toolkit/secall.h" #include "toolkit/ActvHost/constants.h"
#define _ATL_APARTMENT_THREADED #include <atlbase.h> //You may derive a class from CComModule and use it if you want to override //something, but do not change the name of _Module class CMAppModule : public CComModule { public: LONG Unlock(); LONG Lock(); DWORD dwThreadID; }; extern CMAppModule _Module; #include <atlcom.h> #include <comdef.h>
#ifdef RB_INITGUID #include <initguid.h> // Have to be included, for DEFINE_GUID mechanism to work #endif
// Setting/resetting of resource handle #ifdef MODULE_INSTANCE #undef MODULE_INSTANCE #endif #define MODULE_INSTANCE AfxGetInstanceHandle( ) // Instance handle of the application #include "CommonMacros.h"
//{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #define TBD(name) AfxMessageBox (_T(#name))
#endif // !defined(AFX_STDAFX_H__117DAA7D_792C_11D2_A69F_0008C7B2F515__INCLUDED_)
|
|
Technical Support
|
Mar 13, 2007 - 8:14 AM
|
It is of little help to have the content of StdAfx.h here. Haven’t you checked if a newer SDK and/or DDK is installed as we suggested?
|
|
Technical Support
|
Feb 22, 2007 - 10:48 AM
|
Please also check if a newer SDK and/or DDK is installed on your computer. Please check the Include folder list in your Visual Studio settings. Make sure that the Platform SDK paths are at the bottom of the list and default Visual C++ folders are above them. If this does not help, let us take a look at the content of your StdAfx.h file.
|
|
Suhai Gyorgy
|
Feb 22, 2007 - 2:52 AM
|
Just a guess, which might not be what you need: There’s an article Compatibility with Built-In Unicode Character Type. It’s a quite long article, it tells a lot of things, but also this: both ProfUIS lib and your application has to have the same project setting for "Treat w_char as Built-in type". So check this in your case.
|
|
Brian Horn
|
Feb 21, 2007 - 2:17 PM
|
Regarding OnRibbonGalleryItemHoverChange Whenever i move the mouse from one item to another placed in ribbongallery control it show the tooltip to me however for this we need mouse movement.
Because of this when i take mouse on any item very first time it does not show any tooltip and for that i need to move the mouse and bring back to same item. Is there any other similar function which will do the same thing but not require mouse move change
|
|
Technical Support
|
Feb 22, 2007 - 11:51 AM
|
What we can see in the RibbonBar sample:
1) Mouse is out of the gallery and we moving it into the first item. The Style 1 tooltip is displayed.
2) Moving most over next item. . The Style 2 tooltip is displayed.
3) If we move mouse out of the ribbon bar, the tooltip will disappear. If we keep the mouse at the same position, the tooltip will disappear after several seconds.
This behavior is equal for both gallery inside displayed ribbon page and inside popup gallery menu. Do you see the same on your computer?
The OnRibbonGalleryItemHoverChange() virtual method is invoked to notify about item’s hovered state changing when item becomes hovered and un-hovered. Is that the notification you need? Or, may be, you need to get notified with some additional information such as exact mouse position inside ribbon gallery control?
|
|
Brian Horn
|
Feb 21, 2007 - 2:16 PM
|
1) I have implemented ribbon gallery control inside ribbon bar same as shown in ribbon bar example Home-> Style Tab. which contains some buttons. On clicking of each button i am doing certain functionality.
Need to know how will i get the functionality of OnUpdate so that I can enable/disable particular button in gallery e. g a function is declared as below void Class1::OnUpdateToolsVerifyBeamOrientation(CCmdUI* pCmdUI)
If i am using the button without gallery control it calls onupdate of that particular button when i click on ribbon tab which contains that button however if the same button is inside gallery control it is not calling onupdate.
|
|
Technical Support
|
Feb 22, 2007 - 11:05 AM
|
The ribbon gallery control (the CExtRibbonGalleryWnd class) is based on the toolbox control represented by CExtToolBoxWnd , which is a two level tree like control. The toolbox items are similar to the items in the list box in the tree view common control. These items are not controlled by MFC’s command updating mechanism. The CExtToolBoxWnd::TOOLBOX_ITEM_DATA objects implementing items in the toolbox control/gallery control do not support the disabled item state but they support the invisible state. This means the gallery/toolbox design is different from that of menus and toolbars. The items inside gallery/toolbox should be considered as always available and they cannot be disabled. You can disable only the entire gallery if you disable the ribbon gallery button’s command via MFC’s command updating mechanism.
|
|
Hans Bergmeister
|
Feb 21, 2007 - 4:49 AM
|
Hello,
in our applications it is sometimes useful to temporarily fix the current size of a CExtControlBar object, which is currently floating in a CExtMiniDockFrameWnd, and to prevent the user from changing the size with the mouse. In such cases it would be useful to give the CExtControlBar object control over the return value of CExtMiniDockFrameWnd::OnNcHitTest().
A suggested way to solve this, are the following extensions of the source code:
UINT CExtMiniDockFrameWnd::OnNcHitTest(CPoint point) { ... CExtControlBar * pExtBar = GetControlBarExt(); if( pExtBar != NULL ) { ASSERT_VALID( pExtBar );
if(pExtBar->CalcNcHit(nHit, this, point))) { return nHit; } ... }
and
class __PROF_UIS_API CExtControlBar : public ... { ... virtual bool CalcNcHit(UINT& nHit, CFrameWnd* pFrame, CPoint point) const { pFrame; point; return false; } ... };
This would offer classes derived from CExtControlBar the chance to hook UINT CExtMiniDockFrameWnd::OnNcHitTest().
Is there any change, that a feature like is will be added to Prof-UIS?
|
|
Technical Support
|
Feb 22, 2007 - 9:43 AM
|
If you need to lock all the bars, then it is handy to use the following code: CExtControlBar::g_bLockAllBars = true;
pMainFrame->RecalcLayout();
CExtControlBar::stat_RecalcBarMetrics( pMainFrame ); The following set of virtual methods should simply return false if you want to lock only one bar: CExtControlBar::_DraggingIsEnabled()
CExtControlBar::_RowResizingIsEnabled()
CExtControlBar::_RowRecalcingIsEnabled()
CExtControlBar::_FloatStateChangingIsEnabled()
CExtControlBar::_NcMenuButtonIsEnabled()
CExtControlBar::_ClosingIsEnabled()
CExtControlBar::_AutoHidingIsEnabled()
CExtControlBar::OnConstructDockSiteControlBarPopupMenu()
CExtControlBar::_CanDockToTabbedContainers()
CExtControlBar::_CanDockLTRB() The CExtControlBar::OnConstructDockSiteControlBarPopupMenu() method is required to remove the bar from the context menus. The last two methods are required to prevent other bars from being docked into the same area with this bar.
|
|
Hans Bergmeister
|
Feb 22, 2007 - 2:45 AM
|
Hello,
I just detected, that 2.64 introduces a new function CExtControlBar::_FloatStateChangingIsEnabled(). This provides exactly the "hook" we have been looking for. Many thanks. Case closed.
|
|
David Skok
|
Feb 20, 2007 - 12:50 PM
|
I derive a new type from CExtReportGridColumn as follows:
class DxReportGridColumn : public CExtReportGridColumn { DECLARE_DYNCREATE( DxReportGridColumn);
CRuntimeClass* pCellClass; public: DxReportGridColumn(CExtGridDataProvider *pDP = 0) : CExtReportGridColumn(pDP) { pCellClass = 0; } void SetDefaultCellColumnClass( CRuntimeClass *pClass ) { pCellClass = pClass; } CRuntimeClass* GetDefaultCellColumnClass( void ) { return pCellClass; } };
In the ReportGrid I call:
DxReportGridColumn * pRGC = NULL;
pRGC = (DxReportGridColumn *) ReportColumnRegister( "ColumnName", "CategoryName", true, false, RUNTIME_CLASS(DxReportGridColumn) );
The type of pRGC returned is always CExtReportGridColumn!! The constructor for my type is called so it is actually created however the type is downcast back to CExtReportGridColumn somewhere before it is returned by ReportColumnRegister. I can see this when I step into ReportColumnRegister code.
Dave
|
|
Suhai Gyorgy
|
Feb 21, 2007 - 3:02 AM
|
CExtReportGridColumn is derived from CExtGridCellHeader, which is derived from CExtGridCell, so when deriving a new class from CExtReportGridColumn, you need to do all steps required for the deriving of a new cell class. You need to use DECLARE_SERIAL( DxReportGridColumn );
IMPLEMENT_ExtGridCell_Clone( DxReportGridColumn, CExtReportGridColumn);
instead of DECLARE_DYNCREATE(DxReportGridColumn); , and also you need to use IMPLEMENT_SERIAL instead of IMPLEMENT_DYNCREATE on the very top of the .cpp file, like this: IMPLEMENT_SERIAL( DxReportGridColumn, CExtReportGridColumn, VERSIONABLE_SCHEMA|1 ); // add this one line
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
|
|
Technical Support
|
Feb 21, 2007 - 3:12 AM
|
In addition we would like to add you may also need to implement the CExtGridCell::Assign() and CExtGridCell::Serialize() virtual methods if your DxReportGridColumn class has some data properties.
PS You can use any grid cell class as an example of IMPLEMENT_ExtGridCell_Clone( DxReportGridColumn, CExtReportGridColumn ); declaration.
|
|
Rado Manzela
|
Feb 20, 2007 - 11:52 AM
|
It seems that column reordering using drag&drop causes that also column indexes used in ItemGetCell() are changed. Call to ItemGetCell(x,1,....) gives another cell after column drag&drop to another place. Is this by design or bug ? I think column d&d should be transparent for ItemGetCell so I wouldn’t need to bother by column rearrangements made by user. Thank you
|
|
Rado Manzela
|
Feb 22, 2007 - 5:28 AM
|
So do I need to track column swapping in CExtTreeGridWnd and make my own coluns mapping? I’d suggest you to implement this in future as part of all grid controls. Thank you
|
|
Technical Support
|
Feb 22, 2007 - 10:39 AM
|
You can use cell object pointers from the top outer row as unique column identifiers. In this case, we (or you) just need to implement only the one CellPointerToColumnIndex() method. This method could use a cached map of cell pointers to their column indixes and the cache could be updated automatically in the overridden CExtGridWnd::OnDataProviderSwapDroppedSeries() virtual method. But in the grid window, there can be many outer rows/columns at the left/top/right/bottom sides and the row/column swapping event will occur in two cases: drag-and-dropping outer cells and sorting (which is supported both horizontally and vertically). We think we should not implement the row/column-to-index mapping feature in the grid window to keep it working faster.
|
|
Technical Support
|
Feb 22, 2007 - 4:24 AM
|
In both CExtTreeGridWnd and CExtGridWnd classes, plain indexes for accessing columns are used. If some columns were swapped, the column indexes get changed.
In the CExtReportGridWnd class, CExtReportGridColumn* pointers are used as unique column handles. This allows you to access grid cells in the report grid even if the column is inactive and not displayed in the report grid.
|
|
Jean-Yves Tremblay
|
Feb 20, 2007 - 9:14 AM
|
Hi,
I have some problems when I refresh my CCacheableGridBaseWnd derived class based on this sample. This happens when I call SiwFireCacheChanging with a vertical scrolling position different of 0 ; the data doesn’t correspond to its row and some appear twice.
Here’s my code :
BoardGrid.h :
class CBoardGrid : public CCacheableGridBaseWnd
{
...
}
BoardGrid.cpp :
void CBoardGrid::OnCacheHeaderCell(LONG nRealHeaderColNo,
CExtGridDataProvider * pCacheDataStorage,
LONG nCacheDataStorageColNo,
LONG nCacheDataStorageRowNo)
{
...
}
void CBoardGrid::OnCacheDataCell(LONG nRealRangeColNo,
LONG nRealRangeRowNo,
CExtGridDataProvider * pCacheDataStorage,
LONG nCacheDataStorageColNo,
LONG nCacheDataStorageRowNo)
{
ASSERT_VALID(this);
ASSERT_VALID(pCacheDataStorage);
if (nRealRangeRowNo >= m_pBoardsQueue->size() ||
nRealRangeRowNo >= m_pSolutionsQueue->size())
{
pCacheDataStorage->CellRangeSet(nCacheDataStorageColNo,
nCacheDataStorageRowNo, 1, 1, NULL);
return;
}
int nBrdNumber = (*m_pBoardsQueue)[nRealRangeRowNo].GetBoardNumber();
CExtGridCellString cellData(pCacheDataStorage);
cellData.ModifyStyle(__EGCS_READ_ONLY);
cellData.BackColorSet(CExtGridCell::__ECS_ALL,
(nBrdNumber%2)?GRID_LINE_EVEN_COLOR:GRID_LINE_ODD_COLOR);
cellData.TextColorSet(CExtGridCell::__ECS_ALL,
(!(nBrdNumber%2))?GRID_TEXT_EVEN_COLOR:GRID_TEXT_ODD_COLOR);
CExtSafeString strDataCellText;
strDataCellText.Format("%d", nBrdNumber);
cellData.TextSet(LPCTSTR(strDataCellText));
pCacheDataStorage->CellRangeSet(nCacheDataStorageColNo,
nCacheDataStorageRowNo, 1, 1, &cellData);
}
where m_pBoardsQueue is a fixed size queue. And this is how it works to update the grid : (SDI App) I have a timer in the CMainFrame that calls UpdateAllViews from the active document (in which the queue is declared). I also have a CFormview-derived view that contains the grid and an overloaded member OnUpdate that calls SiwFireCacheChanging(). MainFrm.cpp :
void CMainFrame::OnTimer(UINT_PTR nIDEvent)
{
switch(nIDEvent)
{
...
case IDT_REFRESHING_RATE :
{
COptiMainDoc *pDoc = (COptiMainDoc*)GetDocBeforeDisplay();
if (m_pCommGUI == NULL || pDoc == NULL || !m_bCommInitialized)
{
break;
}
pDoc->UpdateAllViews(NULL, HVU_BOARD);
}
break;
default :
break;
}
CVABMainFrame::OnTimer(nIDEvent);
}
BoardBaseView.cpp :
void CBoardBaseView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
if (!(lHint & HVU_BOARD) && lHint != HVU_ALL)
{
return;
}
m_gridBoardsQueue.SiwFireCacheChanging();
CExtWA<CExtWS<CExtAFV<CFormView> > >::OnUpdate(pSender, lHint, pHint);
}
Thanks in advance
|
|
Technical Support
|
Feb 22, 2007 - 4:42 AM
|
Please download a new version of the CacheableGrid sample:
CacheableGrid2.zip
The new version features a Fire! button, which is handled in CDlg::OnFire() where the grid is recached: void CDlg::OnFire()
{
m_wndGrid.SiwFireCacheChanging();
} We used this sample to check the implementation of cacheable grid as careful as possible. We have not found any problems yet. Here is the typical call stack while cashing the data: CMyGridWnd::OnCacheDataCell(long 0, long 1073047847, CExtGridDataProvider * 0x0012fbb0 {CExtGridDataProviderMemory}, long 0, long 1) line 400
CCacheableGridBaseWnd::_CDP::RsCacheRow(unsigned long 0, unsigned long 1, unsigned char 0) line 242 + 66 bytes
CExtGridDataProviderRecordset::CacheDataStatic(const CExtScrollItemCacheInfo & {...}, const CExtScrollItemCacheInfo & {...}) line 46176 + 38 bytes
CExtGridDataProviderRecordset::CacheData(const CExtScrollItemCacheInfo & {...}, const CExtScrollItemCacheInfo & {...}) line 46432 + 24 bytes
CExtGridWnd::OnSiwCacheChanged(const CExtScrollItemCacheInfo & {...}, const CExtScrollItemCacheInfo & {...}) line 50421 + 21 bytes
CExtScrollItemWnd::_NotifyCacheChanged(long 0, long 0, long 26, long 620, long 1073047847, long 0, long 1999999977, long 24, unsigned char 1, unsigned char 0, unsigned char 0, unsigned char 0) line 5697 + 27 bytes
CExtScrollItemWnd::SiwFireCacheChanging(long -1, long -1, unsigned char 1) line 5441 + 64 bytes
CDlg::OnFire() line 65 + 32 bytes
... We checked everything the source code relatting to the call stack above and found no problems in re-caching the grid data virtually at any scroll position. We guess there may be something wrong with data access in your "fixed sized queue". We can check what is the m_pBoardsQueue in your code if you send us your project.
|
|
Hans Bergmeister
|
Feb 20, 2007 - 2:08 AM
|
Hello,
we face a performance issue with floating, dockable CExtDynamicControlBars. When such bars are being dragged over areas, where they can be docked to other windows, they move a bit "sticky". This effect can be seen also on 3.0 GHz machines and it happens also with your MDI_DynamicBars sample.
The effect does not occur, if the CExtDynamicControlBars are changed from "dockable" to "floating". In this case the bars move smoothly and fast.
Thus there seems to be something in Prof-UIS related to dragging of dockable bars, that causes this effect.
Is there something we can do on our side to improve the performance of this feature?
|
|
Technical Support
|
Feb 22, 2007 - 9:49 AM
|
There are lots of assertion statements and other checks in the source code to make the library robust and reliable. So the debug versions are much slower than release ones.
|
|
Soo Wei Tan
|
Feb 19, 2007 - 12:26 PM
|
How do I center the text displayed in a CExtHyperLinkButton? Also, is it possible to make the text multiline? I tried doing this in the VS2005 dialog editor, but the changes don’t appear when running the app.
|
|
Technical Support
|
Feb 20, 2007 - 3:22 AM
|
Thank you for reporting the problem. It is already fixed. You can download the latest code from our ftp site or update the CExtHyperLinkButton::OnPaintHyperLink() method in this way: void CExtHyperLinkButton::OnPaintHyperLink(
CDC & dc,
CRect rcText,
bool bVisited,
bool bEnabled,
bool bDrawFocusRect,
bool bFocus,
bool bHover,
bool bPushed
) const
{
ASSERT_VALID( this );
ASSERT( dc.GetSafeHdc() != NULL );
CExtSafeString strHyperLinkURL = OnQueryHyperLinkURL( true );
if( strHyperLinkURL.IsEmpty() )
return;
CRect rcInitial( rcText );
int nOldBkMode = dc.SetBkMode( TRANSPARENT );
HFONT hFont = OnQueryFont();
if( ! PmBridge_GetPM()->AdjustControlFont(
hFont,
(CObject*)this
)
)
{
LOGFONT _lf;
::memset( &_lf, 0, sizeof(LOGFONT) );
::GetObject( (HGDIOBJ)hFont, sizeof(LOGFONT), (LPVOID) &_lf );
if( m_nButtonType == BS_DEFPUSHBUTTON )
_lf.lfWeight =
(_lf.lfWeight > FW_BOLD)
? _lf.lfWeight
: FW_BOLD;
if( ( bHover /*|| bFocus*/ || bPushed )
&& GetTextUnderline()
)
_lf.lfUnderline = 1;
hFont = ::CreateFontIndirect( &_lf );
}
ASSERT( hFont != NULL );
CFont _fontDestructor;
_fontDestructor.Attach( hFont );
CFont * pFont = CFont::FromHandle( hFont ); CFont * pFontOld = dc.SelectObject( pFont );
COLORREF clrText =
OnQueryHyperLinkTextColor(
bVisited,
bEnabled,
bDrawFocusRect,
bFocus,
bHover,
bPushed
);
COLORREF clrTextOld = dc.SetTextColor( clrText );
INT nTextLength = strHyperLinkURL.GetLength();
CRect rcTextLocation( 0, 0, 0, 0);
rcText.DeflateRect( 2, 2 );
DWORD dwStyle = GetStyle();
bool bMultiline = (dwStyle&BS_MULTILINE) != 0 ? true : false;
INT nAlign = 0;
const UINT __BS_H_MASK = (BS_LEFT|BS_CENTER|BS_RIGHT); const UINT __BS_V_MASK = (BS_TOP|BS_VCENTER|BS_BOTTOM);
if( (dwStyle&__BS_H_MASK) == BS_RIGHT )
nAlign |= CExtPaintManager::__ALIGN_HORIZ_RIGHT;
else if( (dwStyle&__BS_H_MASK) == BS_LEFT )
nAlign |= CExtPaintManager::__ALIGN_HORIZ_LEFT;
else
nAlign |= CExtPaintManager::__ALIGN_HORIZ_CENTER;
if( (dwStyle&__BS_V_MASK) == BS_BOTTOM )
nAlign |= CExtPaintManager::__ALIGN_VERT_BOTTOM;
else if( (dwStyle&__BS_V_MASK) == BS_TOP )
nAlign |= CExtPaintManager::__ALIGN_VERT_TOP;
else
nAlign |= CExtPaintManager::__ALIGN_VERT_CENTER;
UINT nDtMeasureFlags =
DT_LEFT|DT_TOP|DT_CALCRECT;
if( bMultiline )
{
rcTextLocation = rcText;
rcTextLocation.OffsetRect( -rcTextLocation.TopLeft() );
rcTextLocation.bottom = rcTextLocation.top;
nDtMeasureFlags |= DT_WORDBREAK;
}
else
nDtMeasureFlags |= DT_SINGLELINE;
dc.DrawText(
LPCTSTR( strHyperLinkURL ),
nTextLength,
rcTextLocation,
nDtMeasureFlags
);
rcTextLocation.OffsetRect(
rcText.TopLeft() - rcTextLocation.TopLeft()
);
UINT nDtDrawFlags = 0;
if( (nAlign&CExtPaintManager::__ALIGN_HORIZ_MASK) == CExtPaintManager::__ALIGN_HORIZ_RIGHT )
{
nDtDrawFlags |= DT_RIGHT;
rcTextLocation.OffsetRect(
rcText.Width() - rcTextLocation.Width(),
0
);
}
else if( (nAlign&CExtPaintManager::__ALIGN_HORIZ_MASK) == CExtPaintManager::__ALIGN_HORIZ_CENTER )
{
nDtDrawFlags |= DT_CENTER;
rcTextLocation.OffsetRect(
( rcText.Width() - rcTextLocation.Width() ) / 2,
0
);
}
else
nDtDrawFlags |= DT_LEFT;
if( (nAlign&CExtPaintManager::__ALIGN_VERT_MASK) == CExtPaintManager::__ALIGN_VERT_BOTTOM )
{
nDtDrawFlags |= DT_BOTTOM;
rcTextLocation.OffsetRect(
0,
rcText.Height() - rcTextLocation.Height()
);
}
else if( (nAlign&CExtPaintManager::__ALIGN_VERT_MASK) == CExtPaintManager::__ALIGN_VERT_TOP )
{
nDtDrawFlags |= DT_TOP;
}
else
{
nDtDrawFlags |= DT_VCENTER;
rcTextLocation.OffsetRect(
0,
( rcText.Height() - rcTextLocation.Height() ) / 2
);
}
if( bMultiline )
nDtDrawFlags |= DT_WORDBREAK;
else
nDtDrawFlags |= DT_SINGLELINE;
dc.DrawText(
LPCTSTR( strHyperLinkURL ),
nTextLength,
rcTextLocation,
nDtDrawFlags
);
CRect rcFocus( rcTextLocation );
rcFocus.InflateRect( 2, 2, 2, 1 );
dc.SetTextColor( clrTextOld );
dc.SelectObject( pFontOld );
dc.SetBkMode( nOldBkMode );
if( bDrawFocusRect && bFocus )
dc.DrawFocusRect( &rcFocus );
}
|
|
Rado Manzela
|
Feb 19, 2007 - 11:05 AM
|
I’d like to ask whether do you plan to implement replacement for MessageBox(). At least standard functionality with themed appearance. It is very often used function IMHO and it looks weird when error/information messages in themed application have old design.
It would be also great if you would implement sorting by columns in CExtTreeGridWnd. It could sort siblings at the same level in tree hierarchy. Optionally recursively to last level or to given depth using some tree’s option variable (1=sort only children of root). I guess I could do this by myself after some hard days of studying of dataprovider class, but maybe it could take couple of minutes to you and would be useful for other users ;)
|
|
Rado Manzela
|
Feb 21, 2007 - 8:30 AM
|
|
|
Rado Manzela
|
Feb 20, 2007 - 5:08 AM
|
some example of usage could be this:
|name |amount| ----------------------------- |order1 | $10 | | \ item1 | $5 | | \ item2 | $5 | |order2 | $4 | | \ item1 | $3 | | \ item2 | $1 |
order’s amount is sum of all children items’ amount - provided by me.
user would be able to to sort tree by clicking to name column (this is how is the example sorted now) or amount column ( ascending order would be (order2,(item2,item1)),(order1(item1,item2))
|
|
Technical Support
|
Feb 21, 2007 - 2:59 AM
|
Thank you for providing these details. We will add this feature in one of the next releases.
|
|
Technical Support
|
Feb 20, 2007 - 3:30 AM
|
Thank you for suggesting new features. We added this to our to-do list. We could implement the message box as some ProfUIS_MessageBox() and the tree grid sorting as a method of CExtTreeGridWnd class (however we have no idea how to use it in the default tree grid).
|
|
Rado Manzela
|
Feb 19, 2007 - 10:56 AM
|
When I call CExtTreeGridWnd::ItemGetFirstChild() at item which contains no children, it asserts in CExtTreeGridCellNode::TreeNodeGetChildAt( ULONG nPos ) at line ASSERT( nPos < ULONG(m_arrChildren.GetSize()) ); Shouldn’t it return NULL instead?
|
|
Rado Manzela
|
Feb 21, 2007 - 8:28 AM
|
ok. in the demo , function CChildView::OnUpdateTreeDeleteFocusedChildren().... replace ItemGetChildCount() like this :
void CChildView::OnUpdateTreeDeleteFocusedChildren(CCmdUI* pCmdUI) { HTREEITEM htiFocus = ItemFocusGet(); if( htiFocus == NULL || ItemGetFirstChild( htiFocus ) == NULL // || ItemGetChildCount( htiFocus ) == 0 )
then focus last child and it will assert
|
|
Technical Support
|
Feb 22, 2007 - 10:35 AM
|
We confirm this issue. To fix it, please update the source code for the CExtTreeGridCellNode::TreeNodeGetChildAt() method in ../Src/ExtTreeGridWnd.cpp: CExtTreeGridCellNode * CExtTreeGridCellNode::TreeNodeGetChildAt( ULONG nPos )
{
ASSERT_VALID( this );
if( m_arrChildren.GetSize() == 0 )
return NULL;
ASSERT( nPos < ULONG(m_arrChildren.GetSize()) );
CExtTreeGridCellNode * pNode = m_arrChildren.GetAt( nPos );
ASSERT_VALID( pNode );
ASSERT( pNode->m_nOptIndex == nPos );
return pNode;
}
|
|
Rado Manzela
|
Feb 20, 2007 - 11:02 AM
|
I’ve tried the last 2.63.4 code and the bug is still there.
|
|
Technical Support
|
Feb 21, 2007 - 3:06 AM
|
In this case we would like to ask you to help us reproduce the problem. Would you modify this test project to reproduce this assertion failure?
|
|
Technical Support
|
Feb 20, 2007 - 3:25 AM
|
Thank you for reporting the bug. It is fixed in the latest code (2.63.4) available from our ftp site.
|
|
Hans Bergmeister
|
Feb 19, 2007 - 9:43 AM
|
Hello,
it seems to me, that Prof-UIS uses the order in m_pDockSite->m_listControlBars and PtInRect() to determine a docking container, that fits to the current mouse position, when a control bar is about to be dragged.
Sometimes this causes a problem, when a bar is dragged over a visible bar, that covers another bar. Sometimes it happens, that the docking markers of the covered bar gain priority over the docking markers of the visible bar making it impossible to dock the dragged bar together with the visible bar.
It would be helpful, if the Z-order of the available bars would be evaluated, too, and if the bar with a "topmore" Z-position (i.e. that bar, that is currently "visible" at the mouse position) would receive priority over a covered bar.
|
|
Technical Support
|
Feb 19, 2007 - 10:47 AM
|
We confirm the target bar hit testing is not always corresponding to Z-order of floating mini frame windows. But in all such cases the following is true: some of overlapped floating windows are placed into absolutely unusable state. So typically you don’t face the incorrect Z-order hit testing because you are keeping floating window so they are not intersected with each other.
|
|
Hans Bergmeister
|
Feb 19, 2007 - 11:18 AM
|
Hello
I am afraid that I don’t agree with your response. It is common sense under Windows to allow floating windows to overlap each other. It is usually also possible to have full access to all features of the topmost window. You are right, that some of overlapped floating windows are placed into absolutely unusable state. But this is not true for the topmost, fully visible window of such group of overlapping windows.
With Prof-UIS, however, it is not always possible to drag another bar from another part of the screen to a group of overlapping bars in order to dock this dragged bar into the topmost, fully visible container. Sometimes docking markers of other bars appear, that are currently completely covered by the visible bar. These covered bars may even completely prevent the visible bar from acting as docking target.
I think dragging and docking of a bar is somewhat similar to object drag&drop. With object drag&drop it is common sense, that the drop target is always the topmost window. This is not always the case for Prof-UIS dragging and docking. From my point of view this is a bug in Prof-UIS.
|
|
Hans Bergmeister
|
Feb 19, 2007 - 3:19 AM
|
Hello,
I just discovered a small display problem with the Office 2007 Silver Theme. This problem can be reproduced with the MDI_DynamicBars sample.
The gradient background visible in the upper menu/toolbar area of the main window ends after about two third of the main window width. Then it changes to a very light brownish background. This way the gradient background looks as if it were divided into two parts.
This problem does not occur with other themes.
Is this a software issue or a problem of our graphics system? Is anybody else able to reproduce this effect?
|
|
Technical Support
|
Feb 20, 2007 - 9:10 AM
|
This behavior is by design. Actually the Office 2007 Silver theme is the same as Office 2003 under the Luna Silver theme. If you open Office 2003, you will see exactly the same gradient.
|
|
Hans Bergmeister
|
Feb 20, 2007 - 11:22 AM
|
Ok, I am aware that Microsoft sometimes uses bitmaps of limited width and height (about 600 pixels) to paint gradient backgrounds in their software. Sometimes this causes nasty display effects, if the gradient area is bigger than the dimensions of the bitmap. We are aware of this.
As far as I understand your response it is a design goal of Prof-UIS to emulate even such Microsoft limitations.
|
|
Technical Support
|
Feb 21, 2007 - 4:27 AM
|
Why do you believe it is a limitation of Microsoft Office? We would not agree with you on this. This gradient is not painted with a bitmap. The GradientFill() method works much faster than stretching a bitmap and we are pretty sure Microsoft uses this method (you can make sure of this by setting a low color depth for your desktop). We do not also see any reason not to draw the gradient up to the right most edge of the frame window: this would not affect the performance much. So this design is probably defined in a Microsoft’s specification and we follow this as well.
Would you send us some screenshots with nasty effects so we can offer you an appropriate solution?
|
|
Hans Bergmeister
|
Feb 21, 2007 - 5:03 AM
|
Hello,
many thanks for your response.
>> This gradient is not painted with a bitmap. The GradientFill() method works much faster than stretching a bitmap << I fully agree with you here!! Microsoft sometimes seems to use stretched bitmaps instead of GradientFill() and I like it very much, that Prof-UIS is using GradientFill() instead of such bitmaps. No disagreement about this point!
>> We do not also see any reason not to draw the gradient up to the right most edge of the frame window: this would not affect the performance much. << But exactly this is the point! You actually do NOT draw the gradient up to the right most edge of the frame window! If you did as you say everything would be perfect. Actually the gradient stops at pixel 686 (search for ’686’ in CExtPaintManager.cpp, please, and you will see what I mean). This causes nasty affects on several of our computers. I will send you a screenshot, that shows this effect.
|
|
Technical Support
|
Feb 22, 2007 - 9:54 AM
|
Thank you for the screenshot. The problem is that you are using the 16-bit color depth for the display. Please find the following lines in the CExtPaintManagerOffice2003::PaintDockerBkgnd method: if( ! rcDst2.IsRectNull() )
dc.FillSolidRect( &rcDst2, clrRight ); and replace it with the following: if( ! rcDst2.IsRectNull() )
{
if( ::GetDeviceCaps( dc.m_hDC, BITSPIXEL ) > 16 )
dc.FillSolidRect( &rcDst2, clrRight );
else
stat_PaintGradientRect(
dc,
rcDst2,
clrRight,
clrRight,
false,
64
);
} This should fix the problem.
|
|
Hans Bergmeister
|
Feb 22, 2007 - 10:09 AM
|
Hello,
ok, but why does Prof-UIS draw the complete background in two steps? What is the magic behind the "686" in the CExtPaintManagerOffice2003::PaintDockerBkgnd method?
|
|
Hans Bergmeister
|
Feb 19, 2007 - 3:30 AM
|
Hello,
in the meantime I think I found the originator of this effect.
It is line 21926 of CExtPaintManagerOffice2003::PaintDockerBkgnd() where it reads
if( rcDst.Width() >= 686 )
This divides the gradient background into two parts.
What is the reason to do this?
|
|
Stan Miasnikov
|
Feb 18, 2007 - 3:08 PM
|
Function call:
CExtRibbonPage::RedrawCommandItems( nCmdID );
does not do anything in the RibbonPage example because the toolbar mapping is empty. How to update command items when needed?
|
|
Stan Miasnikov
|
Feb 19, 2007 - 12:44 PM
|
Sorry, do you mean that these functions were just added and are not a part of the latest downloadable code (ZIP)?
|
|
Technical Support
|
Feb 20, 2007 - 3:49 AM
|
No, these methods were added to the CExtRibbonPage class immediately before answering your message. They are not inside the latest downloadable source code yet. We are sorry for inconvenience. But they will be statically available in future of course. So, please add them manually or we can provide you with the newer download.
|
|
Stan Miasnikov
|
Feb 19, 2007 - 12:41 PM
|
I check it in the sample applicaiton under the debugger. The different function is actually called for CExtRibbonPage::RedrawCommandItems( nCmdID )
INT CExtCustomizeSite::RedrawCommandItems( UINT nCmdID, bool bUpdateWindows // = true ) const { ASSERT( CExtCmdManager::IsCommand(nCmdID) ); INT nUpdateBtnsCount = 0; for( POSITION pos = m_mapToolBars.GetStartPosition(); pos != NULL; ) { CExtToolControlBar * pBar = NULL; CToolBarCustomizeInfo * pInfo = NULL; m_mapToolBars.GetNextAssoc( pos, (void * &)pBar, (void * &)pInfo ); ASSERT( pBar != NULL ); ASSERT( pInfo != NULL ); if( !pBar->IsVisible() ) continue; INT nBtnsCount = pBar->GetButtonsCount(); if( nBtnsCount == 0 ) continue; bool bUpdateBar = false; for( INT nBtnIdx = 0; nBtnIdx < nBtnsCount; nBtnIdx++ ) { CExtBarButton * pTBB = pBar->GetButton( nBtnIdx ); ASSERT_VALID( pTBB ); UINT nTbbCmdID = pTBB->GetCmdID( false ); if( nTbbCmdID != nCmdID || (! pTBB->IsVisible() ) || (pTBB->GetStyle()&TBBS_HIDDEN) != 0 ) continue; nUpdateBtnsCount ++; bUpdateBar = true; if( pTBB->IsKindOf(RUNTIME_CLASS(CExtBarColorButton)) ) ((CExtBarColorButton*)pTBB)->OnSyncIcon(); pTBB->RedrawButton( false ); } // for( INT nBtnIdx = 0; nBtnIdx < nBtnsCount; nBtnIdx++ ) if( bUpdateWindows && bUpdateBar ) pBar->UpdateWindow(); } return nUpdateBtnsCount; }
and the m_mapToolBars is empty, so it does not do anything. Note that under the debugger the RedrawCommandItems() method is called from the CExtCustomizeSite class not from the CExtRibbonPage. This is in the standard sample code, I did not make any changes.
|
|
Technical Support
|
Feb 19, 2007 - 10:48 AM
|
We confirm this issue. The following two public methods were added to the CExtRibbonPage class for re-painting and updating ribbon bar’s/ribbon page’s buttons: virtual INT RedrawCommandItems(
UINT nCmdID,
bool bUpdateWindows = true
) const;
virtual INT UpdateAllCommandItems() const;
INT CExtRibbonPage::RedrawCommandItems(
UINT nCmdID,
bool bUpdateWindows // = true
) const
{
ASSERT_VALID( this );
ASSERT( CExtCmdManager::IsCommand(nCmdID) );
if( ! IsVisible() )
return 0;
INT nBtnsCount = GetButtonsCount();
if( nBtnsCount == 0 )
return 0;
INT nUpdateBtnsCount = 0;
bool bUpdateBar = false;
for( INT nBtnIdx = 0; nBtnIdx < nBtnsCount; nBtnIdx++ )
{
CExtBarButton * pTBB = ( const_cast < CExtRibbonPage * > ( this ) ) -> GetButton( nBtnIdx );
ASSERT_VALID( pTBB );
UINT nTbbCmdID = pTBB->GetCmdID( false );
if( nTbbCmdID != nCmdID
|| (! pTBB->IsVisible() )
|| (pTBB->GetStyle()&TBBS_HIDDEN) != 0
)
continue;
nUpdateBtnsCount ++;
bUpdateBar = true;
if( pTBB->IsKindOf(RUNTIME_CLASS(CExtBarColorButton)) )
((CExtBarColorButton*)pTBB)->OnSyncIcon();
pTBB->RedrawButton( false );
} // for( INT nBtnIdx = 0; nBtnIdx < nBtnsCount; nBtnIdx++ )
if( bUpdateWindows && bUpdateBar )
( const_cast < CExtRibbonPage * > ( this ) ) -> UpdateWindow();
return nUpdateBtnsCount;
}
INT CExtRibbonPage::UpdateAllCommandItems() const
{
ASSERT_VALID( this );
if( ! IsVisible() )
return 0;
( const_cast < CExtRibbonPage * > ( this ) ) -> DoCustomModeUpdateCmdUI();
( const_cast < CExtRibbonPage * > ( this ) ) -> UpdateWindow();
return 1;
}
|
|
Hans Bergmeister
|
Feb 18, 2007 - 7:39 AM
|
Hello,
I need to make all CExtDynamicControlBar windows, that are contained in the same floating container, visible with one menu command, when this floating container is hidden.
Imagine a scenario, where three CExtDynamicControlBar windows are docked in the same floating container, are hidden by pressing the X of this container. It should now be possible, to make these windows visible again with one single menu command.
With the menu item associated with the control bar ID of one of these bars it is just possible to make one bar visible at a time. Thus the user would have to select three menu items, to make all bars contained in that floating container visible again (can be reproduced with your MDI_DynamicBars example).
I tried the following approach:
if (GetParentFrame()->IsKindOf(RUNTIME_CLASS(CMiniFrameWnd)) && (!GetParentFrame()->IsWindowVisible())) { CFrameWnd* poMainFrame = (CFrameWnd*)AfxGetMainWnd();
POSITION pos = poMainFrame->m_listControlBars.GetHeadPosition(); while (pos != NULL) { CControlBar* poBar = (CControlBar*)poMainFrame->m_listControlBars.GetNext(pos);
if ((poBar != NULL) && (poBar != this) && (poBar->IsKindOf(RUNTIME_CLASS(CExtDynamicControlBar))) && (poBar->GetParentFrame() == GetParentFrame())) { CExtControlBar::DoFrameBarCheckCmd((CFrameWnd*)AfxGetMainWnd(), poBar->GetDlgCtrlID(),false); } } } CExtControlBar::DoFrameBarCheckCmd((CFrameWnd*)AfxGetMainWnd(), GetDlgCtrlID(), false);
The above code shall make all "sibling" bars visible, too, when one of these bars is about to become visible.
This works well, when all bars are tabbed in the floating container. When all bars are docked, then all bars become visible. However, the new size, which is assigned to each of these bars is different from their former size, when the X was pressed to close the floating container. In other words: the bars are not restored with their previous size.
Any ideas how to avoid this effect?
|
|
Technical Support
|
Feb 22, 2007 - 9:40 AM
|
As you know the feature you want to implement is not supported in the Visual Studio-style docking. There is no way in Visual Studio to make all control bars in a floating group visible at once. But the behavior you requested sounds reasonable and will certainly be handy for users. However to implement it as a general feature requires time and effort. At the moment, we can offer you another solution. There is a StateInFile sample in Prof-UIS, which allows the user to state the UI state into a file. So the solution could be to save the state of grouped control bars into a file ( or under some registry key) and then when the user clicks a menu item or button, this state is restored and the user can see all the control bars restored into their floating container.
|
|
Hans Bergmeister
|
Feb 22, 2007 - 9:59 AM
|
Hello,
many thanks for considering this request as a general feature. >> At the moment, we can offer you another solution. There is a StateInFile sample in Prof-UIS, which allows the user to state the UI state into a file. So the solution could be to save the state of grouped control bars into a file ( or under some registry key) and then when the user clicks a menu item or button, this state is restored and the user can see all the control bars restored into their floating container. << This sounds like a rather tricky workaround. Could you please tell me, how to serialize the state of just those control bars to a CArchive, that are grouped together in a floating container? I would prefer to use a CMemFile as a temporary storage for the state of the affected control bars.
|
|
Technical Support
|
Feb 22, 2007 - 11:46 AM
|
The CExtControlBar::ProfileBarStateLoad() and CExtControlBar::ProfileBarStateSave() static methods are used in the most of Prof-UIS samples for loading /saving the control bar state from/to the system registry. The CExtControlBar::ProfileBarStateSerialize() static method also laods/saves the state but it uses the reference to the CArchive object as parameter. This archive can be based either on the CMemFile memory file object or on the CFile file object on disk.
|
|
Hans Bergmeister
|
Feb 22, 2007 - 12:03 PM
|
Yes, I am aware of these methods. But as far as I understand, these methods will save and restore the state of ALL bars. This will very probably not solve my problem.
CExtControlBar::ProfileBarStateSerialize() will probably restore the status of ALL bars with regard to the moment, when the floating container with the grouped bars was hidden. While the floating container was hidden, some other "third party" bars may have changed their status. These status changes would be reset, too, when CExtControlBar::ProfileBarStateSerialize() is invoked, correct?
For this reason it is necessary, just to serialize only the state of the grouped bars, but nothing else. Is this possible and if so, how?
|
|
Technical Support
|
Feb 23, 2007 - 10:44 AM
|
The CExtControlBar::ProfileBarStateLoad() , CExtControlBar::ProfileBarStateSave() and CExtControlBar::ProfileBarStateSerialize() methods allow you to load and save the state of the following control bars:
1) All the control bars. 2) Only the fixed-size toolbars (menu bar, toolbars, palette bars, status bar and other bars located in outer frame areas). 3) Only the resizable control bars.
Actually the feature of serializing the UI state of a separate group of control bars is not supported. As said earlier, we developed the CExtControlBar windows to be similar to the dockable panes in Visual Studio .NET and Visual Studio 2005. In fact there is no ready-to-use solution that would allow you to restore the positions of several control bars at once. We can only add this to our to-do list. But in any case, when we are ready to start working on this, we will have to carefully think over every detail.
|
|
Hans Bergmeister
|
Feb 23, 2007 - 10:52 AM
|
Hello,
Understood. I appreciate very much, that you put it on your to do list. This will be a feature, which is very handy for many end users.
|
|
Hans Bergmeister
|
Feb 18, 2007 - 10:19 AM
|
Hello,
>> However, the new size, which is assigned to each of these bars is different from their former size, when the X was pressed to close the floating container. In other words: the bars are not restored with their previous size. << It is possible to reproduce a similar problem with the MDI_DynamicBars sample:
1. Dock two dynamic bars together in the same floating frame. 2. Hide the left bar by clicking the X in the NC area of the left bar. 3. Make the left bar visible via the menu.
Both bars are restored with their previous size.
So far so good.
Now:
1. Dock two dynamic bars together in the same floating frame. 2. Hide the right bar by clicking the X in the NC area of the right bar. 3. Make the right bar visible via the menu.
This time the bars are not (!) restored with their previous size.
Even more: if the "hide and show" procedure for the right bar is repeated several times, then the right bar gets smaller and smaller each time. If this procedure is repeated with the left bar, then both bars maintain their size.
From my point of view this is a (small) bug and I guess, that the solution for this effect will probably also solve my original problem.
|
|
Hans Bergmeister
|
Feb 18, 2007 - 10:31 AM
|
Hello,
playing further with the MDI_DynamicBars I found another problem, that can be easily reproduced:
1. Start the sample with a cleared registry. 2. Dock Dynamic Bar 1, Dynamic Bar 2 and Dynamic Bar 3 within the same floating container, 1 on the left, 2 in the middle, 3 on the right. 3. Press X in the NC area of the floating container to hide all three bars in one step. 4. Now select the menu item, that belongs to bar 3.
Nothing happens. I would expect, though, that the container becomes visible again with bar 3 as the only content. A bug?
|
|
Technical Support
|
Feb 19, 2007 - 10:47 AM
|
We failed to reproduce this problem with the latest Prof-UIS source code you can download from our web site (i.e. 2.63.3 or 2.63.4).
Additionally, the state of the dynamic control bars should be managed using the CExtDynamicControlBar::BarStateGet() and CExtDynamicControlBar::BarStateSet() methods. If you want to make the bar visible without changing its state, you can do this by calling pDynamicBar->BarStateSet( pDynamicBar->BarStateGet(), true ) .
If you need to show and activate (set focus to bar’s child window) only one control bar (simple or dynamic) in any state except for the document state of dynamic bar, then you should send the WM_COMMAND message to the main frame window and specify bar’s dialog control identifier as the command identifier: pMainFrame->SendMessage( WM_COMMAND, WPARAM( pBar->GetDlgCtrlID() ), LPARAM( 0 ) ) .
It is not possible to display/activate more than one bar in the auto-hidden mode. This is a limitation of the auto-hiding feature by its design.
|
|
Hans Bergmeister
|
Feb 21, 2007 - 2:16 AM
|
Hello,
>> We failed to reproduce this problem with the latest Prof-UIS source code you can download from our web site (i.e. 2.63.3 or 2.63.4). << the following bug still persists in Version 2.63.3:
1. Start the MDI_DynamicBars sample with a cleared registry. 2. Dock Dynamic Bar 1, Dynamic Bar 2 and Dynamic Bar 3 within the same floating container, 1 on the left, 2 in the middle, 3 on the right. 3. Press X in the NC area of the floating container to hide all three bars in one step. 4. Now select the menu item, that belongs to bar 3.
Nothing happens. I would expect, though, that the container becomes visible again with bar 3 as the only content.
We could not try with 2.63.4, because on the contrary to your statement we didn’t find this version on your web site.
|
|
Hans Bergmeister
|
Feb 20, 2007 - 5:56 AM
|
Hello,
>> It is not possible to display/activate more than one bar in the auto-hidden mode. This is a limitation of the auto-hiding feature by its design. << I was not referring to bars in auto-hidden mode. I meant several bars, that are docked or tabbed in the same floating container.
Assume a scenario, in which a user has arranged - say - three docked bars side by side in a floating container. He is able to hide the complete container (including all three bars) with one single click to the X in the upper right corner of the container. But he is not able to make the container with all three bars visible again with one click. Instead he has to go to the menu three times and to click to each particular menu item, that belongs to each bar.
In our applications we make very extensive use of such bars. It is even possible, that users arrange 5 or even more bars this way. I don’t find it very convenient for the end user to force him to select 5 or even more menu items in order to make a window visible again in the same arrangement as before, that he closed before with one click to an X.
|
|
Hans Bergmeister
|
Feb 19, 2007 - 11:04 AM
|
Hello,
>> We failed to reproduce this problem with the latest Prof-UIS source code you can download from our web site (i.e. 2.63.3 or 2.63.4). << We will verify this as soon as an official release (incl. installer) of this or a subsequent version is available.
|
|
Technical Support
|
Feb 22, 2007 - 9:25 AM
|
We confirm that this bug does occur. The bug fix will be soon available. Thank you.
|
|
Hans Bergmeister
|
Feb 17, 2007 - 8:34 AM
|
Hello,
we want to create a CExtDynamicControlBar, that is initially hidden and floating.
When FloatControlBar() is being called after creating the bar with BarAlloc(), then the bar becomes temporarily visible. When FloatControlBar() is not called, then the bar is docked, when it is made visible later.
How can we create an initially hidden, floating bar?
|
|
Technical Support
|
Feb 17, 2007 - 1:12 PM
|
It seems you mean the case when your application runs for the first time on the end user machine. Here is how you can easily achieve this: 1) Run your application and make all control bars docked and/or floating so that they have the desirable layout (the one the user should see when your application starts for the first time). Hide some control bars and containers if needed.
2) Exit your application. The layout and state of control bars are now saved either to the registry or to a file.
3) Distribute the .reg file or the file with saved ui state to target machines (inside your installer).
|
|
Hans Bergmeister
|
Feb 18, 2007 - 3:46 AM
|
Many thanks for the reponse.
With "classic" MFC and CControlBar objects one just had to create the bar and call FloatControlBar without calling ShowControlBar.
As far as I understand your response this can be now easily achieved with Prof-UIS and CExtDynamicControlBar by replacing this single line of code by a procedure, that creates a .reg or file, which contains the desired status of the bar and by extending the installation procedure of the application to include this .reg or file and to install this file on the target computer of all end users. Many thanks for pointing me to this solution, which is really easy compared to classic MFC.
|
|
Technical Support
|
Feb 19, 2007 - 10:44 AM
|
You should not create any special code in your project: simply run your app, then run regedit and export the folder with ui settng to a .reg file.
|
|
Hans Bergmeister
|
Feb 19, 2007 - 10:59 AM
|
Hello,
>> You should not create any special code in your project << We have to create a dynamic number of bars at runtime, that must be hidden in certain cases. Sounds funny, but is a consequence of our current design, which worked flawlessly with plain MFC.
|