|
Subject |
Author |
Date |
|
|
Bill Olson
|
May 15, 2012 - 10:21 PM
|
After waiting in vain for two weeks for a reply to my question about tooltip timing, I spent two days digging through the code and finally found how to change it. Along the way I found a bug. CExtPopupMenuTipWnd::Show() defaults the variable bNoDelay=false, that is checked twice in the function and if it is false, bQuickDelay is set to true. The checks should be if(bNoDelay), instead of if(!bNoDelay). This make the default delay 20 ms instead of 500 ms. And to change the default tooltip time delay, make the above fix and change ID_PERIOD_DELAY_SHOW_NORMAL. It is defined as 500, which is 500 ms. Unfortunately I’m beginning to think we’re on our own with Prof-UIS. This is a great package and customer support was great the last few years, but I haven’t seen any tech support answers in over 2 weeks. I tried sending e-mails to tech support which never got answered. I don’t know what happened, but I think we’re going to have to help each other now. Bill
|
|
|
Wilhelm Falkner
|
May 12, 2012 - 10:26 AM
|
Hi, we are preparing a new version of our software. Starting with this new version, we wana give our customers the posibility to switch between different themes. So we have to modify our source code in this way: Use CExtResizableDialog instead oc CDialog, use for static text CExtLabel, ... include a DDX_Control for each element. All works fine, but this result in an unsuitable runtime behavior. Switching dialogs need so much time, build up terrible long time. Sometimes buttons has to be pressed twice, because the programm is not reacting in time. Example: loading a document need more than 4 seconds, with the old version less than 1 second. The programm is reaction l ike working with an old 286 :-( What do we wrong? How can we speed up execution time? TIA Willi
|
|
|
Technical Support
|
May 16, 2012 - 2:59 AM
|
Please compare the performance of your app with some Prof-UIS sample app. If yours is slower, then we need to reproduce the performance problem of your app somehow to provide you with advices. Typically performance problems are brought by heavy timer processing code, a lot of timers are running, heavy thread idle state processing code, heavy command updating code. Please do not forget to invoke the SetAutoSubclassChildControls() API in constructors of the CExtResizableDialog-derived classes. This will subclass all the common controls with dynamic instances of Prof-UIS C++ classes. I.e. you will not need to add CExtLabel instance for each static manually. The same is related to combo boxes, buttons, check boxes, radio buttons, editors.
|
|
|
Wilhelm Falkner
|
May 21, 2012 - 10:29 AM
|
Comparing with the Your sample Apps is not real fair: in Your samples, You create 1,2 or 3 dialogs, not more. In the real world, I have to create 20 up to 40 dialogs. I’m also not sure, how to find out, where the runtime is wasted. Measuring the time to switch between dialogs is very hard. So my fisrt try is to find out, what code need a lot of time, in my try: Open an existing document, create all needed dialogs and display at screen. a) I started with only a very little Prof-UIS elements (old version): 1.1 sec b) replaced all CDialog with CExtResizableDialog: 1.8 sec c) For each element used CExtLabel, CExtEdit, ... (BUT NOT CExtComboBox): 3.6 sec d) like c) but now also used ( about 70) CExtComboBox: 5.7 sec So, it seems, that CExtComboBox needs so much time. Done a cross-check: e) No CExtResizableDialog, No CExtLabel, CExtEdit, only CExtComboBo: 2.6 sec From substrcatime time of c) from time of d) and adding base time of a) I would exspect a time of e) 3.7 sec. So, it seems to me, that ist is very important, how much Prof-UIS elements are called. And this is only an example, I have a lot of documents with lot of different dialogs. The time measurement was done during lod of document, without any timers running, no idle processing, omly very few command update code. Waht do I wrong? Where can I speed up? TIA Willi P.S. Tnx, I know the SetAutoSubclassChildControls API, but for finding out the time consumption, I do not use it. I have tried, I get exact same timeing, when using this function instead of declaring and calling by hand
|
|
|
Wilhelm Falkner
|
May 12, 2012 - 8:32 AM
|
Hi, on Windows XP the menu of CExtNCW < CFrameWnd > is missing, when working with CExtPaintManagerOffice2007xxx or above. When running same programm at Windows 7, it is ok. At XP the menu is not displayed, but can become visable by pressing "Alt". Also al painting inside the FrameWnd is mispositioned. Pls advise. TIA Willi
|
|
|
Technical Support
|
May 16, 2012 - 2:59 AM
|
How to reproduce this using Prof-UIS sample apps? Could you please modify any of sample apps to make it hiding its menus on XP and send it to us?
|
|
|
Wilhelm Falkner
|
May 21, 2012 - 8:38 AM
|
|
|
|
|
Wilhelm Falkner
|
May 12, 2012 - 8:21 AM
|
Hi, when real working with BackstageView, the programm is crashing in CExtRichContentScrollWnd::OnRcsAnalyzeMouseClickEvent (Line 10536 of ExtScrollWnd.cpp V2.93). This happens when doning a real action. e.g. having a command "Open File". When opening the file, the crash happens. It crash, if I make the BSV invisable or not. What I tried is to modify Your code by checking again, if _ht_item.m_pRCI is valid. But I’m not sure, if this is the right solution. Can You please advise? TIA Willi
|
|
|
Wilhelm Falkner
|
May 16, 2012 - 3:49 AM
|
In OnCmdMsg of my MainFrame I call for some Commands, invoked by BSV, the sequence: if ( ((nID == ID_FILE_OPEN) ||
(nID == ID_FILE_PRINT) ||
(nID == ID_FILE_PRINT_PREVIEW) || // Print page preview
((nID >= ID_FILE_MRU_FILE1) && (nID <= ID_FILE_MRU_FILE16)) || // Recent File open
((nID >= ID_BV_OPEN_ALL_TYPES) && (nID <= ID_BV_OPEN_EXTRA_LAST)) || // Open special Type of file
((nID >= ID_BV_NEW_DOC_00) && (nID <= (ID_BV_NEW_DOC_00 + (UINT)theApp.m_pSaveValues->m_templateListNew.GetCount() + 1))) // Create New
)
&& (nCode == CN_COMMAND) && (pExtra == NULL) ) {
if (m_wndRibbonBar.BackstageView_IsVisible()) {
m_wndRibbonBar.BackstageView_EnsureHidden();
} But the crash happend also, if I don’t call it. It also happens, if I close the BSV by clicking with the mouse
|
|
|
Technical Support
|
May 16, 2012 - 3:00 AM
|
You wrote "It crash, if I make the BSV invisable". Which code did you invoke for that and where?
|
|
|
Wilhelm Falkner
|
May 12, 2012 - 8:11 AM
|
Hi, where can I define/set the width of left-side pane of the Backstage? The problem is, when having longer texts/buttons/icons on the left-side pane it will be wrapped into 2 or more lines. Basicly no problem, but then the highlighting is not at the right position. You can test this very easily with applying longer texts at Your RibbonBarMDI_DocView sample. TIA Willi
|
|
|
Technical Support
|
May 16, 2012 - 3:01 AM
|
It’s the <code>bsv_top_level_menu</css> tag. Its width set to <code>8.5em</css> in the <code>CExtRibbonBackstageViewWnd::OnRcgwGenerateContent()</css> virtual method. You can override it and append re-defined widths for the <code>bsv_top_level_menu</css> tag by appending the new CSS block.
|
|
|
Wilhelm Falkner
|
May 21, 2012 - 8:57 AM
|
It’s working :-) Thanks Willi
|
|
|
Wilhelm Falkner
|
May 3, 2012 - 8:19 AM
|
Hello, in Your sample for the Backstageview, you have followimg links included: pData_DirectContent->m_strHtmlInner =
_T("<p style=\" margin-top:0.4em; \" >Application version: XXXX.XXXX.XXXX.XXXX (XX-bit)</p>\r\n")
_T("<p style=\" margin-top:0.4em; \" ><a href=\"http://www.prof-uis.com\">Additional Version and Copyright information.</a></p>\r\n")
_T("<p style=\" margin-top:0.4em; \" >Part of the XXXX XXXX XXXX XXXX (xxxx xxxx xxxx xxxx) product.</p>\r\n")
_T("<p style=\" margin-top:0.4em; \" >©201X Company Name. All rights reserved.</p>\r\n")
_T("<p style=\" margin-top:0.4em; \" ><a href=\"http://www.prof-uis.com\">Company Product Support Services.</a></p>\r\n")
_T("<p style=\" margin-top:0.4em; \" >Product ID: 1111-2222-3333-4444-5555-6666-7777</p>\r\n")
_T("<p style=\" margin-top:0.4em; \" ><a href=\"http://www.prof-uis.com\">Company Software License Terms.</a></p>\r\n")
; Can You pls tell me, you to make them work? E.g. opening explorer, got to HP? TIA Willi
|
|
|
Technical Support
|
May 16, 2012 - 3:14 AM
|
The CExtRibbonBackstageViewWnd::OnBsvItemInvokeCommand() virtual method allows you to handle invocations of most of elements in the backstage view. But the hyperlink is not a button like element of backstage view. So, a hyperlink click can be handled by overriding the CExtRibbonBackstageViewWnd::OnRcgtdItemInvoke() virtual method.
|
|
|
Technical Support
|
May 16, 2012 - 3:02 AM
|
The CExtRibbonBackstageViewWnd::OnBsvItemInvokeCommand() virtual method allows you to handle invocations of most of elements in the backstage view. But the hyperlink is not a button like element of backstage view. So, a hyperlink click can be handled by overriding the CExtRibbonBackstageViewWnd::OnRcgtdItemInvoke() virtual method.
|
|
|
Wilhelm Falkner
|
May 21, 2012 - 6:46 AM
|
You are right, OnRcgtdItemInvoke is called. But how can I detect, what the user has clicked? I tried to read it out from m_strHtmlInner, but this is allways empty, except for leftmost pane entries. What have I done: I have overwritten OnRcgtdItemInvok: bool CMyBackstageViewWnd::OnRcgtdItemInvoke( HTREEITEM hti, e_item_invoke_type eIIT )
{
{
ASSERT_VALID( this );
ASSERT( hti != NULL );
ASSERT( RcgtdItemIsPresent( hti ) );
CExtRichContentLayout * pRCL = RcsLayoutGet();
if( pRCL == NULL )
return CExtRichGenWnd::OnRcgtdItemInvoke( hti, eIIT );
CExtRichGenItemData * pData = (CExtRichGenItemData*)RcgtdItemDataGet( hti );
if( pData == NULL )
return CExtRichGenWnd::OnRcgtdItemInvoke( hti, eIIT );
if (!pData->m_strHtmlInner.IsEmpty())
TRACE("CMyBackstageViewWnd::OnRcgtdItemInvoke m_strHtmlInner = %s\n", pData->m_strHtmlInner);
if (pData->m_nItemType == __BSVIT_DIRECT_CONTENT) { // here I try to decode element, use has clicked on ...... // .................
return TRUE;
}
}
return CExtRibbonBackstageViewWnd::OnRcgtdItemInvoke( hti, eIIT );
} What have I done wrong? What is missing ? TIA Willi
|
|
|
Bill Olson
|
May 1, 2012 - 7:22 PM
|
Searching your site, I see that you shortened the default tooltip trigger delay from 1s to 500ms. How would I go about changing this delay? I don’t see in the Prof-UIS source where this is set to begin with. It would be nice to set the delay for all controls. I tried accessing the m_wndToolTip for a control, but it’s a protected member. I could always change it to a public one and recompile, but I would have to set the timing for each control in my application independently and that’s going to be a pain. I was hoping there was an easier way. I also had a further question about adding the scroll to my control bar. I couldn’t get it to work. I posted some code late last week in that thread. I’m awaiting a reply. Thanks, Bill
|
|
|
Bill Olson
|
May 16, 2012 - 11:12 PM
|
I found m_nPeriodDelayShowNormal yesterday. I also found a bug in the code handling tooltips. It was always using the minimum delay instead of the normal delay. When I fixed that it worked more as expected. Bill
|
|
|
Technical Support
|
May 16, 2012 - 3:08 AM
|
Here is how to change it for most of controls and toolbars:
g_DefPopupMenuSite.GetTip()->m_nPeriodDelayShowNormal = 1000;
Here is how to change it for tje ribbon bar and ribbon page: wndRibbon.OnAdvancedPopupMenuTipWndGet()->m_nPeriodDelayShowNormal = 1000;
|
|
|
Bill Olson
|
Apr 25, 2012 - 2:34 AM
|
I have a control bar with a CExtResizableDialog attached. Under some conditions, the window may be too small to see everything on the bar at once. How do I create scroll bars for this control bar? I found a sample for TestScrollDialog that was posted for someone else with a little bit of a different question. You add m_wndScrollContainer in that example, but I’m not quite sure how to make that work with a dynamic control bar. Thanks, Bill
|
|
|
Bill Olson
|
May 16, 2012 - 11:09 PM
|
OK, I added an nDesiredCmdID to the BarAlloc call. I then get that ID with nCmdID = (UINT)m_pBarRight->GetDlgCtrlID(); That looks fine. Just before calling ShowControlBar, I make the call to m_wndScrollRight.Create with the nCmdID. I also tried it as the last command in OnCreate. I get through OnCreate, but when OnSize is called, the program crashes. I get an assert in void CExtControlBar::MaximizeOnRow() on line 11965 ASSERT( ::GetWindow( hWndChild, GW_HWNDNEXT ) == NULL ); hWndChild is non-zero, so it is getting initialized. The comment a few lines above says: // automatic child resizing - only one child is allowed Thanks, Bill
|
|
|
Technical Support
|
Apr 26, 2012 - 1:00 PM
|
Please create CExtScrollContainerWnd as a child of CExtControlBar. Then create a dialog inside CExtScrollContainerWnd.
|
|
|
Bill Olson
|
Apr 27, 2012 - 3:10 AM
|
I found something similar in the TabPages example, but I couldn’t get it to work in my code. My code is derrived from the Dynamic Inner and Outer Bar sample which uses CExtDynamicControlBar pointers. The TabPages sample doesn’t use pointers. I don’t know if that’s contributing to my problem or not.
My CMDIChildWnd derrived class has the following:
class CChildMyWnd : public CExtNCW < CMDIChildWnd >, public CExtDynamicBarSite
{
...
public:
CExtDynamicControlBar * m_pBarPersistentInner;
CExtDynamicControlBar *m_pBarRight;
CExtScrollContainerWnd m_wndScrollRight;
CDlgBarR m_DlgBarR;
...
};
Then in the OnCreate function:
...
CExtDynamicBarSite::Install( this );
...
strBarCaption.Format(_T("Control Window"));
//if(!m_BarRight.Create(strBarCaption, this, ID_STDTR_DLGBAR_RIGHT))
//{
// TRACE0("Failed to create m_BarRight\n");
// return -1;
//}
m_pBarRight = BarAlloc(strBarCaption,icon,0,NULL,true);
m_pBarRight->m_nMdiMenuResourceID = IDR_MyTYPE;
m_pBarRight->m_nMdiAccelTableResourceID = IDR_MAINFRAME;
if(!m_wndScrollRight.Create(m_pBarRight, rectDefault ))
{
TRACE0("Failed to create m_wndScrollRight\n");
return -1;
}
nCmdID = (UINT)m_pBarRight->GetDlgCtrlID();
pCmdItem = g_CmdManager->CmdGetPtr(pApp->m_pszProfileName,nCmdID);
ASSERT( pCmdItem != NULL );
pCmdItem->StateSetBasic();
if(!m_DlgBarStdR.CreateInsideBar(m_pBarRight))
{
ASSERT( FALSE );
return -1;
}
...
The CreateInsideBar call fails. Here is the code in my dialog
bool CDlgBarR::CreateInsideBar(CExtControlBar * pBar)
{
ASSERT_VALID( this );
ASSERT_VALID( pBar );
ASSERT( GetSafeHwnd() == NULL );
ASSERT( pBar->GetSafeHwnd() != NULL );
if( ! CExtResizableDialog::Create( IDD, pBar ) )
return false;
pBar->OnRepositionSingleChild(); //<------ ASSERTS in this call
return true;
}
The assert happens on the line (in CExtControlBar)
ASSERT(::GetWindow(hWndChild, GW_HWNDNEXT) == NULL);
Obviously the scroll bar is causing something to go awry down here, but I’m stumped about how. Unless I’m completely out to lunch... Bill
|
|
|
Technical Support
|
May 16, 2012 - 3:08 AM
|
The nDesiredCmdID parameter of the CExtDynamicBarSite::BarAlloc() allows you to specify a non-zero command identifier which you then can always use to get pointers to your bars and create bar child windows. I.e. bar child windows should be invoked after creating all bars or after loading bar states and dynamic bar site’s state.
|
|
|
Wilhelm Falkner
|
Apr 24, 2012 - 11:03 AM
|
Hello, I want to create a backstageview on the fly. In your samples this is done during creation, but I have to reflect changes, e.g. teh recent file list may have changed. So, what I have tried: - I have overwritten our function BackstageView_EnsureVisible. In this I do following: - I deleted the old Items with RcgtdItemRemoveAllChildren - I inserted my new items at the end of the function I call your BackstageView_EnsureVisible. Seems to work, no errors - but the window at screen is not updated. What do I miss, what do I have to do else? TIA Willi
|
|
|
Technical Support
|
Apr 26, 2012 - 1:01 PM
|
The CExtRichContentScrollWnd::RcsDelayRecalcLayout() method tells the backstage/HTML view to recompute the HTML layout before an upcoming painting.
|
|
|
Wilhelm Falkner
|
Apr 26, 2012 - 9:24 AM
|
Found it :-) have to add at end: OnRcgwGenerateContent and RcsTextSet
|
|
|
Michael Nitsche
|
Apr 19, 2012 - 9:28 AM
|
I would like to create a grid cell item that will be used in a property grid so I can instead of showing a drop down of enumerated types, show a drop down of custom drawn items that would illustrate the enumeration values. Should I inherit from the CExtGridCell class and is there a help topic on doing something like this?
Thanks in advance.
|
|
|
Technical Support
|
Apr 23, 2012 - 8:56 AM
|
|
|
|
|
Emmanuel V.
|
Apr 17, 2012 - 9:19 AM
|
Hi, Is it possible to set read-only all cells of a CExtGridWnd, without using ModifyStyle(__EGCS_READ_ONLY) for each cells ? I do not want to disable CExtGridWnd, I want it able to expand/scroll cells. Thanks.
|
|
|
Technical Support
|
Apr 23, 2012 - 9:08 AM
|
You can override the CExtGridWnd::OnGridCellInplaceControlCreate() virtual method. Your method should invoke parent class method and change the default cell editor in such a way that it is read only.
|
|
|
Oliver Rau
|
Apr 13, 2012 - 5:41 AM
|
Hello, is there a possibility to have a tree-Control inside the grid.
So I should work as the CExtGridCellCheckListComboBox, but the content of the popup window
is not a list, it should be a CExtTreeGridWnd. We want to display checkboxes in the tree so the behavior should be like the Checklistbox
(open until you click out of the window).
thanks in advance
|
|
|
Technical Support
|
Apr 17, 2012 - 4:41 AM
|
The Combo Box column in the Grid dialog page in the ProfUIS_Controls demonstrates popup list boxes with a tree like content. But it’s not a tree control based tree and there is no support for per-item check box there. Check boxes can be implemented as custom drawn list box items.
|
|
|
Darlene Gariepy
|
Apr 11, 2012 - 1:50 PM
|
We’ve found what looks like a bug. It can be reproduced with the following steps using your MDI_DynamicBars sample.
1. Launch the sample. We used Unicode DEBUG.
2. Remove all control bars from the document tab. The only thing that should be left in the document area is MDIDOC1.
3. Move the "Persistent Bar" to the document area (i.e. Select "Tabbed Document" from the bar’s menu).
4. Save the layout (i.e. *** Bar State Persistence *** -> Save resizable bar to file).
5. Repeat step 4.
In step 5, after the second attempt to save, a failed assertion will trigger in ExtControlBar.cpp, line 28285: ASSERT( m_listBarsInDocMode.Find( pBar ) != NULL ); We are using version 2.9.2.
|
|
|
Technical Support
|
Apr 23, 2012 - 9:04 AM
|
Thank you for additional information. To fix this issue, please update the source code for the following method:
bool CExtDynamicBarSite::StateSerialize(
CArchive & ar,
bool bEnableThrowExceptions // = false
)
{
ASSERT( this != NULL );
DWORD dwGeneralFlags = 0;
DWORD dwReserved = 0L;
try
{
if( ar.IsStoring() )
{
ar << dwGeneralFlags;
ar << dwReserved;
ar << dwReserved;
ar << dwReserved;
ar << dwReserved;
DWORD dwCount = (DWORD)BarEnumGetCount();
ar << dwCount;
POSITION pos;
for( pos = BarEnumGetStartPosition(); pos != NULL; )
{ // delayed rebuild of visible documents list after reloading
CExtDynamicControlBar * pBar = BarEnumGetNext( pos );
ASSERT_VALID( pBar );
POSITION posInListBarsInDocMode = m_listBarsInDocMode.Find( pBar );
bool bVisibleState = false;
if( pBar->BarStateGet( &bVisibleState ) == CExtDynamicControlBar::__EDBS_DOCUMENT )
{
if( bVisibleState )
{
if( posInListBarsInDocMode == NULL )
m_listBarsInDocMode.AddTail( pBar );
continue;
} // if( bVisibleState )
} // if( pBar->BarStateGet( &bVisibleState ) == CExtDynamicControlBar::__EDBS_DOCUMENT )
if( posInListBarsInDocMode != NULL )
m_listBarsInDocMode.RemoveAt( posInListBarsInDocMode );
} // delayed rebuild of visible documents list after reloading
for( pos = BarEnumGetStartPosition(); pos != NULL; )
{ // serialize per-bar dynamic properties
CExtDynamicControlBar * pBar = BarEnumGetNext( pos );
ASSERT_VALID( pBar );
bool bVisibleState = false;
if( pBar->BarStateGet( &bVisibleState ) == CExtDynamicControlBar::__EDBS_DOCUMENT )
{
if( bVisibleState )
{
ASSERT( m_listBarsInDocMode.Find( pBar ) != NULL );
continue;
} // if( bVisibleState )
} // if( pBar->BarStateGet( &bVisibleState ) == CExtDynamicControlBar::__EDBS_DOCUMENT )
ASSERT( m_listBarsInDocMode.Find( pBar ) == NULL );
UINT nCmdID = (UINT)pBar->GetDlgCtrlID();
ar << DWORD(nCmdID);
bool bPersistentBar = pBar->IsPersistentBar();
DWORD dwSerializeFlags = 0;
if( bPersistentBar )
dwSerializeFlags |= 0x01;
ar << dwSerializeFlags;
if( ! bPersistentBar )
{
CRuntimeClass * pRTC = pBar->GetRuntimeClass();
ASSERT( pRTC != NULL );
ar.WriteClass( pRTC );
} // if( ! bPersistentBar )
ar << pBar->m_strCaptionText;
pBar->m_icon.Serialize( ar );
pBar->OnSerializeDynamicProps( ar );
} // serialize per-bar dynamic properties
CTypedPtrList < CPtrList, CExtDynamicControlBar * > _listSerialize;
bool bUseDefaultOrder = true;
CExtDynamicBarSite::eDetectedUiType_t eDUIT = GetDetectedUiType();
eDUIT;
#if (!defined __EXT_MFC_NO_TABMDI_CTRL)
if( eDUIT == __EDUIT_MDI_WITH_TABS )
{ // detect MDI order using tabs
CExtTabWnd * pTabs = GetMdiTabs();
if( pTabs != NULL )
{
LONG nIndex, nCount = pTabs->ItemGetCount();
for( nIndex = 0L; nIndex < nCount; nIndex ++ )
{
HWND hWnd = (HWND)pTabs->ItemGet( nIndex )->LParamGet();
CWnd * pWndPremanent = CWnd::FromHandlePermanent( hWnd );
if( pWndPremanent == NULL )
continue;
CExtDynamicMDIChildWnd * pWndMdiChild = DYNAMIC_DOWNCAST( CExtDynamicMDIChildWnd, pWndPremanent );
if( pWndMdiChild == NULL )
continue;
if( pWndMdiChild->GetBarSite() != this )
continue;
CExtDynamicControlBar * pBar = pWndMdiChild->GetBar();
if( pBar == NULL )
continue;
if( m_listBarsInDocMode.Find( pBar ) == NULL )
continue;
_listSerialize.AddTail( pBar );
} // for( nIndex = 0L; nIndex < nCount; nIndex ++ )
if( _listSerialize.GetCount() == m_listBarsInDocMode.GetCount() )
bUseDefaultOrder = false;
else
_listSerialize.RemoveAll();
} // if( pTabs != NULL )
} // detect MDI order using tabs
#endif // (!defined __EXT_MFC_NO_TABMDI_CTRL)
#if (!defined __EXT_MFC_NO_TAB_PAGECONTAINER_CTRL)
if( eDUIT == __EDUIT_SDI_TAB_PAGE_CONTAINER )
{ // detect document mode order using SDI tab page container
CExtTabPageContainerWnd * pWndTabPageContainer = GetTabPageContainer();
if( pWndTabPageContainer->GetSafeHwnd() != NULL )
{
ASSERT_VALID( pWndTabPageContainer );
CTypedPtrList < CPtrList, CExtDynamicControlBar * > _listFound;
INT nIndex = 0, nCount = pWndTabPageContainer->PageGetCount();
for( nIndex = 0; nIndex < nCount; nIndex ++ )
{
HWND hWndPage = pWndTabPageContainer->PageHwndGetSafe( nIndex );
if( hWndPage == NULL )
continue;
CExtDynamicControlBar * pBar = BarFindByChildHWND( hWndPage );
if( pBar == NULL )
continue;
ASSERT_VALID( pBar );
#ifdef _DEBUG
bool bVisibleState = false;
ASSERT( pBar->BarStateGet( &bVisibleState ) == CExtDynamicControlBar::__EDBS_DOCUMENT );
ASSERT( bVisibleState );
#endif // _DEBUG
if( m_listBarsInDocMode.Find( pBar ) == NULL )
continue;
_listSerialize.AddTail( pBar );
}
if( _listSerialize.GetCount() == m_listBarsInDocMode.GetCount() )
bUseDefaultOrder = false;
else
_listSerialize.RemoveAll();
}
} // detect document mode order using SDI tab page container
#endif // (!defined __EXT_MFC_NO_TAB_PAGECONTAINER_CTRL)
if( bUseDefaultOrder )
_listSerialize.AddTail( &m_listBarsInDocMode );
for( pos = _listSerialize.GetTailPosition(); pos != NULL; )
{ // serialize per-bar dynamic properties
CExtDynamicControlBar * pBar = _listSerialize.GetPrev( pos );
ASSERT_VALID( pBar );
ASSERT( pBar->BarStateGet() == CExtDynamicControlBar::__EDBS_DOCUMENT );
UINT nCmdID = (UINT)pBar->GetDlgCtrlID();
ar << DWORD(nCmdID);
bool bPersistentBar = pBar->IsPersistentBar();
DWORD dwSerializeFlags = 0;
if( bPersistentBar )
dwSerializeFlags |= 0x01;
ar << dwSerializeFlags;
if( ! bPersistentBar )
{
CRuntimeClass * pRTC = pBar->GetRuntimeClass();
ASSERT( pRTC != NULL );
ar.WriteClass( pRTC );
} // if( ! bPersistentBar )
ar << pBar->m_strCaptionText;
pBar->m_icon.Serialize( ar );
pBar->OnSerializeDynamicProps( ar );
} // serialize per-bar dynamic properties
} // if( ar.IsStoring() )
else
{
ar >> dwGeneralFlags;
ar >> dwReserved;
ar >> dwReserved;
ar >> dwReserved;
ar >> dwReserved;
BarFreeAll( false, true );
m_listBarsInDocMode.RemoveAll();
ASSERT( BarEnumGetCount( false, true ) == 0 );
DWORD dwCount;
ar >> dwCount;
for( DWORD dwIndex = 0; dwIndex < dwCount; dwIndex++ )
{
UINT nCmdID;
DWORD dwTmp;
ar >> dwTmp;
nCmdID = UINT(dwTmp);
DWORD dwSerializeFlags;
ar >> dwSerializeFlags;
CExtDynamicControlBar * pBar = NULL;
if( (dwSerializeFlags & 0x01) != 0 )
{ // if serializing persistent bar
pBar = BarGetByCmdID( nCmdID );
if( pBar == NULL )
{
ASSERT( FALSE );
BarFreeAll( false, true );
#if _MFC_VER >= 0x0800
::AfxThrowArchiveException( CArchiveException::genericException );
#else
::AfxThrowArchiveException( CArchiveException::generic );
#endif
} // if( pBar == NULL )
ASSERT_VALID( pBar );
ar >> pBar->m_strCaptionText;
pBar->m_icon.Serialize( ar );
} // if serializing persistent bar
else
{ // if serializing dynamic bar
CRuntimeClass * pRTC = ar.ReadClass();
ASSERT( pRTC != NULL );
CExtSafeString strCaptionText;
ar >> strCaptionText;
CExtCmdIcon icon;
icon.Serialize( ar );
pBar =
BarAlloc(
strCaptionText,
icon,
nCmdID,
pRTC
);
if( pBar == NULL )
{
ASSERT( FALSE );
BarFreeAll( false, true );
#if _MFC_VER >= 0x0800
::AfxThrowArchiveException( CArchiveException::genericException );
#else
::AfxThrowArchiveException( CArchiveException::generic );
#endif
} // if( pBar == NULL )
} // if serializing dynamic bar
ASSERT_VALID( pBar );
pBar->OnSerializeDynamicProps( ar );
} // for( DWORD dwIndex = 0; dwIndex < dwCount; dwIndex++ )
ASSERT( ((DWORD)BarEnumGetCount()) == dwCount );
} // else from if( ar.IsStoring() )
return true;
} // try
catch( CException * pException )
{
if( bEnableThrowExceptions )
throw;
pException->Delete();
} // catch( CException * pException )
catch( ... )
{
if( bEnableThrowExceptions )
throw;
} // catch( ... )
dwGeneralFlags;
dwReserved;
return false;
}
|
|
|
Darlene Gariepy
|
Apr 17, 2012 - 8:18 AM
|
Try these alternate steps:
1. Delete the registry state (e.g. HKEY_CURRENT_USER\Software\Foss\MDI_DynamicBars).
2. Launch the app in debug.
3. Remove "Auto-Hide" from "Persistant Bar" (i.e. click on Pin button in bar title).
4. Right-click "Persistant Bar" title bar and choose "Tabbed Document".
5. Save the layout (i.e. *** Bar State Persistence *** -> Save resizable bar to file).
6. Load the layout from step 5.
7. Close the application.
|
|
|
Technical Support
|
Apr 17, 2012 - 4:37 AM
|
We cannot reproduce this issue. We assume step 2 is hiding bars or switching bars into docked state. Could you send us the state file you saved during your test?
|
|
|
Michael Nitsche
|
Apr 9, 2012 - 1:13 PM
|
When a user event occurs I want to tell the PropertyGrid to re-read all of the properties that are in the property store. Is there a way to do this?
|
|
|
Technical Support
|
Apr 17, 2012 - 4:39 AM
|
Please try CExtPropertyGridCtrl::PropertyStoreSynchronize().
|
|
|
Alastair Watts
|
Apr 1, 2012 - 7:41 AM
|
Is it possible to have 2 buttons in a grid cell, eg: __EBTT_DROPDOWN & __EBTT_UPDOWN* Thanks in advance
|
|
|
Technical Support
|
Apr 2, 2012 - 2:40 PM
|
Sure. The ellipsis, up-down and drop-down buttons are built-in and can be turned on/off in any grid cell. The following cell styles can be applied to show appropriate built-in cell buttons:
// have up-down button
#define __EGCS_BUTTON_UPDOWN 0x00400000L
// have drop-down button
#define __EGCS_BUTTON_DROPDOWN 0x02000000L
// have ellipsis button
#define __EGCS_BUTTON_ELLIPSIS 0x08000000L
|
|
|
Andreas Spachtholz
|
Mar 29, 2012 - 12:53 PM
|
Hi, I would like to change the colour of the border of the main fram of our application. Exactly I would like to let the colour change between two colours every second.
I already searched the forum and played around with WM_NCPAINT, but didn’t find the correct way.
Could you please help me !
Thanks a lot.
BR, Andreas
|
|
|
Technical Support
|
Apr 2, 2012 - 2:42 PM
|
You should start a timer and send the WM_NCPAINT message from your timer handler. The WM_NCPAINT message should draw what you need into the window device context with an excluded client area rectangle. You should also disable the window glass provided by DWM when running on Windows Vista or 7. This can be done using the DwmSetWindowAttribute() API invocation (you can see how we did this in the CExtNcFrameImpl::NcFrameImpl_AdjustVistaDwmCompatibilityIssues() method).
But ... You can simply use the standard FlashWindow() Win32 API which does what you need using system defined colors and style.
|
|
|
Barbara Roth
|
Mar 28, 2012 - 1:17 PM
|
I have an MDI application. I want to show a list of the currenly open MDI windows, so I call SetMdiWindowPopupName which does show all the open MDI windows. Is their a simple method that I can use to pick and choose which MDI windows I want to show if I don’t want to show all of them?
|
|
|
Technical Support
|
Apr 2, 2012 - 2:42 PM
|
You should avoid using the SetMdiWindowPopupName() API and implement MDI window list from scratch. Please insert some command item into any menu(s) where you want to see MDI window list. This command item we call marker item because your app will search it for removing and inserting a set of MDI menu items instead of it. So, the first thing you need is to add message handler for the CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel message into your main frame class:
ON_REGISTERED_MESSAGE( CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel, OnExtMenuPrepare )
LRESULT CMainFrame::OnExtMenuPrepare(WPARAM wParam, LPARAM lParam)
{
lParam;
CExtPopupMenuWnd::MsgPrepareMenuData_t * pData =
reinterpret_cast
< CExtPopupMenuWnd::MsgPrepareMenuData_t * >
( wParam );
ASSERT( pData != NULL );
CExtPopupMenuWnd * pPopup = pData->m_pPopup;
ASSERT( pPopup != NULL );
for( INT nReplacePos = pPopup->ItemFindPosForCmdID( ID_MY_MARKER_MENU_ITEM ); nReplacePos >= 0; nReplacePos = pPopup->ItemFindPosForCmdID( ID_MY_MARKER_MENU_ITEM ) )
{
VERIFY( pPopup->ItemRemove( nReplacePos ) );
//
// TO-DO: detect all required MDI documents and insert appropriate menu items into nReplacePos position of the pPopup menu here
//
} // if( nReplacePos >= 0 )
return 1L;
}
The standard MDI menu command items are sequential starting from the __ID_MDIWNDLIST_FIRST identifier. The maximum command count is __ID_MDIWNDLIST_COUNT. These commands are handled automatically. But you cannot use these command identifiers because your MDI menu contains only optionally selected MDI windows. This means you should use your own range of commands and handle them manually in main frames OnCmdMsg() virtual method.
|
|
|
Alastair Watts
|
Mar 20, 2012 - 4:15 AM
|
I’ve added a button menu to CExtPropertyGridToolBar but it is displayed above the toolbar. How do I make it appear below? Thanks.
|
|
|
Technical Support
|
Apr 2, 2012 - 2:41 PM
|
If a toolbar is top-docked in its parent window, then menus displayed from its windows are bottom-oriented. The same opposite rule is applied to the toolbars docked to other sides. How are you initializing your button and its menu?
|
|
|
Alastair Watts
|
Mar 30, 2012 - 2:04 AM
|
|
|
|
|
Alastair Watts
|
Mar 23, 2012 - 1:23 AM
|
I meant the position of the menu!
|
|
|
Technical Support
|
Mar 22, 2012 - 1:23 PM
|
The toolbar always organizes all its buttons in one row. It’s not possible to put a button into a toolbar and above it. Please provide us with some more details and a screenshot.
|
|
|
Alastair Watts
|
Mar 14, 2012 - 10:37 AM
|
|
|
|
|
Technical Support
|
Mar 16, 2012 - 6:46 AM
|
First, of all, you should get the active tree grid window inside the property grid control:
CExtPropertyGridCtrl * pPGC = . . .
CExtPropertyGridWnd * pPGW = GetActiveGrid();
if( pPGW == NULL )
return . . .
Second, you should get the focused tree item: HTREEITEM hti = pPGW->ItemFocusGet();
if( hti == NULL )
return . . .
Third, you should get property item which corresponds to the focused tree item. CExtPropertyItem * pPI = pPGW->PropertyItemFromTreeItem( hti );
if( pPI == NULL )
return . . .
Fourth, the property item can be a property category. User always change property values - not categories. So, you should also check whether focused row in tree grid is property value row: CExtPropertyValue * pValue = DYNAMIC_DOWNCAST( CExtPropertyValue, pPI );
if( pValue == NULL )
return . . .
|
|
|
Celal Sen
|
Mar 13, 2012 - 8:15 AM
|
|
|