Subject |
Author |
Date |
|
David Skok
|
May 4, 2007 - 3:02 PM
|
Is there a way that I can disable sorting on a column when clicking on that column heading but still allow group sorting using drag and drop or programatic methods.
|
|
Technical Support
|
May 5, 2007 - 4:45 AM
|
The following methods of the CExtReportGridColumn class allow you to customize the column behavior in the report grid control
virtual bool GroupingEnabledGet() const;
virtual void GroupingEnabledSet(
bool bGroupingEnabled = true
);
virtual bool SortingEnabledGet() const;
virtual void SortingEnabledSet(
bool bSortingEnabled = true
);
virtual bool DragDropEnabledGet() const;
virtual void DragDropEnabledSet(
bool bDragDropEnabled = true
);
|
|
David Skok
|
May 4, 2007 - 2:58 PM
|
Not a huge issue but the context menu presented from the "Group By" box in a report grid is the global menubar/toolbar/controlbar enable disable version rather than the Report grid context menu which presents Report grid options.
For consistency sake it would seem that if one right clicks on the "Group By" box in a report grid it would make sense to present the Report grid context menu just as a right click over a column heading does.
Just a suggestion.
|
|
Technical Support
|
May 5, 2007 - 4:43 AM
|
Thank you for this suggestion. The current context menu mostly relates to one particular column in the report grid control. We could implement such a menu but it would contain only a few items like Show/Hide Group By Box and it would be different from that in Microsoft Outlook. So it needs to be discussed further.
|
|
Burak Petekkaya
|
May 4, 2007 - 12:06 AM
|
Hello again,
While changing the current theme in the ribbon bar; if there is an already opened window , I get asserts from wincore.cpp at line 883 and 884
883->ASSERT((p = pMap->LookupPermanent(m_hWnd)) != NULL || (p = pMap->LookupTemporary(m_hWnd)) != NULL); 884->ASSERT((CWnd*)p == this); // must be us
What are the reasons of these asserts?
Thanks for all your help.
|
|
Burak Petekkaya
|
May 10, 2007 - 8:46 AM
|
Hi,
I could not write all of them here. So I have mailed you codes as a sample.
Thanks
|
|
Technical Support
|
May 4, 2007 - 7:10 AM
|
Would you try to reproduce the problem using the RibbonBar sample. That would allow us to help you more effectively.
|
|
Timothy Anderson
|
May 3, 2007 - 2:11 PM
|
|
|
Timothy Anderson
|
May 3, 2007 - 3:07 PM
|
I’m building this menu dynamically and profuis is gluing the keyboard shortcut to it inside some menu processing somewhere
... String.LoadString(IDS_MENU_PROPERTIES); pMenu->AppendMenu(MF_STRING|MF_ENABLED, ID_EDIT_PROPERTIESPXP, (LPCTSTR)String); ...
|
|
Technical Support
|
May 4, 2007 - 7:08 AM
|
If you build menus dynamically then (we guess) you handles the CExtPopupMenuWnd::g_nMsgPrepareMenu registered message handler as it is described in the How to insert menu items at run time? If so, the message handler looks as follows: LRESULT CYourDialogOrFrame::OnExtMenuPrepareLevel(WPARAM wParam, LPARAM lParam)
{
lParam;
CExtPopupMenuWnd::MsgPrepareMenuData_t * pData =
reinterpret_cast
< CExtPopupMenuWnd::MsgPrepareMenuData_t * >
( wParam );
ASSERT( pData != NULL );
CExtPopupMenuWnd * pPopup = pData->m_pPopup;
ASSERT( pPopup != NULL );
pData->m_bMenuChanged = true;
. . .
The last line of code ( pData->m_bMenuChanged = true; ) is very important to let the popup menu know that it should recompute its size and layout. If you construct y popup menus in some other way, please provide us with more info.
|
|
Timothy Anderson
|
May 4, 2007 - 1:33 PM
|
I’m building a popup. I blocked out a set of menu id’s that I change dynamically according to what tree node I’m currently on. I ask each node to return a CMenu that has a variable number of these menu id’s along with a block of custom text. like this (stripped down a little):
// we are inside OnRClick here // do floating menu based off of the individual node we are on CMenu MainFloatMenu; pNode->GetRClickMenu(&MainFloatMenu);
// We now have a MainFloatMenu with custom strings inside my blocked out menu id range, // along with the usual cut/copy/past/properties stuff
//Message handled! *pResult = 1;
// USE_PROFUIS_TOOLKIT // These things are deleted "magically" by the profuis toolkit CExtPopupMenuWnd *pPopupMenu = new CExtPopupMenuWnd;
// Here’s the problem // If I do this call it sets up the spacing correctly BUT it also changes // my customized menu strings back to the original ones as blocked out in // a spare menu inside of my resources pPopupMenu->UpdateFromMenu(GetSafeHwnd(), &MainFloatMenu, false, true, false);
// However, if I do this it leaves the customized menus alone but does incorrect spacing // of the properties menu item pPopupMenu->UpdateFromMenu(GetSafeHwnd(), &MainFloatMenu, false, true, true);
pPopupMenu->TrackPopupMenu ...
I also never get the afore mentioned custom menu handler message inside cmainframe (it’s an mdi app). I’m apparently doing something wrong with this way of doing things?
|
|
Technical Support
|
May 5, 2007 - 4:55 AM
|
We traced the CExtPopupMenuWnd::UpdateFromMenu() , CExtPopupMenuWnd::MENUITEMDATA::UpdateFromMenu() and CExtPopupMenuWnd::_SyncItems() methods and found nothing wrong with them: a sub menu level is measured OK regardless of whether it’s based on the command manager or not (the fourth parameter in UpdateFromMenu() ). We suspect there must be something specific in scope of your project and it may have to do with the item icon only. Could you create a small dialog-based test project which contains one control and the code which displays context menu over this control exactly like in your project?
|
|
Stan Miasnikov
|
May 3, 2007 - 11:56 AM
|
Hi,
The list box in Undo/Redo toolbar button behaves strange, for some reason the multiple selection is used, which makes it not intuitive to users. I don’t really understand what was a reasoning to make the selection to work the way it does, but I am sure that this is more confusing to a user than helpful. Can you change it to the single selection or may be add an option that would allow to change the list box style in the next version... I tried to put the code below in the CMainFrame::OnPopupListBoxInitContent, but it did not help. Or may be you have other suggestions that would allow selecting a single item in this list box.
DWORD dw = wndListBox.GetStyle(); dw &= ~(LBS_MULTIPLESEL | LBS_SORT | LBS_EXTENDEDSEL); ::SetWindowLong( wndListBox.GetSafeHwnd(), GWL_STYLE, dw );
Thanks,
|
|
Technical Support
|
May 3, 2007 - 1:44 PM
|
All the list box menus are owner drawn (although, by default, they look like standard list boxes and you can see the font size selection list box in the StyleEditor sample). The undo/redo list box is similar to that in Visual Studio 2005, Visual Studio .NET and MS Office applications. The actions to be undone or redone are represented as selected items and this is logically correct and more understandable than one selected item which could confuse users about which actions are actually to be undone or redone: actions above or below the selected item.
|
|
Stan Miasnikov
|
May 3, 2007 - 10:14 PM
|
I actually do not use this button for Undo/Redo. The problem is that I could not find the with a divider button which would drop list box, like the combobox button, but without the text field. There is button that drops menu, but I need a list box, so the closes I found in undo/redo button. Unfortunately, I need single selection not multiple. I know I can write my own button, but I was trying to fid a quick way.
|
|
Technical Support
|
May 4, 2007 - 12:08 PM
|
You could use a CExtBarTextFieldButton -derived class where CExtBarTextFieldButton::PaintCompound is overridden: void CYourBarTextFieldButton::PaintCompound(
CDC & dc,
bool bPaintParentChain,
bool bPaintChildren,
bool bPaintOneNearestChildrenLevelOnly
)
{
ASSERT_VALID( this );
ASSERT_VALID( GetBar() );
CExtBarButton::PaintCompound(
dc,
bPaintParentChain,
bPaintChildren,
bPaintOneNearestChildrenLevelOnly
);
} You could also override the OnInplaceControlCreate virtual method and return NULL in it so that the inplace editor cannot be created.
|
|
Chris Anderson
|
May 3, 2007 - 11:03 AM
|
I have a dialog box which uses a list box and a Prof UIS push button. When the user selects any item in the list box and presses enter/return key, I need for the default push button to be activated. This isnt happening with Prof UIS push button.
|
|
Chris Anderson
|
May 7, 2007 - 12:31 PM
|
Only the button is getting the default style but not the behavior. When I press the enter or return key it doesnaĖā¢t not invoke the handler for the default button. So something is still missing.
|
|
Technical Support
|
May 14, 2007 - 8:33 AM
|
We tried to repeat the reported behavior using the standard and Prof-UIS buttons and in both cases we failed to reproduce this. The button handler is not invoked. Would you provide more details about the problem?
|
|
Chris Anderson
|
May 4, 2007 - 5:27 PM
|
I have sent the sample which shows that DM_SETDEFID isnt working with Prof UIS.
|
|
Technical Support
|
May 7, 2007 - 11:57 AM
|
You can use the following code to make the button default. void MyDialog::OnSelectChange()
{
// ::SendMessage( m_hWnd, DM_SETDEFID, ID_ADD_CHILD, 0L );
m_btnAddChild.SendMessage(
BM_SETSTYLE,
BS_DEFPUSHBUTTON,
TRUE
);
}
|
|
Chris Anderson
|
May 4, 2007 - 12:16 PM
|
Well it works when I fire the DM_SETDEFID message within the focus handler of the list box in the IconEditor sample. But in my application I am using a dialog box present within a CExtControlBar and it doesnt seem to be working in this scenrio.
|
|
Chris Anderson
|
May 3, 2007 - 3:27 PM
|
OK you have set the Default Button property to true for the push button. How can I do it without setting this property to true? My application uses the DM_SETDEFID to set a button as the default button but this doesnt seem to work with the Prof UIS button since it is owner drawn.
|
|
Technical Support
|
May 4, 2007 - 2:56 AM
|
Although this message is not supported by Prof-UIS, it is not a problem to implement it. But it would be very convenient to receive a modified version of the IconEditor sample from you, which demonstrates the problem.
|
|
Technical Support
|
May 3, 2007 - 1:32 PM
|
We cannot confirm this issue. You can make sure of this yourself using the IconEditor sample. When Enter is pressed on the focused list box, the Edit button becomes pressed.
|
|
tera t
|
May 2, 2007 - 1:21 AM
|
Hello~~
I stick CExtPPVW CExtGridWnd on Dialog.
When I do Dialog-Create by a program, I seem to have to appoint GetDesktopWindow in pParentWnd.
Unless I go through such a procedure. "Assert" appears by a print preview.
Why?
|
|
Technical Support
|
May 3, 2007 - 1:48 PM
|
We failed to reproduce this problem with the ProfUIS_Controls sample. Could you provide us with a small test project demonstrating the problem?
We are recoding the printing and print preview at the moment. We will notify you later about this.
|
|
tera t
|
May 7, 2007 - 1:30 AM
|
Hi
I cannot make a reproduction program. Assert appears first of all at the following points.
----------------------------------------------- int CView::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message) { int nResult = CWnd::OnMouseActivate(pDesktopWnd, nHitTest, message); if (nResult == MA_NOACTIVATE || nResult == MA_NOACTIVATEANDEAT) return nResult; // frame does not want to activate
CFrameWnd* pParentFrame = GetParentFrame(); if (pParentFrame != NULL) { // eat it if this will cause activation >>>>>>>>ASSERT(pParentFrame == pDesktopWnd || pDesktopWnd->IsChild(pParentFrame)); -----------------------------------------------
Please answer it if I seem to understand a cause. It moves commonly if I do normal how to make.
Thank You
|
|
Technical Support
|
May 7, 2007 - 11:31 AM
|
Please contact us via email at support@prof-uis.com. We have a solution that should fix this problem.
|
|
tera t
|
May 9, 2007 - 1:47 AM
|
Hi
When I am for "Debug", this Assert occurs. Please move to a print preview screen. With a mouse, please click a preview screen Assert occurs. (-o-;)
ttp://profuis0.tripod.com/20070509/image01.jpg ttp://profuis0.tripod.com/20070509/pptest3.lzh
[ A cause of an error ] In SDI Frame, I make a dialog. It seems to be not good when I set up a preview in the dialog.
|
|
Technical Support
|
May 11, 2007 - 7:25 AM
|
We are sorry for the delay with this reply. Thank you for reporting the problem. You can fix it by updating the source code of the CExtPPVW_HostWnd::OnMouseActivate() method: int CExtPPVW_HostWnd::OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message)
{
ASSERT_VALID( this );
int nResult = CWnd::OnMouseActivate( pDesktopWnd, nHitTest, message );
if( nResult == MA_NOACTIVATE || nResult == MA_NOACTIVATEANDEAT )
return nResult;
CFrameWnd * pParentFrame = NULL;
CWnd * pParentWnd = GetParent();
for( ; pParentWnd != NULL; pParentWnd = pParentWnd->GetParent() )
{
if( pParentWnd->IsFrameWnd() )
{
pParentFrame = STATIC_DOWNCAST( CFrameWnd, pParentWnd );
break;
}
if( ( pParentWnd->GetStyle() & WS_CHILD ) == 0 )
break;
}
if( pParentFrame != NULL )
{
CView * pView = pParentFrame->GetActiveView();
HWND hWndFocus = ::GetFocus();
if( pView == this
&& m_hWnd != hWndFocus
&& ( ! ::IsChild( m_hWnd, hWndFocus ) )
)
OnActivateView( TRUE, this, this );
else
pParentFrame->SetActiveView( this );
}
return nResult;
}
|
|
tera t
|
May 10, 2007 - 2:46 AM
|
Hi
Were you able to reproduce the Assert situation?
Thank
|
|
Chris Anderson
|
May 1, 2007 - 4:51 PM
|
How can I set the check/uncheck mark of a menu item in a context menu which is not part of the command manager i.e these items are dynamically created and I do not want this information to be serialized. I have created CExtPopupMenuWnd, called CreatePopupMenu and then inserted the items using ItemInsertCommand. Even though I pass the nCheck parameter with appropriate values (1 & 0), I dont see the check marks on the context menu item. Am I missing something?
|
|
Chris Anderson
|
May 2, 2007 - 12:49 PM
|
|
|
Technical Support
|
May 2, 2007 - 8:48 AM
|
Please find the following code in CPagePopupMenus::OnContextMenu() in the ProfUIS_Controls sample pLongSubMenu->ItemInsertCommand(
nCmdID,
-1,
LPCTSTR(strLongCommandName)
); and replace it with pLongSubMenu->ItemInsertCommand(
nCmdID,
-1,
LPCTSTR(strLongCommandName),
NULL,
NULL,
false,
1
); Now if you run this sample again, select the popup menus page, invoke a context menu over it and select the Long sub-menu, then you will see many checked menu items. So please make sure you set all the parameters in the CExtPopupMenuWnd::ItemInsertCommand() method correctly.
|
|
Darren Oliver
|
May 1, 2007 - 11:56 AM
|
Hi Tech Support
I have a CExtGridWnd with a bunch of columns containing values, I would like to have a row above in the grid where I could have a single column span 4 columns. This would allow me to have a row where I could set titles and a row below with extra sub columns.
===================================== | Address | Gender | <-----header line 1 | city | state | zip code| <-----header line 2 ===================================== | AB | BC | CD | Male | <-----first row | GH | IJ | KL | Female | <-----second row =====================================
Is this possible to do in a CExtGridWnd or maybe possible in another type of grid window?
This would be a great feature to have so you could have a column that contains a person’s address and have the address broken down in the next row into street, city, etc. Allowing the entire address column to be hidden or displayed instead of having to manage a bunch of sub columns independently .
I hope I have explained this well enough. If not I can respond and clarify. (It’s possible to do this in Excel and Word)
Thank you tech support for all your help in the past, Darren
|
|
Darren Oliver
|
May 1, 2007 - 2:06 PM
|
Thank you for a quick response.
I think your solution for expanding a column overtop of the next column will work.
Is there a way to give a grid two header rows? I have tried adding a second row but I crash when I try to get the second row’s first cell as a CExtGridCellHeader.
Thanks again!
|
|
Technical Support
|
May 3, 2007 - 12:11 PM
|
The CExtGridWnd and CExtTreeGridWnd classes support multiple header rows and columns. You should invoke the CExtGridWnd::OuterRowCountTopSet() , CExtGridWnd::OuterRowCountBottomSet() , CExtGridWnd::OuterColumnCountLeftSet() and CExtGridWnd::OuterColumnCountRightSet() methods to specify the desired number of header rows/columns. The CExtGridWnd::GridCellGet() and CExtTreeGridWnd::ItemGetCell () methods allow you to instantiate grid cells in any area of the grid window. The CExtReportGridWnd class does not support multiple headers
|
|
Suhai Gyorgy
|
May 2, 2007 - 1:28 AM
|
OuterRowCountTopSet( 2 ); will add 2 header rows.
After that you can get the first cell of the second header row with
CExtGridCellHeader * pCell = STATIC_DOWNCAST( CExtGridCellHeader, m_wndGrid.GridCellGetOuterAtTop( 0L, 1L, RUNTIME_CLASS(CExtGridCellHeader) ) );
|
|
Technical Support
|
May 1, 2007 - 1:01 PM
|
This feature is not implemented yet but it is possible to change the location of grid cells to emulate span cells like it is demonstrated in this test project.
|
|
Ian McIntosh
|
May 1, 2007 - 5:55 AM
|
If I right click on the title bar of a CExtControlBar it brings up a menu with a list of bars that can be shown.
However, I have a bar that is initially auto hidden. If I right click on that bar’s tab while the bar is hidden I get an assertion failure in CExtPopupMenuWnd::ItemInsert() when it gets a NULL back from g_CmdManager->CmdGetPtr().
I stepped into g_CmdManager->CmdGetPtr() and it seems that my auto hidden bar is not listed in the CmdManager.
NOTE: The assert only happens if I haven’t already displayed the list by right clicking on a title bar first - once i have done that right clicking on a hidden bar’s tab works correctly.
I wonder if there is a problem in my OnCreate() method. This is it:
int CMainFrame::OnCreate( LPCREATESTRUCT lpCreateStruct ) { if( CExtNCW < CMDIFrameWnd > :: OnCreate( lpCreateStruct ) == -1 ) return -1; ///////////////////////////////////////////////////////// // STEP 1: Initialize the command manager ///////////////////////////////////////////////////////// CWinApp * pApp = ::AfxGetApp(); ASSERT( pApp != NULL ); ASSERT( pApp->m_pszRegistryKey != NULL ); ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) ); ASSERT( pApp->m_pszProfileName != NULL ); ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) ); VERIFY( g_CmdManager->ProfileWndAdd( __PROF_UIS_PROJECT_CMD_PROFILE_NAME, GetSafeHwnd() ) ); VERIFY( g_CmdManager->UpdateFromMenu( __PROF_UIS_PROJECT_CMD_PROFILE_NAME, IDR_MAINFRAME ) ); VERIFY( g_CmdManager->UpdateFromMenu( __PROF_UIS_PROJECT_CMD_PROFILE_NAME, IDR_GuiMdiTYPE ) ); ///////////////////////////////////////////////////////// // STEP 2: Pre-initialize fixed size bars // (menu bar, ribbon bar, toolbars) ///////////////////////////////////////////////////////// if( ! m_wndRibbonBar.Create( NULL, this ) ) { TRACE0("Failed to create the m_wndRibbonBar toolbar\n"); ASSERT( FALSE ); return -1; // fail to create } m_wndRibbonBar.Init();
///////////////////////////////////////////////////////// // STEP 3: Pre-initialize resizable bars ///////////////////////////////////////////////////////// HFONT hDefaultGuiFont = (HFONT) ::GetStockObject( DEFAULT_GUI_FONT ); if( hDefaultGuiFont == NULL ) { hDefaultGuiFont = (HFONT) ::GetStockObject( SYSTEM_FONT ); ASSERT( hDefaultGuiFont != NULL ); } // Init System tree (part 1): m_wndSystemTree.SetInitDesiredSizeVertical( CSize( 200, 400 ) ); m_wndSystemTree.SetInitDesiredSizeHorizontal( CSize( 400, 200 ) ); if( ! m_wndSystemTree.Create( _T("System Tree"), this, ID_SYSTEM_TREE ) ) { TRACE0("Failed to create m_wndSystemTree\n"); ASSERT( FALSE ); return -1; // fail to create } if( ! m_wndSystemTreeCtrl.Create( CTreeMainDlg::IDD, &m_wndSystemTree ) ) { TRACE0("Failed to create m_wndSystemTreeCtrl\n"); ASSERT( FALSE ); return -1; // fail to create } m_wndSystemTree.SetFont( CFont::FromHandle( hDefaultGuiFont ) ); // Init Resource tree (part 1): m_wndResourceTree.SetInitDesiredSizeVertical( CSize( 200, 400 ) ); m_wndResourceTree.SetInitDesiredSizeHorizontal( CSize( 400, 200 ) ); if( ! m_wndResourceTree.Create( _T("Resource Tree"), this, ID_RESOURCE_TREE ) ) { TRACE0("Failed to create m_wndResourceTree\n"); ASSERT( FALSE ); return -1; // fail to create } if( ! m_wndResourceTreeCtrl.Create( WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_HSCROLL |TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT |TVS_INFOTIP|TVS_DISABLEDRAGDROP |TVS_SHOWSELALWAYS, CRect( 0, 0, 0, 0 ), &m_wndResourceTree, m_wndResourceTree.GetDlgCtrlID() ) ) { TRACE0("Failed to create m_wndResourceTreeCtrl\n"); ASSERT( FALSE ); return -1; // fail to create } m_wndResourceTree.SetFont( CFont::FromHandle( hDefaultGuiFont ) ); // Init Selection List (part 1): m_wndSelectionList.SetInitDesiredSizeVertical( CSize( 100, 200 ) ); if( ! m_wndSelectionList.Create( _T("Selection List"), this, ID_SELECTION_LIST ) ) { TRACE0("Failed to create m_wndSelectionList\n"); ASSERT( FALSE ); return -1; // fail to create } if( ! m_wndSelectionListCtrl.Create( CSelectionDlg::IDD, &m_wndSelectionList ) ) { TRACE0("Failed to create m_wndSelectionListCtrl\n"); ASSERT( FALSE ); return -1; // fail to create } m_wndSelectionList.SetFont( CFont::FromHandle( hDefaultGuiFont ) ); // Init Indicators (part 1): m_wndIndicators.SetInitDesiredSizeVertical( CSize( 100, 200 ) ); if( ! m_wndIndicators.Create( _T("Indicators"), this, IDD_DLG_INDICATOR_GRID ) ) { TRACE0("Failed to create m_wndIndicators\n"); ASSERT( FALSE ); return -1; // fail to create } if( ! m_wndIndicatorsCtrl.Create( IDD_DLG_INDICATOR_GRID, &m_wndIndicators ) ) { int i = GetLastError(); TRACE0("Failed to create m_wndIndicatorsCtrl\n"); ASSERT( FALSE ); return -1; // fail to create } m_wndIndicators.SetFont( CFont::FromHandle( hDefaultGuiFont ) );
// Init State Dialog (part 1): m_wndState.SetInitDesiredSizeVertical( CSize( 200, 400 ) ); //m_wndState.SetInitDesiredSizeHorizontal( CSize( 400, 200 ) ); if( ! m_wndState.Create( _T("State"), this, IDD_STATE_DIALOG ) ) { TRACE0("Failed to create State Dialog\n"); ASSERT( FALSE ); return -1; // fail to create } if( ! m_wndStateCtrl.Create( IDD_STATE_DIALOG, &m_wndState ) ) { TRACE0("Failed to create State Dlg Ctrl\n"); ASSERT( FALSE ); return -1; // fail to create } m_wndState.SetFont( CFont::FromHandle( hDefaultGuiFont ) ); ///////////////////////////////////////////////////////// // STEP 4: Initialize status bar ///////////////////////////////////////////////////////// if( (! m_wndStatusBar.Create( this ) ) || (! m_wndStatusBar.SetIndicators( indicators, sizeof(indicators)/sizeof(UINT) ) ) ) { TRACE0("Failed to create status bar\n"); ASSERT( FALSE ); return -1; // fail to create } ///////////////////////////////////////////////////////// // STEP 5: Enable re-docking feature only for those // bars which need it ///////////////////////////////////////////////////////// // Init System tree (part 2): m_wndSystemTree.EnableDocking( CBRS_ALIGN_ANY ); // Init Resource tree (part 2): m_wndResourceTree.EnableDocking( CBRS_ALIGN_ANY ); // Init Selection List (part 2): m_wndSelectionList.EnableDocking( CBRS_ALIGN_ANY ); // Init Indicators (part 2): m_wndIndicators.EnableDocking( CBRS_ALIGN_ANY ); // Init State Dialog (part 2): m_wndState.EnableDocking( CBRS_ALIGN_ANY ); ///////////////////////////////////////////////////////// // STEP 6: Enable re-docking feature only for entire // main frame window and, optionally, enable // enable auto-hiding feature fore resizable // bars ///////////////////////////////////////////////////////// // Enable control bars in the frame window to be redocable if( ! CExtControlBar::FrameEnableDocking( this ) ) { ASSERT( FALSE ); return -1; } // Enable autohide feature for resizable control bars if( ! CExtControlBar::FrameInjectAutoHideAreas( this ) ) { ASSERT( FALSE ); return -1; } ///////////////////////////////////////////////////////// // STEP 7: Load command manager state if needed ///////////////////////////////////////////////////////// // g_CmdManager->SerializeState( // __PROF_UIS_PROJECT_CMD_PROFILE_NAME, // pApp->m_pszRegistryKey, // pApp->m_pszProfileName, // false // ); ///////////////////////////////////////////////////////// // STEP 8: Try to load state of all the bars and dock // all of them initially if the state loading // was failed ///////////////////////////////////////////////////////// /* if( ! CExtControlBar::ProfileBarStateLoad( this, pApp->m_pszRegistryKey, pApp->m_pszProfileName, pApp->m_pszProfileName, &m_dataFrameWP ) ) */ { // Init System tree (part 3): m_wndSystemTree.DockControlBarInnerOuter( AFX_IDW_DOCKBAR_LEFT, true ); // Init Resource tree (part 3): m_wndResourceTree.DockControlBarInnerOuter( AFX_IDW_DOCKBAR_LEFT, true ); m_wndResourceTree.AutoHideModeSet(true, true, true, false); // Init Selection List (part 3): m_wndSelectionList.DockControlBarLTRB( &m_wndSystemTree, AFX_IDW_DOCKBAR_BOTTOM ); m_wndIndicators.DockControlBarInnerOuter( AFX_IDW_DOCKBAR_BOTTOM, true ); m_wndIndicators.AutoHideModeSet(true, true, true, false);
m_wndState.DockControlBarInnerOuter( AFX_IDW_DOCKBAR_BOTTOM, true ); m_wndState.AutoHideModeSet(true, true, true, false); } ///////////////////////////////////////////////////////// // STEP 9: Initialize other features. Embeddable controls // such as MDI tabs should be initialized here ///////////////////////////////////////////////////////// if( ! m_wndMdiManager.Create( this, CRect( 0, 0, 0, 0 ), UINT( IDC_STATIC ), WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS, __ETWS_ORIENT_TOP|__ETWS_ENABLED_BTN_CLOSE|__ETWS_SHOW_BTN_CLOSE ) ) { ASSERT( FALSE ); return -1; } RecalcLayout(); return 0; }
|
|
Technical Support
|
May 1, 2007 - 11:03 AM
|
Please try the following:
- create a new menu resource for commands that display/hide control bars - add a command for each control bar - update the command manager with this menu resource
The problem should be gone. Please note the menu will never be used as a pop-up menu in your project.
|
|
Chris Anderson
|
Apr 30, 2007 - 10:14 AM
|
I have a toolbar in a dialog box which needs to wrap as the dialog is resized. The toolbar is always docked and cannot float. I need the buttons in the toolbar to be always displayed (the buttons should wrap to the next row. something like the menubar on the frame window). Is there an easy way to do this?
|
|
Chris Anderson
|
May 2, 2007 - 11:46 AM
|
|
|
Chris Anderson
|
May 1, 2007 - 4:39 PM
|
OK I this only works if you use SetWrap and hard code the positions where wrapping will occur. How can I provide for dynamically wrapping the toolbar buttons based on the dialog width and height?
|
|
Technical Support
|
May 2, 2007 - 8:19 AM
|
Please download and try a test project that we coded to demonstrate you how it works.
|
|
Technical Support
|
May 1, 2007 - 12:58 PM
|
You can achieve this by overriding the OnQueryMultiRowLayout() method in a CExtToolControlBar -derived class in this way bool OnQueryMultiRowLayout() const
{
ASSERT_VALID( this );
return true;
}
|
|
Burak Petekkaya
|
Apr 30, 2007 - 9:19 AM
|
Hi,
I want to use ribbon bar in a terminal service. But when the program starts with ribbon bar in the terminal service the animations,color changes of groupboxes and also the fade in - fade out actions of the File menu makes the program slow. So, How can I disable all of the animations and changes of the menus ?
|
|
Technical Support
|
Apr 30, 2007 - 2:19 PM
|
The animations are controlled by the paint manager rather than by particular controls. There are several ways to turn off all the animations. You can create and use a custom paint manager that is derived from the supported paint managers and implements the CExtPaintManager::Animation_GetParameters() virtual method like as follows: const CExtAnimationParameters *
CExtPaintManager::Animation_GetParameters(
INT eAPT, // __EAPT_*** animation type
CObject * pHelperSrc,
const CExtAnimationClient * pAC,
LPARAM lParam // = 0L
) const
{
ASSERT_VALID( this );
ASSERT( pAC != NULL );
eAPT;
pHelperSrc;
pAC;
lParam;
return (&g_DefAnimationParametersEmpty);
} Another approach is to reset the global animation templates used by the paint manager whe your application starts: CExtPaintManager::g_DefAnimationParametersNormal
= CExtPaintManager::g_DefAnimationParametersSlow
= CExtPaintManager::g_DefAnimationParametersVerySlow
= CExtPaintManager::g_DefAnimationParametersVerySlowAndSmooth
= CExtPaintManager::g_DefAnimationParametersEmpty;
|
|
Burak Petekkaya
|
May 1, 2007 - 2:55 AM
|
Hello again,
I tried to implement the second solution in my application and I reset the globals as you said. But it did not solve my problem. Still the button group’s colour change when we move on it with mouse and also still our menus are opening and closing slowly (like transparent). I saw "SetupUiAdvancedOptions()" function in your examples and modified it as I want { ...................... CExtPopupMenuWnd::g_bMenuWithShadows = false; CExtPopupMenuWnd::g_bMenuShowCoolTips = true; CExtPopupMenuWnd::g_bMenuExpanding = false; CExtPopupMenuWnd::g_bMenuHighlightRarely = false; CExtPopupMenuWnd::g_bMenuExpandAnimation = false; CExtPopupMenuWnd::g_bUseDesktopWorkArea = true; CExtPopupMenuWnd::g_DefAnimationType = CExtPopupMenuWnd::__AT_NONE; ............. } But it could not be the soultion too..
What am I doing wrong?Do you have any other suggestions?
|
|
Technical Support
|
May 1, 2007 - 12:25 PM
|
Please try the code below
CExtPopupMenuWnd::g_bMenuWithShadows = false;
CExtPopupMenuWnd::g_bMenuShowCoolTips = true;
CExtPopupMenuWnd::g_bMenuExpanding = false;
CExtPopupMenuWnd::g_bMenuHighlightRarely = false;
CExtPopupMenuWnd::g_bMenuExpandAnimation = false;
CExtPopupMenuWnd::g_DefAnimationType = CExtPopupMenuWnd::__AT_NONE;
CExtPopupMenuWnd::g_nDefaultFadeOutAnimationStepCount = 0;
CExtPopupMenuWnd::g_nDefaultFadeOutAnimationEllapse = 0;
CExtPaintManager::g_DefAnimationParametersNormal
= CExtPaintManager::g_DefAnimationParametersSlow
= CExtPaintManager::g_DefAnimationParametersVerySlow
= CExtPaintManager::g_DefAnimationParametersVerySlowAndSmooth
= CExtPaintManager::g_DefAnimationParametersEmpty; Invoke it after the code that loads the ribbon bar’s state. You will also need to fix the following issue: the CExtPopupMenuWnd::g_nDefaultFadeOutAnimationStepCount and CExtPopupMenuWnd::g_nDefaultFadeOutAnimationEllapse static properties should be public instead of protected .
|
|
Burak Petekkaya
|
May 3, 2007 - 12:45 AM
|
Thanks for the solution. The animations had dissappeared..
|
|
Adam Keadey
|
Apr 27, 2007 - 3:04 PM
|
I want to hide the date and time cell button for modifying the date and time.
I want the sort capabilities of the date and time ctrl, but not the editing features
|
|
Technical Support
|
Apr 28, 2007 - 12:28 PM
|
You can make any grid cell read-only using this method pCell->ModifyStyle( __EGCS_READ_ONLY ); The in-place editor window for a particular grid cell will not be activated if you modify the cell styles in this way pCell->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
|
|
Adam Keadey
|
Apr 30, 2007 - 4:40 AM
|
While this disabled the ability to change the date and time, the dropdown button is still visible. I want to hide the button.
How do I do that???
|
|
Technical Support
|
Apr 30, 2007 - 2:15 PM
|
Any grid cell supports 3 built-in buttons: up-down, drop-down and ellipsis. This is controlled with the following styles:
__EGCS_BUTTON_UPDOWN
__EGCS_BUTTON_DROPDOWN
__EGCS_BUTTON_ELLIPSIS .
You can add/remove these styles using CExtGridCell::ModifyStyle() .
|
|
Adam Keadey
|
May 1, 2007 - 4:55 AM
|
Thank you for the response.
I went ahead and derived a control from CExtGridCellNumber and stored the seconds from 1970 as the number. Then overrode the TextGet function to return the formatted date and time.
I do some custom drawing so this actually works better cause I derived from my number class.
|
|
Adam Keadey
|
Apr 27, 2007 - 6:07 AM
|
I have the report grid grouped and collapsed. When I insert a row it expands. I want it to stay collapsed.
Is there a style I can set? Is there an override I can change?
|
|
Technical Support
|
Apr 28, 2007 - 12:37 PM
|
This feature is not supported at the moment but we will implement it soon. When you have a report grid with that is grouped by a number of columns and you insert a new row somewhere and instantiate cells in it, the report sort order should be finally updated. This unfortunately changes the collapsed state of group rows because they are become completely rebuilt. We will change this in one of the next versions.
|
|
Matthew Fraser
|
Apr 26, 2007 - 11:12 PM
|
Hi!!
How to arrange toolbars attached in a MDI child view ? I got the following codes. It doesn’t work.
CRect rectAlreadyDockedBar; m_wndToolBarZoom.GetWindowRect(&rectAlreadyDockedBar); rectAlreadyDockedBar.OffsetRect(1, 0); DockControlBar(&m_wndToolBarZoom, AFX_IDW_DOCKBAR_TOP); //DockControlBar(&m_wndToolBarZoom, AFX_IDW_DOCKBAR_TOP, &rectAlreadyDockedBar);
Thanks.
|
|
Suhai Gyorgy
|
Apr 27, 2007 - 2:15 AM
|
I’m guessing you have 2 toolbars that you’d like to dock side by side on top. But in your code you are only mentioning one toolbar.
This one works for me: CRect wrAlreadyDockedBar, wrMainWindow;
GetWindowRect( &wrMainWindow );
DockControlBar( &m_wndToolBar1, AFX_IDW_DOCKBAR_TOP );
ShowControlBar( &m_wndToolBar1, true, true );
RecalcLayout();
int iOccupiedWidth = m_wndToolBar1.CalcFixedLayout( FALSE, TRUE ).cx;
int iOtherWidth = m_wndToolBar2.CalcFixedLayout( FALSE, TRUE ).cx;
if ( iOccupiedWidth + iOtherWidth < wrMainWindow.Width() )
{
m_wndToolBar1.GetWindowRect( &wrAlreadyDockedBar );
wrAlreadyDockedBar.OffsetRect( 1, 0 );
DockControlBar( &m_wndToolBar2, AFX_IDW_DOCKBAR_TOP, &wrAlreadyDockedBar );
}
else
{
DockControlBar( &m_wndToolBar2 );
}
ShowControlBar( &m_wndToolBar2, true, true );
RecalcLayout();
|
|
Matthew Fraser
|
Apr 26, 2007 - 11:05 PM
|
Hi!!
I got the following message map. OnExtMenuPrepare and OnDrawPopupMenuItem method are called but OnDrawPopupLeftArea method is not called. I just followed an example given.
Any idea ?
Thanks.
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd) ///
ON_REGISTERED_MESSAGE(CExtPopupMenuWnd::g_nMsgPrepareMenu, OnExtMenuPrepare) ON_REGISTERED_MESSAGE(CExtPopupMenuWnd::g_nMsgPopupDrawItem, OnDrawPopupMenuItem) ON_REGISTERED_MESSAGE(CExtPopupMenuWnd::g_nMsgPopupDrawLeftArea, OnDrawPopupLeftArea) END_MESSAGE_MAP()
|
|
Technical Support
|
Apr 27, 2007 - 11:46 AM
|
The popup menus displayed from the menu bar in your application send their notification messages to the main frame window only and you should resend the needed messages to the active MDI child frame manually and exactly as it is demonstrated in the DRAWCLI sample. The context menus send their messages to the window handle which was specified when invoking the CExtPopupMenuWnd::CreatePopupMenu() , CExtPopupMenuWnd::LoadMenu() or CExtPopupMenuWnd::UpdateFromMenu() methods.
|
|
Suhai Gyorgy
|
Apr 27, 2007 - 1:56 AM
|
g_nMsgPopupDrawLeftArea message is sent only if you give a width for the left area:
CExtPopupMenuWnd * pPopup = new CExtPopupMenuWnd; pPopup->SetLeftAreaWidth( 30 );
Another thing: this left area is not the area where the icons of the command items are displayed, but some additional left area drawn when the width of it is set with SetLeftAreaWidth. Hope that helps.
|
|
Lynn Reid
|
Apr 25, 2007 - 7:57 PM
|
I’ve got an MDI Doc/View application which can open multiple documents, each in their own tabbed window. There are four views in each tab, created with a splitter. There’s also a bunch of other stuff going on with three dockable control bars which display additional views of the topmost document.
My problem: When I click on the "x" close button, either in the ChildFrame or in the main menu bar, the topmost tab disappears and the document is closed. The next document’s tab becomes uppermost, but the views don’t refresh. I get a completely blank white screen -- the frames and splitters are all properly arranged, but nothing displays within them.
If I activate another tab by clicking on it, it displays properly. Same thing if I go back to the original "blank" tab. But nothing refreshes properly when the close button is pressed.
This USED to work before I implemented my tabs as CExtTabMdiWnd... so I suspect I need to call something in addition to the defaults. Within the ChildFrame, I’ve tried to UpdateAllViews(NULL) ala
void CMIPSChildFrame::OnMDIActivate(BOOL bActivate, CWnd* pActivateWnd, CWnd* pDeactivateWnd) { CMDIChildWnd::OnMDIActivate(bActivate, pActivateWnd, pDeactivateWnd);
CMainFrame* pMF = (CMainFrame*) ::AfxGetMainWnd(); if (bActivate) { // window is becoming active CView5Doc* pDoc = (CView5Doc*) GetActiveDocument(); if (pDoc) { // load history window with current document CHistoryBar* pBarHistory = (CHistoryBar*) pMF->GetControlBar(ID_VIEW_HISTORY); if (pBarHistory != NULL) pBarHistory->SetHistory(pDoc); // maybe update the view? Doesn’t work, still blank white.... pDoc->UpdateAllViews(NULL); } ....
Any suggestions? I’m going to have to disable all the X buttons if I can’t get this to work....
Thanks, Lynn
|
|
Technical Support
|
Apr 26, 2007 - 1:42 PM
|
We are not sure that the problem is brought by Prof-UIS. The DRAWCLI sample seems to be very close to your project. It have MDI tabs and splitter based views but we failed to reproduce the problem in it. Please try the following:
1) Exclude some parts of the code from your application step-by-step so you can figure out when the problem is gone. 2) Modify the DRAWCLI sample so you can reproduce the problem and send it to us.
|
|
Chris Anderson
|
Apr 25, 2007 - 5:52 PM
|
I am porting the Windows Menu Bar using CExtMenuControlBar. Some of my sample uses MF_MENUBREAK for creating new row and MF_MENUBARBREAK column column. How do I get these feature using CExtMenuControlBar?
|
|
Chris Anderson
|
Apr 26, 2007 - 2:50 PM
|
Thanks.
What about MF_MENUBARBREAK. This is used as column in our application and can we get this feature?
|
|
Technical Support
|
Apr 27, 2007 - 11:34 AM
|
We are sorry but it is not completely cleat what you mean exactly. Could you send us a screenshot of the menu line in your project demonstrating what you actually mean so that we can help you more efficiently?
|
|
Technical Support
|
Apr 26, 2007 - 1:31 PM
|
The menu bar supports dynamic wrap flags for its toolbar buttons. You can see how the buttons become wrapped when you are decreasing the width of menu bar’s parent window. We do not support the static wrap flags because this kind of layout is quite obsolete and never used in menu bars in latest Microsoft applications. The toolbars (and menu bar) are supporting three wraps for each button (for horizontally docked state, vertically docked state and floating state) and palette mode. The toolbar in palette mode can be seen in the DRAWCLI sample. It is possible to override several internal virtual functions in your menu bar class to get the same layout in the menu bar, but we are not sure that you really need this.
|
|
Richard Chaney
|
Apr 25, 2007 - 2:53 PM
|
I have an edit control in a dialog which requires validation. I am using the ON_EN_KILLFOCUS message to validate the input when the edit loses focus. This event calls UpdateData(TRUE) and MFC automatically shows a message box like "Please enter an integer between 0 and 100" if the data is invalid.
The problem is that when the focus moves to a Prof-UIS control, e.g. CExtButton, the error message box pops up twice (the kill focus message also comes twice). However, moving focus to a standard CButton only causes it once. It seems moving focus to any Prof-UIS control causes the problem, while any normal MFC control does not.
I am using Prof-UIS 2.64 under Windows XP SP2 with VS2005. I can email a simple example project showing this problem if you wish.
Richard Chaney
|
|
Technical Support
|
Apr 29, 2007 - 10:15 AM
|
Thank you for reporting this bug. We fixed it and the fix will be available in the next version. You can also fix this yourself by updating the source code for the CExtButton::OnLButtonDown() method (in ../Prof-UIS/ExtButton.cpp): void CExtButton::OnLButtonDown(UINT nFlags, CPoint point)
{
if( m_bKeyTracking )
return;
CButton::OnLButtonDown( nFlags, point );
HWND hWndOwn = m_hWnd;
if( IsWindowEnabled() )
{
CFrameWnd * pParentFrame = GetParentFrame();
if( pParentFrame != NULL
&& pParentFrame->IsKindOf( RUNTIME_CLASS(CMDIChildWnd) )
)
{
CFrameWnd * pMDIFrame = pParentFrame->GetParentFrame();
if( pMDIFrame != NULL
&& pMDIFrame->IsKindOf( RUNTIME_CLASS(CMDIFrameWnd) )
)
{
CMDIChildWnd * pActive = ((CMDIFrameWnd*)pMDIFrame)->MDIGetActive();
if( LPVOID(pParentFrame) != LPVOID(pActive) )
((CMDIChildWnd*)pParentFrame)->MDIActivate();
}
}
if( ! ::IsWindow( hWndOwn ) )
return;
HWND hWndFocus = ::GetFocus();
if( hWndFocus != hWndOwn )
{
// ::SetFocus( hWndOwn );
return; // DDX validation failed
}
} // if( IsWindowEnabled() )
if( ! ::IsWindow( hWndOwn ) )
return;
_DoClick();
} Here is the project we used for testing.
|
|
Chris Anderson
|
Apr 25, 2007 - 1:16 PM
|
I am using a instance of CExtResizableDialog in a CExtControlBar. I need for the initial size on display to be the same as specified with the dialog template resource. I need the resizing funtionality and hence dont want to use the CExtPanelControlBar. How would I go about doing this?
|
|
Chris Anderson
|
May 1, 2007 - 4:45 PM
|
|
|
Chris Anderson
|
Apr 30, 2007 - 10:17 AM
|
Yes I agree but I need the control over the size only when the dock window is floated. When it is docked I dont care about the size. I need the dialog resource size to be respected (atleast with the initial lauch of the app). Once the user resizes it, I dont care about the size of the dock windows (docked or floated) since the information is stored as part of the state and written out to the registry.
|
|
Technical Support
|
May 1, 2007 - 1:26 PM
|
You can use the CExtControlBar::SetInitDesiredSizeFloating() method for that. It allows you to specify the floating size of your control bar with a dialog inside.
|
|
Chris Anderson
|
Apr 27, 2007 - 11:15 AM
|
Any other approach other than the ones suggested above?
|
|
Technical Support
|
Apr 28, 2007 - 12:59 PM
|
The control bar (CExtControlBar ) is resizable, which means that if you dock more than one control bars in a row/column, they affect each other. That is the main difficulty in setting a particular size for the control bar (the size of dialog template in your case). If you have many control bars organized into a complex layout, this makes the problem even harder. The way we suggested in the previous post is worth to try. There is one issue we forgot to mention. You can anchor the controls on your dialog so that their size and layout proportionally changes when the dialog is resized. This is described in this article:
How to create a window containing auto-resizable controls
This approach (anchoring controls) may allow you to drop this requirement (a certain initial size) because the controls will always be neatly arranged on the dialog.
|
|
Chris Anderson
|
Apr 26, 2007 - 9:14 AM
|
Anyway of it getting created with the size of the dialog resource rather than programmatically?
|
|
Technical Support
|
Apr 27, 2007 - 10:59 AM
|
There is another approach. You run your application, dock the control bars manually, close the application and add the state of control bars including their positions (saved in the registry) to your installer. Please note you can also serialize the state to a file on disk instead of to the registry.
|
|
Technical Support
|
Apr 26, 2007 - 4:21 AM
|
There are a set of CExtControlBar::SetInitDesiredSize***() methods that allow you to specify the desired size. But please note that there is no guaranty that the size will be exactly the same as you specified if the control bar is docked together with other control bars in the same row or column because in this case control bars affect each other’s positions and sizes.
|