Subject |
Author |
Date |
|
David Skok
|
Dec 11, 2007 - 6:35 AM
|
How can I associate a set of toolbars/controlbars with a type of view and turn them on (or just the ones enabled) all at once when that type of view is active like in VS?
Thanks, Dave
|
|
Technical Support
|
Dec 11, 2007 - 12:27 PM
|
You can do this in two ways:
1) The approach demonstrated in the FullScreenState sample demonstrates how to implement multiple profile state persistence for control bars. This sample application manages two different control bar states for normal and full screen modes of the main frame window.
2) You can simply handle activation of each view in your project and show/hide appropriate control bars.
|
|
Debabrata Mukherjee
|
Dec 10, 2007 - 9:13 AM
|
Hi < My applicattion uses Prof_UIS 2.82 and has an implementation of CExtTabPageContainerWnds. When closing my application a error comes up Cinvalid Arguement Exception. In debug setup, I get the error in the MFC file list_o.cpp. When traced back, I get the error in the DestroyWindow of the Mainframe Class. Here is my Mainframe:: DestroyWindow()
BOOL CSaIsMainFrame::DestroyWindow() { //m_wndMenuBar.RemoveAllWndHooks(); // I HAVE TRIED IT BUT NO USE CWinApp * pApp = ::AfxGetApp(); ASSERT( pApp != NULL ); //ASSERT( pApp->m_pszRegistryKey != NULL ); //ASSERT( pApp->m_pszRegistryKey[0] != _T(’\0’) ); ASSERT( pApp->m_pszProfileName != NULL ); ASSERT( pApp->m_pszProfileName[0] != _T(’\0’) );
// this was commented for debugging only // VERIFY( CExtControlBar::ProfileBarStateSave(this,pApp->m_pszRegistryKey,pApp->m_pszProfileName, // pApp->m_pszProfileName));
g_CmdManager->ProfileWndRemove( GetSafeHwnd() ); // SetActiveView( NULL ); // // I HAVE TRIED IT BUT NO USE
return CExtNCW < CFrameWnd > :: DestroyWindow(); // This is the point where the problem occurs.
What can I do so that my application shuts down cleanly.
Please suggest ASAP. Its very urgent.
PLease feel free to mail me any other details if you need. at
sanket_das1@yahoo.co.in }
|
|
Eric CASADOUMECQ
|
Dec 10, 2007 - 1:52 AM
|
Hi,
In your samples, rows and columns lines are not printed. I would like to do it for CExtGridWnd and CExtReportGridWnd. Can you tell me how to do that?
Thank you.
|
|
Technical Support
|
Dec 10, 2007 - 9:39 AM
|
Unfortunately the print feature does not support printing grid lines at the moment. We can regard your message as a feature request.
|
|
Suhai Gyorgy
|
Dec 6, 2007 - 7:32 AM
|
Dear Support,
On one of our dialogs ( CDialog, not ProfUIS themed dialog ) we have a CExtGridWnd control. Earlier it was CListCtrl with LVS_REPORT style. On this same dialog we also have some CEdit controls. What we’d like to achieve is to have both the grid and the editboxes have the same border, both in XP theme and in Classic theme. (When editbox have thin blue border - in XP theme -, so should the grid, when editbox have black 3D border - in Classic theme -, so should the grid.) This worked with CListCtrl, but not with CExtGridWnd. ( I know the reason, it is because in the different themes CEdit and CListCtrl is taken from different versions of ComCtl32.dll. But this knowledge won’t help me solve the problem. )
Could you please help us in this matter? Thank you!
|
|
Technical Support
|
Dec 7, 2007 - 11:19 AM
|
You didn’t see the grid because the container window had been created with a zero size. We coded a test project which implements what you are looking for. Take a look at the screenshots below. The first screenshot shows the grid with the XP theme and the second one with the Classic theme.
The container window which paints a theme dependent border is implemented in the CPMGridBorderWnd class. We also added a CExtPaintManagerCustomT template to set the CExtPaintManagerNativeXP paint manager to the grid window m_wndGrid.SetCustomPM( RUNTIME_CLASS( CExtPaintManagerNativeXP ) );
|
|
Suhai Gyorgy
|
Dec 14, 2007 - 2:10 AM
|
Thank you, it works great!
|
|
Svetlozar Kostadinov
|
Dec 6, 2007 - 5:28 PM
|
I am not sure if this would help you, but I am using CSimpleThinFrame class. It is defined in many of the Prof-UIS samples. You can wrap all of your own CWnd-derived objects by calling CSimpleThinFrame::CreateDynamicThinFrame( CWnd * pChildWnd ) I hope this helps.
|
|
Suhai Gyorgy
|
Dec 7, 2007 - 4:54 AM
|
Thank you, I’ve tried that, but my grid just disappears when using it. In all Prof-UIS Samples this class is used in controlbars, not on a dialog. I’m guessing the problem is because a dialog can’t have more than one child with the same id (CSimpleThinFrame::Create creates a CWnd with the id of the control you attach it to). I’ve tried setting the id of this new "frame" window to be IDC_STATIC, but the grid is still invisible.
Have you used this class on a CDialog (not a CExtResizableDialog)?
|
|
Ian McIntosh
|
Dec 4, 2007 - 9:57 AM
|
These seem to only accept 2 digits per segment not the 3 required for a decimal ip address. How do I correct this?
|
|
Technical Support
|
Dec 5, 2007 - 8:30 AM
|
Thank you for reporting this issue. It seems this limitation is provided by the IP Address common control, which has so little width that is does not allow you to display all the digits. Here is the fix bool CExtGridInplaceEditIPAddress::Create()
{
ASSERT_VALID( this );
ASSERT( m_hWnd == NULL );
if( m_wndGrid.GetSafeHwnd() == NULL )
{
ASSERT( FALSE );
delete this;
return false;
}
DWORD dwAreaFlags =
CExtGridHitTestInfo::CellTypesToAreaFlags(
m_nColType,
m_nRowType
);
bool bFontMustBeDestroyed = false;
HFONT hCellFont =
m_cell.OnQueryCellFont(
m_wndGrid,
m_nVisibleColNo,
m_nVisibleRowNo,
m_nColNo,
m_nRowNo,
m_nColType,
m_nRowType,
dwAreaFlags,
bFontMustBeDestroyed
);
HFONT hFont = hCellFont;
if( hFont == NULL )
{
hFont = (HFONT)
m_wndGrid.OnSiwGetDefaultFont().GetSafeHandle();
if( hFont == NULL )
hFont = (HFONT)
::GetStockObject(DEFAULT_GUI_FONT);
if( hFont == NULL )
{
if( hFont == NULL )
hFont = (HFONT)
::GetStockObject(SYSTEM_FONT);
if( hFont == NULL )
{
ASSERT( FALSE );
delete this;
return false;
}
}
}
LOGFONT lf;
VERIFY( ::GetObject(hFont,sizeof(LOGFONT),&lf) );
if( bFontMustBeDestroyed
&& hCellFont != NULL
)
::DeleteObject( hCellFont );
if( ! m_font.CreateFontIndirect(&lf) )
{
ASSERT( FALSE );
delete this;
return false;
}
UINT nDrawTextFlags =
m_cell.OnQueryDrawTextFlags(
m_nVisibleColNo,
m_nVisibleRowNo,
m_nColNo,
m_nRowNo,
m_nColType,
m_nRowType,
dwAreaFlags,
0
);
nDrawTextFlags;
bool bReadOnly = false;
bool bPassword = false;
COLORREF clrText = COLORREF(-1L);
COLORREF clrBack = COLORREF(-1L);
m_cell.OnInplaceControlQueryStyle(
m_wndGrid,
this,
m_nVisibleColNo,
m_nVisibleRowNo,
m_nColNo,
m_nRowNo,
m_nColType,
m_nRowType,
dwAreaFlags,
bReadOnly,
bPassword,
clrBack,
clrText
);
COLORREF clrBackAll = m_cell.BackColorGet( CExtGridCell::__ECS_ALL );
COLORREF clrBackNormal = m_cell.BackColorGet( CExtGridCell::__ECS_NORMAL );
if( clrBackAll != COLORREF(-1L) )
clrBack = clrBackAll;
else if( clrBackNormal != COLORREF(-1L) )
clrBack = clrBackNormal;
if( clrBack == COLORREF(-1L) )
clrBack = m_wndGrid.OnSiwGetSysColor( COLOR_WINDOW );
m_bInConstruction = true;
{ // BLOCK: client DC
CClientDC dcMeasure( &m_wndGrid );
CExtSafeString strMeasureText = _T(" 000 . 000 . 000 . 000 ");
CSize _sizeData = CExtPaintManager::stat_CalcTextDimension( dcMeasure, m_font, strMeasureText ).Size();
CSize _sizeControl = m_rcInplaceControl.Size();
_sizeData.cy += 2;
if( _sizeControl.cx < _sizeData.cx )
m_rcInplaceControl.right = m_rcInplaceControl.left + _sizeData.cx;
if( _sizeControl.cy < _sizeData.cy )
m_rcInplaceControl.bottom = m_rcInplaceControl.top + _sizeData.cy;
CRect rcAlign = m_wndGrid.OnSwGetClientRect();
if( m_rcInplaceControl.right > rcAlign.right )
m_rcInplaceControl.OffsetRect( rcAlign.right - m_rcInplaceControl.right, 0 );
if( m_rcInplaceControl.left < rcAlign.left )
m_rcInplaceControl.OffsetRect( rcAlign.left - m_rcInplaceControl.left, 0 );
if( m_rcInplaceControl.bottom > rcAlign.bottom )
m_rcInplaceControl.OffsetRect( 0, rcAlign.bottom - m_rcInplaceControl.bottom );
if( m_rcInplaceControl.top < rcAlign.top )
m_rcInplaceControl.OffsetRect( 0, rcAlign.top - m_rcInplaceControl.top );
} // BLOCK: client DC
CExtGIE < CIPAddressCtrl >::Create(
WS_CHILD|WS_VISIBLE,
m_rcInplaceControl,
&m_wndGrid,
UINT( __EXT_MFC_IDC_STATIC )
);
if( m_hWnd == NULL )
{
ASSERT( FALSE );
delete this;
return false;
}
SetFont( &m_font );
CExtGridCellIPAddress * pCell =
DYNAMIC_DOWNCAST( CExtGridCellIPAddress, &m_cell );
ASSERT( pCell != NULL );
ASSERT_VALID( pCell );
DWORD dwCellStyle = m_cell.GetStyle();
if( (dwCellStyle&__EGCS_READ_ONLY) != 0 || bReadOnly )
EnableWindow( FALSE );
if( (m_cell.GetStyleEx()&__EGCS_EX_UNDEFINED_ROLE) != 0
|| m_cell.IsEmpty()
)
m_dwIPAddressPrevious = 0;
else
pCell->GetAddress( m_dwIPAddressPrevious );
m_dwIPAddressInitial = m_dwIPAddressPrevious;
SetAddress( m_dwIPAddressPrevious );
SetWindowPos(
&CWnd::wndTop,0,0,0,0,
SWP_NOMOVE|SWP_NOSIZE
|SWP_NOACTIVATE
|SWP_FRAMECHANGED
|SWP_SHOWWINDOW
);
SetFocus();
m_bInConstruction = false;
g_pHookTarget = this;
INT nIndexWnd = 0;
for( HWND hWnd = ::GetWindow( m_hWnd, GW_CHILD );
hWnd != NULL, nIndexWnd < 4;
hWnd = ::GetWindow( hWnd, GW_HWNDNEXT ), nIndexWnd++
)
{
m_hWndHooked[ nIndexWnd ] = hWnd;
ASSERT( m_hWndHooked[ nIndexWnd ] != NULL );
ASSERT( ::IsWindow(m_hWndHooked[ nIndexWnd ]) );
#if _MFC_VER >= 0x800
m_pWNDPROC[ nIndexWnd ] = (WNDPROC)
::SetWindowLongPtr(
m_hWndHooked[ nIndexWnd ],
__EXT_MFC_GWL_WNDPROC,
(DWORD_PTR)g_HookWndProc
);
#else
m_pWNDPROC[ nIndexWnd ] = (WNDPROC)
::SetWindowLong(
m_hWndHooked[ nIndexWnd ],
__EXT_MFC_GWL_WNDPROC,
(DWORD)g_HookWndProc
);
#endif
ASSERT( m_pWNDPROC[ nIndexWnd ] != NULL );
}
return true;
}
|
|
Ian McIntosh
|
Dec 5, 2007 - 1:22 AM
|
I can reproduce the problem using the simple grids sample by making the following changes in CDemoGrid::_InitDemoTable_Colors():
change static LPCTSTR g_arrHdrNames[] = {_T("Sample"),_T("Text"),_T("Background")}; static INT g_arrHdrExtents[] = { 250, 150, 150 }; to static LPCTSTR g_arrHdrNames[] = {_T("Sample"),_T("Text"),_T("Background"),_T("IP Address")}; static INT g_arrHdrExtents[] = { 250, 150, 150, 70 };
add CExtGridCellIPAddress * pCellIpAddress = STATIC_DOWNCAST( CExtGridCellIPAddress, GridCellGet( 3L, nRowNo, 0, 0, RUNTIME_CLASS(CExtGridCellIPAddress) ) ); pCellIpAddress->TextSet( "0.0.0.0" );
between pCellColor->ModifyStyle( __EGCS_BUTTON_DROPDOWN|__EGCS_CHK_CHECK ); and } // for( LONG nRowNo = 0L; nRowNo < nRowCount; nRowNo++ )
now build & run. go to the color tab and edit one of the IpAddresses. It only allows me to type in 2 digit numbers for each segment.
|
|
Technical Support
|
Dec 4, 2007 - 11:47 AM
|
We tested this feature with the ProfUIS_Controls sample (the Grid page, the IP Address column) and found no problems. We successfully typed any 3-digit based numbers less or equal to 255 in each part of the in-place IP Address control activated by the IP Address grid cells. Please provide more details on how to reproduce this issue.
|
|
Raha Mohtasham
|
Dec 4, 2007 - 8:57 AM
|
Dear Support,
Following questions related to CExtToolBoxWnd:
1) How to disable/enable group items or child items?
2) How to change the group items background color (m_clrBkLT and m_clrBkRB change only the children area color but not the background of the Title)?
Thanks in advance
|
|
Raha Mohtasham
|
Dec 4, 2007 - 8:42 AM
|
Dear Support,
Following questions related to CExtToolBoxWnd:
1) How to disable/enable group items or child items?
2) How to change the group items background color? (m_clrBkLT and m_clrBkRB change only the children area color but not the background of the Title)
Thanks in advance
|
|
Technical Support
|
Dec 4, 2007 - 12:20 PM
|
The CExtToolBoxWnd control does not support disabled items. It is like a palette in the designer and everything is accessible in it. If you want to disable some toolbox item/group, you should hide it by applying the __TBWI_VISIBLE style to the toolbox item. CExtToolBoxWnd::TOOLBOX_ITEM_DATA * pItem = . . .
pItem->ModifyItemStyle( __TBWI_VISIBLE ); The m_clrBkLT and m_clrBkRB color values are used in the CExtToolBoxWnd::OnToolBoxWndEraseEntire() virtual method for painting the entire background of a toolbox control. You can override this method to repainting the background in a custom way. You can override the CExtToolBoxWnd::OnToolBoxWndEraseItem() virtual method to repaint the background of a particular toolbox item.
|
|
Wes Aday
|
Dec 3, 2007 - 4:41 PM
|
When I compiled the DLLs in VS 2008 I got 4 errors on line 180 of ExtLabel.cpp. The line reads:"if( strText.Find( _T(’\t’) ) != -1 )". The errors are: Error 1 error C2017: illegal escape sequence c:\Program Files\FOSS Software Inc\Prof-UIS\Src\ExtLabel.cpp 180 ProfUISDLL Error 2 error C2065: ’L’’ : undeclared identifier c:\Program Files\FOSS Software Inc\Prof-UIS\Src\ExtLabel.cpp 180 ProfUISDLL Error 3 error C2146: syntax error : missing ’)’ before identifier ’t’’ c:\Program Files\FOSS Software Inc\Prof-UIS\Src\ExtLabel.cpp 180 ProfUISDLL Error 4 error C2059: syntax error : ’)’ c:\Program Files\FOSS Software Inc\Prof-UIS\Src\ExtLabel.cpp 180 ProfUISDLL
Changing the single quotes to doubles quotes eliminates the errors.
if( strText.Find( _T("\t") ) != -1 )
|
|
Technical Support
|
Dec 4, 2007 - 1:26 PM
|
Thank you for this information. We can provide you with the latest source code on your request.
|
|
Wes Aday
|
Dec 3, 2007 - 4:43 PM
|
Forgot to mention that this was v2.81 and VS2008 RTM.
|
|
Paul Cowan
|
Dec 3, 2007 - 12:39 PM
|
In v2.81 history you say "Improved the CExtGridCellComboBox so now when the user is typing a letter in the combo box grid cell, the first item in the combo list whose text begins with this letter will be selected." This works, however if the user types a letter that is not the beginning letter of an item in the combo, such as space, the letter is displayed in the combo. In the standard combo, nothing happens when typing an unused letter.
|
|
Paul Cowan
|
Dec 4, 2007 - 11:54 AM
|
|
|
Technical Support
|
Dec 4, 2007 - 11:01 AM
|
It seems you are talking about the combo box whose in-place editor is turned on. You can turned it off to get the desired behavior pCellComboBox->ModifyStyle( __EGCS_NO_INPLACE_CONTROL ); Now the user can only select items from the list. If it is not what you are looking for, please let us know.
|
|
Jacek Piszczek
|
Dec 3, 2007 - 12:55 AM
|
Hi!
There seems to be a problem when calling SetButtons(NULL) on a Ribbon. If there are animation clients active, ProfUIS will crash in CExtToolControlBar::_GetButtonPtr(). This is because CExtToolControlBar::AnimationSite_OnProgressShutdownTimer() calls _UpdateHoverButton which in turn performs a check on all buttons inside _HitTestImpl(). Now let’s look at the code in _RemoveAllButtonsImpl:
for( INT nBtnIdx = 0; nBtnIdx < m_buttons.GetSize(); nBtnIdx++ ) { CExtBarButton * pTBB = m_buttons[nBtnIdx]; ASSERT( pTBB != NULL ); AnimationSite_ClientRemove( pTBB ); delete pTBB; } // for( INT nBtnIdx = 0; nBtnIdx < m_buttons.GetSize(); nBtnIdx++ )
As you can see AnimationSite_ClientRemove may already crash for the 2nd iteration because the m_buttons[0] button was already deleted and the table still contains a bogus pointer. I guess doing the iteration twice (removing all animation clients in the 1st iteration) is the safest solution here.
|
|
Technical Support
|
Dec 3, 2007 - 7:33 AM
|
We think your guess about the crash may be wrong because the CExtToolControlBar::_RemoveAllButtonsImpl() method invokes the AnimationSite_ClientProgressStop() method of each toolbar button object (the animation client) before removing all buttons: void CExtToolControlBar::_RemoveAllButtonsImpl()
{
INT nAcIndex, nAcCount = AnimationSite_ClientGetCount();
for( nAcIndex = 0; nAcIndex < nAcCount; nAcIndex ++ )
{
CExtAnimationClient * pAC = AnimationSite_ClientGetAt( nAcIndex );
AnimationSite_ClientProgressStop( pAC );
}
if( GetMenuTrackingButton() != NULL )
{
_CloseTrackingMenus();
CExtPopupMenuWnd::CancelMenuTracking();
}
if( m_pRightBtn != NULL )
m_pRightBtn->GetButtons().RemoveAll();
for( INT nBtnIdx = 0; nBtnIdx < m_buttons.GetSize(); nBtnIdx++ )
{
CExtBarButton * pTBB = m_buttons[nBtnIdx];
ASSERT( pTBB != NULL );
AnimationSite_ClientRemove( pTBB );
delete pTBB;
} // for( INT nBtnIdx = 0; nBtnIdx < m_buttons.GetSize(); nBtnIdx++ )
m_buttons.RemoveAll();
m_pRightBtn = NULL;
m_nBtnIdxCapture = -1; // nothing captured
m_nBtnIdxHover = -1;
m_nBtnIdxMenuTracking = -1;
} Could you reproduce the crash in a modified version of the RibbonBar sample and send it to us?
|
|
Henry Tso
|
Dec 2, 2007 - 7:42 AM
|
Hi, I new install Windows Vista Ultimate (Traditional Chinese), Visual Studio 2005 Pro Edition and Prof-UIS V2.80 or V2.81. And then load my project wtih Pro-UIS static link. When I click the rebuild all button, Visual Studio 2005 will be crash. Would you give me any comment to fix this problem ?
|
|
Technical Support
|
Dec 2, 2007 - 12:59 PM
|
The problem is known and has to do with a bug in VS 2005 when under certain conditions VS 2005 crashes (it cannot compile resource files for some languages). You can find the details and workaround in this thread.
|
|
Darius Mikalauskas
|
Nov 30, 2007 - 5:14 PM
|
Hello,
how to enable a tooltip on standard toolbar button.
Thank you. Darius
|
|
Technical Support
|
Dec 4, 2007 - 5:48 AM
|
You should specify both status tip and tooltip text for your toolbar buttons. Both text strings should be specified in one line and separated with \n character, e.g. Status tip text\nTool tip text We guess you typed only Status tip text .
|
|
Darius Mikalauskas
|
Dec 3, 2007 - 3:40 PM
|
Text is specified and appiers on status bar. But it doesn’t appear as tooltip. (Tooltips for menu working fine)..
Darius
|
|
Technical Support
|
Dec 1, 2007 - 11:56 AM
|
You should not do anything special to enable tooltips. They appear if you specify text for them.
|
|
Pierre MEDART
|
Nov 30, 2007 - 9:21 AM
|
Is there a way to reduce the size of the text displayed in the tab (CExtTabPageContainerWnd) so that all tab can still be displayed if the user resizes the hosting pane (derived form CExtControlBar) ?
|
|
Pierre MEDART
|
Dec 4, 2007 - 3:40 AM
|
|
|
Technical Support
|
Nov 30, 2007 - 12:10 PM
|
A CExtTabWnd control with items configured to take up the full row and having an equal width (__ETWS_EQUAL_WIDTHS|__ETWS_FULL_WIDTH ) should be exactly what you are looking for.
|
|
Dominik Braendlin
|
Nov 30, 2007 - 5:47 AM
|
Dear Tech Support, Is it possible to add status bar text for menu items that have been added dynamically with ItemInsertCommand. If this is not possible and I have to use the command manager to do so. How can I implement the following problem? I want to display a part of a directory Structure in the MainFrame menu. To do so I have an ID section of about 100 Ids (51000 - 51099). How can I register these on Create with the CMD manager since I never know how many Ids will be used? General: Any example about adding / removing menuitems that are not resource based (UpdateFromMenu / UpdateFromToolBar) functions cannot be used. Regards Adrian
|
|
Technical Support
|
Nov 30, 2007 - 9:43 AM
|
Status tips are supported only for menu items whose data is stored in the command manager. You should register your commands in the command manager first. g_CmdManager->CmdAllocPtr() allocates a new command description object and you can set a string for the status tip in CExtCmdItem::m_sTipStatus . The g_CmdManager->CmdAllocPtr() takes one parameter that is if not zero, specifies the desired command identifier (you assign set directly), and if it is zero, the command identifier will be generated by the method itselself. In Prof-UIS, the range of 29000 to 32000 is used internally. All the other identifiers are available for you. You can use an allocated command identifier when using the CExtPopupMenuWnd::ItemInsert() method rather than (IMPORTANT) in the CExtPopupMenuWnd::ItemInsertCommand() method
|
|
Rado Manzela
|
Nov 28, 2007 - 10:33 AM
|
I’m using CExtPropertyGridCtrl in my project. One of properties is check box. I need to disable some properties (make them read-only) when checkbox is unchecked (react to clicks on this checkbox). How can I do this?
I’ve created custom cell from checkbox cell (it contains my dialog’s callback function’s address + dialog’s "this") and overrided OnClick() function. The problem is that it seems OnClick is called at some copy of cell so it has uninitialized callback address. Why is it cloned? I’m creating it this way (important parts only):
CCellCheckBox *myCk; myCk = (CCellCheckBox*)iCreate(RUNTIME_CLASS(CCellCheckBox),m_cat); myCk->SetCallback(&EnableItems,this); myCk->SetAutoTextMode(true);
CExtGridCell* iCreate(CRuntimeClass *rtc,CExtPropertyItem* parent) { CExtGridCell* val; i.pv = new CExtPropertyValue(dName,NULL,NULL,false,false); val = i.pv->ValueActiveGetByRTC(rtc); parent->ItemInsert(i.pv); return val; }
Anyway isn’t there some smarter way how to notice parent that some cell was clicked? I mean some notification message. I’m creating own cell class just to catch click and send it to dialog which is hosting the grid. Thank you!
|
|
Rado Manzela
|
Nov 30, 2007 - 6:58 AM
|
Thank you, now I’ve got it working :)
BTW: I would suggest you to make built-in support for easier disabling of items, it is quite big code which must be written :)
|
|
Suhai Gyorgy
|
Nov 30, 2007 - 1:52 AM
|
If you create a custom cell class derived from any of the CExtGridCell*** classes, and you add a new member variable to this new class, then you should also override its Assign method. This method is called when the cell is "cloned", as mentioned by Support. Example follows. In .h file: class CCellCheckBox : public CExtGridCellCheckBox
{
public:
DECLARE_SERIAL( CCellCheckBox );
IMPLEMENT_ExtGridCell_Clone( CCellCheckBox, CExtGridCellCheckBox );
CCellCheckBox( CExtGridDataProvider * pDP = NULL );
virtual void Assign( const CExtGridCell & other );
...
private:
bool m_bNewMember;
};
In .cpp file ...
#include "SomeFile.h"
IMPLEMENT_SERIAL( CCellCheckBox, CExtGridCellCheckBox, VERSIONABLE_SCHEMA|1 );
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
...
CCellCheckBox::CCellCheckBox( CExtGridDataProvider * pDP /* = NULL */ )
: CExtGridCellCheckBox( pDP )
, m_bNewMember(false)
{
}
...
void CCellCheckBox::Assign( const CExtGridCell & other )
{
ASSERT_VALID( this );
CExtGridCellCheckBox::Assign( other );
CCellCheckBox *pCell = DYNAMIC_DOWNCAST(CCellCheckBox, (&other));
if ( pCell != NULL )
m_bNewMember = pCell->m_bNewMember;
}
...
|
|
Technical Support
|
Nov 29, 2007 - 2:11 PM
|
Each CExtPropertyValue property value inside the property store tree contains two CExtGridCell*** grid cell objects representing active and default/initial values. The CExtPropertyGridCtrl property grid control is designed as a container for one or more CExtPropertyGridWnd -based tree grid windows displaying the content of a property store. By default, two tree grids are created: CExtPropertyGridWndCategorized and CExtPropertyGridWndSorted . These tree grid windows contain copies of active grid cells from each property value. When some grid cell editing is complete in the active tree grid window, then cell’s value is assigned to cells in other inactive/invisible tree grid window(s) and to active cell value in the corresponding CExtPropertyValue property value object. We assume you have a CExtPropertyValue* pointer and you should disable its cells in both property grid and property store: CExtPropertyValue * pPvToDisable = . . .
CExtPropertyGridWnd * pPGC = . . .
//
// first, we should disable property value’s cells inside property store
//
CExtGridCell * pCellActive = pPvToDisable->ValueActiveGet();
ASSERT_VALID( pCellActive );
pCellActive->ModifyStyle( __EGCS_READ_ONLY, 0 ); // disable it
CExtGridCell * pCellDefault = pPvToDisable->ValueDefaultGet();
ASSERT_VALID( pCellDefault );
pCellDefault->ModifyStyle( __EGCS_READ_ONLY, 0 ); // disable it
//
// second, we should disable cells in tree grids
//
CTypedPtrArray < CPtrArray, CExtPropertyGridWnd * > arrGrids;
pPGC->OnPgcQueryGrids( arrGrids );
INT nGridIdx = 0;
for( ; nGridIdx < arrGrids.GetSize(); nGridIdx ++ )
{
CExtPropertyGridWnd * pGrid = arrGrids[ nGridIdx ];
ASSERT_VALID( pGrid );
HTREEITEM hTreeItem = pGrid->PropertyItemToTreeItem( pPvToDisable );
if( hTreeItem == NULL )
continue;
CExtGridCell * pCellDst = pGrid->ItemGetCell( hTreeItem, 1 );
if( pCellDst == NULL )
continue;
ASSERT_VALID( pCellDst );
pCellDst->ModifyStyle( __EGCS_READ_ONLY, 0 ); // disable it
if( ! pGrid->IsWindowVisible() )
continue;
LONG nRowNo = pGrid->ItemGetVisibleIndexOf( hTreeItem );
if( nRowNo < 0 )
continue;
CRect rc;
if( pGrid->GridCellRectsGet(
1,
nRowNo,
0,
0,
NULL,
&rc
)
)
{
CRect rcClient;
pGrid->GetClientRect( &rcClient );
rc.left = rcClient.left;
rc.right = rcClient.right;
pGrid->InvalidateRect( &rc );
}
}
|
|
Darius Mikalauskas
|
Nov 28, 2007 - 8:34 AM
|
Hello,
how properly handle CExtCheckBox button on toolbar. I created it as described in example with combo box, but after button is checked and mouse pointer is removed from button- sometimes button unchecks.
Thank you in advance. Darius
|
|
Technical Support
|
Nov 29, 2007 - 2:14 PM
|
A CExtToolControlBar window contains a set of CExtBarButton -based objects implementing toolbar buttons. These objects are non-HWND based UI elements. If a button common control is attached to a toolbar button object (push button, check box or radio button), then the checked/pressed state of button window is controlled by MFC’s command updating mechanism which should be used to set checked/unchecked state of the button. It’s not recommended to attach button common controls to button objects inside the CExtToolControlBar window. Please use a non-HWND based CExtBarCheckBoxButton object instead. It works exactly like a simple toolbar button but has a look like a check box common control with a consistent toolbar background. By default, the CExtBarCheckBoxButton window instantiates CExtBarButton objects for all its buttons. You can insert a CExtBarCheckBoxButton check box button or any other type of toolbar button (color picker, undo/redo, etc.) by invoking the CExtToolControlBar::InsertSpecButton() method. Alternatively you can create and use a custom CExtToolControlBar -derived class which implements CExtToolControlBar::OnCreateBarCommandBtn() class CMyToolBar : public CExtToolControlBar
{
public:
virtual CExtBarButton * OnCreateBarCommandBtn(
UINT nCmdID,
UINT nStyle = 0
)
{
ASSERT_VALID( this );
if( nCmdID == ID_YOUR_CHECK_BOX_BUTTON_IN_TOOLBAR )
{
CExtBarCheckBoxButton * pCheckBoxTBB = new CExtBarCheckBoxButton ( this, nCmdID, nStyle );
ASSERT_VALID( pCheckBoxTBB );
return pCheckBoxTBB;
}
return CExtToolControlBar::OnCreateBarCommandBtn( nCmdID, nStyle );
}
};
|
|
Dominik Braendlin
|
Nov 28, 2007 - 5:34 AM
|
Dear Tech Support I create dynamic popup menus using OnExtMenuPrepare(WPARAM wParam, LPARAM lParam) and then pMenu->ItemInsertCommand(… In my void CMainFrame::OnScriptMenuItems(UINT nID) function I need to get the menu text. Is there a way to get that menu text by using the nID? Regards, Adrian
|
|
Dominik Braendlin
|
Nov 29, 2007 - 11:58 PM
|
Std::map – that’s how I did it so far. I see, there is no way to read it back from the menu item using the nID.
Adrian
|
|
Technical Support
|
Nov 29, 2007 - 2:17 PM
|
You can remember the menu items you inserted into a menu in some CMap or std::map map object where command identifiers are used as key values and menu item text strings as mapped values.
|
|
David Skok
|
Nov 27, 2007 - 3:03 PM
|
given an HTREEITEM and a column. How can I do it?
There isn’t an equivalent to CExtGridWnd::GridCellRectsGet in CExtTreeGridWnd that accepts HTREEITEM rather than row.
I need it to invalidate a progress cell rect for repainting in a tree.
Thanks, Dave
|
|
Technical Support
|
Nov 28, 2007 - 4:17 AM
|
You should use CExtGridWnd::GridCellRectsGet() for all grid windows (CExtGridWnd , CExtTreeGridWnd and CExtReportGridWnd ). You can convert a HTREEITEM handle into a plain zero-based row index by using CExtTreeGridWnd::ItemGetByVisibleRowIndex() . Please note this method returns a negative value if it failed to compute a row index in a tree row (one of row’s parent items is collapsed).
|
|
Suhai Gyorgy
|
Nov 28, 2007 - 1:29 AM
|
You should use LONG CExtTreeGridWnd::ItemGetVisibleIndexOf( HTREEITEM hTreeItem) const; method to get the row index from HTREEITEM. If the item is not visible ( its parent is not expanded ), the return value will be -1, otherwise you can use the return value in CExtGridWnd::GridCellRectsGet method.
|
|
Juri Tsjornoi
|
Nov 27, 2007 - 4:12 AM
|
Hello! Could you tell me please, is it possible to use CExtPropertyGrid control without caption cell (left cell)? So that only value cell (right cell) will be in the grid. I guess I should overwrite CExtPropertyItem::OnGridRowInitialized method?
|
|
Technical Support
|
Nov 27, 2007 - 5:46 AM
|
A CExtPropertyGridCtrl control is a container for one or more CExtPropertyGridWnd -based tree grid windows displaying the content of an attached property store. By default, two tree grid windows are used, CExtPropertyGridWndCategorized and CExtPropertyGridWndSorted . These tree grids are designed for a two-column layout. The property grid control won’t work if any of the inner tree grids has only one column with values.
If you need a single column grid, you can use a custom property grid control which initializes some custom tree grid classes. That is you should override the CExtPropertyGridCtrl::OnPgcCreateGrids() method in a CExtPropertyGridCtrl -derived class. Make this method similar to the original one except that you should use your CExtPropertyGridWndCategorized -derived and CExtPropertyGridWndSorted -derived tree grid classes. In these tree grids, override the CExtPropertyGridWnd::OnGbwAdjustRects() method so that you can adjust default rectangles of grid cells inside the tree grid window. The CExtPropertyGridWnd::OnGbwAdjustRects() method works in a way that a grid cell in the first column of property category row covers a cell in the second value column (that is empty for category rows). You should do the same with property value rows, but the second value column should cover the first name column.
|
|
Debabrata Mukherjee
|
Nov 26, 2007 - 10:34 AM
|
My windows Application shakes violently in JPN locale after Prof-UIS integration. It works fine in English locale though.
|
|
Technical Support
|
Dec 21, 2007 - 6:25 AM
|
Unfortunately we have not received it. Would you send it again and a copy to profuis at gmail.com?
|
|
Debabrata Mukherjee
|
Dec 19, 2007 - 10:49 AM
|
I have sent you guys a separate email
|
|
Technical Support
|
Nov 27, 2007 - 7:39 AM
|
It is not completely clear what you mean by "shakes violently”. Would you provide more details and send some screenshots so we can better understand what the problem is?
|