Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
John Ritzenthaler
|
May 18, 2009 - 5:38 PM
|
When right-clicking in an empty area of the toolbar, a menu appears listing the various toolbars. What determines the sequence of the entries in this toolbar?
|
|
Technical Support
|
May 19, 2009 - 1:29 PM
|
The bars inserted in the same order provided by the CExtControlBar::_GetFrameControlBars() method. It is defined by the CExtControlBar::g_AllBars array. The CExtControlBar::CExtControlBar() constructor adds all bars to this array and the CExtControlBar::~CExtControlBar() destructor removes each bar from it. So, the bars in the context menu appear in the order which defined by the order of C++ object instantiation. If you don’t like the context menu constructed by default , you can modify it or even rebuild from scratch like the ProfStudio sample application does it by handling the CExtControlBar::g_nMsgConstructPopupMenu registered message:
http://www.prof-uis.com/prof-uis/tech-support/faq/pop-up-menus.aspx#how-to-modify-or-suppress-entirely-built-in-pop-up-menus-available-in-prof-uis
|
|
tera tera
|
May 18, 2009 - 2:42 AM
|
|
|
Technical Support
|
May 19, 2009 - 1:21 AM
|
We analyzed your project. It opens a popup dialog (CPrtPreviewDlg ) with an empty grid window (CMuPrintGrid m_pGrid ) and Button1 button for invoking print preview mode. But we do not understand how the empty grid in the popup dialog interacts with the initialized grid in the child view? Do you want display the print preview of the child view grid in the popup dialog? If yes, then you should implement the CExtPPVW_Printable::OnGetPrintableWnd() virtual method in your child view grid (CDemoPrintGrid ) and return the parent window for the print preview window.
|
|
tera tera
|
May 18, 2009 - 2:42 AM
|
|
|
Technical Support
|
May 19, 2009 - 1:21 AM
|
We reviewed your project. It opens a popup dialog (CPrtPreviewDlg ) with an empty grid window (CMuPrintGrid m_pGrid ) and Button1 button for invoking print preview mode. But we do not understand how the empty grid in the popup dialog interacts with the initialized grid in the child view? Do you want display the print preview of the child view grid in the popup dialog? If yes, then you should implement the CExtPPVW_Printable::OnGetPrintableWnd() virtual method in your child view grid (CDemoPrintGrid ) and return the parent window for the print preview window.
|
|
tera tera
|
May 17, 2009 - 7:58 PM
|
Hello. (1), Please teach a method to draw the frame line of the button.
(2), I want to change the background of the button.
Thanks,
|
|
Technical Support
|
May 25, 2009 - 11:29 AM
|
We modified the following method for painting a custom border around button cells in the inner grid area only: void CNxL_MlGrid::OnGbwPaintCell(
CDC & dc,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
const RECT & rcCellExtra,
const RECT & rcCell,
const RECT & rcVisibleRange,
DWORD dwAreaFlags,
DWORD dwHelperPaintFlags
) const
{
//--note
// ĘtĘHĀ[ĘJĘXāĀŖāĆāĀ¬āĆāĆ Å½Ā©ĀgāĀŖĘtĘHĀ[ĘJĘXāĀ³āĆŖāĆāĀ¢āĆ©āĆāĀ¢āĀ¤ĘtĘā°ĘOāĆ°āĀ§āĆāĆ©
dwHelperPaintFlags |= __EGCPF_FOCUSED_CONTROL;
CExtGridWnd::OnGbwPaintCell( dc,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
rcCellExtra,
rcCell,
rcVisibleRange,
dwAreaFlags,
dwHelperPaintFlags
);
if( ( dwAreaFlags & __EGBWA_INNER_CELLS ) != 0 )
{ // if inner data cell
const CExtGridCell * pCell = GridCellGet( nColNo, nRowNo );
if( pCell != NULL && pCell->IsKindOf( RUNTIME_CLASS(CExtGridCellButton) ) )
{ // if button cell
COLORREF clr1tl = RGB(192,0,0), clr1rb = RGB(128,0,0);
CRect rc = rcCell;
dc.Draw3dRect( &rc, clr1tl, clr1rb );
rc.DeflateRect( 1, 1 );
COLORREF clr2tl = RGB(255,0,0), clr2rb = RGB(144,0,0);
dc.Draw3dRect( &rc, clr2tl, clr2rb );
} // if button cell
} // if inner data cell
} Is that what you need?
|
|
tera tera
|
May 25, 2009 - 7:19 PM
|
Hello First of all,
Because a line can draw, it is OK.
Why cannot a line actually draw with this sample?
I asked you a question. Thanks,
|
|
Technical Support
|
May 26, 2009 - 11:40 AM
|
Please let us know more details about your task. Which lines exactly do you need?
Your screen shots displaying default looking button cells. Do you need to customize the look of button?
|
|
Technical Support
|
May 19, 2009 - 1:20 AM
|
The push button is painted in the CExtGridCell::OnPaintButton() virtual method. This method paints the button using the CExtPaintManger::Grid_PaintButton() method. The button’s look depend on which paint manager is used. But generally there are no fill color and button color based rules for button painting. The skin, native XP and Office 2007 paint manager are using bitmap based button shapes. So, you should implement the CExtGridCell::OnPaintButton() virtual method and completely repaint the button if you need some frame around it and some preferred button color.
|
|
tera tera
|
May 25, 2009 - 3:25 AM
|
|
|
tera tera
|
May 17, 2009 - 7:53 PM
|
Hello. When I push the cell button and execute RowRemoveAll of own.
Assert appears.
I am troubled.
Please teach measures method. http://ifreeta.dee.cc/20090518/SampleMuGrid200904.lzh bool CNxL_MlGrid::OnGridCellButtonPressed(
CExtGridCell & _cell,
INT nButtonType,
const RECT & rcCellExtra,
const RECT & rcCell,
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType
)
{ RowRemoveAll(); return true;
}
|
|
Technical Support
|
May 19, 2009 - 1:18 AM
|
Thank you for reporting this issue. To fix it, please update the source code for the following method:
bool CExtGridWnd::OnGridTrackCellButton(
CExtGridCell * pCell,
const CExtGridHitTestInfo & htInfo
)
{
ASSERT_VALID( this );
ASSERT_VALID( pCell );
ASSERT( (htInfo.m_dwAreaFlags&__EGBWA_CELL_BUTTON) != 0 );
ASSERT( htInfo.m_nButtonType >= 0 );
static CExtGridCell * g_pTrackCell = NULL;
if( g_pTrackCell != NULL )
return false;
if( htInfo.m_rcPart.left >= htInfo.m_rcPart.right
|| htInfo.m_rcPart.top >= htInfo.m_rcPart.bottom
)
return false;
bool bEnabled = false;
bool bStayPressed = false;
UINT nTimerElapseValue = 0;
if( ! pCell->OnQueryButtonInfo(
htInfo.m_nButtonType,
this,
htInfo.m_nColNo,
htInfo.m_nRowNo,
htInfo.GetInnerOuterTypeOfColumn(),
htInfo.GetInnerOuterTypeOfRow(),
&bEnabled,
NULL,
&bStayPressed,
&nTimerElapseValue
)
)
return false;
if( ! bEnabled )
return false;
g_pTrackCell = pCell;
g_pTrackCell->OnChangeButtonPressedState(
htInfo.m_nButtonType,
true
);
InvalidateRect( &htInfo.m_rcPart );
ULONG nPressedTimerCounter = 0L;
if( nTimerElapseValue > 0 )
SetTimer( m_nTimerIdPressedButton, nTimerElapseValue, NULL );
HWND hWndGrid = m_hWnd;
CExtMouseCaptureSink::SetCapture( hWndGrid );
bool bStopFlag = false;
bool bPressedEvent = false;
bool bMouseInsideButton = true;
for( MSG msg;
::IsWindow( hWndGrid )
&& (!bStopFlag)
&& (g_pTrackCell != NULL)
;
)
{ // main message loop
if( ! ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
{
if( ( ! ::IsWindow( hWndGrid ) )
|| bStopFlag
|| g_pTrackCell == NULL
)
break;
if( CExtGridWnd::g_bEnableOnIdleCalls )
{
for( LONG nIdleCounter = 0L;
::AfxGetThread()->OnIdle(nIdleCounter);
nIdleCounter ++
);
}
::WaitMessage();
continue;
} // if( ! ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
switch( msg.message )
{
case WM_KILLFOCUS:
if( msg.hwnd == hWndGrid )
bStopFlag = true;
break;
case WM_CANCELMODE:
case WM_ACTIVATEAPP:
case WM_SYSCOMMAND:
case WM_SETTINGCHANGE:
case WM_SYSCOLORCHANGE:
bStopFlag = true;
break;
case WM_COMMAND:
if( (HIWORD(msg.wParam)) == 0
|| (HIWORD(msg.wParam)) == 1
)
bStopFlag = true;
break;
case WM_CAPTURECHANGED:
if( (HWND)msg.wParam != hWndGrid )
bStopFlag = true;
break;
case WM_TIMER:
if( msg.hwnd == hWndGrid
&& UINT(msg.wParam) == m_nTimerIdPressedButton
)
{ // if pressed button timer event
ASSERT_VALID( this );
ASSERT_VALID( g_pTrackCell );
::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
g_pTrackCell->OnButtonPressing(
*this,
htInfo.m_nButtonType,
bMouseInsideButton,
nPressedTimerCounter,
htInfo.m_rcPart,
htInfo.m_rcExtra,
htInfo.m_rcItem,
htInfo.m_nColNo,
htInfo.m_nRowNo,
htInfo.GetInnerOuterTypeOfColumn(),
htInfo.GetInnerOuterTypeOfRow()
);
nPressedTimerCounter ++;
continue;
} // if pressed button timer event
break;
case WM_MOUSEWHEEL:
if( msg.hwnd != hWndGrid )
bStopFlag = true;
else
{
::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
continue;
} // else from if( msg.hwnd != hWndGrid )
break;
case WM_MOUSEMOVE:
if( msg.hwnd != hWndGrid )
bStopFlag = true;
else
{
ASSERT_VALID( this );
ASSERT_VALID( g_pTrackCell );
::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
CPoint point;
point = DWORD( msg.lParam );
bool bInside =
htInfo.m_rcPart.PtInRect(point) ? true : false;
if( bMouseInsideButton != bInside )
{
bMouseInsideButton = bInside;
g_pTrackCell->OnChangeButtonPressedState(
htInfo.m_nButtonType,
bMouseInsideButton
);
InvalidateRect( &htInfo.m_rcPart );
} // if( bMouseInsideButton != bInside )
continue;
} // else from if( msg.hwnd != hWndGrid )
break;
case WM_LBUTTONUP:
bStopFlag = true;
if( msg.hwnd == hWndGrid )
{
ASSERT_VALID( this );
ASSERT_VALID( g_pTrackCell );
CPoint point;
point = DWORD( msg.lParam );
if( htInfo.m_rcPart.PtInRect(point) )
{
bPressedEvent = true;
if( bMouseInsideButton != bPressedEvent )
{
bMouseInsideButton = bPressedEvent;
if( ( ! bMouseInsideButton )
&& nTimerElapseValue > 0
)
{
KillTimer( m_nTimerIdPressedButton );
nPressedTimerCounter = 0L;
}
g_pTrackCell->OnChangeButtonPressedState(
htInfo.m_nButtonType,
bMouseInsideButton
);
InvalidateRect( &htInfo.m_rcPart );
} // if( bMouseInsideButton != bPressedEvent )
} // if( htInfo.m_rcPart.PtInRect(point) )
::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
} // if( msg.hwnd == hWndGrid )
break;
case WM_LBUTTONDBLCLK:
case WM_LBUTTONDOWN:
case WM_RBUTTONUP:
case WM_RBUTTONDBLCLK:
case WM_RBUTTONDOWN:
case WM_MBUTTONUP:
case WM_MBUTTONDBLCLK:
case WM_MBUTTONDOWN:
case WM_CONTEXTMENU:
case WM_NCLBUTTONUP:
case WM_NCLBUTTONDBLCLK:
case WM_NCLBUTTONDOWN:
case WM_NCRBUTTONUP:
case WM_NCRBUTTONDBLCLK:
case WM_NCRBUTTONDOWN:
case WM_NCMBUTTONUP:
case WM_NCMBUTTONDBLCLK:
case WM_NCMBUTTONDOWN:
bStopFlag = true;
break;
default:
if( WM_KEYFIRST <= msg.message
&& msg.message <= WM_KEYLAST
)
bStopFlag = true;
break;
} // switch( msg.message )
if( bStopFlag )
break;
if( ! ::AfxGetThread() -> PumpMessage() )
break;
} // message loop
g_pTrackCell = NULL;
if( ! ::IsWindow( hWndGrid ) )
return true;
KillTimer( m_nTimerIdPressedButton );
if( nTimerElapseValue > 0 )
{
nPressedTimerCounter = 0L;
}
if( CExtMouseCaptureSink::GetCapture() == hWndGrid )
CExtMouseCaptureSink::ReleaseCapture();
ASSERT( CWnd::FromHandlePermanent(hWndGrid) == this );
ASSERT_VALID( this );
ASSERT_VALID( pCell );
if( bPressedEvent )
{
if( (!bStayPressed) && bMouseInsideButton )
{
bMouseInsideButton = false;
pCell->OnChangeButtonPressedState(
htInfo.m_nButtonType,
false
);
} // if( (!bStayPressed) && bMouseInsideButton )
INT nColType = htInfo.GetInnerOuterTypeOfColumn(), nRowType = htInfo.GetInnerOuterTypeOfRow();
pCell->OnButtonPressed(
*this, htInfo.m_nButtonType, htInfo.m_rcExtra, htInfo.m_rcItem,
htInfo.m_nVisibleColNo, htInfo.m_nVisibleRowNo, htInfo.m_nColNo, htInfo.m_nRowNo, nColType, nRowType
);
CExtGridCell * pCellTest = GridCellGet( htInfo.m_nColNo, htInfo.m_nRowNo, nColType, nRowType, NULL, false, false );
if( LPVOID(pCellTest) != LPVOID(pCell) )
return true;
} // if( bPressedEvent )
if( bMouseInsideButton )
pCell->OnChangeButtonPressedState(
htInfo.m_nButtonType,
false
);
InvalidateRect( &htInfo.m_rcPart );
return true;
}
|
|
tera tera
|
May 14, 2009 - 8:06 PM
|
|
|
Technical Support
|
May 15, 2009 - 4:50 AM
|
We tried to reproduce this issue but failed. We would like to ask you to let us connect to your desktop and debug this project on it.
|
|
tera tera
|
May 22, 2009 - 3:39 AM
|
Hello. I describe a reproduction method in detail. (1), You move the following menus. (2), You add an accelerator key. (3), You choose the following menus. ( MenuRebuild works. ) (4), You move the following menus. (5), You choose a Quick accelerator key menu.
|
|
Technical Support
|
May 23, 2009 - 11:47 AM
|
We would like to ask you to let us connect to your desktop and debug this issue.
|
|
Offer Har
|
May 12, 2009 - 12:01 PM
|
Dear Support, We have the following scenario in an CExtTreeGrid : 1. Add two nodes to a tree under root 2. Add a third node to the tree 3. Move the first two nodes under the third node using ItemCopyMove . 4. Try to call CExtTreeGridCellNode::ItemGetChildCount on the first two nodes - CRASH!, the crash is in CExtTreeGridCellNode::FromHTREEITEM , in the line:
ASSERT_KINDOF( CExtTreeGridCellNode, pCell ); I am sending you now an application to reproduce this bug. Please attent to it as soon as possible, because we need it urgently! The same code worked fine under 2.83 Thanks, Ron.
|
|
Technical Support
|
May 14, 2009 - 12:46 PM
|
There are no problems with Prof-UIS. The CExtTreeGridWnd::ItemCopyMove() method inserts cloned copies of tree rows or even tree branches. So, the CComboProblemDlg::OnClick3() method in the test project you sent us should renew the item handles: void CComboProblemDlg::OnClick3()
{
m_tree.ItemCopyMove(m_tree.m_htItem1, m_tree.m_htParent, (ULONG(-1L)), true, true, TVE_TOGGLE, true, false);
m_tree.ItemCopyMove(m_tree.m_htItem2, m_tree.m_htParent, (ULONG(-1L)), true, true, TVE_TOGGLE, true, false);
m_tree.m_htItem1 = m_tree.ItemGetChildAt( m_tree.m_htParent, 0L ); // renew HTREEITEM handle
m_tree.m_htItem2 = m_tree.ItemGetChildAt( m_tree.m_htParent, 1L ); // renew HTREEITEM handle
m_tree.OnSwUpdateScrollBars();
m_tree.OnSwDoRedraw();
}
|
|
Lars Mohr
|
May 11, 2009 - 1:32 AM
|
Hallo Support-Team! Is there a way to remove the first line like it is in visual studio class view.? I think it is also in the standard control class CTreeCtrl, but I am not sure. Regards
|
|
Technical Support
|
May 11, 2009 - 11:45 AM
|
At present, this task requires overriding visrtual methods of the CExtTreeGridWnd class. CExtTreeGridWnd::OnTreeGridQueryColumnOutline() determines which column should display a tree outline. It’s possible to display a tree outline in more than one column or hide it at all. CExtTreeGridWnd::OnGbwAdjustRects() reserves some space for tree outline. Finally CExtTreeGridWnd::OnGbwPaintCell() draws a tree outline and this is the method you need to implement if you want to change outline lines.
|
|
Lars Mohr
|
May 12, 2009 - 2:57 AM
|
I didn’t understand the relationship between CExtTreeCtrl and CExtTree GridWnd . I have had a look into a the funktion CExtTreeCtrl::OnPaintTreeItemLines and it seems that I have overriding this funktion. Is this right?
|
|
Technical Support
|
May 12, 2009 - 1:33 PM
|
We are sorry but there is no relationship between the CExtTreeGridWnd and CExtTreeCtrl classes. But the CExtTreeCtrl control is also completely custom painting and it’s also possible to repaint its outline. You should override the CExtTreeCtrl::OnPaintTreeItemLines() method for that.
|
|
tera tera
|
May 8, 2009 - 10:19 PM
|
Hello. Can I read only accelerator key information from Registry?
Should I use pRibbonBar->CustomizeStateLoad?
|
|
Technical Support
|
May 11, 2009 - 11:38 AM
|
No, you should use the code similar to that present in the CExtCustomizeSite::CustomizeStateSerialize() method. The accelerator tables are stored in the CExtCustomizeSite::CCmdMenuInfo objects. Each CExtCustomizeSite::CCmdMenuInfo describes one menu tree linked to the document/view objects of MFC’s document/view architecture. Te accelerator table is linked to menu tree. The following code saves the menu info objects in the CExtCustomizeSite::CustomizeStateSerialize() method:
// serialize menus
DWORD dwMenuInfoCount = (DWORD)MenuInfoGetCount();
ar << dwMenuInfoCount;
for( DWORD i = 0; i < dwMenuInfoCount; i++ )
{
CCmdMenuInfo * pCmdMenuInfo =
MenuInfoGetAt( i );
ASSERT( pCmdMenuInfo != NULL );
CExtCustomizeCmdTreeNode * pMenuNode =
pCmdMenuInfo->GetNode( false );
ASSERT_VALID( pMenuNode );
pMenuNode->Serialize( ar );
pCmdMenuInfo->AccelTableSerialize( ar );
} // for( DWORD i = 0; i < dwMenuInfoCount; i++ )
The following code loads the menu info objects in the CExtCustomizeSite::CustomizeStateSerialize() method: // serialize menus
DWORD dwMenuInfoCount = (DWORD)MenuInfoGetCount();
DWORD dwMenuInfoCountA = 0;
ar >> dwMenuInfoCountA;
if( dwMenuInfoCountA != dwMenuInfoCount )
{
ASSERT( FALSE );
#if _MFC_VER >= 0x0800
::AfxThrowArchiveException( CArchiveException::genericException, NULL );
#else
::AfxThrowArchiveException( CArchiveException::generic, NULL );
#endif
}
if( m_pWndMenuBar != NULL )
{
ASSERT_VALID( m_pWndMenuBar );
m_pWndMenuBar->SetButtons();
}
DWORD i = 0;
for( i = 0; i < dwMenuInfoCount; i++ )
{
CCmdMenuInfo * pCmdMenuInfo =
MenuInfoGetAt( i );
ASSERT( pCmdMenuInfo != NULL );
CExtCustomizeCmdTreeNode * pMenuNode =
pCmdMenuInfo->GetNode( false );
ASSERT_VALID( pMenuNode );
pMenuNode->Serialize( ar );
pCmdMenuInfo->AccelTableSerialize( ar );
} // for( i = 0; i < dwMenuInfoCount; i++ )
if( m_pWndMenuBar != NULL )
{
ASSERT_VALID( m_pWndMenuBar );
VERIFY( m_pWndMenuBar->UpdateMenuBar( FALSE ) );
}
. . .
if( (GetCustomizeFlags()&__ECSF_ACCELERATORS) != 0 )
OnUpdateAccelGlobalInfo( true );
Both code snippets have the following lines: pMenuNode->Serialize( ar );
pCmdMenuInfo->AccelTableSerialize( ar );
The first line invokes the CExtCustomizeCmdTreeNode::Serialize() method for serializing menu tree. The second line invokes the CExtCustomizeSite::CCmdMenuInfo::AccelTableSerialize() method for serializing accelerator table and that is what you need. You need to all the CExtCustomizeSite::CCmdMenuInfo objects using the CExtCustomizeSite::MenuInfo***() methods and invoke their CExtCustomizeSite::CCmdMenuInfo::AccelTableSerialize() method. This serialization is CArchive based. You can create CArchive object based on the CMemFile memory file and save it to the system registry or load it from there like demonstrated in the CExtCustomizeSite::CustomizeStateLoad() and CExtCustomizeSite::CustomizeStateSave() methods.
|
|
Offer Har
|
May 8, 2009 - 4:34 PM
|
Dear Support, We have a requirement to filter rows from the display, and show them according to specific settings. We found RowHide , but there is no RowUnHide . We saw RowUnHideAll , but this is useless to us, because we need it on a row level - if a value in a specific row changes, we know it, and we want to show that row if it was hidden, without running over all rows. Please explain how to do it, we need it ASAP... Thanks, Ron.
|
|
Offer Har
|
May 11, 2009 - 2:24 PM
|
Thanks for the details. A couple of things I still do not understand, which is how to un-hide a row: I can now get access to all my rows, from the rows, to get the data I need to decide if to hide or un-hide these row - the reason for all this extra work is to get back access to the hidden row. Let’s say I found a row that I want to show again, I need two thinks: 1. To know that it is currently hidden. 2. To show it back. And the same issue with rows I want to hide. If I changed the flag m_bMappingEnabledY , and I call HideRow , would the grid get all messed up? Thanks, Ron.
|
|
Technical Support
|
May 11, 2009 - 11:37 AM
|
The RowHide() method hides the specified row and after that the row count decreased and indices of all the next rows after just hidden row too. The hidden row is stored somewhere inside the data provider and absolutely unavailable for accessing via APIs of the CExtGridWnd class. The data provider keeps internal references to all the hidden rows. The RowHideAll() just clears this internal references and all the hidden rows become visible. This is the current row hiding implementation and it’s enough for grid filtering. When the filer conditions are changed, then the grid window un-hides all the previously hidden rows without repainting the grid window and hides all the filtered rows again using new filtering conditions. We can develop the RowUnHide() feature, but which index should it use in parameters? Probably, we will need to support two indices and rows counts: one is for visible rows and one is for all.
|
|
Offer Har
|
May 11, 2009 - 12:44 PM
|
I understand, but it really impose a problem on data that is updated in real-time. If a specific record in the table has changed, and not it matches the filter criteria, it needs to be unhidden. Going and running all the filter on a 500 rows table each time one row changes will not work... If this is the design and you cannot change it, I need somehow to access this hidden row, and unhide it, maybe directly from the data provider, and not from the grid. Please advise.
|
|
Technical Support
|
May 11, 2009 - 1:41 PM
|
As you know, the CExtGridWnd control uses the CExtGridDataProviderMemory data provider for storing grid cells. The CExtGridDataProviderMemory is not able to hide rows. The CExtMDP template class adds this feature to any data provider. The CExtGridWnd::OnGridQueryDataProvider() virtual method instantiates and returns the instance of the CExtMDP < CExtGridDataProviderMemory > data provider and that is why CExtGridWnd control supports row hiding. The CExtMDP template class overrides data provider’s methods which manager rows. This template keeps internal map of visible rows and lets the grid control to access only them. If the CExtMDP::MappingIsEnabledY() method returns false , then the CExtMDP < CExtGridDataProviderMemory > data provider works like the CExtGridDataProviderMemory simple memory data provider and there are no hidden rows. If the MappingIsEnabledY() method returns true , then at least one row is hidden and internal map of visible rows is used for accessing real rows. The CExtMDP::MappingIsEnabledY() method returns the CExtMDP::m_bMappingEnabledY flag which keeps the current row mapping mode. The CExtMDP::MappingEnableY() method enables or disables the mapping mode for rows. But you should not invoke the CExtMDP::MappingEnableY() method with the false parameter for disabling the row mapping mode because it does more than changing the CExtMDP::m_bMappingEnabledY flag to false - it clears internal map of rows what is equal to un-hiding all the rows. You should just change CExtMDP::m_bMappingEnabledY flag to false . After that you will be able to access all the grid rows. Then you should restore the CExtMDP::m_bMappingEnabledY flag. The code should look like:
CExtGridWnd & wndGrid = . . .
LONG nRowCountReallyVisible = wndGrid.RowCountGet();
CExtMDP < CExtGridDataProviderMemory > * pDataProvider = ( CExtMDP < CExtGridDataProviderMemory > * ) ( & wndGrid.OnGridQueryDataProvider() );
bool bSavedMappingModeFlagForRows = pDataProvider->m_bMappingEnabledY;
pDataProvider->m_bMappingEnabledY = false;
//
// now all the rows are available, please do try to hide some rows or unhide all the rows until the m_bMappingEnabledY flag will be restored
//
LONG nRowCountAll = wndGrid.RowCountGet();
ASSERT( nRowCountReallyVisible <= nRowCountAll );
//
// you can access all grid cells using the CExtGridWnd::GridCellGet() method here
//
. . .
//
// we must restore the mapping mode finally
//
pDataProvider->m_bMappingEnabledY = bSavedMappingModeFlagForRows;
The code snippet above just lets the data provider and the grid control forget about the hidden grid rows temporarily. This allows to access all the rows. As you can see, each visible row really has two row indices. One is the number of row in the sequence of the visible rows. Let us call it virtual row index. Second is the number of row in the sequence of all the rows. Let us call it real row index. It’s possible to convert the virtual row index to real and vice versa when the CExtMDP::m_bMappingEnabledY flag is set to true . The CExtMDP::MapV2RY() method converts virtual index to real. The CExtMDP::MapR2VY() method converts real index to virtual. It can return the ULONG(-1L) value when the specified real index corresponds to the hidden row or when the real index is invalid (greater than real row count). If the CExtMDP::m_bMappingEnabledY flag is set to false , then both the CExtMDP::MapV2RY() and CExtMDP::MapR2VY() methods just return the row index specified in the method parameter.
|
|
tera tera
|
May 8, 2009 - 4:34 AM
|
Hello. (1), I perform MenuRebuild. void MenuRebuild( CExtRibbonNode * pRibbonNode )
{
CMemFile _file;
CArchive arSave( &_file, CArchive::store );
MenuInfoGetDefault()->AccelTableSerialize( arSave );
arSave.Close(); : :
(2), Assert appears if I perform the setting of the quick access bar.
I ask for a countermeasure.
|
|
Technical Support
|
May 15, 2009 - 4:50 AM
|
We tried to reproduce this issue but failed. We would like to ask you to let us connect to your desktop and debug this project on it.
|
|
tera tera
|
May 8, 2009 - 4:36 AM
|
|
|
Technical Support
|
May 11, 2009 - 11:59 AM
|
We cannot confirm that. We encountered no assertion failures. Your MenuRebuild() method replaces the content of the ribbon bar with the same content. The menu displayed from the expand button on the quick access toolbar works exactly the same like before rebuilding ribbon bar’s buttons.
|
|
tera tera
|
May 12, 2009 - 12:34 AM
|
Hello. I’m sorry.
I forgot one procedure. (A), I add one quick access key. (1), I perform MenuRebuild.
(2), Assert appears if I perform the setting of the quick access bar. Give my best regards
|
|
Technical Support
|
May 12, 2009 - 1:35 PM
|
We added the Clipboard item into the quick access toolbar using your test project but there are no assertions appear. Could you please show us the entire call stack when the assertion occurred on your computer?
|
|
tera tera
|
May 12, 2009 - 6:23 PM
|
I send call stack. Is the information else necessary? CExtRibbonOptionsPageCustomizeQATB::RibbonOptionsPage_InitContent() line 13209 + 30 bytes
CExtRibbonOptionsDialog::OnInitDialog() line 14348 + 22 bytes
AfxDlgProc(HWND__ * 0x00490542, unsigned int 272, unsigned int 5637372, unsigned int 5637372) line 35 + 14 bytes
USER32! 77cf8734()
USER32! 77d03b9c()
USER32! 77d03591()
USER32! 77d1e561()
USER32! 77cf8734()
USER32! 77cf8816()
USER32! 77cfc63f()
USER32! 77cff65d()
CWnd::DefWindowProcA(unsigned int 272, unsigned int 5637372, long 0) line 1011 + 32 bytes
CWnd::Default() line 258
CDialog::HandleInitDialog(unsigned int 5637372, unsigned int 5637372) line 624 + 8 bytes
CWnd::OnWndMsg(unsigned int 272, unsigned int 5637372, long 0, long * 0x0012dea0) line 1826 + 17 bytes
CWnd::WindowProc(unsigned int 272, unsigned int 5637372, long 0) line 1596 + 30 bytes
CExtWS<CExtResDlg,301>::WindowProc(unsigned int 272, unsigned int 5637372, long 0) line 741 + 23 bytes
CExtWA<CExtWS<CExtResDlg,301> >::WindowProc(unsigned int 272, unsigned int 5637372, long 0) line 1844 + 20 bytes
CExtResizableDialog::WindowProc(unsigned int 272, unsigned int 5637372, long 0) line 378 + 20 bytes
CExtNCW<CExtResizableDialog>::WindowProc(unsigned int 272, unsigned int 5637372, long 0) line 604 + 20 bytes
CExtRibbonOptionsDialog::WindowProc(unsigned int 272, unsigned int 5637372, long 0) line 14395 + 20 bytes
AfxCallWndProc(CWnd * 0x0012e810 {CExtRibbonOptionsDialog hWnd=???}, HWND__ * 0x00490542, unsigned int 272, unsigned int 5637372, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x00490542, unsigned int 272, unsigned int 5637372, long 0) line 379
AfxWndProcBase(HWND__ * 0x00490542, unsigned int 272, unsigned int 5637372, long 0) line 220 + 21 bytes
USER32! 77cf8734()
USER32! 77cf8816()
USER32! 77cfb4c0()
USER32! 77cfb50c()
NTDLL! 7c94e473()
USER32! 77d043e0()
USER32! 77d04704()
USER32! 77d19b0b()
CExtResDlg::CreateDlgIndirect(const DLGTEMPLATE * 0x001639d0, CWnd * 0x00389118 {CMainFrame hWnd=???}, HINSTANCE__ * 0x006b0000) line 6520 + 44 bytes
CExtResDlg::_DoModalImpl() line 6365 + 32 bytes
CExtResDlg::DoModal() line 6316 + 16 bytes
CExtRibbonBar::OnRibbonOptionsDialogTrack(unsigned int 30525) line 18554
CExtRibbonBar::_OnCmdRibbonQuickAccessToolbarCustomize() line 16967 + 21 bytes
_AfxDispatchCmdMsg(CCmdTarget * 0x00389690 {CMyRibbonBar}, unsigned int 30513, int 0, void (void)* 0x006b4c0f CExtRibbonBar::_OnCmdRibbonQuickAccessToolbarCustomize(void), void * 0x00000000, unsigned int 12, AFX_CMDHANDLERINFO * 0x00000000) line 88
CCmdTarget::OnCmdMsg(unsigned int 30513, int 0, void * 0x00000000, AFX_CMDHANDLERINFO * 0x00000000) line 302 + 39 bytes
CWnd::OnCommand(unsigned int 30513, long 0) line 2099
CWnd::OnWndMsg(unsigned int 273, unsigned int 30513, long 0, long * 0x0012fa5c) line 1608 + 28 bytes
CControlBar::WindowProc(unsigned int 273, unsigned int 30513, long 0) line 442 + 30 bytes
CExtControlBar::WindowProc(unsigned int 273, unsigned int 30513, long 0) line 8626
CExtToolControlBar::WindowProc(unsigned int 273, unsigned int 30513, long 0) line 13411
CExtRibbonPage::WindowProc(unsigned int 273, unsigned int 30513, long 0) line 6407 + 20 bytes
AfxCallWndProc(CWnd * 0x00389690 {CMyRibbonBar hWnd=???}, HWND__ * 0x003c052c, unsigned int 273, unsigned int 30513, long 0) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x003c052c, unsigned int 273, unsigned int 30513, long 0) line 379
AfxWndProcBase(HWND__ * 0x003c052c, unsigned int 273, unsigned int 30513, long 0) line 220 + 21 bytes
USER32! 77cf8734()
USER32! 77cf8816()
USER32! 77cf89cd()
USER32! 77cf96c7()
CWinThread::PumpMessage() line 853
CWinThread::Run() line 487 + 11 bytes
CWinApp::Run() line 400
AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00151f18, int 1) line 49 + 11 bytes
WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00151f18, int 1) line 30
WinMainCRTStartup() line 330 + 54 bytes
KERNEL32! 7c816fe7()
|
|
tera tera
|
May 12, 2009 - 6:45 PM
|
|
|
tera tera
|
May 8, 2009 - 3:38 AM
|
Hello. Only as for 3 columns, I want the width of the screen to follow the grid.
Please teach a good method.
|
|
Technical Support
|
May 20, 2009 - 12:30 PM
|
We have 3 white columns with fixed size. We have one blue column and it’s resizable. We have one magenta column with fixed size. First of all we need to get the header cells for this column from the top header row:
CExtGridWnd & wndGrid = . . .
CExtGridCell * pHeaderCellWhite0 = wndGrid.GridCellGetOuterAtTop( 0L, 0L );
CExtGridCell * pHeaderCellWhite1 = wndGrid.GridCellGetOuterAtTop( 1L, 0L );
CExtGridCell * pHeaderCellWhite2 = wndGrid.GridCellGetOuterAtTop( 2L, 0L );
CExtGridCell * pHeaderCellBlue = wndGrid.GridCellGetOuterAtTop( 3L, 0L );
CExtGridCell * pHeaderCellMagenta = wndGrid.GridCellGetOuterAtTop( 4L, 0L );
Then, we need to set the proportional extents for these columns: pHeaderCellWhite0->ExtentPercentSet( 0.0 );
pHeaderCellWhite1->ExtentPercentSet( 0.0 );
pHeaderCellWhite2->ExtentPercentSet( 0.0 );
pHeaderCellBlue->ExtentPercentSet( 1.0 );
pHeaderCellMagenta->ExtentPercentSet( 0.0 );
That’s all. These columns will be automatically resizable like demonstrated on your video. But if you want to disable resizing of the white and magenta columns by user, then you also should set the fixed widths of their columns in pixels: INT nSomeWidthInPixels = . . .
pHeaderCellWhite0->ExtentSet( nSomeWidthInPixels, -1 );
pHeaderCellWhite0->ExtentSet( nSomeWidthInPixels, 0 );
pHeaderCellWhite0->ExtentSet( nSomeWidthInPixels, 1 );
pHeaderCellWhite1->ExtentSet( nSomeWidthInPixels, -1 );
pHeaderCellWhite1->ExtentSet( nSomeWidthInPixels, 0 );
pHeaderCellWhite1->ExtentSet( nSomeWidthInPixels, 1 );
pHeaderCellWhite2->ExtentSet( nSomeWidthInPixels, -1 );
pHeaderCellWhite2->ExtentSet( nSomeWidthInPixels, 0 );
pHeaderCellWhite2->ExtentSet( nSomeWidthInPixels, 1 );
pHeaderCellMagenta->ExtentSet( nSomeWidthInPixels, -1 );
pHeaderCellMagenta->ExtentSet( nSomeWidthInPixels, 0 );
pHeaderCellMagenta->ExtentSet( nSomeWidthInPixels, 1 );
|
|
Technical Support
|
May 11, 2009 - 11:43 AM
|
The CExtGridBaseWnd::OnGbwResizingStateApply() virtual method is invoked when the column width or row height has changed during column or row resizing drag-n-dropping the separator between column or row header cells. The column and/or row resizing can be also enabled via drag-n-dropping of grid lines in the central grid area with data cells. If you need to catch the grid resizing event, then you should handle it’s WM_SIZE message.
|
|
tera tera
|
May 12, 2009 - 1:09 AM
|
Hello. >If you need to catch the grid resizing event, then you should handle it’s WM_SIZE message. When a domain spreads ,
I want to make the width of 0 cells and 1 cell and 3 cells fixation.
however , Only 2 cells want to make width variable. Is not there the good command? Thanks,
|
|
Technical Support
|
May 12, 2009 - 1:33 PM
|
To make a grid column having a fixed size, you should set all its extents (minimal, current and maximal) to equal values:
CExtGridWnd & wndGrid = . . .
INT nFixedColumnWidthInPixels = . . .
CExtGridCell * pCellHeader = wndGrid.GridCellGetOuterAtTop( . . . );
pCellHeader->ExtentSet( nFixedColumnWidthInPixels, -1 );
pCellHeader->ExtentSet( nFixedColumnWidthInPixels, 0 );
pCellHeader->ExtentSet( nFixedColumnWidthInPixels, 1 );
|
|
tera tera
|
May 14, 2009 - 12:07 AM
|
Hello. The method how only a specific item fixes width.
Will it be the following methods? void CNxL_MVT_BaseGrid::OnSize(UINT nType, int cx, int cy)
{
CExtGridCellHeader * pExtGridCellHeader;
pExtGridCellHeader = STATIC_DOWNCAST(
CExtGridCellHeader,
GridCellGetOuterAtTop(
0 ,
0 ,
RUNTIME_CLASS(CExtGridCellHeader)
)
);
pExtGridCellHeader->ExtentSet ( 100 );
CNxL_MlGrid::OnSize(nType, cx, cy);
}
|
|
Technical Support
|
May 15, 2009 - 4:54 AM
|
You can use CExtGridCell::ExtentSet() to assign the minimum, current and maximum column width in pixels and CExtGridCell::ExtentPercentSet() to set the proportional column width used for automatic column resizing. The total of all the proportional column widths is 100%. If some of column has an equal minimum and maximum width, it is not resized proportionally. This allows you to keep several columns having a fixed size when other columns are resized proportionally. If you are using proportional column resizing, the CExtGridCell::ExtentSet() method just sets the initial column width in pixels for the proportionally resized columns.
|
|
tera tera
|
May 20, 2009 - 2:51 AM
|
|
|
Technical Support
|
May 8, 2009 - 11:57 AM
|
The CExtGridBaseWnd::OnGbwResizingStateApply() virtual method is invoked to apply the new size to resized columns and/or rows. You should override this virtual method in your CExtGridWnd -derived class. Your method should invoke the parent class method and then change the size of the parent frame or dialog window. First of all you will need to compute summary width of all the columns. The CExtGridWnd::ColumnCountGet() method returns count of columns. The CExtGridWnd::GridCellGetOuterAtTop() method returns pointers to header grid cells at top. The CExtGridCell::ExtentGet() method of each header cell returns column width in pixels. So, you can compute summary width of all the columns. The next step is to compute the new width of the parent dialog or frame window:
CExtGridWnd * pWndGrid = . . .
CWnd * pWndParent = . . . // parent dialog or frame window.
INT nSummaryWidthOfAllTheColumns = . . . // you already computed this like we described above
CRect rcWndParent, rcGrid;
pWndParent->GetWindowRect( &rcWndParent );
pWndGrid->GetCientRect( &rcGrid );
INT nCurrentGridWidth = rcGrid.Width();
if( pWndGrid->OnSwHasScrollBar( false ) )
nCurrentGridWidth -= ::GetSystemMetrics( SM_CXVSCROLL ); // subtract width of vertical scroll bar
INT nDiff = nSummaryWidthOfAllTheColumns - nCurrentGridWidth;
if( nDiff == 0 )
return . . . // donāt need to resize the parent frame or dialog window in this case
rcWndParent.right += nDiff;
pWndParent->MoveWindow( &rcWndParent );
|
|
tera tera
|
May 11, 2009 - 12:02 AM
|
Hello. OnGbwResizingStateApply is not called even if I change the view area of the grid.
Why ?
|
|
tera tera
|
May 7, 2009 - 8:10 PM
|
Hello. When I scroll in a red cursor place...
When I scroll in a blue cursor place....
Scroll ways are different each. When I scroll at a particularly blue cursor point, there is sense of incongruity.
You had better revise it?
|
|
Technical Support
|
May 8, 2009 - 11:56 AM
|
We checked both line and page scrolling in 2.85. Looks like everything is correct. The scroll bar makes the list box scrolling slow first half of second, then faster.
|
|
tera tera
|
May 8, 2009 - 6:53 PM
|
|
|
Technical Support
|
May 11, 2009 - 11:56 AM
|
We remembered two first icons displayed at the top of the list box. It looks like you double clicked the page up area of the vertical scroll bar and then double clicked page down area of it. As a result, the scrolling position returned to the same as before scrolling up and then down. The same two icons became displayed at the top of the list box. We repeated the same experiment with the RibbonBar sample application and got the same: the vertical scrolling position is returned to the same place. We saw that the scrolling speed were equal both in the up and down directions and both in your 2nd video and in the RibbonBar sample application running on our computers on both Vista and XP. So what is wrong with this?
|
|
tera tera
|
May 12, 2009 - 1:27 AM
|
|
|
Technical Support
|
May 12, 2009 - 1:34 PM
|
The only difference we see is that on the first video looks like you did several clicks on the scroll bar to scroll down the list box content but on the second video you clicked the scroll bar once and kept mouse pressed.
|
|
Chris Anderson
|
May 7, 2009 - 11:15 AM
|
I’m using CExtResizablePropertyPage and CExtResizablePropertySheet to skin a property sheet, they work farily well. The only issue I found is : the tab control inside the property (SysTabControl32) is not skinned. Can I use Prof-UI class here or I need to handle this manually ? thanks
|
|
Technical Support
|
May 7, 2009 - 1:48 PM
|
The CExtResizablePropertySheet and CExtResizablePropertyPage classes are currently fully skinned in the wizard mode only. Prof-UIS uses the CExtTabWnd control everywhere. This is not an extension of the tab common control. The CExtTabWnd control is written from scratch and supports a wider set of features than CTabCtrl does. We have a container control based on our tabs. The CExtTabPageContainerWnd window is designed as a container for one CExtTabWnd window docked to one of its sides and several page windows. You can create one popup dialog window, then create a CExtTabPageContainerWnd window and several buttons in it. The property pages should be created as child and visible dialogs inside the CExtTabPageContainerWnd window. Such design implements a themed property sheet window.
|
|
tera tera
|
May 6, 2009 - 7:19 PM
|
Hello. When I want to return a key allotment to standard setting. IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"0", IDM_POWER_VIEWER, VIRTKEY, CONTROL, NOINVERT
"1", IDM_SOU_1, VIRTKEY, CONTROL, NOINVERT
"2", IDM_SOU_2, VIRTKEY, CONTROL, NOINVERT
"3", IDM_SOU_3, VIRTKEY, CONTROL, NOINVERT
"3", IDM_ZENTAI3D, VIRTKEY, CONTROL, ALT, NOINVERT
"4", IDM_SOU_4, VIRTKEY, CONTROL, NOINVERT
"A", IDM_OP_VIEW_FIT, VIRTKEY, CONTROL, NOINVERT
"B", IDM_BUBUN_SEISEI, VIRTKEY, CONTROL, ALT, NOINVERT
"D", IDM_OP_CHANGE_DEL, VIRTKEY, CONTROL, NOINVERT
"E", IDM_ERRORLIST, VIRTKEY, CONTROL, NOINVERT
"H", IDM_OP_LAYER_STACK_DIRECT, VIRTKEY, CONTROL, NOINVERT
"I", IDM_OP_CHANGE_INPUT, VIRTKEY, CONTROL, NOINVERT
"K", IDM_OP_LAYER_STACK_DN, VIRTKEY, CONTROL, NOINVERT
"K", IDM_SAI_SEISEI, VIRTKEY, CONTROL, ALT, NOINVERT
"N", IDM_HYOUJIBUHIN, VIRTKEY, CONTROL, NOINVERT
"M", IDM_OP_VIEW_MOVE, VIRTKEY, CONTROL, NOINVERT
"O", IDM_HASIRASUNPOU, VIRTKEY, CONTROL, NOINVERT
"O", IDM_OUTSIDE_PROGRAM_START, VIRTKEY, CONTROL, ALT,
NOINVERT Will it be necessary to delete "register data" ?
|
|
Technical Support
|
May 8, 2009 - 11:56 AM
|
No, unfortunately we have no such option.
|
|
tera tera
|
May 8, 2009 - 6:21 PM
|
Hello. I think that there is time when a user wants to reset the setting of the key.
I think that there is time when the setting of user own key cannot understand it.
Why do not you let this function attach? Thanks,
|
|
Technical Support
|
May 11, 2009 - 11:38 AM
|
If you changed the Ctrl+C key for the copy to clipboard a command to something else, then resetting it back is just assigning the Ctrl+C combination again. Everyone knows what is Ctrl+C and what it should do. Microsoft’s application does not have resetting option for particular commands either. We think it’s not needed and very rarely useful.
|
|
tera tera
|
May 7, 2009 - 7:21 PM
|
Hello. You return an accelerator key for standard setting , Is not there the schedule building a UI menu?
|
|
Technical Support
|
May 7, 2009 - 1:43 PM
|
It’s possible to reset all the keyboard accelerators. You should invoke one of the CExtCustomizeSite::MenuInfoGet***() methods first to get a CExtCustomizeSite::CCmdMenuInfo object pointer. Then you should invoke its CExtCustomizeSite::CCmdMenuInfo::AccelTableReset() method to reset the keyboard accelerator maps internally stored . Finally you should invoke the CExtCustomizeSite::OnUpdateAccelGlobalInfo() method which updates the internal MFC accelerator tables from the key mappings stored in the CExtCustomizeSite::CCmdMenuInfo object. This is related both to customizable toolbars/menus and ribbon because the CExtRibbonBar / CExtRibbonPage classes are based on the CExtCustomizeSite class. The resetting of one accelerator key combination is not supported. But it’s performed in the similar way we described above. You can invoke the CExtCustomizeSite::CCmdMenuInfo::GetMapInitialKey2Cmd() to get the initial keyboard accelerators map. Then you can find initial key combinations assigned to particular command. Then you can invoke the CExtCustomizeSite::CCmdMenuInfo::AccelTableCmdKeyAssign() method to assign the key combination to this command in the current map. Finally you should not forget to invoke the CExtCustomizeSite::OnUpdateAccelGlobalInfo() method to apply changes to MFC’s internal accelerator tables.
|
|
Chris Anderson
|
May 6, 2009 - 11:32 AM
|
I’m wondering if there is a quick way to skin a MFC based dialog. I can use CExtResizableDialog to skin the dialog itself, but need to manually subclass the controls ( button, edit, check box ... ) to skin the controls. Is there sort of wizard that can import a dialog from resource file and automatically generate the code ? Thanks
|
|
Technical Support
|
May 6, 2009 - 12:42 PM
|
The CExtResizableDialog class has a themed client area, a resizing gripper and the default non-client area. So, you can use the CExtNCW < CExtResizableDialog > class. There are several ways to skin all the dialog controls automatically:
1) InvokeSetAutoSubclassChildControls(); in your dialog’s constructor.
2) Invoke SubclassChildControls(); in your dialog’s OnInitDialog() virtual method.
3) Invoke the ::SubclassChildControls(HWND); global function in your dialog’s OnInitDialog() virtual method.
The first method remembers that dialog should apply the second method just after loading dialog template resource. The second method uses the third one.
This will subclass all the un-subclassed yet dialog controls with dynamic instances of Prof-UIS classes. You may have some dialog controls explicitly subclassed in your code. The class names of these controls should be manually replaced with Prof-UIS class names.
|
|
Chris Anderson
|
May 6, 2009 - 1:13 PM
|
Thank you for the quick response. It works very well
|
|
Kevin Murray
|
May 5, 2009 - 5:06 PM
|
Trying to utilize
CExtTabMdiWhidbeyWnd in our MDI based application with dynamic windows. I’m working my way through most things, but one I haven’t been able to figure out is bugging me. If I have two dynamic windows of the same type as MDI windows, the tabs will only display the active window’s title. So, if I have three instances of a given window, each has its own title, what I would expect is this:
|title 1|title 2| title3|
Instead, if you click the middle tab, you get this:
|title 2|title 2|title 2|
And so on. What am I doing wrong? :) I create the tab window like this:
m_wndMdiTabs.Create( this, CRect(0,0,0,0), UINT(__EXT_MFC_IDC_STATIC),WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN|WS_CLIPSIBLINGS,__ETWS_ITEM_DRAGGING|__ETWS_ORIENT_BOTTOM|__ETWS_ENABLED_BTN_CLOSE|__ETWS_ENABLED_BTN_TAB_LIST|__ETWS_AUTOHIDE_SCROLL|__ETWS_SHOW_BTN_TAB_LIST|__ETWS_SHOW_BTN_CLOSE
);
The MDI windows are from CExtDynamicControlBars that have been told to become documents via ( CExtDynamicControlBar::__EDBS_DOCUMENT, true )
BarStateSet ( CExtDynamicControlBar::__EDBS_DOCUMENT, true )
Any help is appreciated.
K.
|
|
Technical Support
|
May 7, 2009 - 1:46 PM
|
We think your OnUpdateFrameTitle() virtual method should invoke the following code finally: if( pMainFrame->m_wndMdiTabs.GetSafeHwnd() != NULL )
pMainFrame->m_wndMdiTabs.UpdateTabWnd();
|
|
Kevin Murray
|
May 11, 2009 - 9:31 AM
|
For what it is worth, I started mostly over again. :) I figured out how to get things working in a sample application that didn’t carry the baggage of our full application. Now, things seem to work properly in my sample app. So I’ll have to figure out how to migrate what I have done into our product line. That said, two questions: 1) How do I get an icon to show up in the MDI windows? 2) How do I get the title-bar right click menu (Dockable, Floating, etc.) on the MDI windows? Thanks, K.
|
|
Technical Support
|
May 11, 2009 - 11:57 AM
|
The answer to the first question can be found in the CExtTMWI::OnTabWndQueryItemIcon() virtual method which provides tab items of an MDI tabs control with icons. As you can see, it tries to send the WM_GETICON message to the MDI child frame window. If the ICON_SMALL small 16x16 icon is not returned, then it tries to query the ICON_BIG big 32x32 icon and scale it to 16x16 size which is more friendly to tab items. If the both WM_GETICON message invocations does not return icon, then this method tries to get the icon from window class information of the MDI child frame window. The good style of coding is to assign the small icon to the MDI child frame window when handling its WM_CREATE message. You can modify the Window menu of the dynamic resizable control bar by overriding the CExtDynamicControlBar::OnInitDbsMenu() virtual method. Your method can invoke the parent class method to construct the default menu and then insert your menu items. The CExtDynamicControlBar::OnInitDbsMenu() virtual method initializes menu command items using the CExtPopupMenuWnd::ItemInsertCommand() method and specifies HWND handle of the CExtDynamicControlBar window as target for the WM_COMMAND messages for menu command items.
|
|
Technical Support
|
May 6, 2009 - 12:40 PM
|
Could you provide more details? Do you change the MDI window titles dynamically? If so, you many need to invoke the CExtTabWnd::UpdateTabWnd() method to apply title changes immediately. The CExtTMWI::OnTabWndQueryItemText() virtual method provides text for tab items of MDI tab controls. It just tries to find an MFC document object \ and use its document title, then it just gets the caption of the MDI child frame window. We believe there must be a way to reproduce this issue with the MDI_DynamicBars sample application.
|
|
Kevin Murray
|
May 6, 2009 - 1:34 PM
|
We have the same document, with multiple views. So, I derived a class from CExtDynamicMDIChildWnd and overrode OnUpdateFrameTitle. This will ask the current child view (and document) what its title should be. This title is then set to the frame via SetTitle AND SetWindowText. GetBar is utilized to set the caption text of the control bar as well (so it stays in sync, should the title change). Interestingly, the windows themselves have the right title -- it is only the tabs that are changing and incorrect. So I think my override of OnUpdateFrameTitle is working as it should, but that the tabs aren’t using this title, perhaps? Then again, I’m not even sure how the tabs are getting created... K.
|
|
Lars Mohr
|
May 4, 2009 - 7:02 AM
|
Hello Support-Team! Has the CExtTreeCtrl any special function for drag and drop items functionallity?. Or do I have to write from scratch like it is written down in the MSDN? But then I think I get some problems with the CreateDragImage, because I use only icons (TreeIconAdd). Do you have any example for that? Regards
|
|
Lars Mohr
|
May 5, 2009 - 9:15 AM
|
Funny, but I receive the TVN_BEGINDRAG notification message! You are right, it is easier with OLE. I will try it. Thanks
|
|
Technical Support
|
May 5, 2009 - 12:38 PM
|
The CExtTreeCtrl class uses the tree common control simply as a storage for tree items and implements the tree control’s behavior from scratch by handling keyboard and mouse events. You should not receive a TVN_BEGINDRAG message from the CExtTreeCtrl control in Prof-UIS 2.84 because we simply forgot to implement it. This is checked on different Windows versions and reported by customers. The TVN_BEGINDRAG message is sent by the improved version of the CExtTreeCtrl class in Prof-UIS 2.85 only. Did you download 2.85?
|
|
Lars Mohr
|
May 5, 2009 - 2:44 PM
|
Sorry but I receive the message: ON_NOTIFY(TVN_BEGINDRAG, IDC_TREE_PROJECT_EXPLORER, &CProjectExplorer::OnTvnBegindragTreeProjectExplorer)
And I use Prof-UIS 2.84 / XP / VS2005. But I don’t receive other notify messages like TVN_BEGINLABLEEDIT . But I have solved this by overwrite the OnTimer function. if( nIDEvent == m_nDelayedEditingTimerID )
|
|
Technical Support
|
May 4, 2009 - 11:33 AM
|
The CExtTreeCtrl class in Prof-UIS 2.84 does not send the TVN_BEGINDRAG notification. This issue is fixed in Prof-UIS 2.85. So, first thing you need is to update the source code of the CExtTreeCtrl class or switch to Prof-UIS 2.85. You can drop us an e-mail to the support mail box and we will provide you with the FTP download.
Next thing is drag-n-drop implementation. We prefer to use OLE drag-n-drop everywhere. It’s convenient and simple. The FormEditor sample application allows to drag-n-drop controls from toolbox into opened forms. The MDI tabs, tabs inside tabbed groups of resizable control bars and auto hide tabs support drag-n-drop and do selection changing when you dragging something over their tab items.
|
|
Ulrich Heinicke
|
May 3, 2009 - 11:14 PM
|
Hi, i got yesterday the new beta version 2.85. After i compile my project i get an error: the method OnGridCellInplaceControlCreate has now one argument more. Could you please explain me the first variable, which is new. Thanks Ulrich
|
|
Technical Support
|
May 4, 2009 - 11:32 AM
|
In Prof-UIS 2.84: An in-place cell editor window can be created as a child of a grid window only. In Prof-UIS 2.85: An in-place cell editor window can be created outside the grid window and a new hWndParentForEditor parameter of the CExtGridWnd::OnGridCellInplaceControlCreate() method specifies the parent window handle of the in-place editor window.
Very unfortunately we had to change the signatures of the following methods for that: CExtGridBaseWnd::OnGbwBeginEdit() , CExtGridWnd::OnGridCellInplaceControlCreate() , CExtGridCell::OnInplaceControlAdjustCreationRect() , CExtGridWnd::OnGridCellInplaceControlAdjustCreationRect() and CExtGridCell::OnInplaceControlCreate() .
Where this feature is needed? The new CExtFormulaGridWnd control demonstrated in the new FormulaGrid sample application allows in place cell editing in two ways: classic in place editing and formula bar based editing. The colorized editor windows activated inside the formula grid and inside the formula bar are really the same editors activated as in place cell editors using the CExtGridWnd class methods meant above.
|
|
tera tera
|
May 2, 2009 - 1:30 AM
|
Hello. When I include space in a title. There is the bug that string is not displayed midmost.
|
|
Technical Support
|
May 3, 2009 - 2:22 PM
|
Do you want us to make the ribbon group using some wider layout if the caption string is not displayed completely?
|
|
tera tera
|
May 2, 2009 - 5:01 PM
|
Hello. It was a mistake of dialog launcher button.
strting is not displayed by the center.
|
|
Technical Support
|
May 2, 2009 - 12:41 PM
|
It looks like there is a dialog launcher button under the red caption, isn’t it?
|
|