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 |
|
Paul Cowan
|
Oct 11, 2007 - 9:18 AM
|
I have a data grid with buttons in the cells (using __EGCS_BUTTON_ELLIPSIS). If I make a cell read-only, the button is disabled. I still need the button to work in these cells. How can I have an enabled button in a read-only cell?
|
|
Technical Support
|
Oct 13, 2007 - 12:11 PM
|
We are not completely sure what result you are expecting to get but if you need a cell without inplace editor, the __EGCS_NO_INPLACE_CONTROL cell style can be more suitable than __EGCS_READ_ONLY .
Read-only cells come with an in-place editor, but it is read-only. In the case of the disabled in-place editor, it is not activated at all pCell->ModifyStyle( __EGCS_NO_INPLACE_CONTROL );
|
|
Paul Cowan
|
Oct 11, 2007 - 1:34 PM
|
Thanks for the info. I now have the button enabled, however clicking the button doesn’t work. I’m using CExtGridWnd::OnGridCellButtonPressed to detect and handle the button clicking, but this is not being called because CExtGridCell::OnClick checks if the cell is read-only. I don’t want to override OnClick for every cell type. How do I work around this?
|
|
Technical Support
|
Oct 11, 2007 - 10:50 AM
|
You can control if a cell button is enabled or disabled by overriding CExtGridCell::OnQueryButtonInfo() virtual bool OnQueryButtonInfo(
INT nButtonType,
bool * p_bEnabled,
bool * p_bPressed = NULL,
bool * p_bStayPressed = NULL,
UINT * p_nTimerElapseValue = NULL
) const;
|
|
Adrian M
|
Oct 11, 2007 - 5:25 AM
|
1. How to make the CExtGroupBox text use the same color as the bar (like in the Controls sample). My CExtGroupBox controls have the text black. 2. Is the CExtGridWnd control suited for many rows, on the order of thousands? Will it be resposive when scrolling up/down, or when adding new rows and populating them? Some of the rows (few of them) will have the progress control activated in one column. 3. Is it possible to use the same progress control from the CExtGridWnd outside of the grid, instead of the default CProgressCtrl for example? Or in general, is it possible to use some of the controls demoed with the grid outside of the grid? 4. Is it possible to link a dll with the static version of the prof-uis libraries? 5. How to change the text size of a CExtLabel? 6. How to do a search on the forums for "all words". I tried AND but it didn’t seem to work - all queries seem to use OR by default, which means many irrelevant posts.
Thanks,
Adrian
|
|
Technical Support
|
Oct 11, 2007 - 10:45 AM
|
1. To show a caption in the group box, set the CExtGroupBox::STYLE_CAPTION style for it m_wndGroupBox.SetStyle( CExtGroupBox::STYLE_CAPTION ); 2. Scrolling an unlimited data source is not a problem. This is fully supported in the Prof-UIS grid. You need to use a virtual grid. The solution is based on coding a CExtGridDataProviderRecordSet -derived class and implementing all its abstract methods. The cacheable and virtual grid windows are demonstrated in the AdoRecordsetView sample. Open the recordset options dialog and specify database connection settings and an SQL Query. Now you can click OK to see the results in the grid window. There is a check box in the recordset options dialog: Use Virtual Mode. If it is checked, the data is displayed in the virtual mode. If unchecked, a simple cacheable mode is used instead. In fact, both modes are based on caching. This means the grid window keeps only data records which are visible on the screen. But simple cacheable mode is based on a database recordset with a known number of rows in the query result and you can see the vertical scrollbar that is working classically. The virtual mode is based on a recordset with an unknown number of rows. The vertical scrollbar in the virtual mode can have only three states: top, middle and bottom. The virtual database recordset knows only the current record position and whether the current record at this position is the first and/or last record in the returned table. This explains the meaning of the grid virtual mode and the behavior of the scroll bar in this mode. The virtual mode can be used if the data base API supports only this kind of recordset or if you have a very large scrollable data range which often becomes updated dynamically. The Prof-UIS grid window supports the cacheable and/or virtual scrolling strategies in both horizontal and vertical directions even at the same time. 3. Actually any grid cell is windowless controls. It cannot be used as a standalone controls. But there is a trick when you can create a grid window with one column and one row without outer grid headers. So you will get only one cell. After that just resize the grid window so that it has the very same size as this cell. Note you need to use the CExtGridWnd::GridCellRectsGet() method to retrieve the cell’s rectangle. As a result you will visually see the control based on a grid cell. As for the progress bar you can use the CExtProgressWnd control which is a skinned version of the progress common control so it does not introduce any new features but the skinned look. 4. What the dll you want to link with? Your question is not clear. Please give us more information on this. 5. You should change the font size by creating a new font with an appropriate size and assign it to the label using the SetFont() method 6. Please try quotation marks. For example, "MFC control bar"
|
|
Malcolm D
|
Oct 10, 2007 - 7:44 PM
|
The case I am using I am using a grid to replace a list-ctrl, because it is more powerful, and easier to do more than basic stuff. Is there a way of making the grid appear like a list-ctrl? The main part which is different in appearance is the columns headers - they are quite different from the list-ctrl header (in XP). There may be some other minor differences I haven’t noticed. I have used the styles etc to make it as much like a list-ctrl as possible.
|
|
Technical Support
|
Oct 11, 2007 - 10:09 AM
|
You can use the Report Grid with the CExtPaintManagerNativeXP paint manager installed. Check the ReportGrid sample to see how it works. The simple grid does not support such a look.
|
|
Malcolm D
|
Oct 10, 2007 - 7:36 PM
|
Is there a way of making the selection behave the same way as selection in a list ctrl. E.G Ctrl enables multi-selection , but if you select an item that is already selected, it unselects. When using shift it selects every where from the initial selection to the last clicked item. If you click again with shift then it removes the previous selection before adding the new selection. The case I am using is full row selection, and selection different rows.
This is the same behaviour we get in explorer.
|
|
Technical Support
|
Oct 11, 2007 - 10:07 AM
|
Different ways of selection are demonstrated in the SimpleGrids sample and described in the Help bar right in the application. It seems you are looking for the selection model that is shown in the Order Details grid. If so, just check the source code that creates this grid for the grid styles you need to set.
|
|
Eric CASADOUMECQ
|
Oct 10, 2007 - 1:53 AM
|
Hi,
In an MDI project based on the document/view architecture, I have a child view class derived from CExtWA < CExtWS < CExtAFV < CFormView> > > class in a CExtControlBar. I would like having my FormView stretch dynamically to entire client area of the CExtControlBar window. I have tried this code but with no effect:
void CMyExtControlBar::OnSize(UINT nType, int cx, int cy) { CExtControlBar::OnSize(nType,cx,cy); if(m_pView) { CRect rect; GetClientRect(&rect); m_pView->MoveWindow(rect);
} }
Have you got an idea?
|
|
Suhai Gyorgy
|
Oct 10, 2007 - 3:18 AM
|
CExtControlBar automatically resizes its single child window to fit, you don’t have to add any code to implement this. What makes you think that the formview is not resized?
Have you set anchors for its controls in its OnInitialUpdate? If so, please read this FAQ: How to apply anchoring for controls when using CFormView?
FormViews, similarly to dialogs, have a minimum size which is the size set in their resource. If you try to make the formview smaller than that size, scrollbars should appear.
|
|
Andrew Moulden
|
Oct 8, 2007 - 3:42 PM
|
Hi,
I have a CExtGridCellColor in a property grid, and on initialization I am setting the color value to 7D9EC0, which maps to "LightBlue" in the preset color dropdown. If the user simply clicks within the cell and then immediately moves focus to another grid cell (i.e. no edit is made), the color in the grid cell changes to ADD8E6. The text still says "LightBlue" but is painted in bold text, indicating a change from default.
It seems that this is a problem with two colors mapping to an identical name (one a Web color, the other an Office color). Presumably the RGB->text pulls one of these first out of the lookup map, and text->RGB pulls the other first. This could happen with other colors too I imagine.
For me this isn’t a major issue as I’ve just changed the default color and I’m hoping users never encounter the problem, but I believe the mapping should be consistent, otherwise it looks like a bug.
Thanks.
|
|
Technical Support
|
Oct 9, 2007 - 11:08 AM
|
Thank you for reporting this issue. We have renamed web colors in CExtGridCellColor::CPackedColor::InitColorMap() method in the ../Prof-UIS/Src/ExtGridWnd.cpp file static struct
{
LPCTSTR lpszColorName;
COLORREF clr;
} _arrWebColors[] =
{
{ _T("WebSnow"), RGB(0xFF, 0xFA, 0xFA) },
{ _T("WebGhostWhite"), RGB(0xF8, 0xF8, 0xFF) },
{ _T("WebWhiteSmoke"), RGB(0xF5, 0xF5, 0xF5) },
{ _T("WebGainsboro"), RGB(0xDC, 0xDC, 0xDC) },
{ _T("WebFloralWhite"), RGB(0xFF, 0xFA, 0xF0) },
{ _T("WebOldLace"), RGB(0xFD, 0xF5, 0xE6) },
{ _T("WebLinen"), RGB(0xFA, 0xF0, 0xE6) },
{ _T("WebAntiqueWhite"), RGB(0xFA, 0xEB, 0xD7) },
{ _T("WebPapayaWhip"), RGB(0xFF, 0xEF, 0xD5) },
{ _T("WebBlanchedAlmond"), RGB(0xFF, 0xEB, 0xCD) },
{ _T("WebBisque"), RGB(0xFF, 0xFA, 0xF0) },
{ _T("WebPeachPuff"), RGB(0xFF, 0xDA, 0xB9) },
{ _T("WebNavajoWhite"), RGB(0xFF, 0xDE, 0xAD) },
{ _T("WebMoccasin"), RGB(0xFF, 0xE4, 0xB5) },
{ _T("WebCornsilk"), RGB(0xFF, 0xF8, 0xDC) },
{ _T("WebIvory"), RGB(0xFF, 0xFF, 0xF0) },
{ _T("WebLemonChiffon"), RGB(0xFF, 0xFA, 0xCD) },
{ _T("WebSeashell"), RGB(0xFF, 0xF5, 0xEE) },
{ _T("WebHoneydew"), RGB(0xF0, 0xFF, 0xF0) },
{ _T("WebMintCream"), RGB(0xF5, 0xFF, 0xFA) },
{ _T("WebAzure"), RGB(0xF0, 0xFF, 0xFF) },
{ _T("WebAliceBlue"), RGB(0xF0, 0xF8, 0xFF) },
{ _T("Weblavender"), RGB(0xE6, 0xE6, 0xFA) },
{ _T("WebLavenderBlush"), RGB(0xFF, 0xF0, 0xF5) },
{ _T("WebMistyRose"), RGB(0xFF, 0xE4, 0xE1) },
{ _T("WebWhite"), RGB(0xFF, 0xFF, 0xFF) },
{ _T("WebBlack"), RGB(0x00, 0x00, 0x00) },
{ _T("WebDarkSlateGray"), RGB(0x2F, 0x4F, 0x4F) },
{ _T("WebLightSlateGray"), RGB(0x77, 0x88, 0x99) },
{ _T("WebGrey"), RGB(0xBE, 0xBE, 0xBE) },
{ _T("WebLightGray"), RGB(0xD3, 0xD3, 0xD3) },
{ _T("WebMidnightBlue"), RGB(0x19, 0x19, 0x70) },
{ _T("WebCornflowerBlue"), RGB(0x64, 0x95, 0xED) },
{ _T("WebDarkSlateBlue"), RGB(0x48, 0x3D, 0x8B) },
{ _T("WebSlateBlue"), RGB(0x6A, 0x5A, 0xCD) },
{ _T("WebMediumSlateBlue"), RGB(0x7B, 0x68, 0xEE) },
{ _T("WebLightSlateBlue"), RGB(0x84, 0x70, 0xFF) },
{ _T("WebNavyBlue"), RGB(0x00, 0x00, 0x80) },
{ _T("WebDimGrey"), RGB(0x69, 0x69, 0x69) },
{ _T("WebSlateGrey"), RGB(0x70, 0x80, 0x90) },
{ _T("WebMediumBlue"), RGB(0x00, 0x00, 0xCD) },
{ _T("WebRoyalBlue"), RGB(0x41, 0x69, 0xE1) },
{ _T("WebBlue"), RGB(0x00, 0x00, 0xFF) },
{ _T("WebDodgerBlue"), RGB(0x1E, 0x90, 0xFF) },
{ _T("WebDeepSkyBlue"), RGB(0x00, 0xBF, 0xFF) },
{ _T("WebSkyBlue"), RGB(0x87, 0xCE, 0xEB) },
{ _T("WebLightSkyBlue"), RGB(0x87, 0xCE, 0xFA) },
{ _T("WebSteelBlue"), RGB(0x46, 0x82, 0xB4) },
{ _T("WebLightSteelBlue"), RGB(0xB0, 0xC4, 0xDE) },
{ _T("WebLightBlue"), RGB(0xAD, 0xD8, 0xE6) },
{ _T("WebPowderBlue"), RGB(0xB0, 0xE0, 0xE6) },
{ _T("WebPaleTurquoise"), RGB(0xAF, 0xEE, 0xEE) },
{ _T("WebDarkTurquoise"), RGB(0x00, 0xCE, 0xD1) },
{ _T("WebMediumTurquoise"), RGB(0x48, 0xD1, 0xCC) },
{ _T("WebTurquoise"), RGB(0x40, 0xE0, 0xD0) },
{ _T("WebCyan"), RGB(0x00, 0xFF, 0xFF) },
{ _T("WebLightCyan"), RGB(0xE0, 0xFF, 0xFF) },
{ _T("WebCadetBlue"), RGB(0x5F, 0x9E, 0xA0) },
{ _T("WebMediumAquamarine"), RGB(0x66, 0xCD, 0xAA) },
{ _T("WebAquamarine"), RGB(0x7F, 0xFF, 0xD4) },
{ _T("WebDarkGreen"), RGB(0x00, 0x64, 0x00) },
{ _T("WebDarkOliveGreen"), RGB(0x55, 0x6B, 0x2F) },
{ _T("WebDarkSeaGreen"), RGB(0x8F, 0xBC, 0x8F) },
{ _T("WebSeaGreen"), RGB(0x2E, 0x8B, 0x57) },
{ _T("WebMediumSeaGreen"), RGB(0x3C, 0xB3, 0x71) },
{ _T("WebLightSeaGreen"), RGB(0x20, 0xB2, 0xAA) },
{ _T("WebPaleGreen"), RGB(0x98, 0xFB, 0x98) },
{ _T("WebSpringGreen"), RGB(0x00, 0xFF, 0x7F) },
{ _T("WebLawnGreen"), RGB(0x7C, 0xFC, 0x00) },
{ _T("WebGreen"), RGB(0x00, 0xFF, 0x00) },
{ _T("WebChartreuse"), RGB(0x7F, 0xFF, 0x00) },
{ _T("WebMedSpringGreen"), RGB(0x00, 0xFA, 0x9A) },
{ _T("WebGreenYellow"), RGB(0xAD, 0xFF, 0x2F) },
{ _T("WebLimeGreen"), RGB(0x32, 0xCD, 0x32) },
{ _T("WebYellowGreen"), RGB(0x9A, 0xCD, 0x32) },
{ _T("WebForestGreen"), RGB(0x22, 0x8B, 0x22) },
{ _T("WebOliveDrab"), RGB(0x6B, 0x8E, 0x23) },
{ _T("WebDarkKhaki"), RGB(0xBD, 0xB7, 0x6B) },
{ _T("WebPaleGoldenrod"), RGB(0xEE, 0xE8, 0xAA) },
{ _T("WebLtGoldenrodYello"), RGB(0xFA, 0xFA, 0xD2) },
{ _T("WebLightYellow"), RGB(0xFF, 0xFF, 0xE0) },
{ _T("WebYellow"), RGB(0xFF, 0xFF, 0x00) },
{ _T("WebGold"), RGB(0xFF, 0xD7, 0x00) },
{ _T("WebLightGoldenrod"), RGB(0xEE, 0xDD, 0x82) },
{ _T("WebGoldenrod"), RGB(0xDA, 0xA5, 0x20) },
{ _T("WebDarkGoldenrod"), RGB(0xB8, 0x86, 0x0B) },
{ _T("WebRosyBrown"), RGB(0xBC, 0x8F, 0x8F) },
{ _T("WebIndianRed"), RGB(0xCD, 0x5C, 0x5C) },
{ _T("WebSaddleBrown"), RGB(0x8B, 0x45, 0x13) },
{ _T("WebSienna"), RGB(0xA0, 0x52, 0x2D) },
{ _T("WebPeru"), RGB(0xCD, 0x85, 0x3F) },
{ _T("WebBurlywood"), RGB(0xDE, 0xB8, 0x87) },
{ _T("WebBeige"), RGB(0xF5, 0xF5, 0xDC) },
{ _T("WebWheat"), RGB(0xF5, 0xDE, 0xB3) },
{ _T("WebSandyBrown"), RGB(0xF4, 0xA4, 0x60) },
{ _T("WebTan"), RGB(0xD2, 0xB4, 0x8C) },
{ _T("WebChocolate"), RGB(0xD2, 0x69, 0x1E) },
{ _T("WebFirebrick"), RGB(0xB2, 0x22, 0x22) },
{ _T("WebBrown"), RGB(0xA5, 0x2A, 0x2A) },
{ _T("WebDarkSalmon"), RGB(0xE9, 0x96, 0x7A) },
{ _T("WebSalmon"), RGB(0xFA, 0x80, 0x72) },
{ _T("WebLightSalmon"), RGB(0xFF, 0xA0, 0x7A) },
{ _T("WebOrange"), RGB(0xFF, 0xA5, 0x00) },
{ _T("WebDarkOrange"), RGB(0xFF, 0x8C, 0x00) },
{ _T("WebCoral"), RGB(0xFF, 0x7F, 0x50) },
{ _T("WebLightCoral"), RGB(0xF0, 0x80, 0x80) },
{ _T("WebTomato"), RGB(0xFF, 0x63, 0x47) },
{ _T("WebOrangeRed"), RGB(0xFF, 0x45, 0x00) },
{ _T("WebRed"), RGB(0xFF, 0x00, 0x00) },
{ _T("WebHotPink"), RGB(0xFF, 0x69, 0xB4) },
{ _T("WebDeepPink"), RGB(0xFF, 0x14, 0x93) },
{ _T("WebPink"), RGB(0xFF, 0xC0, 0xCB) },
{ _T("WebMediumVioletRed"), RGB(0xC7, 0x15, 0x85) },
{ _T("WebVioletRed"), RGB(0xD0, 0x20, 0x90) },
{ _T("WebMagenta"), RGB(0xFF, 0x00, 0xFF) },
{ _T("WebViolet"), RGB(0xEE, 0x82, 0xEE) },
{ _T("WebPlum"), RGB(0xDD, 0xA0, 0xDD) },
{ _T("WebLightPink"), RGB(0xFF, 0xB6, 0xC1) },
{ _T("WebPaleVioletRed"), RGB(0xDB, 0x70, 0x93) },
{ _T("WebMaroon"), RGB(0xB0, 0x30, 0x60) },
{ _T("WebOrchid"), RGB(0xDA, 0x70, 0xD6) },
{ _T("WebMediumOrchid"), RGB(0xBA, 0x55, 0xD3) },
{ _T("WebDarkOrchid"), RGB(0x99, 0x32, 0xCC) },
{ _T("WebDarkViolet"), RGB(0x94, 0x00, 0xD3) },
{ _T("WebBlueViolet"), RGB(0x8A, 0x2B, 0xE2) },
{ _T("WebPurple"), RGB(0xA0, 0x20, 0xF0) },
{ _T("WebMediumPurple"), RGB(0x93, 0x70, 0xDB) },
{ _T("WebThistle"), RGB(0xD8, 0xBF, 0xD8) },
};
|
|
Richard Rodruck
|
Oct 8, 2007 - 10:25 AM
|
When I implement a CExtGridCellComboBox and populate it, if you type in a letter to go to an item nothing happens. In searching this forum it looks like it is supposed to work like a regular combo box and select the first item with that letter. This is true in the sample prof uis controls also. I am using version 2.80. Is there something I need to do to make this work? I overroad the function that is supposed to perform this operation and the message WM_CHAR never fires.
|
|
Technical Support
|
Oct 11, 2007 - 11:38 AM
|
The feature is implemented. Now when the user is typing a letter something and the focus is on a combo box cell or the popup list box is visible, the corresponding item whose text begins with this letter is selected. If there are several items with text beginning with the same letter, they are selected cyclically. This behavior is identical to that in the standard combo box.
Please update the source code for the CExtGridCellComboBox class. Add the following method declaration virtual bool OnKey(
CExtGridWnd & wndGrid,
bool bKeyDownEvent, // true - key-down event, false - key-up event
UINT nChar, // virtual key code
UINT nRepCnt, // key-down/key-up press count
UINT nFlags // key-down/key-up event flags
);
here its implementation:
bool CExtGridCellComboBox::OnKey(
CExtGridWnd & wndGrid,
bool bKeyDownEvent, // true - key-down event, false - key-up event
UINT nChar, // virtual key code
UINT nRepCnt, // key-down/key-up press count
UINT nFlags // key-down/key-up event flags
)
{
ASSERT_VALID( this );
ASSERT_VALID( (&wndGrid) );
DWORD dwCellStyle = GetStyle();
if( (dwCellStyle&__EGCS_READ_ONLY) != 0 )
return false;
if( bKeyDownEvent )
{
CString sSpecSymbols( _T("~`!@#$%ˆ&*()_-+={}[]:;\"’|\\<,>.?/ ") );
TCHAR ch = (TCHAR)nChar;
if( IsCharAlphaNumeric( ch )
|| sSpecSymbols.FindOneOf( CString(ch) )
)
{
LONG nNextItem = -1L;
LONG nCurSel = GetCurSel();
LONG nItemsProcessed = 0L;
LONG nItem = nCurSel;
LONG nCount = GetCount();
while( nItemsProcessed < nCount )
{
if( nItem == -1L )
nItem = 0L;
else if( nItem < nCount - 1L )
nItem++;
else
nItem = 0L;
ITEM_INFO * pItemInfo = m_arrItems[ nItem ];
ASSERT( pItemInfo != NULL );
CExtSafeString sItemString = pItemInfo->m_sString;
if( sItemString.GetLength() > 0 )
{
CExtSafeString sStringToFind = ch;
sItemString.MakeLower();
sStringToFind.MakeLower();
if( sItemString[0] == sStringToFind[0] )
{
nNextItem = nItem;
break;
}
}
nItemsProcessed++;
}
if( nNextItem >= 0L
&& nNextItem != nCurSel
)
{
SetCurSel( nNextItem, true );
CPoint ptFocus = wndGrid.FocusGet();
if( ptFocus.x >= 0 && ptFocus.y >= 0 )
wndGrid.OnGridCellInputComplete(
*this,
ptFocus.x,
ptFocus.y,
0,
0
);
}
return true;
}
} // if( bKeyDownEvent )
return
CExtGridCellString::OnKey(
wndGrid,
bKeyDownEvent,
nChar,
nRepCnt,
nFlags
);
} Then update the CExtPopupListBoxMenuWnd::_OnKeyDown() method bool CExtPopupListBoxMenuWnd::_OnKeyDown(
UINT nChar,
UINT nRepCnt,
UINT nFlags,
bool & bNoEat
)
{
ASSERT_VALID( this );
if( GetSafeHwnd() == NULL )
return true; //false;
if( GetSite().GetAnimated() != NULL )
return true;
if( _IsResizingMode() )
{
bNoEat = true;
return false;
}
TranslateKeyboardEventData_t _td( this, nChar, nRepCnt, nFlags, bNoEat );
if( _td.Notify() )
{
bNoEat = _td.m_bNoEat;
return true;
}
if( nChar == VK_F4 )
{
bNoEat = false;
_EndSequence();
return true;
}
CExtPopupInplaceListBox * pListBox =
STATIC_DOWNCAST(
CExtPopupInplaceListBox,
CWnd::FromHandlePermanent( GetChildCtrlHWND() )
);
ASSERT( pListBox != NULL );
ASSERT_VALID( pListBox );
CString sSpecSymbols( _T("~`!@#$%ˆ&*()_-+={}[]:;\"’|\\<,>.?/ ") );
TCHAR ch = (TCHAR)nChar;
if( IsCharAlphaNumeric( ch )
|| sSpecSymbols.FindOneOf( CString(ch) )
)
{
LONG nNextItem = -1L;
LONG nCurSel = pListBox->GetCurSel();
LONG nItemsProcessed = 0L;
LONG nItem = nCurSel;
LONG nCount = pListBox->GetCount();
while( nItemsProcessed < nCount )
{
if( nItem == -1L )
nItem = 0L;
else if( nItem < nCount - 1L )
nItem++;
else
nItem = 0L;
CExtSafeString sItemString;
pListBox->GetText( nItem, sItemString );
if( sItemString.GetLength() > 0 )
{
CExtSafeString sStringToFind = ch;
sItemString.MakeLower();
sStringToFind.MakeLower();
if( sItemString[0] == sStringToFind[0] )
{
nNextItem = nItem;
break;
}
}
nItemsProcessed++;
}
if( nNextItem >= 0L
&& nNextItem != nCurSel
)
pListBox->SetCurSel( nNextItem );
}
return
CExtPopupControlMenuWnd::_OnKeyDown(
nChar,
nRepCnt,
nFlags,
bNoEat
);
} Recompile the Prof-UIS library after that.
|
|
Technical Support
|
Oct 8, 2007 - 2:06 PM
|
We can regard your message as a feature request and implemented it very soon. Thank you.
|
|
Ian McIntosh
|
Oct 8, 2007 - 5:44 AM
|
I have found that screen tips shadows are not cleared if the screen tip is not fully drawn. This is an extract from my user’s report:
hover over a ribbon bar button. After about a second or two, the screen tip fades up quickly. If you pull your mouse away just as its fading up (you’ve only got a fraction of a second !), you end up with the outline of the screen tip as a shadow that doesn’t go away. The shadow even stays on top when you have other applications’ windows on top
|
|
Technical Support
|
Oct 8, 2007 - 1:14 PM
|
Thank you for reporting the problem. We are working on it now.
|
|
Debabrata Mukherjee
|
Oct 7, 2007 - 10:04 PM
|
I have a dockable control bar which is docked with a main CExtTabPageContainerWnd. Now when I open another OCX is loaded onto my main application, the entire application gets refreshed. It is now that the dockable control bar gets vanished because the docking code had been written in the oncreate() method and this is called only once during the startup of the application. Could you please let us know what could be the reasons?
|
|
Debabrata Mukherjee
|
Oct 24, 2007 - 11:45 PM
|
I have a Mainframe for my main app called saisd. I have a dockable control bar called "binsbar" that is created inside the OnCreate() of MainFrame. Inside the Mainframe I have CExtTabPageContainerWnd called the ChildView. This child view class has three tab pages. CSaISMainFrame::OnCreate() { //Creation of TabPage ContinerWnd in the OnCreateClient method here. if( CExtNCW < CFrameWnd > :: OnCreate( lpCreateStruct ) == -1 ) return -1; //Following is the code for creation of binsbar
m_wndBinsBar.SetInitDesiredSizeVertical(CSize(200,50)); CString strFrameName = _T(""); strFrameName.LoadString(IDS_SAIS_BIN_EXPLORER); if( !m_wndBinsBar.Create(strFrameName,this,AFX_WS_DEFAULT_VIEW/*,AFX_IDW_PANE_FIRST*/)) { TRACE0(_T("Failed to create m_wndBinsBar\n")); return -1; // fail to create }
CCreateContext* pContext = NULL; if (lpCreateStruct != NULL) pContext = (CCreateContext*)lpCreateStruct->lpCreateParams;
if( ! m_pBinsView->Create(NULL,_T(""),WS_CHILD | WS_VISIBLE,CRect(200,50,1,1), &m_wndBinsBar,ID_SAIS_BINSVIEW,pContext)) { ASSERT( FALSE ); return -1; } CRect crAlreadyDockBinBarforFormat; m_wndDataToolsBar.GetWindowRect( &crAlreadyDockBinBarforFormat ); crAlreadyDockedBar.OffsetRect( 1, 0 ); DockControlBar(&m_wndFormattingBar,AFX_IDW_DOCKBAR_TOP,&crAlreadyDockBinBarforFormat); RecalcLayout(); //UI Enhancements 6.5
CExtControlBar::g_bAllowDynamicTabsOleDropTarget = true; m_wndBinsBar.EnableDocking( CBRS_ALIGN_ANY ); if( !m_wndBinsBar.DockControlBarInnerOuter(AFX_IDW_DOCKBAR_LEFT,false,NULL,1)) { ASSERT( FALSE ); return -1; } if( ! CExtControlBar::FrameEnableDocking(this) ) { ASSERT( FALSE ); return -1; } // #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS) if( ! CExtControlBar::FrameInjectAutoHideAreas(this) ) { ASSERT( FALSE ); return -1; } //#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
if( ! CExtControlBar::ProfileBarStateLoad( this, /*pApp->m_pszRegistryKey, pApp->m_pszProfileName,*/ _T("SAISD"),_T("DESIGN STUDIO"), pApp->m_pszProfileName, &m_dataFrameWP ) ) { //DockControlBar( &m_wndMenuBar ); DockControlBar( &m_wndBinsBar, AFX_IDW_DOCKBAR_LEFT ); } }
At runtime when I drag a so called "transform", the new toolbars and menubars in the mainframe are loaded. Also these transforms have a new mainframe of theirs. So when they get loaded the docked bins bar vanishes as of course it was created and docked with the original mainframe of the application not the one that we loaded just now. However if I have done an auto hide, then I can see the binsbar at the side. Please let me know if I can dock my controlbar at the available mainframe rather than the one which was originally created.
Please treat it with utmost urgency.!
|
|
Debabrata Mukherjee
|
Oct 12, 2007 - 5:23 AM
|
A mail was sent yesterday with screenshots but we have not recieved any updates yet
|
|
Technical Support
|
Oct 8, 2007 - 2:05 PM
|
This re-painting effect can be caused by the ActiveX control. The easiest way to solve such a problem is to create your ActiveX control as a child of its invisible parent window and then show the parent window.
|
|
Richard Chaney
|
Oct 7, 2007 - 10:13 AM
|
My application allows customization with unmodified keyboard accelerators, using the __ECSF_ALLOW_UNMODIFIED_ACCELERATORS flag. This is so a Photoshop style tool selector can use a single keypress to select a tool.
When a CExtEdit has focus, these keys cannot be typed into the edit, since they trigger the accelerator command.
Is there a way to stop the accelerators when CExtEdit has focus? Thanks.
|
|
Technical Support
|
Oct 8, 2007 - 10:11 AM
|
You should use the following message pre-translation in your main frame class: BOOL CMainFrame::PreTranslateMessage( MSG * pMsg )
{
if( WM_KEYFIRST <= pMsg->message && pMsg->message <= WM_KEYLAST )
{
HWND hWndFocus = ::GetFocus();
if( hWndFocus != NULL )
{
CWnd * pWnd = CWnd::FromHandlePermanent( hWndFocus );
if( pWnd != NULL )
{
if( pWnd->IsKindOf( RUNTIME_CLASS( CExtEdit ) ) )
return FALSE;
}
}
}
// your default message pre-translation code goes here
. . .
|
|
Adrian M
|
Oct 7, 2007 - 9:49 AM
|
I replaced CExtResizableDialog with CExtNCW < CExtResizableDialog > as base class for my app’s dialog, and now when I start it up, it always gets positioned in the top left corner of the screen, instead of in the middle. Any easy fix for this?
Thanks.
Adrian
|
|
Adrian M
|
Oct 10, 2007 - 2:32 PM
|
Calling CWnd::CenterWindow() fixed the problem.
Thanks,
Adrian
|
|
Technical Support
|
Oct 9, 2007 - 11:13 AM
|
We are not sure that the DLL project type affects this problem. Please ensure you have specified the correct parent window for the dialog when invoking its constructor. Please also let us know what happens when you invoke the dialog’s CWnd::CenterWindow() . If you send us a test project, that should help us find out what’s wrong. But first, would let us take a look at the dialog’s creation code?
|
|
Technical Support
|
Oct 8, 2007 - 10:44 AM
|
Please check if this can be reproduced with our dialog-based applications (e.g. ProfUIS_Controls and IconEditor), which are also based on CExtNCW < CExtResizableDialog > . If not, could you send a project that demonstrates the problem?
|
|
Adrian M
|
Oct 8, 2007 - 4:34 PM
|
The two samples obviously don’t have this problem.
Do you need it just to look at my project or to build and debug it too? My project depends on some external libraries, so without these you won’t be able to build it.
Not sure if this makes any difference - the dialog is implemented as a dll, and it is displayed by running another executable and callling an exported method in the dll.
Adrian
|
|
Adrian M
|
Oct 6, 2007 - 1:51 PM
|
I have a dialog whose code is in a dll. I’m trying to add a toolbar using CToolControlBar but I can’t get the different buttons to show. Here’s what I get:
http://www.amichel.com/toolbar/toolbar.jpg (BTW, how to you insert an image in a post? I tried with but that didn’t work).
Some buttons show when I click the arrow at the right, but they are disabled (this has to do with command handlers though). The first several buttons don’t show here as though there were already on the toolbar.
Second, is it possible to add any controls to this toolbar? For example, I need to add a date/time control with a button to bring up the calendar control - how can I do that?
Thanks,
adrian
|
|
Adrian M
|
Oct 10, 2007 - 2:37 PM
|
It turns out I wasn’t calling the required command manager methods to handle profiles - I’m calling them now and the toolbar is working fine.
Thanks for your help,
Adrian
|
|
Technical Support
|
Oct 9, 2007 - 11:24 AM
|
First of all, please ensure CWnd::RepositionBars( 0, 0xFFFF, 0 ); is invoked after toolbar buttons are initialized. Second, you can send us your dialog’s source code so we will clarify what may be wrong.
|
|
Adrian M
|
Oct 8, 2007 - 4:20 PM
|
I had already done that ( the call to RepositionBars) but it didn’t make any difference. I think my first image was misleading - it was not about the toolbar size or position (see this image http://www.amichel.com/toolbar/toolbar.jpg ), regardless of the toolbar size, no buttons are displayed there. But it looks like internally the code things the buttons are there as I explained in my first message.
Regarding the second question, I already read that article, but I could not experiment with this feature because I couldn’t get any buttons to show. I’ll try that when I get this first issue fixed.
Thanks,
Adrian
|
|
Technical Support
|
Oct 8, 2007 - 10:38 AM
|
A CExtToolControlBar toolbar created inside a dialog cannot be dockable. So your dialog is responsible for positioning such a toolbar near a dialog side. The code CWnd::RepositionBars( 0, 0xFFFF, 0 ); placed at the end of dialog’s OnInitDialog() and OnSize() methods do that and resizes the toolbar so it displays the maximum possible number of buttons.
As for your second question please read the How to insert controls into the toolbar?.
We are sorry but you cannot use the <img> at the moment. We will fix it soon.
|
|
Adrian M
|
Oct 8, 2007 - 4:24 PM
|
I’m reposting as a reply to your message - sorry about the duplicate post.
I had already done that ( the call to RepositionBars) but it didn’t make any difference. I think my first image was misleading - it was not about the toolbar size or position (see this image http://www.amichel.com/toolbar/toolbar.jpg ), regardless of the toolbar size, no buttons are displayed there. But it looks like internally the code things the buttons are there as I explained in my first message.
Regarding the second question, I already read that article, but I could not experiment with this feature because I couldn’t get any buttons to show. I’ll try that when I get this first issue fixed.
Thanks,
Adrian
|
|
Andrew Banks
|
Oct 5, 2007 - 8:34 PM
|
I would like a slider that represents a range of values rather than just one.
Therefore, say the min/max were 0-100. Once I move the slider from 0 up, a painted bar follows the slider upward similar to a progress bar.
That way, it is clear to the user that all values from 0 to the slider bar are included.
Do you have this. I don’t see it in the docu.
|
|
Technical Support
|
Oct 8, 2007 - 2:14 PM
|
In the AdoRecordsetView sample, you can find a custom painted slider window near the bottom of the vertical scroll bar in it. This control is implemented in the CInplaceSliderWnd class. As you can see, its painting code is very simple. You can put this class into your project and use it. It requires only a small improvement to fit your requirements. The rcChannel and rcThumb rectangle can be used for computing left/and right parts which you can fill using some desired color.
|
|
Suhai Gyorgy
|
Oct 5, 2007 - 6:16 AM
|
Dear Support,
In our non-customizable application we are using a color selection button in the toolbar. I’d like to make the button reflect the currently selected color in its icon. Unfortunately all of your samples which uses the color selection button are customizable, so probably this is the reason you haven’t encountered the problem I have: When the application is non-customizable, CExtBarColorButton::ColorGet is reduced to the following code:
return bSelected ? m_clrDefault : m_clrSelected;
As you can see, this produces the default color when it should produce the selected one. Because of this, OnSyncIcon sets an icon with the default color and not with the selected color, as it should.
Please, check this issue! Thank you!
|
|
Technical Support
|
Oct 8, 2007 - 12:58 PM
|
If you click the color area of a CExtBarColorButton toolbar button, the classic WM_COMMAND message with color button’s identifier will be sent. The command handler method should access the CExtBarColorButton object to get its color value and apply it to something in your project. If you click the drop-down arrow, then the CExtPopupColorMenuWnd color popup menu is displayed and you should handle its notification messages (CExtPopupColorMenuWnd:: g_nMsgNotifyColorChangedFinally ).
|
|
Technical Support
|
Oct 5, 2007 - 1:42 PM
|
We confirm this typo in the CExtBarColorButton::ColorGet() method. In fact it should be COLORREF CExtBarColorButton::ColorGet( bool bSelected ) const
{
ASSERT_VALID( this );
#if (!defined __EXT_MFC_NO_CUSTOMIZE)
const CExtToolControlBar * pBar = GetBar();
CExtCustomizeCmdTreeNode * pNode = ((CExtBarButton*)this)->GetCmdNode(false);
if( pNode != NULL
&& pBar->GetSafeHwnd() != NULL
&& ::IsWindow( pBar->GetSafeHwnd() )
)
{
ASSERT_VALID( GetBar() );
ASSERT_VALID( pNode );
CExtCustomizeSite * pSite =
((CExtToolControlBar *)GetBar())->GetCustomizeSite();
if( pSite != NULL )
{
COLORREF clr = bSelected ? m_clrSelected : m_clrDefault;
if( pSite->OnColorItemValueGet(
(CExtBarColorButton*)this,
pNode,
clr,
bSelected
)
)
return clr;
} // if( pSite != NULL )
}
#endif // (!defined __EXT_MFC_NO_CUSTOMIZE)
return bSelected ? m_clrSelected : m_clrDefault;
} The CExtBarColorButton toolbar buttons are used in the DRAWCLI sample which is non-customizable in Prof-UIS Freeware.
|
|
Suhai Gyorgy
|
Oct 5, 2007 - 3:23 PM
|
In connection to Color button, whats the default behaviour when user clicks the button with separated dropdown set? In my application, it seems as if it produces a random color, but it could be something specific in my app.
|
|
Paul Cowan
|
Oct 4, 2007 - 10:57 AM
|
How can I get the grid to show ###’s instead of a number for a cell that is too narrow to show the entire number, as Excel does?
|
|
Technical Support
|
Oct 8, 2007 - 11:47 AM
|
You can do this by using a custom grid cell class in which the CExtGridCell::OnPaintText() method is overridden so it measures the text before painting it and paints either the default text or ###.
|
|
Dominik Braendlin
|
Oct 4, 2007 - 12:46 AM
|
Dear Tech Support As mentioned in my last question our MDI application consists of a main frame e.g. CMainFrame and several different child frames e.g. CMDIChildWnd. http://www.prof-uis.com/Forum_View.aspx?CID=40&M=57803
I am using the g_CmdManager to organize all the Toolbar and Menubar handling. I’ve been having problems while serializing to and from the registry due to missing ID’s. This problem should be solved by know but in order to do this I had to get a closer look at the samples programs and this support form.
Unfortunately I am still a bit uncertain whether I am using the command manger in the right way. Looking at all the samples and forum threads did not give me a somehow consistent picture of the command manager.
At the moment I use in the OnCreate method of the MainFrame ProfileSetup -> ProfileWndAdd -> UpdateFromMenu -> UpdateFromToolbar -> SerializeState. In the DestroyWindow I use SerializeState -> ProfileWndRemove. This seems to work fine but I have seen examples where each child window is also being registered. If I try to do this I am starting to have problems with the dock able toolbars of the child windows. As soon as they are floating they are either gaining or losing text and pictures which I have assigned to them with g_CmdManager->CmdGetPtr -> pCmdItem->m_sToolbarText = string.
What is the common way with an MDI application? Only register the mainframe or do I also need to register the child frames. Our application comes closest to the MDI_InnerOuterBars sample application. One thing I do not understand about the MDI_InnerOuterBars application is why they use the ProfileWndRemove() in the ChildFrame::DestroyWindow(). I cannot see that this child window ever gets registered.
|
|
Technical Support
|
Oct 4, 2007 - 11:25 AM
|
If you have a fixed number of MDI child frame/view/document types in your project, you should register all the toolbars and menus in the main frame’s OnCreate() method. The OnCreate() method in the MDI child frame classes should only create their control bars in this case.
In the case of a variable number of MDI child frame/view/document types (for instance, implemented as plugins ), each MDI child frame should use its unique command profile as the main frame class does. There is one additional restriction related to the CExtMenuControlBar menu bar window: there must be only one instance of the menu bar instance in scope of one command manager’s profile. So, if your MDI child frames have their inner menu bars, these frames should also use their unique command profiles in the command manager. If you are going to make temporarily existing windows like MDI child frames having their unique command profiles, then these profiles should have unique names and the MDI child frame window handle should be removed from its profile which makes the command manager removing profile and all its command descriptions. Please provide us with more details about your project, especially MDI child frame(s), so we can help you.
|
|
Malcolm D
|
Oct 3, 2007 - 10:40 PM
|
(in 2.7 - you may have fixed it in 2.8 I haven’t checked yet) When I use CExtGridCellObjectSize in a data grid, without changing any settings, it removes ’0’ (zeros) when it shouldn’t. For example if the size should be 90 KB it displays this as 9 KB. (the original number is 92160, with units set to "KB")
It does this when m_bAllowTrailingZeroes is set to true (the default is "true" in CExtGridCellNumberBase). This variable should be set to true but it seems that the call to OnQueryTrailingZeroes() is used incorrectly in "CExtGridCellObjectSize::TextGet" - it trims any zeros, not just ones after the decimal separator. The implementation of TextGet in CExtGridCellNumberBase seems to have the correct behaviour in regards to the usage of OnQueryTrailingZeroes().
|
|
Technical Support
|
Oct 4, 2007 - 8:36 AM
|
Thank you for reporting the bug. Here is the fixed CExtGridCellObjectSize::TextGet() method void CExtGridCellObjectSize::TextGet( CExtSafeString & strCopy ) const
{
ASSERT_VALID( this );
if( (GetStyleEx()&__EGCS_EX_UNDEFINED_ROLE) != 0
|| IsEmpty()
)
{
strCopy = _T("");
return;
}
strCopy.Empty();
if( this->vt == VT_EMPTY )
return;
VARIANT varCopy;
::VariantInit( &varCopy );
HRESULT hr =
stat_VariantCopy(
&varCopy,
LPVARIANT( LPCVARIANT( this ) )
);
if( FAILED(hr) )
{
ASSERT( FALSE );
return;
}
e_Mode_t eMode = GetMode();
INT nPower = 0;
switch( eMode )
{
case eAuto:
break;
case eBytes:
nPower = 1;
break;
case eKilobytes:
nPower = 10;
break;
case eMegabytes:
nPower = 20;
break;
case eGigabytes:
nPower = 30;
break;
case eTerabytes:
nPower = 40;
break;
case ePetabytes:
nPower = 50;
break;
case eExabytes:
nPower = 60;
break;
}
VARIANT varRight;
VARIANT varResult;
::VariantInit( &varRight );
::VariantInit( &varResult );
if( nPower > 1 )
{
varRight.vt = VT_R8;
V_R8(&varRight) = pow( 2.0, DOUBLE(nPower) );
HRESULT hr =
::VarDiv(
&varCopy,
&varRight,
&varResult
);
if( SUCCEEDED(hr) )
stat_VariantCopy(
&varCopy,
&varResult
);
}
else if( nPower == 0 )
{
VARIANT varBase;
::VariantInit( &varBase );
varBase.vt = VT_R8;
V_R8(&varBase) = 1024;
INT nModeCurrent = INT( eKilobytes );
for( nPower = 10; nPower <= 60; nPower += 10, nModeCurrent++ )
{
varRight.vt = VT_R8;
V_R8(&varRight) = pow( 2.0, DOUBLE(nPower) );
HRESULT hr =
::VarDiv(
&varCopy,
&varRight,
&varResult
);
if( SUCCEEDED(hr) )
{
if( stat_VariantCompare( &varResult, &varBase ) < 0 )
{
stat_VariantCopy(
&varCopy,
&varResult
);
eMode = e_Mode_t( nModeCurrent );
break;
}
}
}
}
stat_VariantClear( &varRight );
stat_VariantClear( &varResult );
CExtSafeString sNumberText;
if( ! OnQueryNumberText( &varCopy, sNumberText ) )
return;
UINT nNumDigits = OnQueryNumDigits( &varCopy );
if( ! OnQueryTrailingZeroes() )
{
INT nPosPoint = sNumberText.ReverseFind( _T(’.’) );
UINT nNumDigitsReal = 0;
if( nPosPoint >= 0 )
nNumDigitsReal = min( sNumberText.GetLength() - 1 - nPosPoint, 9 );
if( nNumDigitsReal < nNumDigits )
nNumDigits = nNumDigitsReal;
}
stat_VariantClear( &varCopy );
NUMBERFMT fmt;
memset( &fmt, 0, sizeof(NUMBERFMT) );
fmt.NumDigits = nNumDigits;
fmt.LeadingZero = OnQueryLeadingZero();
fmt.NegativeOrder = OnQueryNegativeOrder();
CExtSafeString sGrouping;
OnQueryGrouping( sGrouping );
sGrouping.Remove( _T(’;’) );
sGrouping.TrimRight( _T(’0’) );
fmt.Grouping = _ttoi( sGrouping );
CExtSafeString sDecimalSep;
OnQueryDecimalSeparator( sDecimalSep );
fmt.lpDecimalSep = sDecimalSep.GetBuffer( sDecimalSep.GetLength() );
sDecimalSep.ReleaseBuffer();
CExtSafeString sThousandSep;
OnQueryThousandSeparator( sThousandSep );
fmt.lpThousandSep = sThousandSep.GetBuffer( sThousandSep.GetLength() );
sThousandSep.ReleaseBuffer();
CExtSafeString sText;
VERIFY(
g_ResourceManager->GetNumberFormat(
0,
sNumberText,
&fmt,
sText.GetBuffer( 100 ),
100
) != 0
);
sText.ReleaseBuffer();
CExtSafeString sAbbreviation;
OnQuerySizeAbbreviation( eMode, sAbbreviation );
strCopy.Format( _T("%s %s"), sText, sAbbreviation );
strCopy.TrimRight();
}
|
|
Debabrata Mukherjee
|
Oct 3, 2007 - 9:30 AM
|
Even with ProfUIS 2.8 I am still facing DebugAsserts in my Debug Setup when ever I move the mouse over the Scroll arrow in the CExtTabWnd. What could be the resolution to this.
One more thing is Enabling ToolTips also causes unavoidable DebugAsserts in the Debug Setup for tab pages in CExtTabWnd.( Not found in release)
My working on Debug Setup is very difficult.Kindly suggest ASAP. This is very urgent
|
|
Technical Support
|
Oct 3, 2007 - 1:14 PM
|
We came to conclusion the assertion problems occur due to conflicts between two or more MFC based ActiveX controls in your application. Please try excluding the ActiveX controls from your project and then add them one by one. This should allow you to find the conflict source. We believe there must be some initialization errors in some of ActiveX controls.
|
|
Debabrata Mukherjee
|
Oct 3, 2007 - 6:31 AM
|
Can you let me know the handler for this?
|
|
Technical Support
|
Oct 16, 2007 - 12:42 PM
|
The CChildView window is the parent for the CYourTabWnd window. So you should invoke the following code in the OnTabWndClickedItem() method GetParent()->SendMessage( . . .
|
|
Debabrata Mukherjee
|
Oct 15, 2007 - 9:28 AM
|
class CChildView : public CExtTabPageContainerOneNoteWnd { class CYourTabWnd : public CExtTabWnd { protected: virtual bool OnTabWndClickedItem(LONG nItemIndex,bool bButtonPressed,INT nMouseButton,UINT nMouseEventFlags) { bool bRet = CExtTabWnd::OnTabWndClickedItem(nItemIndex,bButtonPressed,nMouseButton,nMouseEventFlags); //CSaIsDoc * pDoc = (CSaIsDoc *)((CSaIsMainFrame*)GetParentFrame()->GetActiveDocument()); if(nItemIndex > 2) { if ( nMouseButton == MK_RBUTTON ) { //GetPresentationView()->SendMessage(WM_SAIS_SINK_TAB_RIGHT_CLICKED,0,nItemIndex); //CChildView::GetMessageForPresentationView(nItemIndex); } } return bRet; }
}; virtual CExtTabWnd * OnTabWndGetTabImpl() { return new CExtTWPC < CYourTabWnd >; } I have a query... I wanto send a message to the CSaIsPresentationView class which has an object as a member of CChildView . But in this nested declaration that you have suggested me, it seems difficult to do...
Please respond..Its very urgent.!
|
|
Technical Support
|
Oct 3, 2007 - 1:08 PM
|
This method is required to make the tab page container use the CYourTabWnd control inside it instead of CExtTabWnd that is used by default. This is a very important method because tab item clicks are handled in the CYourTabWnd class.
|
|
Debabrata Mukherjee
|
Oct 3, 2007 - 9:53 AM
|
virtual CExtTabWnd * OnTabWndGetTabImpl() { return new CExtTWPC < CYourTabWnd >; }
Is this part required? If yes then what for
|
|
Suhai Gyorgy
|
Oct 3, 2007 - 1:11 PM
|
Yes, it’s needed. Every CExtTabPageContainerWnd-derived object uses a built-in CExtTabWnd-derived object (the tabs with which users can switch between pages). OnTabWndClickedItem is method of CExtTabWnd class, so you have to override it in a CExtTabWnd-derived class. With the above OnTabWndGetTabImpl method you make your TabPageContainerWnd class use your TabWnd-derived object. If you don’t override it, the TabPageContainer will use the default tabwnd implementation, not yours.
|
|
Suhai Gyorgy
|
Oct 3, 2007 - 9:28 AM
|
Use this class as your TabPageContainer. Change the base classes appropietly if you need Whidbey or any other type of tab: class CYourTabPageContainerWnd : public CExtTabPageContainerWnd
{
class CYourTabWnd : public CExtTabWnd
{
protected:
virtual bool OnTabWndClickedItem(
LONG nItemIndex,
bool bButtonPressed,
INT nMouseButton, // MK_... values
UINT nMouseEventFlags
)
{
bool bRet = CExtTabWnd::OnTabWndClickedItem(
nItemIndex,
bButtonPressed,
nMouseButton,
nMouseEventFlags
);
if ( nMouseButton == MK_RBUTTON ) {
// nItemIndex indicates which tab item is clicked
// bButtonPressed is true for WM_LBUTTONDOWN and false for WM_LBUTTONUP
}
return bRet;
}
};
virtual CExtTabWnd * OnTabWndGetTabImpl()
{
return new CExtTWPC < CYourTabWnd >;
}
};
Check out Help for more information on OnTabWndClickedItem method.
|
|
Debabrata Mukherjee
|
Oct 3, 2007 - 6:07 AM
|
Hi Support,
I try to remove multiple pages from the CextTabPageContainerWnd. using the method PageRemove(Idex,no.from index,TRUE). But this crashes in both ProfUIS 2.54 and 2.80 . Any pointers into what may be going wrong.
If I do single pageRemoval in a loop, this works fine.
One more query is : Can I Remove a page from the TabPageContainerWnd and not select the previous tab by default. i.e. if i remove the page with index 9, i donot want the 8 to be selected.Can it be done?
Please suggest ASAP.
Thanks
|
|
Technical Support
|
Oct 3, 2007 - 12:43 PM
|
We tested the CExtTabPageContainerWnd::PageRemove() and found no problems with it. But anyway we have changed this method to make it safer. So now any crashes are simply impossible.
Here is the modified code: LONG CExtTabPageContainerWnd::PageRemove(
LONG nIndex,
LONG nCountToRemove, // = 1
bool bDestroyPageWnd // = true
)
{
ASSERT_VALID( this );
if( nIndex > m_pWndTab->ItemGetCount() - 1L )
return 0L;
LONG nCountRemoved = 0L; // returns count of removed items
LONG nCount = m_pWndTab->ItemGetCount();
LONG nAvailToRemove = nCount - nIndex;
if( nCountToRemove > nAvailToRemove )
nCountToRemove = nAvailToRemove;
for( LONG i = 0L; i < nCountToRemove; i++ )
{
HWND hWnd = (HWND) m_pWndTab->ItemLParamGet( nIndex );
if( hWnd != NULL
&& ::IsWindow( hWnd )
)
{
::ShowWindow( hWnd, SW_HIDE );
if( bDestroyPageWnd )
::DestroyWindow( hWnd );
}
if( m_pWndTab->ItemRemove( nIndex, 1L, false ) > 0L )
nCountRemoved++;
}
nCount = m_pWndTab->ItemGetCount();
for( i = 0L; i < nCount; i++ )
::SetWindowLong(
(HWND)m_pWndTab->ItemLParamGet(i),
GWL_ID,
0x101 + i
);
// select previous page
if( nCount > 0L )
{
if( nIndex > 0L )
nIndex--;
PageSelectionSet( nIndex );
}
_RepositionBarsImpl();
if( nCountRemoved > 0L )
m_pWndTab->UpdateTabWnd( true );
return nCountRemoved;
}
|
|
Suhai Gyorgy
|
Oct 3, 2007 - 9:14 AM
|
True, PageRemove really seems a bit messy when second parameter is bigger than 1. I’m sure Support will soon fix it, in the meanwhile remove the pages with a loop.
If you don’t want the previous page selected, which page would you like selected? One of the pages have to be selected at all times. If you want the last page selected, you can do that by calling PageSelectionSet(PageGetCount() - 1); right after PageRemove ( or after the loop with PageRemove in it ). Or select the first page by calling the same method with 0 as parameter.
|
|