Subject |
Author |
Date |
|
Andreas Werner
|
Oct 27, 2006 - 8:28 AM
|
I want to use a CExtWFF <CListCtrl> in design mode in Visual Studio. I have done the following:
In the graphical designer I have dropped a CListCtrl to the dialog I use. I have modified the CDialog class that was generated by Visual Studio in the following way:
In the header file I have declared a member of CExtWFF <CListCtrl> #if !defined(AFX_DIALOG2_H__8485B2B1_6F9D_495A_B95B_19C56C484C0B__INCLUDED_) #define AFX_DIALOG2_H__8485B2B1_6F9D_495A_B95B_19C56C484C0B__INCLUDED_
#if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Dialog2.h : Header-Datei // class CDialog2 : public CExtResizableDialog { // Konstruktion public: CDialog2(CWnd* pParent = NULL); // Standardkonstruktor ~CDialog2 ();
// Dialogfelddaten //{{AFX_DATA(CDialog2) enum { IDD = IDD_DIALOG2 }; //}}AFX_DATA CExtPropertyGridCtrl m_PGC; CExtWFF <CListCtrl> m_LC; // // Überschreibungen // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CDialog2) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung //}}AFX_VIRTUAL
// Implementierung protected:
// Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CDialog2) virtual BOOL OnInitDialog(); afx_msg void OnItemchangedCustumListCtrl(NMHDR* pNMHDR, LRESULT* pResult); //}}AFX_MSG DECLARE_MESSAGE_MAP() };
//{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein.
#endif // AFX_DIALOG2_H__8485B2B1_6F9D_495A_B95B_19C56C484C0B__INCLUDED_
In the implementation I have added the following code:
void CDialog2::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDialog2) //}}AFX_DATA_MAP DDX_Control(pDX,IDC_CUSTOM_PROPERTY_GRID, m_PGC); DDX_Control(pDX,IDC_CUSTOM_LIST_CTRL, m_LC); }
BEGIN_MESSAGE_MAP(CDialog2, CDialog) //{{AFX_MSG_MAP(CDialog2) ON_NOTIFY(LVN_ITEMCHANGED, IDC_COSTUM_LIST_CTRL, OnItemchangedCustumListCtrl) //}}AFX_MSG_MAP END_MESSAGE_MAP()
BOOL CDialog2::OnInitDialog() { CExtResizableDialog::OnInitDialog(); AddAnchor(IDC_CUSTOM_LIST_CTRL, CPoint(0,0), CPoint(100,100)); AddAnchor(IDC_CUSTOM_PROPERTY_GRID, CPoint(0,100), CPoint(100,100));
return TRUE; }
The list works well. I can use anchoring and message notification. The problem is. The list is not shown in the style of the Prof-UIS themes. For example if I use the Office 2007 themes the scrollbars of the list do not change their colour if the mouse is moved over the scrollbar, instead they remain grey like usual windows scroll bars.
What is missing in my code to make the list control look correctly? Which style settings should be applied to the list?
With best regards Andreas
|
|
Technical Support
|
Oct 28, 2006 - 11:44 AM
|
Thank you for the interesting question but it has little to do with to the CExtWFF template class. The following article explains how to use the scroll bar windows with common controls. This test project implements the approach described in the article (with regard to CExtScrollBar windows). Unfortunately, in any case you will not able to see Prof-UIS-themed controls in design mode because this is not possible. Unlike ActiveX controls, the MFC based C++ classes do not support the design mode.
|
|
Andreas Werner
|
Oct 27, 2006 - 7:42 AM
|
Hallo,
I have a property store with 12 property Items and 4 property categories. The properties represent the attributes of a business object. Each time the user selects a different instance of the business object I change the values of the property items to the values of the attributes of the currently selected business object. The trigger to update the property items is the selection in a list. The following code example demonstrates what is happening:
void CMyDialog::OnItemchangedCustumListCtrl(NMHDR* pNMHDR, LRESULT* pResult) { NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; pNMListView; INT n = pNMListView->iItem; Item1->ValueActiveSet(BusinessObject[n].GetProperty1()); Item2->ValueActiveSet(BusinessObject[n].GetProperty2()); Item3->ValueActiveSet(BusinessObject[n].GetProperty3()); Etc ⦠Item12->ValueActiveSet(BusinessObject[n].GetProperty12());
m_PGC.PropertyStoreSynchronize(); *pResult = 0; }
1. Question: The update of the cells of the property grid works smooth, but the text in the tip panel (CExtPropertyGridTipBar) at the bottom of the property grid is flickering. It seems that the tip panel is updated 12 times, each time when ValueActiveSet() is invoked.
Is there a way to stop the flickering of the tip panel?
2. Question: Each time I update the property gird the tip panel shows the tip text of the category that was inserted as the last one to the property store. Is there a way to tell the tip panel to show the tip text of the category that was inserted as the first one?
|
|
Technical Support
|
Oct 28, 2006 - 11:35 AM
|
The first issue can be reproduced with the PropertyGrid sample when the Selected stars item is selected in the combo box and you change the checked state of star buttons. The flicker of the tip area can be prevented in the PropertyGrid sample locally and you can use the same approach in your project: void CMainDlg::_CombineMixedStoreSelection()
{
m_PropertyStoreCompoundSelection.ItemRemove();
if( m_Btn1.SelectedStateGet() )
m_PropertyStoreCompoundSelection.Combine( m_Btn1.GetPropertyStore() );
if( m_Btn2.SelectedStateGet() )
m_PropertyStoreCompoundSelection.Combine( m_Btn2.GetPropertyStore() );
if( m_Btn3.SelectedStateGet() )
m_PropertyStoreCompoundSelection.Combine( m_Btn3.GetPropertyStore() );
if( m_Btn4.SelectedStateGet() )
m_PropertyStoreCompoundSelection.Combine( m_Btn4.GetPropertyStore() );
CExtPropertyGridComboBoxBar * pCombo =
STATIC_DOWNCAST(
CExtPropertyGridComboBoxBar,
m_PGC.GetChildByRTC(
RUNTIME_CLASS(CExtPropertyGridComboBoxBar)
)
);
if( pCombo == NULL )
return;
ASSERT_VALID( pCombo );
if( pCombo->GetCurSel() == 0 )
{
m_PGC.SetRedraw( FALSE );
m_PGC.PropertyStoreSynchronize();
m_PGC.SetRedraw( TRUE );
m_PGC.RedrawWindow( NULL, NULL, RDW_INVALIDATE|RDW_ERASE|RDW_ALLCHILDREN );
}
} We have protected the invocation of the m_PGC.PropertyStoreSynchronize() code with the SetRedraw() and RedrawWindow() APIs. The second issue means you should select the known property item (category or value) in the property grid control before it is repainted: CExtPropertyGridCtrl & _PGC = . . .
CExtPropertyItem * pPropertyItem = . . . // CExtPropertyCategory or CExtPropertyValue
CExtPropertyGridWnd * pActiveGrid = _PGC.GetActiveGrid();
HTREEITEM hTreeItem = pActiveGrid->PropertyItemToTreeItem( pPropertyItem );
pActiveGrid->ItemFocusSet( hTreeItem ); The property grid control automatically synchronizes selection in all inserted tree grid windows.
|
|
Andreas Werner
|
Oct 30, 2006 - 7:57 AM
|
That was what I have been looking for. Thank you for your help :-)
|
|
Offer Har
|
Oct 26, 2006 - 10:12 PM
|
Dear support,
I have downloaded the 2.62 preview version, and checked this function. I am happy to say that it works... i guess it either did not work well in 2.61+patch, or made a mistake ;-)
There is one small issue that you should look over: This is from your sample code:
if( pBarActiveInContainer == NULL // IF this BAR IS STAND ALONE DOCKED OR FLOATING || pBarActiveInContainer == pBarEventSource // IF THIS BAR IS SELECTED IN TABBED GROUP
What i see is as follows: 1) If the bar is floating alone, and i close it, pBarActiveInContainer == NULL, as you wrote 2) If the bar is tabbed, then pBarActiveInContainer is not pBarEventSource. What i get is that pBarEventSource is of type CExtDynaTabControlBar, and pBarActiveInContainer is the bar whose tab is the selected one, thus, your second check is not correct, it should be pBarActiveInContainer != NULL instead.
Please enlighten me if I’m wrong...
Regards, Offer.
|
|
Technical Support
|
Oct 27, 2006 - 6:19 AM
|
We agree with you and the final version uses pBarActiveInContainer != NULL . Thank you, Offer.
|
|
Offer Har
|
Oct 27, 2006 - 9:35 AM
|
Hi,
I have explored some more this tabbed problem. I have found out that when tabbed, the NcButtons_RemoveAll is called for EACH tabbed bar. If one of tabbed return true, and another returns false (that is, go to the default NcButtons_RemoveAll), the tabbed bars is closed.
This is a problem. What should be done is either that only the bars that call the default NcButtons_RemoveAll will be closed, or that none of them will be closed. The main concept is to PREVENT the closure of a docked/tabbed bar, so the closure should be on the restrictive side, and to not allow the closure if not all docked bars agree to the closure.
Best Regards, Offer
|
|
Suhai Gyorgy
|
Oct 27, 2006 - 10:38 AM
|
Just a guess: check if you set CExtControlBar::g_bCloseOnlyOneBarInTabGroup to true, maybe then it will work as expected.
|
|
Offer Har
|
Oct 27, 2006 - 8:52 PM
|
Thanks for the suggestion, but the bug is still there - it’s even clearer now that there is a bug, because the bar that was not supposed to get closed got closed...
Support - please check the scenario with the flag g_bCloseOnlyOneBarInTabGroup set to true, you’ll see that the problem is real and there - a docked bar that returns true in the NcButtons_RemoveAll function, and does not call the base implementation is getting closed if tabbed, even if this flag is set to true (when only the active docked bar is to be closed, and although it was not supposed to get closed, it does)
Please try to solve this for the next version. Thanks.
|
|
Offer Har
|
Oct 27, 2006 - 9:16 AM
|
Dear Support,
This feature is still not working well. Now, when the docked bar is in a tabbed bar, the function NcButtons_RemoveAll is called, but even if i return true in it, the docked bar is closed. Please verify, and fix for the 2.62 release.
Regards, Offer
|
|
Technical Support
|
Oct 30, 2006 - 12:04 PM
|
First of all, we can guess you are talking about the CExtControlBar::NcButtons_HandleClick() method, not about the CExtControlBar::NcButtons_Remove() . The CExtControlBar::NcButtons_HandleClick() method is really invoked for all bars inside the tabbed container or dynamic row/column container. This provides all the bars with information about which bar was clicked and where. This works regardless of if the "X" button closes one control bar or the group of control bars. This allows you to prevent a particular control bar or a group of bars from being closed depending on some conditions in other control bars.
|
|
Offer Har
|
Oct 31, 2006 - 11:55 AM
|
You are correct, the function NcButtons_HandleClick.
Please try to reproduce the bug, in a tabbed bar, even if i don’t let the default NcButtons_HandleClick to be called, the tabbed control bar is closed.
When i set the flag g_bCloseOnlyOneBarInTabGroup , it is supposed to close only the active bar, and even if don’t let the default NcButtons_HandleClick to be called, the tabbed bar is closed. If the flag g_bCloseOnlyOneBarInTabGroup is false, the whole tabbed container is closed, no matter if one of the tabbed bars do not call the default NcButtons_HandleClick.
|
|
Technical Support
|
Nov 2, 2006 - 9:02 AM
|
Thank you for reporting this problem. We fixed it and you can download the latest source code from our ftp site.
|
|
Neville Franks
|
Oct 26, 2006 - 8:27 PM
|
When a Prof-UIS application isn’t the active (foreground) application and the user hovers the mouse over its menu or toolbar, menu items and buttons are highlighted and tooltips are displayed. This shouldn’t be happening.
Neville, http://www.surfulater.com
|
|
Technical Support
|
Oct 27, 2006 - 6:32 AM
|
If you run any of Microsoft Office and Visual Studio applications, you can see that, if the application window is not active, toolbar buttons are not highlighted when the user hovers the mouse pointer over them. So we agree that the same functionality should be implemented in Prof-UIS. Thank you, Neville. Please update the source code for the CExtControlBar::OnMouseMove() and CExtControlBar::WindowProc() methods in the ExtControlBar.cpp file: void CExtControlBar::OnMouseMove(UINT nFlags, CPoint point)
{
__PROF_UIS_MANAGE_STATE;
if( ! CExtPopupMenuWnd::TestHoverEnabledFromActiveHWND( m_hWnd ) )
return;
if( _OnMouseMoveMsg(nFlags,point) )
return;
CControlBar::OnMouseMove(nFlags,point);
}
LRESULT CExtControlBar::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch( message )
{
case WM_NCMOUSEMOVE:
{
if( ! CExtPopupMenuWnd::TestHoverEnabledFromActiveHWND( m_hWnd ) )
return 0;
CExtPopupMenuTipWnd * pATTW =
OnAdvancedPopupMenuTipWndGet();
if( pATTW == NULL )
return 0;
CPoint ptScreen;
if( ! ::GetCursorPos( &ptScreen ) )
return 0;
CExtBarNcAreaButton * pBtn = NULL;
NcButtons_HitTest( ptScreen, &pBtn );
if( pBtn != NULL )
{
ASSERT_VALID( pBtn );
TOOLINFO _ti;
::memset( &_ti, 0, sizeof(AFX_OLDTOOLINFO) );
_ti.cbSize = sizeof( TOOLINFO );
_ti.hinst = ::AfxGetInstanceHandle();
if( pBtn->OnToolHitTest( ptScreen, &_ti ) > 0 )
{
if( _ti.lpszText != NULL
&& _ti.lpszText != LPSTR_TEXTCALLBACK
&& _tcslen( _ti.lpszText ) > 0
)
{
CRect rcArea = *pBtn;
CRect rcDefOffsetWnd;
GetWindowRect( &rcDefOffsetWnd );
rcArea.OffsetRect( rcDefOffsetWnd.TopLeft() );
OnAdvancedPopupMenuTipWndDisplay(
*pATTW,
rcArea,
_ti.lpszText
);
}
}
if( _ti.lpszText != NULL
&& _ti.lpszText != LPSTR_TEXTCALLBACK
)
::free( _ti.lpszText );
}
}
break;
case WM_PRINT:
case WM_PRINTCLIENT:
{
CDC * pDC = CDC::FromHandle( (HDC) wParam );
CRect rcRgnWnd, rcRgnClient;
GetWindowRect( &rcRgnWnd );
GetClientRect( &rcRgnClient );
if( IsFloating() )
{
CRect rcFloatClient;
GetParentFrame()->GetClientRect( &rcFloatClient );
if( rcRgnClient.Width() > rcFloatClient.Width() )
rcRgnClient.right = rcRgnClient.left + rcFloatClient.Width();
if( rcRgnClient.Height() > rcFloatClient.Height() )
rcRgnClient.bottom = rcRgnClient.top + rcFloatClient.Height();
}
if( (lParam&PRF_NONCLIENT) != 0 )
{
CRect rcWnd = rcRgnWnd, rcClient = rcRgnClient;
ClientToScreen( &rcClient );
rcClient.OffsetRect( -rcWnd.TopLeft() );
rcWnd.OffsetRect( -rcWnd.TopLeft() );
CRgn rgnWnd;
if( rgnWnd.CreateRectRgnIndirect( &rcWnd ) )
pDC->SelectClipRgn( &rgnWnd );
pDC->ExcludeClipRect( &rcClient );
DoPaintNC( pDC );
pDC->SelectClipRgn( NULL );
}
if( ( lParam & ( PRF_CLIENT | PRF_ERASEBKGND ) ) != 0 )
{
CPoint ptVpOffset( 0, 0 );
if( ( lParam & PRF_NONCLIENT ) != 0 )
{
CRect rcWnd = rcRgnWnd, rcClient = rcRgnClient;
ClientToScreen( &rcClient );
ptVpOffset.x = rcWnd.left - rcClient.left;
ptVpOffset.y = rcWnd.top - rcClient.top;
}
if( ptVpOffset.x != 0
|| ptVpOffset.y != 0
)
pDC->OffsetViewportOrg(
-ptVpOffset.x,
-ptVpOffset.y
);
CDC dcSurface;
CBitmap bmpSurface;
CWindowDC dcDesktop( NULL );
if( dcSurface.CreateCompatibleDC( NULL )
&& bmpSurface.CreateCompatibleBitmap(
&dcDesktop,
rcRgnClient.Width(),
rcRgnClient.Height()
)
)
{
CBitmap * pOldBmp = dcSurface.SelectObject( &bmpSurface );
DoEraseBk( &dcSurface );
DoPaint( &dcSurface );
pDC->BitBlt(
0,
0,
rcRgnClient.Width(),
rcRgnClient.Height(),
&dcSurface,
0,
0,
SRCCOPY
);
dcSurface.SelectObject( pOldBmp );
}
if( ptVpOffset.x != 0
|| ptVpOffset.y != 0
)
pDC->OffsetViewportOrg(
ptVpOffset.x,
ptVpOffset.y
);
}
if( ( lParam & PRF_CHILDREN ) != 0 )
CExtPaintManager::stat_PrintChildren(
m_hWnd,
message,
pDC->GetSafeHdc(),
lParam,
false
);
}
return (!0);
case WM_TIMER:
if( wParam == __TIMER_ID_DELAYED_UPDATE )
return 0L;
else if( wParam == __TIMER_ID_DRELAYED_REPAINT_FAKE )
{
RedrawWindow(
NULL,
NULL,
RDW_INVALIDATE|RDW_UPDATENOW
|RDW_ERASE|RDW_ERASENOW
|RDW_ALLCHILDREN
|RDW_FRAME
);
return 0L;
}
if( AnimationSite_OnHookTimer( UINT(wParam) ) )
return 0L;
break;
case WM_CLOSE:
m_bInCustomModeUpdateCmdUI = true;
return 0;
case WM_DESTROY:
AnimationSite_ClientRemove();
#if (_MFC_VER >= 0x700) && (_MFC_VER <= 0x710)
if( m_pDockSite != NULL
&& m_pDockSite->IsKindOf( RUNTIME_CLASS( CMDIChildWnd ) )
)
{
CFrameWnd * pFrame = GetParentFrame();
if( pFrame != m_pDockSite )
m_bHelperSuppressDestruction = true;
}
#endif
m_bInCustomModeUpdateCmdUI = true;
break;
case WM_NCDESTROY:
AnimationSite_ClientRemove();
if( m_pDockContext != NULL )
{
m_pDockBar = NULL;
delete m_pDockContext;
m_pDockContext = NULL;
}
m_bInCustomModeUpdateCmdUI = true;
NcButtons_RemoveAll();
break;
case WM_SETFOCUS:
{
LRESULT lResult =
CControlBar::WindowProc(message, wParam, lParam);
if( IsMinimizedOnRow() )
MaximizeOnRow();
if( ! IsFixedMode() )
{
CWnd * pWnd = GetWindow(GW_CHILD);
if( pWnd != NULL
&& stat_QueryFocusChangingEnabled( this, pWnd->m_hWnd )
)
{
pWnd->SetFocus();
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
ASSERT(
pWnd->GetWindow( GW_HWNDNEXT ) == NULL
|| IsKindOf( RUNTIME_CLASS( CExtDynTabControlBar ) )
);
#else
ASSERT( pWnd->GetWindow( GW_HWNDNEXT ) == NULL );
#endif
}
}
return lResult;
}
case WM_ERASEBKGND:
if( ! m_bDoNotEraseClientBackground )
return !0;
CExtPaintManager::stat_ExcludeChildAreas(
(HDC)wParam,
*this
);
return CControlBar::WindowProc(message, wParam, lParam);;
case WM_CREATE:
{
if( ( ! m_bPresubclassDialogMode ) && ( ! IsFixedMode() ) )
{
ASSERT( GetSafeHwnd() != NULL );
ASSERT( ::IsWindow(GetSafeHwnd()) );
HWND hWndParent = ::GetParent( GetSafeHwnd() );
CFrameWnd * pFrame = NULL;
do
{
ASSERT( hWndParent != NULL );
ASSERT( ::IsWindow( hWndParent ) );
CWnd * pWnd = CWnd::FromHandle( hWndParent );
if( pWnd->IsKindOf( RUNTIME_CLASS( CFrameWnd ) ) )
{
pFrame = (CFrameWnd *)pWnd;
break;
}
} while( pFrame == NULL );
ASSERT( pFrame != NULL );
ASSERT_VALID( pFrame );
if( pFrame->IsKindOf( RUNTIME_CLASS( CMiniFrameWnd ) ) )
{
pFrame = pFrame->GetParentFrame();
ASSERT( pFrame != NULL );
ASSERT_VALID( pFrame );
ASSERT( ! pFrame->IsKindOf( RUNTIME_CLASS( CMiniFrameWnd ) ) );
}
VERIFY( _FrameEnableDockingImpl( pFrame ) );
}
}
break;
case WM_SHOWWINDOW:
case WM_SIZE:
m_bDelelayRepaintNcButtons = true;
break;
case WM_WINDOWPOSCHANGED:
{
CExtPopupMenuTipWnd * pATTW =
OnAdvancedPopupMenuTipWndGet();
if( pATTW != NULL )
pATTW->Hide();
#if (!defined __EXT_MFC_NO_CUSTOMIZE)
CExtCustomizeSite * pSite = NotifiedCustomizeSiteGet();
if( pSite != NULL )
pSite->OnBarStateChanged( this );
#endif
if( m_pDockBar == NULL && ( ! m_bPresubclassDialogMode ) )
break;
LPWINDOWPOS lpWindowPos =
reinterpret_cast < LPWINDOWPOS > (lParam);
ASSERT( lpWindowPos != NULL );
if( ! IsFixedMode() )
_UpdateVisibilityInChain();
CExtControlBar * pBar = this;
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
CExtDynTabControlBar * pTabBar = _GetNearestTabbedContainer();
if( pTabBar != NULL && pTabBar != this )
pBar = pTabBar;
#endif
pBar->m_bDelelayRepaintNcButtons = true;
pBar->PostMessage( WM_NCPAINT );
if( ( lpWindowPos->flags & SWP_FRAMECHANGED ) == 0 )
_RecalcNcArea();
break;
}
case WM_WINDOWPOSCHANGING:
{
m_bDelelayRepaintNcButtons = true;
if( m_pDockBar == NULL && ( ! m_bPresubclassDialogMode ) )
break;
LPWINDOWPOS lpWindowPos =
reinterpret_cast < LPWINDOWPOS > (lParam);
ASSERT( lpWindowPos != NULL );
lpWindowPos->flags |= SWP_FRAMECHANGED;
break;
}
case WM_SETTEXT:
{
m_bDelelayRepaintNcButtons = true;
LRESULT lResult = CControlBar::WindowProc(message, wParam, lParam);
if( (! IsFixedMode() )
&& (! IsKindOf( RUNTIME_CLASS( CExtDynControlBar ) ) )
)
{
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
if( AutoHideModeGet() )
{
CExtDynAutoHideArea * pTabs =
CExtDynAutoHideArea::stat_FindAreaOfBar( this );
if( pTabs != NULL )
{
ASSERT_VALID( pTabs );
pTabs->UpdateTabWnd();
CExtDynAutoHideSlider * pAutoHideSlider =
pTabs->GetAutoHideSlider();
if( pAutoHideSlider->GetSafeHwnd() != NULL
&& ( pAutoHideSlider->GetStyle() & WS_VISIBLE ) != 0
)
pAutoHideSlider->SendMessage( WM_NCPAINT );
}
}
else
#endif
if( IsVisible() )
{
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
CWnd * pWnd = GetParent();
bool bRecalcThisNcArea = true;
if( pWnd != NULL
&& pWnd->IsKindOf( RUNTIME_CLASS( CExtDockDynTabBar ) )
)
{
ASSERT_VALID( pWnd );
pWnd = pWnd->GetParent();
ASSERT_VALID( pWnd );
CExtDynTabControlBar * pTabBar =
DYNAMIC_DOWNCAST(
CExtDynTabControlBar,
pWnd
);
if( pTabBar != NULL )
{
pTabBar->InvalidateSwitcher();
CFrameWnd * pFrame = pTabBar->GetParentFrame();
ASSERT_VALID( pFrame );
pFrame->DelayRecalcLayout();
pFrame->PostMessage( WM_NULL );
LONG nSelIdx = pTabBar->GetSwitcherSelection();
if( nSelIdx >= 0 )
{
CExtControlBar * pBarTest = pTabBar->GetBarAt( nSelIdx, true );
if( pBarTest == this )
{
CString strText;
GetWindowText( strText );
pTabBar->SetWindowText( strText );
}
}
((CExtControlBar*)pTabBar)->_RecalcNcArea();
bRecalcThisNcArea = false;
}
}
if( bRecalcThisNcArea )
#endif
_RecalcNcArea();
}
}
return lResult;
}
}
return CControlBar::WindowProc(message, wParam, lParam);
}
|
|
Neville Franks
|
Oct 27, 2006 - 1:45 AM
|
Well I haven’t checked the Windows Guidelines, but I hope you aren’t right.
IE6 disables the Menu when it isn’t active. MS Visual Studio 6 and MS Word 2000 work as I suggested, when not active. Skype disables the Menu and doesn’t show tooltips. It does highlight buttons.
So it seems different apps behave differently. Personally I feel that if they aren’t active, the UI shouldn’t do anything on mouse over.
Neville, http://www.surfulater.com
|
|
Suhai Gyorgy
|
Oct 27, 2006 - 1:34 AM
|
Even Internet Explorer works this way, except for the tooltips. So I guess it’s Windows behaviour.
|
|
Neville Franks
|
Oct 26, 2006 - 8:21 PM
|
1) When you drag & drop a tab the mouse cursor should change to a drag & drop cursor.
2) Drag & drop with CSGTabMdiOneNoteWnd and variable width tabs is quite difficult to use as the mouse cursor isn’t necessarily on the Tab being dragged. This happens when you drag a narrow tab over a wider tab. Also the highlighted (dark border) Tab changes as you drag. It is all very confusing to the user. A better implementation might be to change the mouse cursor to an image of the tab being dragged with an I insertion point. IE 7 works a bit like this, but doesn’t include an image of the tab.
3) I’d like to see an option to include a [x] close image on Tabs. I especially like the way IE7 works in that only the current Tab has an [x]. This saves space and has the advantage of making the current Tab easier to identify.
|
|
Technical Support
|
Oct 27, 2006 - 9:27 AM
|
1) The behavior is absolutely the same as in the Microsoft Visual Studio .NET. You can create a CExtTabWnd -derived class and handle the WM_SETCURSOR message yourself. When the m_bDragging property is true, the tab is being dragged and you can change the mouse cursor. 2) We can regard this as a feature request.
3) This feature is already in our To-Do list.
|
|
Brett Cook
|
Oct 26, 2006 - 8:13 PM
|
Tech Support,
I have a rendering application that is updating the main CView on a fast timer. When my dialogs come out of autohide, my CView is painting over them so that they are not visible. Is there a way to get the autohide dialogs to show up without resizing the CView?
Thanks Brett
|
|
Technical Support
|
Oct 27, 2006 - 9:36 AM
|
We can guess your application is SDI. Please ensure the child view window is created with the WS_CLIPSIBLINGS window style. You can add this style in the
CChildView::PreCreateWindow() method. This style is essential for the auto hide feature.
|
|
Brett Cook
|
Oct 27, 2006 - 11:21 AM
|
Once again, you guys are good! Thanks much =).
|
|
Brett Cook
|
Oct 26, 2006 - 2:59 PM
|
Hello Tech Support,
I am wondering if it is possible to arrange controls in a CExtResizableDialog based on whether the dialog is docked at the top/bottom or at the left/right. So if the dialog is docked at the left/right, I’d like to arrange the controls in a vertical manner, whereas if the dialog is docked at the top/bottom, I’d like to arrange the controls in a horizontal manner.
Do you know if this kind of functionality is possible?
Thanks Brett
|
|
Suhai Gyorgy
|
Oct 27, 2006 - 1:43 AM
|
In Prof-UIS there’s no built-in feature like that, as long as I know. But you can code it, handling WM_SIZE message and calling MoveWindow for every control with parameters based on values you get from GetClientRect ( resulting rect’s "right" and "bottom" members having width and height of your resizable dialog)
|
|
Brett Cook
|
Oct 27, 2006 - 11:20 AM
|
Thank you. I will try out something like as you describe. I wonder if re-anchoring the controls will work inside the WM_SIZE handler?
|
|
Technical Support
|
Oct 30, 2006 - 6:09 AM
|
The CExtWA template class moves anchored windows when it receives the WM_SIZE standard Windows message. You need to handle only this message if you want to implement your own layout manager.
|
|
David Skok
|
Oct 26, 2006 - 12:35 PM
|
I have a ReportGrid inside of a resizable formview which is displayed in a MDI frame wnd. Views of this sort are always maximized when instantiated. I set anchoring for the ReportGrid as follows:
AddAnchor( IDC_CUSTOM1, __RDA_LT, __RDA_LB );
If I resize the formview the ReportGrid resizes to the proper proportions however scrollbars in the ReportGrid never display when data is hidden in the now smaller ReportGrid.
What do I need to do to show scrollbars in the ReportGrid automatically when resizable Formview is resized?
Thanks
|
|
Technical Support
|
Oct 27, 2006 - 6:13 AM
|
If you do not need the default scrolling feature of the CFormView class, just use a simple child dialog instead. If you need anchoring and scrolling at the same time depending on the view window’s size, you should not use the form view window either, because it is not compatible with anchoring.
You can download this project demonstrating how to create and use a scrollable container window compatible with anchoring. You could simply use a CExtScrollContainerWnd window as a child of the CView window. Or you could use the a CExtScrollContainerWnd window instead of any CView -based window if you don’t need the MFC’s document/view architecture.
|
|
Suhai Gyorgy
|
Oct 27, 2006 - 1:28 AM
|
Catch the WM_SIZE message and update scrollbars in it: void CChildView::OnSize(UINT nType, int cx, int cy)
{
CFormView::OnSize(nType, cx, cy);
m_reportGridWnd.OnSwUpdateScrollBars();
m_reportGridWnd.OnSwDoRedraw();
}
|
|
Eddie Judson
|
Oct 26, 2006 - 8:00 AM
|
Hi, I have a class derived from a CExtTreeGridWnd that has a listing of fields in it. Can you point me in the right direction for implementing drag and drop functionality much like how your FormEditor sample can drag and drop from the CExtToolBoxWnd to the form editor? Regards, Eddie
|
|
Technical Support
|
Oct 27, 2006 - 5:22 AM
|
We have added a FAQ that outlines how to implement drag-and-drop for any grid including CExtTreeGridWnd . Please note that you can convert plain row numbers of the CExtGridWnd class into HTREEITEM tree row handles of the CExtTreeGridWnd class using the CExtTreeGridWnd::ItemGetByVisibleRowIndex() and CExtTreeGridWnd::ItemGetVisibleIndexOf() methods.
|
|
Ed Kennedy
|
Oct 25, 2006 - 8:12 PM
|
What editor did you use to create the bitmaps?
|
|
Technical Support
|
Oct 26, 2006 - 5:48 AM
|
We would recommend using device independent bitmaps (DIB) in resources of any toolbar including the ribbon bar. You can produce such a bitmap using the MSPaint or Visual Studio’s resource editor. Many advanced graphics editors like Adobe PhotoShop produce bitmaps in non-DIB formats and Prof-UIS may load these bitmaps incorrectly. So you could create a new bitmap in MSPaint, paste an existing bitmap created in another editor and finally override the existing toolbar’s BMP file.
|
|
Eric Houvenaghel
|
Oct 25, 2006 - 2:45 PM
|
Hello
Is there a built in functionality in CExtReprotGridWnd that puts a column back to where it was when it is being reactivated? If not, what is the best way to implement this functionality?
|
|
Technical Support
|
Oct 26, 2006 - 12:30 PM
|
If you mean whether it is possible to hide a column and then return it back at the same position, the answer is yes if all the other columns do not change their positions (i.e. the user cannot hide or change their positions). Otherwise it is hardly possible, because the user can always change positions of active columns so the previous position would have no sense.
|
|
Seth Strong
|
Oct 25, 2006 - 2:03 PM
|
I made a Prof-UIS project using the window. I also let it make me a control bar with a resizable dialog. When using the context menu or the matching View menu, I can check or uncheck the toolbar to have it show or hide respectively. What’s the trick to having the control bar respond the same way so that in the context menu, the control bar has a check by its name, and if there is no check, the control bar is hidden?
Thanks, Seth
|
|
Seth Strong
|
Oct 26, 2006 - 11:21 AM
|
|
|
Technical Support
|
Oct 26, 2006 - 10:04 AM
|
You can show the checked/unchecked state for any control bar only if you are not using the auto hide feature. You should have the CMainFrame::OnUpdateControlBarMenu() and CMainFrame::OnBarCheck() methods implemented in the following way: void CMainFrame::OnUpdateControlBarMenu(CCmdUI* pCmdUI)
{
CExtControlBar::DoFrameBarCheckUpdate( this, pCmdUI, true );
}
BOOL CMainFrame::OnBarCheck(UINT nID)
{
return CExtControlBar::DoFrameBarCheckCmd( this, nID, true );
} Please note that the last parameters both in the CExtControlBar::DoFrameBarCheckUpdate() and CExtControlBar::DoFrameBarCheckCmd() methods are set to true . The SDI sample demonstrates how this works.
|
|
Andreas Werner
|
Oct 25, 2006 - 9:50 AM
|
Hallo,
first of all thank you Suhai Gyorgy for your help yesterday with the CExtControlBar. Now I have my list and my property grid displayed correctly in the window of the control bar.
I have problems with the memory allocation of CExtpropertyStore. I have a class that derives from CExtResizableDialog. This dialog contains my property grid with its property store. My first approach was the following. I declared the property store and the items as members of the dialog.
CDialog2.h: CExtPropertyStore m_PS; CExtPropertyCategory m_Category Etc ā¦
In the OnInitDialog Method of the CDialog2 class I add the items to the property store.
m_PS.NameSet(_T("PS Name")); m_Category.NameSet (_T("Category Name") ); m_Category.DescriptionSet( _T("Category Description") ); VERIFY( m_PS.ItemInsert( &m_Category ) ); Etc ā¦
In the destructor of the CDialog2 class I invoke:
m_PS.ItemRemove();
When I stop the application I get an access violatioan: HEAP[FullScreenState-ynd.exe]: Invalid Address specified to RtlValidateHeap( 00330000, 00338EDC ) A call of the ItemRemove methode on the property store
My second approach was to use only pointer variables and to call the Delete method of property store in the destructor of the CDialog2 class.
CDialog2.h: CExtPropertyStore m_pPS; CExtPropertyCategory m_pCategory Etc ā¦
In the OnInitDialog Method of the CDialog2 class I instantiate the property store and the items and add the items to the property store.
m_pPS = new CExtPropertyStore (); m_pPS->NameSet(_T("PS Name")); CExtPropertyCategory m_pCategory = new CExtPropertyCategory (); m_pCategory->NameSet (_T("Category Name") ); m_pCategory->DescriptionSet( _T("Category Description") ); VERIFY( m_PS->ItemInsert( m_pCategory ) ); Etc ā¦
In the destructor of the CDialog2 class I invoke: m_pPS->Delete();
Now the application terminates without memory access violation.
By the way, I still use the FullScreenState example as template. The instance of the CDialog2 I use is a member of the CMainFrame class of that example. I connect the dialog to the control bar in the OnCreate methode of the CMainFrame class.
My question is: How can I use a property store as member field? How can free the memory correctly if I use a property store object as a member field?
With best regards Andreas
|
|
Technical Support
|
Oct 26, 2006 - 5:34 AM
|
Please use property categories and values and dynamically allocated with C++ new operator objects only. The CExtPropertyCategory and CExtPropertyValue objects will be deleted automatically with C++ delete operator when the parent objects are deleted. The CExtPropertyGridCtrl window only uses the assigned CExtPropertyStore object and never deletes it. So if you are using the property store as CExtPropertyStore -based member of some class, then you should not delete anything.
|
|
Emmanuel Verguet
|
Oct 25, 2006 - 9:07 AM
|
Hello,
What is the best way for having an AfxMessageBox which could have the same look’n’feel than a CExtNCW<CExtResizableDialog> with CExtPaintManagerOffice2007_R2_LunaBlue theme ?
Thanks.
|
|
Technical Support
|
Oct 26, 2006 - 5:59 AM
|
You can only replace the message box with a custom dialog created in scope of your application. Currently we do not hook any standard windows and do not repaint their parts. You can see the same in Microsoft applications
|
|
Suhai Gyorgy
|
Oct 25, 2006 - 8:14 AM
|
I have a combobox in my toolbar. I want to find out when a user changed selection in it. Is the only way for that to make a CExtComboBox-derived class and override SetCurSel and OnReflectCbnSelEndOK methods as it is done in GLViews sample?
Thank you!
|
|
Technical Support
|
Oct 25, 2006 - 11:41 AM
|
There are two ways: 1) Message handling. You can handle combo box notification messages in its parent window. It may be not convenient to code your own toolbar class for that. 2) Message reflection. You can handle combo box messages in a CExtComboBox -derived class.
The second approach seems to be preferable.
|
|
Neville Franks
|
Oct 25, 2006 - 2:26 AM
|
Hi, I’ve been trying for hours to get a Combobox to display in a Toolbar, but all I see is the button image, not the combobox. Here is the code:
// .rc
ID_VIEW_UI_LOOK_BAR TOOLBAR MOVEABLE PURE 16, 16 BEGIN BUTTON ID_VIEW_LIKE_STUDIO_2005 BUTTON ID_VIEW_LIKE_OFFICE_2003 BUTTON ID_VIEW_LIKE_OFFICE_XP BUTTON ID_VIEW_LIKE_OFFICE_2K BUTTON ID_SearchComboUnicode END
// .h #define ID_SearchComboUnicode 20206
CExtComboBox m_wndComboSearch;
// .cpp if ( !m_wndToolBarUiLook.Create( NULL, this, ID_VIEW_UI_LOOK_BAR ) || !m_wndToolBarUiLook.LoadToolBar( ID_VIEW_UI_LOOK_BAR ) ) { TRACE( "Failed to create UI Look Toolbar\n" ); return -1; // fail to create }
if ( !m_wndComboSearch.Create( WS_CHILD|WS_VISIBLE|CBS_HASSTRINGS|CBS_DROPDOWN, CRect(0,0,140,200), &m_wndToolBarUiLook, ID_SearchComboUnicode ) ) { TRACE( "Failed to create m_wndComboSearch\n" ); ASSERT( FALSE ); return -1; // fail to create }
VERIFY( m_wndToolBarUiLook.SetButtonCtrl( m_wndToolBarUiLook.CommandToIndex( ID_SearchComboUnicode ), &m_wndComboSearch ) ); m_wndComboSearch.SetFont( CFont::FromHandle( (HFONT)::GetStockObject(DEFAULT_GUI_FONT) ) ); m_wndComboSearch.SetItemHeight( -1, m_wndComboSearch.GetItemHeight(-1) - 1 ); m_wndComboSearch.AddString( _T("Sample Car 1") );
I’ve looked over the ProfStudio sample code and can’t see any difference between that and what I’m doing.
Neville, http://www.surfulater.com
|
|
Neville Franks
|
Oct 25, 2006 - 2:45 PM
|
I would like to use a combobox and use the customization system.
Is there any way to tell the customization system to ignore a specific toolbar or ignore a specific command (ID) so I can use a combobox?
Also am I correct in assuming that we can’t use any of our own controls on a toolbar if it is customizable?
|
|
Technical Support
|
Oct 27, 2006 - 6:00 AM
|
You can disable customization of a particular toolbar by setting its CExtToolControlBar::m_bCustomizationAllowed property to false. If you want to do the same for a particular toolbar button, you should override two methods:
1) CExtCustomizeSite::OnCustomizeCmdTreeNode() , which disables the button’s context menu when the Customize dialog is open; 2) CExtCustomizeSite::DoDragCmdNode() , which suppresses drag-and-drop for this command item.
You can have any control in the toolbar by attaching this control to a toolbar button. For customizable applications, you should attach this control after the customize site has already been initialized in the frame window. But please note, such a control will never appear in menus (including toolbar’s chevron menu) nor it can be drag-and-dropped during customization (it handles mouse clicks in its own manner).
|
|
Neville Franks
|
Oct 25, 2006 - 5:58 AM
|
I also should have mentioned I tried adding the Combobox to two different toolbars with the same result.
|
|
Neville Franks
|
Oct 25, 2006 - 5:49 AM
|
Suhai, thanks but I don’t use CExtThemeSwitcherToolControlBar.
One difference between the ProfStudio sample and my app is that I use the Prof-UIS Customization Subsystem CExtCustomizeSite and I’m wondering if that stops you from using your own controls on Toolbars. If so that seems like a fairly major limitation.
|
|
Suhai Gyorgy
|
Oct 25, 2006 - 6:43 AM
|
I’ve just tried it. It works for me just fine and I’m not using Customization Subsystem. So it should be something else. I’m using ProfUIS v2.55, Static Unicode Debug and Studio2005 PaintManager with VS7.1, WinXP. I have no idea how this could help you, but I don’t have any more guesses now. But at least you can eliminate Customization as possible cause.
|
|
Technical Support
|
Oct 25, 2006 - 11:38 AM
|
There are two rules that can be applied to combo box windows in toolbars: 1) If you have a customizable toolbar, do not use a combo box window inside. Just use built-in combo fields instead. 2) If you have a non-customizable toolbar, you can attach a combo box window (created as a child of the toolbar window) to a toolbar button.
Such combo box(es) should cause any problems.
|
|
Suhai Gyorgy
|
Oct 25, 2006 - 3:30 AM
|
Just a guess: if your m_wndToolBarUiLook variable is that of CExtThemeSwitcherToolControlBar class then the initialization is different and that might prevent that particular toolbar to have any extra buttons or controls in it. Try making another toolbar and add the combobox in that one.
|
|
Anna Kraus
|
Oct 24, 2006 - 11:09 AM
|
I am trying to display a tooltip while the mouse is being moved with the button pressed. I am using CExtPopupMenuTipWnd. The tooltip is displayed if the mouse button is not pressed but does not get displayed if the mouse button is pressed. Is this as designed? Is there a way to display the tooltip if the mouse button is pressed?
I have downloaded the testCoolTipInMdi sample and I have noticed that the tooltip isn’t displayed as well if the mouse button is pressed.
|
|
Technical Support
|
Oct 25, 2006 - 10:53 AM
|
This is the default behavior of tooltips. If you want to show a tooltip when the mouse button is pressed, a custom tooltip window has to be coded.
|
|
Andreas Werner
|
Oct 24, 2006 - 2:30 AM
|
Hallo,
I have created a dialog resource with graphical tool in Visual Studio. The dialog contains two list boxes. I have changed the source files, that have been created in VS in the following way:
First the header file:
#if !defined(AFX_DIALOG1_H__C8B9C3A0_46A7_408E_8092_33EC22F40DB7__INCLUDED_) #define AFX_DIALOG1_H__C8B9C3A0_46A7_408E_8092_33EC22F40DB7__INCLUDED_
#if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Dialog1.h : Header-Datei //
///////////////////////////////////////////////////////////////////////////// // Dialogfeld CDialog1
class CDialog1 : public CExtResizableDialog { // Konstruktion public: CDialog1(CWnd* pParent = NULL); // Standardkonstruktor
// Dialogfelddaten //{{AFX_DATA(CDialog1) enum { IDD = IDD_DIALOG1 }; //}}AFX_DATA
// Überschreibungen // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen //{{AFX_VIRTUAL(CDialog1) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV-Unterstützung //}}AFX_VIRTUAL
// Implementierung
protected:
// Generierte Nachrichtenzuordnungsfunktionen //{{AFX_MSG(CDialog1) virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() };
//{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein.
#endif // AFX_DIALOG1_H__C8B9C3A0_46A7_408E_8092_33EC22F40DB7__INCLUDED_
Second the cpp file:
// Dialog1.cpp: Implementierungsdatei //
#include "stdafx.h" #include "fullscreenstate.h" #include "Dialog1.h"
#ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif
///////////////////////////////////////////////////////////////////////////// // Dialogfeld CDialog1
CDialog1::CDialog1(CWnd* pParent /*=NULL*/) : CExtResizableDialog(CDialog1::IDD, pParent) { //{{AFX_DATA_INIT(CDialog1) //}}AFX_DATA_INIT }
void CDialog1::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDialog1) //}}AFX_DATA_MAP }
BEGIN_MESSAGE_MAP(CDialog1, CDialog) //{{AFX_MSG_MAP(CDialog1) //}}AFX_MSG_MAP END_MESSAGE_MAP()
///////////////////////////////////////////////////////////////////////////// // Behandlungsroutinen für Nachrichten CDialog1
BOOL CDialog1::OnInitDialog() { CExtResizableDialog::OnInitDialog(); AddAnchor(IDC_LIST1, CPoint(0,0), CPoint(200,200)); AddAnchor(IDC_LIST2, CPoint(0,200), CPoint(100,100));
// TODO: Zusätzliche Initialisierung hier einfügen return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben }
In the FullScreenState example I have added the following code to the OnCreate method of the main frame:
CDialog1* pDlg = new CDialog1 (); if( !pDlg->Create(IDD_DIALOG1, &m_wndResizableBar0)) { TRACE0("Failed to create m_wndInBarDlg\n"); return -1; }
When I run the application I can see in the debugger, that the OnInitDialog method gets invoked by the framework, but the list boxes in the window of the dialog do not appear in the window of the CExtControlBar instance m_wndResizableBar0. It seems that dialog is not connected correctly to its parent window.
|
|
Suhai Gyorgy
|
Oct 24, 2006 - 5:05 AM
|
Most probably the problem is with style you set for your dialog. It has to have these style (in addition to those you want to set): WS_CHILD | WS_CLIPCHILDREN | NOT WS_BORDER Probably you also want to set WS_VISIBLE style.
If it is still not working, try adding a CDialog1 variable to your MainFrame class and use that instead of a CDialog pointer inside your OnCreate only. You can check how it’s done in the ProfStudio sample.
And maybe reading this FAQ can help you as well.
|
|
Andreas Werner
|
Oct 24, 2006 - 7:37 AM
|
Hallo and thank you for your help!
The dialog now appears with the right style settings. Now I have changed the implementation of the OnInitDialog method. Now I create a class that is derived form CExtPropertyGridCtrl and I put it onto the dialog on runtime. This works good. Using the constraints with AddAnchor the property grid changes its size properly. I have only one Problem. I want the property grid to have the same width as the dialog. Now I have 280 hard coded, as shown in the code below Can I determine the width and the hight of the dialog or of the dialogs parent?.
BOOL CDialog1::OnInitDialog() { CExtResizableDialog::OnInitDialog();
LPRECT lpRect; if( !m_PGC.Create(this, IDC_PROPERTY_GRID_CTRL, CRect(0,0,280,0) ) ) { TRACE0("Failed to create m_wndInBarColorPicker\n"); return -1; // fail to create } m_PGC.InitPropertyGrid(); AddAnchor(IDC_PROPERTY_GRID_CTRL, CPoint(0,0), CPoint(100,100)); // TODO: Zusätzliche Initialisierung hier einfügen return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben }
|
|
Suhai Gyorgy
|
Oct 24, 2006 - 7:59 AM
|
In this case I’d recommend you not to use a dialog, but rather have your PropertyGridCtrl be the child of the control bar, as it is done in the ProfStudio sample. But if you have any special reason why you want to use a dialog here, you can try this code modification, although I’m afraid it might not work in every case: BOOL CDialog1::OnInitDialog()
{
CExtResizableDialog::OnInitDialog();
CRect rectWnd;
GetClientRect(&rectWnd);
if( !m_PGC.Create(this,
IDC_PROPERTY_GRID_CTRL,
CRect(0, 0, rectWnd.Width, rectWnd.Height)
)
)
{
TRACE0("Failed to create m_wndInBarColorPicker\n");
return -1; // fail to create
}
...
}
|
|
Andreas Werner
|
Oct 24, 2006 - 8:20 AM
|
Thank you for Help,
the code works in my case. I need this because I am going to add another control to the dialog. Both controls shall use the full width of the dialog and share its height. Now as I can put one single control to the panel and calculate its size at runtime I am going to put the second control on it.
What problem may occur with code?
Is it possible to integrate a CExtPropertyGridCtrl or any other CExt...Ctrl into the graphical designer of Visual Studio? This way I could give the controls zero indents to the border of the dialog at design time?
|
|
Technical Support
|
Oct 26, 2006 - 5:18 AM
|
Chris is right, you can create the property grid as a custom control, which can be placed as you want in the dialog template at design time.
|
|
Suhai Gyorgy
|
Oct 24, 2006 - 8:44 AM
|
First I thought code might casue problem because dialog doesn’t have the right size when the OnInitDialog is called. But I realized that even though the dialog doesnt have the right size at that point, AddAnchor makes sure controls are resized when dialog is resized.
In Visual Studio you can use a custom control in design mode and give class name ProfUIS-PropertyGridCtrl , style 0x50010000 and extended style 0x0 to it. You can see how it’s done in PropertyGrid sample. For other controls... if the control is derived from one of the MFC controls, you can use those MFC controls at design time and in DoDataExchange just add variables of Prof-UIS classes to those control IDs. For other Prof-UIS controls: Try searching for that control in ProfUIS sample codes and see what custom control class they use there.
|
|
Technical Support
|
Oct 24, 2006 - 7:11 AM
|
In addition to what Chris wrote, we would like to ask you to check that the Visible flag for the dialog template is turned on.
|
|
Michael Valentine
|
Oct 24, 2006 - 1:55 AM
|
We are getting a strange problem on one of our machines when the application is maximised. The machine in question has 2 monitors:
Screen 1 (main monitor) 1920x1200 Screen 2 (2nd monitor) 1280x1024 (offset 1920x176)*
* The offset is adjusted via the NVidia display driver properties
The windows taskbar is also located down the left side of screen 1 (rather than the default bottom position)
The steps to reproduce:
1) Start app and close down in restore mode on Screen 1 2) Start app again and it will correctly open at the correct size and position it was when closed down 3) Maximise window here and it disappears off the screen 4) Drag window to screen 2 and maximise and it jumps back to screen 1 and maximises with a space left for the taskbar (but it’s on the wrong window)
Any ideas? Thanks.
|
|
Michael Valentine
|
Oct 24, 2006 - 3:03 AM
|
Sorry that should read:
Screen 2 (main monitor) 1920x1200 Screen 1 (2nd monitor) 1280x1024 (offset 1920x176)*
|
|
Technical Support
|
Oct 30, 2006 - 12:16 PM
|
Thank you for reporting the bug. We fixed it. Please download the latest source code from our FTP site.
|
|
Offer Har
|
Oct 23, 2006 - 5:11 PM
|
Hi,
Can it be that you forgot to change the version macro?
This is what i have after installing version 2.61 In ExtMfcDef.h
// __PROF_UIS_VERSION_DWORD is required for static library builds #define __PROF_UIS_VERSION_DWORD DWORD( 0x02060000 ) #define __PROF_UIS_VERSION 0x02060000
And in my trace window:
* * * INITIALIZING DYNAMIC LIBRARY: ProfUIS version 2.60 * * *
And the only dll loaded is this one:
’XXX.exe’: Loaded ’Z:\Applications\Bin\Debug\ProfUIS261md.dll’, Symbols loaded.
|
|
Technical Support
|
Oct 24, 2006 - 12:13 PM
|
Thank you for reporting the problem. We really missed this define. But this issue is not critical and you can manually fix it: // __PROF_UIS_VERSION_DWORD is required for static library builds
#define __PROF_UIS_VERSION_DWORD DWORD( 0x02060100 )
#define __PROF_UIS_VERSION 0x02060100
|