Subject |
Author |
Date |
|
Krustys Donuts
|
May 12, 2008 - 11:19 AM
|
I am using a CTreeGridWnd. I have the __EGBS_SFB_FULL_ROWS flag set. This configuration is getting me the desired functionallity with one exception. When a row is clicked, the clicked-on row is selected and all other rows are deslected. This is great. My problem is when a row is clicked while the SHIFT key pressed, the selection state of the clicked-on row is toggled and all other rows remain in the same selection state. I would like this behavior to be provided by the CTRL key, not the SHIFT key. What is the best way to make this change? Thanks, Gil
|
|
Krustys Donuts
|
Aug 26, 2008 - 12:25 PM
|
Sorry about the incomplete code snipet. Below is the complete routine.
/////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// bool UINT nChar, VRTeachpointGrid::OnGbwAnalyzeCellMouseClickEvent(// VK_LBUTTON, VK_RBUTTON or VK_MBUTTON onlyUINT nRepCnt, // 0 - button up, 1 - single click, 2 - double click, 3 - post single click & begin editingUINT nFlags, // mouse event flagsCPoint point // mouse pointer in client coordinates) { ASSERT_VALID( ASSERT( 0 <= nRepCnt && nRepCnt <= 3 ); { this );if( nChar == VK_LBUTTON )//If the user is pressing the CTRL key. { if (CExtPopupMenuWnd::IsKeyPressed( VK_CONTROL ))// HandleCtrlClickSelection(point); // return false; } //If the user is pressing the SHIFT key. { else if (CExtPopupMenuWnd::IsKeyPressed( VK_SHIFT ))// HandleShiftClickSelection(point); // return false; } CExtGridHitTestInfo htInfo( point ); HitTest( htInfo, false, true );if (htInfo.IsHoverEmpty() || (! htInfo.IsValidRect() ))return false;//If the user has clicked on an inner cell.INT nColType = htInfo.GetInnerOuterTypeOfColumn(); INT nRowType = htInfo.GetInnerOuterTypeOfRow(); { && OnTreeGridQueryColumnOutline( htInfo.m_nColNo ) && (htInfo.m_dwAreaFlags&__EGBWA_TREE_OUTLINE_AREA) != 0) && (htInfo.m_dwAreaFlags&(__EGBWA_CELL_BUTTON|__EGBWA_CELL_CHECKBOX)) == 0) { HTREEITEM hTreeItem = ItemGetByVisibleRowIndex( htInfo.m_nRowNo ); || ((htInfo.m_dwAreaFlags&__EGBWA_TREE_BOX) != 0)) { OnTreeGridToggleItemExpandedState(htInfo.m_nRowNo, &htInfo); } } if ((nColType == 0) && (nRowType == 0))if (( (nRepCnt == 1)if (((nRepCnt == 2) && (hTreeItem != NULL) && (ItemGetChildCount( hTreeItem ) > 0))return true;//If the user has single-clicked on one of the inner cells. { else if ((nRepCnt == 1) && (htInfo.m_dwAreaFlags & __EGBWA_INNER_CELLS))//If user has clicked on one of the cells in the approved or orientation columns. { if ((htInfo.m_nColNo == kPlateAndA1OrientCol) || (htInfo.m_nColNo == kApprovedCol))//Make sure this cell is of the correct type.VRCellPicture* pCell = { HTREEITEM htiItem = ItemGetByVisibleRowIndex(htInfo.m_nRowNo); string strTpName = GetTpName(htiItem); VRTeachpoint tp = m_modTpList.GetTeachpoint(strTpName); dynamic_cast<VRCellPicture*>(GridCellGet(htInfo));if (pCell != NULL)//If this TP is locked, don’t allow the change. { string str = (boost::format(st.GetString( IDS_strLockedTpErr)) % strTpName).str(); AfxMessageBox(str.c_str()); } if (tp.GetLockedFlg())else{ tp.ToggleA1Orientation((UINT)pCell->LParamGet()); tp.ToggleApprovedFlg((UINT)pCell->LParamGet()); ModTeachpoint(tp.GetName(), tp); } } } } } if (htInfo.m_nColNo == kPlateAndA1OrientCol)else if (htInfo.m_nColNo == kApprovedCol)//Single click on name header cell. Reverse sorting. (htInfo.m_dwAreaFlags & __EGBWA_OUTER_TOP)) { m_bAscendingOrder = !m_bAscendingOrder; SortTps(m_bAscendingOrder); } } else if ((nRepCnt == 1) && (htInfo.m_nColNo == kNameCol) &&// if( nChar == VK_LBUTTON && ( nRepCnt == 1 || nRepCnt == 2 ) ) if( nRepCnt == 2 )returnCExtGridWnd::OnGbwAnalyzeCellMouseClickEvent( // not CExtTreeGridWndnChar, nRepCnt, nFlags, point ); returnCExtTreeGridWnd::OnGbwAnalyzeCellMouseClickEvent( nChar, nRepCnt, nFlags, point ); }
Thanks,
Gil
|
|
Technical Support
|
Aug 27, 2008 - 11:50 AM
|
We tried to copy the method source code from your message into Visual Studio’s C++ source code editor for further code formatting, analysis and testing but we noticed that many lines in your code snippet are swapped with each other. For instance, the first three code lines are:
bool
UINT nChar,
VRTeachpointGrid::OnGbwAnalyzeCellMouseClickEvent(// VK_LBUTTON, VK_RBUTTON or VK_MBUTTON only
The second and third lines are definitively swapped because the UINT nChar, line is definitively the method’s parameter declaration. We have no any ideas what can be reason for such funny copy-paste effect. We would like to avoid any misunderstanding while testing your code snippet. Could you please send us a source file with this method to the support mail box at this web site?
|
|
Krustys Donuts
|
Aug 15, 2008 - 11:23 AM
|
Dear Support, I’ve tried the above suggestion and cannot achieve the desired selection behavoir. The code below shows my attempt: At initialization: SiwModifyStyle( __ESIS_STH_PIXEL | __EGBS_SUBTRACT_SEL_AREAS | __ESIS_STV_ITEM | __EGBS_SFB_FULL_ROWS | __EGBS_RESIZING_CELLS_OUTER_H | __EGBS_DYNAMIC_RESIZING | __EGBS_MULTI_AREA_SELECTION | __EGBS_NO_HIDE_SELECTION | __EGBS_GRIDLINES, 0, //Enable false); In the OnGbwAnalyzeCellMouseClickEvent:
bool
VRTeachpointGrid::OnGbwAnalyzeCellMouseClickEvent(// VK_LBUTTON, VK_RBUTTON or VK_MBUTTON only
UINT nRepCnt, // 0 - button up, 1 - single click, 2 - double click, 3 - post single click & begin editing
UINT nFlags, // mouse event flags
CPoint point // mouse pointer in client coordinates
)
{
ASSERT_VALID(
ASSERT( 0 <= nRepCnt && nRepCnt <= 3 );
{
this );if( nChar == VK_LBUTTON )//If the user is pressing the CTRL key.
{
CExtGridHitTestInfo htInfo( point );
HitTest( htInfo,
{
FocusSet(CPoint(htInfo.m_nColNo, htInfo.m_nRowNo));
}
} if (CExtPopupMenuWnd::IsKeyPressed( VK_CONTROL ))false, true );if (SelectionGetForCell(htInfo.m_nColNo, htInfo.m_nRowNo))return false; UINT nChar,
|
|
Technical Support
|
Aug 16, 2008 - 1:18 PM
|
The selection behavior on mouse clicks is implemented in grid’s OnGbwAnalyzeCellMouseClickEvent() virtual method which is overridden in your grid class. We do not see where your method invokes the base class method. The incomplete code in your message does not allow us to find out what may be wrong. Could you reproduce this problem using any of our sample applications with a grid or some small test project?
|
|
Technical Support
|
May 13, 2008 - 11:40 AM
|
The Ctrl key classically adds or toggles the selected state of one row. The Shift key does the same but with a range of rows starting from the previously focused row and up to the new focused row and just the clicked row. The grid controls (including the tree grid) support intersected and non-intersected multi row selection models. If __EGBS_SUBTRACT_SEL_AREAS is applied to a grid window by using the SiwModifyStyle() method, both the Shift and Ctrl keys will be used for selecting new rows and un-selecting already selected rows. If this style is not applied, both keys will only add selected rows. You need some kind of non-standard selection behavior in the tree grid window. You need the intersected selection model with the Shift key and simple additive selection with the Ctrl key. So, your tree grid control should have the __EGBS_SUBTRACT_SEL_AREAS style and you can override the CExtGridBaseWnd::OnGbwAnalyzeCellMouseClickEvent() virtual method. This method should check whether the VK_CONTROL key is pressed using the CExtPopupMenuWnd::IsKeyPressed() static method and whether the clicked grid cell is already selected. The CExtGridBaseWnd::HitTest() and CExtGridBaseWnd::SelectionGetForCell() methods should be used to determine the selected state of the just clicked grid cell. If it’s already selected and clicked with the Ctrl key being pressed, then you should simply move focus to it without changing the selection using the CExtGridBaseWnd::FocusSet() method and do not invoke the parent class method.
|
|
Jeremy Richards
|
May 12, 2008 - 10:10 AM
|
I need to show a (possibly hidden, or buried in a stack of tabs) CExtControlBar window. I can do this easily enough, with
CMainFrame * pMainFrame = . . .;
CExtControlBar * pBar = . . .;
pMainFrame->SendMessage( WM_COMMAND, WPARAM( pBar->GetDlgCtrlID() ) ); However, this also moves the focus to that window which I do not want. Is there any way to show the docking window without moving the focus to it? I dug through the code a little and it seems like there is some sort of message that could be interecepted to modify this behavior, but it wasn’t clear to me exactly which window was getting this message or how to handle it.
|
|
Technical Support
|
May 13, 2008 - 11:43 AM
|
Thank you for the interesting question. You can simply invoke the CFrameWnd::ShowControlBar() method for a resizable control bar which is not in the auto-hidden mode (CExtControlBar::AutoHideModeGet() ) or for a dynamic resizable control bar which is not in the auto-hidden mode and not in the document mode (CExtDynamicControlBar::BarStateGet() ).
You can also use the current WM_COMMAND based method. The CExtControlBar window receives a CExtControlBar::g_nMsgQueryFocusChangingEnabled registered message with a pointer to the CExtControlBar::QueryFocusChangingEnabled_t data structure in the WPARAM parameter. You can handle this message and set the CExtControlBar::QueryFocusChangingEnabled_t::m_bFocusChangingEnabled property to false . This won’t allow the focus to be set to the control bar’s child window.
|
|
Offer Har
|
May 12, 2008 - 5:16 AM
|
I have an application, in it a floating bar. 1) Click on the main-frame title bar to give it the focus (this ensures the floating bar does not have focus) 2) Move mouse to the frame of the floating bar 3) Start dragging (fast! from the time you press down the button till you start move the mouse do not wait) You will see that the frame and the mouse cursor are not in the same place - the frame is lagging after the mouse. This did not happen in version 2.82.
|
|
Technical Support
|
May 29, 2008 - 11:46 AM
|
This is fixed. Thank you.
|
|
Technical Support
|
May 23, 2008 - 1:52 PM
|
We used the SDI sample application for testing this issue. We made the resizable bar "Resizable Bar 2" floating. We moved the arrow mouse cursor to the bottom right position over the character "2". We tried to click and drag the mouse very quickly as possible and drag-n-dropped the resizable bar. After that it had the character "2" under the same arrow cursor position. We repeated the tests with a toolbar and menu bar and got the same result. We used only laser mouse devices in our tests (Logitech G5 and Logitech G7 high quality mouse devices designed for gamers and Logitech NX 50 small laser mice for notebooks).
|
|
Offer Har
|
May 28, 2008 - 5:17 PM
|
I sent you a video of the problem by mail.
There is one important piece of information that you must have missed - the bar must not have the focus when starting the drag.
|
|
Offer Har
|
May 12, 2008 - 4:06 AM
|
I use the latest 2.83 version, and I still get my child frames not skinned - what do I need to do to skin the child frame? Thanks.
|
|
Technical Support
|
May 12, 2008 - 12:56 PM
|
You should derive you child frame class from CExtNCW < CMDIChildWnd > .
|
|
Offer Har
|
May 11, 2008 - 4:59 PM
|
When an CExtEdit is hovered, it expands by one pixel frame. Is it possible to have this frame always displayed, not only when it is hovered?
|
|
Technical Support
|
May 15, 2008 - 9:14 AM
|
If you need an edit control with a thin solid border, you can achieve that with the CExtFlatEdit class (see the Prof-UIS_Controls sample.
|
|
Offer Har
|
Jun 21, 2008 - 9:45 AM
|
Asking again - why don’t you add this as a standard part of the library? This might be useful to a lot of users.
|
|
Offer Har
|
May 15, 2008 - 10:47 AM
|
Why Is this class not part of the library?
|
|
Offer Har
|
May 10, 2008 - 9:10 AM
|
Is there any chance this control will become skinned? If not, then what is its purpose, and what alternative control do you suggest?
|
|
Offer Har
|
May 11, 2008 - 4:58 PM
|
Never mind... changed to one column grid:
|
|
Technical Support
|
May 11, 2008 - 2:01 PM
|
The check boxes are skinned and you can apply skinned scroll bars now. Please provide us with more information about what you want to see skinned in the check list box?
The classes based on common controls potentially will need to be modified after each next release of Windows OS. Each new common controls may include some new features like animations in Vista which potentially can bring some problems with custom painter classes in Prof-UIS which are based on common controls. It’s a very good idea not to use common controls at all everywhere is possible. You can use a single column grid instead of the list box for instance.
|
|
Offer Har
|
May 11, 2008 - 4:00 PM
|
This is how it looks: As you can see the check-box are very old-school...
|
|
Offer Har
|
May 10, 2008 - 9:07 AM
|
I use CExtWRB<CExtLabel> to add frame to static controls. In black skin, the frame is not noticeable as you can see below: I am using now 2.83, but I guess it’s the same also in 2.82 Please give the frame this some light color in black skins.
|
|
Offer Har
|
Jun 2, 2008 - 8:54 AM
|
Any plans on fixing this problem?
|
|
Technical Support
|
Jun 5, 2008 - 1:10 PM
|
We added a new color to our paint managers so now the frames are painted correctly. It will be available in the new version.
|
|
Offer Har
|
May 9, 2008 - 4:58 PM
|
I have many owner-draw combos. In 2.82 there was a flicker problem which was fixed in 2.83. However, all of them have now some extra line next to the drop-down button as you can see below: This line was not there in version 2.82 or any version before.
|
|
Technical Support
|
Jun 5, 2008 - 4:53 AM
|
You can use the ProfUIS_Controls sample where you can find a couple of combo boxes.
|
|
Offer Har
|
Jun 5, 2008 - 4:55 AM
|
Did you see my other combo-box problem report in 2.83?
|
|
Offer Har
|
Jun 5, 2008 - 4:42 AM
|
Did you see my other 2.83 painting problem? I’m sure these two are related... you don’t draw the combo all the way to the end.
|
|
Offer Har
|
Jun 2, 2008 - 8:53 AM
|
How about some reply?.... This is a bug in the latest 2.83 as well.
|
|
Technical Support
|
Jun 4, 2008 - 6:10 AM
|
We have just checked the ownerdrawn combo boxes with the latest version and found no problems. We guess the problem may appear under some circumstances we cannot reproduce. Would you describe where exactly you encounter this problem? How did you create this combo box? Can this problem be reproduced with one of our samples, i.e. ProfUIS_Controls?
|
|
Offer Har
|
Jun 4, 2008 - 12:52 PM
|
Can you please give me a reference to one of your samples where you create an ownerdrawn combo so I can recreate the problem?
|
|
Technical Support
|
Jun 5, 2008 - 4:03 AM
|
We cannot give you such a reference but you can recreate the problem by making any combo box in our samples ownerdrawn.
|
|
Richard Rodruck
|
May 9, 2008 - 4:08 PM
|
Is there a way to get the Prof-UIS control bars to work with the VC2008 feature pack CMDIFrameWndEx. If I use that the bars and menu do not show
|
|
Richard Rodruck
|
May 11, 2008 - 12:37 PM
|
|
|
Technical Support
|
May 10, 2008 - 12:10 PM
|
Seems that the MDI child frame is hard coded for the appropriate part of MFC in the feature pack. We can provide you with v.2.83 which has skinned MDI child frames.
|
|
Richard Rodruck
|
May 11, 2008 - 12:43 PM
|
|
|
Technical Support
|
May 11, 2008 - 2:02 PM
|
|
|
Richard Rodruck
|
May 11, 2008 - 12:42 PM
|
I guess the other question is does this mean 2.83 will will be compatible with the feature pack.
|
|
Technical Support
|
May 11, 2008 - 1:59 PM
|
We will support integration with components which are not hardly intersected with other components of MFC Feature Pack.
|
|
Offer Har
|
May 9, 2008 - 3:43 PM
|
Consider this scenario: 1) You hove a floating bar in the center of the display 2) You drag it to the left side of the main-frame and dock it on the left side 3) You double-click the bar title (when it is docked) What you except is that the bar will become float again in the center of the display. What happens is that the bar becomes floating, but in the left side of the display, where you let loose of the mouse button while clicking in step 2. It seems that you re-float it where it was dropped, and not where it began the drag, which is the right place.
|
|
Technical Support
|
May 11, 2008 - 2:04 PM
|
In old style MFC control bars, a marker rectangle is displayed on the screen during drag-n-drop and a control bar is kept in its last floating state until the user releases the left mouse button. New style control bars show their window content during drag-n-drop. This means the floating position of control bar constantly changes during drag-n-drop. We guess that is why the latest MS Office applications allow you to double click on the floating mini frame caption and ignore double clicks on docked bars.
|
|
Offer Har
|
Jun 21, 2008 - 9:48 AM
|
This does not make sense and is confusing... Why don’t you keep the location when dragging starts? This is the basic rule of Drag & Drop.
|
|
Offer Har
|
May 9, 2008 - 3:19 PM
|
In version 2.83, when docking a window, it gets a thick frame which is not there in 2.82: This is the same window when floating: Is this a new feature? How to remove it? Thanks.
|
|
Technical Support
|
May 12, 2008 - 12:54 PM
|
We have just made two screenshots using two versions of Prof-UIS.
v.2.83
v.2.81
As you can see there is no difference. So would you specify more details? But first please make sure you are using the latest code downloaded from the FTP.
|
|
Sebastian Leopold
|
May 9, 2008 - 1:53 PM
|
Hello, I use the Fullscreenstate together in a SDI Application with a Ribbonbar. The Problem ist the following:
If Windows Vista was one time switched to the Basic Theme by an Application. The Taskbar is always infront of the Fullscreen Application also on the right sight you can see the frame of the application window ??? You can Reproduce this in the Fullscreenstate sample with the Following steps:
1. Switch Windows Vista Theme to: Basic (Disable DWM/Aero) 2. Start ethe Fullscreenstate sample and switch it to fullscreen: now the taskbar is in front of the fullscreen and on the right side you can see a part of the border.
How can I fix that.
3. How can I prevent the window from beeing movable in Fullscreenmode ??? I cant deaktive the clicks on the non client area because the ribbonbar is part of the Non Client Area.
regards Sebastian Leopold
|
|
D. Cameron DeHeer
|
May 9, 2008 - 7:12 AM
|
|
|
Technical Support
|
May 12, 2008 - 12:55 PM
|
Yes, we confirm this. We have just changed our code once again. Thank you
|
|
Tim Xu
|
Jul 3, 2008 - 11:54 AM
|
So where can I download the fix? I am facing this issue too.
|
|
Technical Support
|
Jul 5, 2008 - 11:09 AM
|
Here is the fixed method. Just modify it and recompile the library. void CExtGridCellComboBox::Assign( const CExtGridCell & other )
{
ASSERT_VALID( this );
CExtGridCellString::Assign( other );
CExtGridCellComboBox * pCell =
DYNAMIC_DOWNCAST(
CExtGridCellComboBox,
( const_cast < CExtGridCell * > ( &other ) )
);
ResetContent();
if( pCell != NULL )
{
// copy cell items
ITEM_INFO * pItemCurSel = NULL;
LONG nItem = 0;
for( nItem = 0; nItem < pCell->m_arrItems.GetSize(); nItem++ )
{
ITEM_INFO * pOtherItem = pCell->m_arrItems[ nItem ];
ITEM_INFO * pNewItem = new ITEM_INFO( *pOtherItem );
m_arrItems.Add( pNewItem );
if( pCell->m_pCurSel == pOtherItem )
pItemCurSel = pNewItem;
}
m_bEnumMode = pCell->m_bEnumMode;
SetImageList( pCell->m_pImageList );
if( pItemCurSel != NULL )
{
nItem = _GetIndexOf( pItemCurSel );
SetCurSel( nItem );
}
else
pCell->TextGet( m_str );
} // if( pCell != NULL )
}
|
|
tera t
|
May 8, 2008 - 11:41 PM
|
Hello. I want you to equip for a standard function. 1, Only numerical value input is possible.
CEditX 2, As for the input, only the model of the format form can perform input.
CEditX
|
|
Peter Meier
|
May 14, 2008 - 12:29 PM
|
A masked edit control would indeed be very nice, and, even more important, a masked grid cell.
|
|
tera t
|
May 9, 2008 - 7:14 PM
|
Hello. Because there is not it with the standard part.
I made these parts through hardships.
Why will not you be supplied with it?
|
|
Technical Support
|
May 11, 2008 - 11:31 AM
|
Unfortunately there is no masked edit control in Prof-UIS. Though there are a plenty of free masked edit controls available on the Internet, we will add such a control in one of the next releases.
|
|
tera t
|
May 12, 2008 - 6:37 PM
|
Hello. >Though there are a plenty of free masked edit controls available on the Internet Where will be those free controllers?
Please teach it if you like.
|
|
tera t
|
May 15, 2008 - 1:15 AM
|
Where is it?
I want you to teach it.
|
|
Technical Support
|
May 16, 2008 - 2:00 PM
|
|
|
tera t
|
May 18, 2008 - 6:05 PM
|
Thank you very much for your advice.
|
|
tera t
|
May 21, 2008 - 2:45 AM
|
Hello. A demand is not made be a free controller. I want CEditX for Prof-UIS.
|
|
Technical Support
|
May 22, 2008 - 4:16 AM
|
We have already started working on this so it will be available soon.
|
|
Offer Har
|
May 8, 2008 - 1:41 PM
|
In 2.83, when there are 2 scroll bars, the bottom right corner is pained in the dialog’s color, which looks like something is missing: Please fix for the coming release, there should be some completion to the rectangle of the grid.
|
|
Technical Support
|
May 11, 2008 - 2:05 PM
|
This corner part is currently painted using the default theme background. It’s OK in the light themes. The Obsidian theme is dark. We will need to support new UI part in all the paint manager classes for repainting this corner area.
|
|
Offer Har
|
May 17, 2008 - 8:12 AM
|
I think this does not look good. There should be some border to continue to bottom and right side of the scroll-bars to complete the rectangle. You can use the color of the group frame (you can see it in the picture above) to complete the rectangle.
|
|
Technical Support
|
May 23, 2008 - 1:53 PM
|
|
|
Offer Har
|
May 8, 2008 - 7:48 AM
|
I have a multi-line edit box - I tried to skin it with the new CExtNCSB template. The problem is as follows: 1) When there is only one line, the scroll-bars are disabled, which is OK: 2) But, when there are two lines, the scroll-bars should stay disabled, and it doesn’t (note the side of the handle - the minimal): 3) The scroll-bar should become enabled only when the text is bigger then the size of the edit-box, this is the standard behavior - you can see that the handle also gets the right size:
|
|
Technical Support
|
May 24, 2008 - 6:15 AM
|
It is fixed. Please update the following method in the declaration of the CExtNCSB_Impl template class: virtual void NCSB_RescanChannel( bool bHorizontal )
{
ASSERT_VALID( this );
if( NCSB_IsDestructionMode() || GetSafeHwnd() == NULL )
return;
CExtNCSB_ScrollContainer * pWnd =
NCSB_GetContainer(
bHorizontal
? CExtNCSB_ScrollContainer::__EM_HORIZONTAL_SCROLL_BAR
: CExtNCSB_ScrollContainer::__EM_VERTICAL_SCROLL_BAR
);
if( pWnd == NULL )
return;
ASSERT( pWnd->GetSafeHwnd() != NULL );
CExtScrollBar * pScrollBar = pWnd->GetScrollBarInContainer();
if( pScrollBar == NULL )
return;
ASSERT( pScrollBar->GetSafeHwnd() != NULL );
BOOL bWindowEnabled = IsWindowEnabled();
pWnd->EnableWindow( bWindowEnabled );
SCROLLINFO _scroll_info_window, _scroll_info_bar;
::memset( &_scroll_info_window, 0, sizeof(SCROLLINFO) );
::memset( &_scroll_info_bar, 0, sizeof(SCROLLINFO) );
_scroll_info_window.cbSize = sizeof(SCROLLINFO);
_scroll_info_bar.cbSize = sizeof(SCROLLINFO);
if( bWindowEnabled )
{
NCSB_GetScrollInfoWindow( bHorizontal, _scroll_info_window );
NCSB_GetScrollInfoBar( pScrollBar, _scroll_info_bar );
}
if( ::memcmp( &_scroll_info_window, &_scroll_info_bar, sizeof(SCROLLINFO) ) != 0 )
{
if( m_bNcsbUse32BitScrollInfo )
pScrollBar->SetScrollInfo( &_scroll_info_window, FALSE );
else
{
pScrollBar->SetScrollRange( _scroll_info_window.nMin, _scroll_info_window.nMax, FALSE );
pScrollBar->SetScrollPos( _scroll_info_window.nPos, FALSE );
}
}
BOOL bEnable =
( bWindowEnabled
&& ( _scroll_info_window.nMin < _scroll_info_window.nMax )
&& ( _scroll_info_window.nPage == 0
|| INT( _scroll_info_window.nMax - _scroll_info_window.nMin + 1 ) > INT(_scroll_info_window.nPage)
)
) ? TRUE : FALSE;
pScrollBar->EnableWindow( bEnable );
pScrollBar->Invalidate();
pScrollBar->UpdateWindow();
} Please also note that by default the CExtNCSB template class does not work with the CListCtrl control. We implemented a specialized version of this template class for the list view common control in the latest code.
|
|
Daisy Peterson
|
May 7, 2008 - 11:56 AM
|
Is there a way of querying the main frame for the active control bar? I need to forward some messages to the active control bar instead of the t an active MDI window. Kevin Eshbach
|
|
Technical Support
|
May 7, 2008 - 2:57 PM
|
The active control bar is a term specific to MFC/Prof-UIS. It has not to do with the GetActiveWindow() Win32 API. The active control bar contains a focused window. You can get a pointer to the active control bar in this way: CExtControlBar * GetActiveControlBar()
{
HWND hWnd = ::GetFocus();
for( ; hWnd != NULL; hWnd = ::GetParent( hWnd ) )
{
if( ( ::GetWindowLong( hWnd, GWL_STYLE ) & WS_CHILD ) == 0 )
break;
CWnd * pWnd = CWnd::FromHandlePermanent( hWnd );
if( pWnd == NULL )
continue;
CExtControlBar * pBar = DYNAMIC_DOWNCAST( CExtControlBar, pWnd );
if( pBar != NULL )
return pBar;
}
return false;
} This function can return a pointer to a CExtToolControlBar object if an editor/combo box control attached to some of its buttons and the user is editing text in it. This function can also return a pointer to a CExtPanelControlBar object if some window inside is focused.
|
|
Timothy Anderson
|
May 6, 2008 - 10:07 PM
|
I have two toolbars, one uses a 16x16 toolbar bitmap, the other uses a 32x32 bitmap. They are created like this: // This is the main small toolbar
if (!m_wndToolBar[0].Create(NULL, this, IDR_MAINFRAME1))
{
TRACE0("Failed to create small toolbar psf\n");
return false;
}
m_wndToolBar[0].LoadToolBar(IDR_MAINFRAME1);
m_wndToolBar[0].EnableDocking(CBRS_ALIGN_ANY); // This is the main large toolbar
if (!m_wndToolBar[1].Create(NULL, this, IDR_MAINFRAME1_LARGE))
{
TRACE0("Failed to create large toolbar psf\n");
return false;
}
m_wndToolBar[1].LoadToolBar(IDR_MAINFRAME1_LARGE);
m_wndToolBar[1].EnableDocking(CBRS_ALIGN_ANY); And I simply switch back and forth by doing a show window. Regardless of what toolbar is supposed to be displayed, the large bitmap is the one that is used. How do I do this? I want multiple toolbars, all at either 16x16 or 32x32. I assumed having two identical toolbars with the different bitmaps and toggling back and forth between them would work as expected. May I add that this text editor you are using for this website is terrible.
|
|
Technical Support
|
May 7, 2008 - 3:04 PM
|
You should use two commands instead one particular command in a toolbar in your project. I.e. you should have ID_FILE_OPEN in the menu and in a 16x16 toolbar resource and a new ID_FILE_OPEN_BIG command in a 32x32 resource. The command manager should be updated from both toolbars. The OnFileNew() and OnUpdateFileNew() methods are currently connected to the ID_FILE_OPEN command only in the message map(s) in your project. You should also connect these handler methods to the ID_FILE_OPEN_BIG command by adding some appropriate message map entries. You can re-initialize toolbar by using CExtToolControlBar::LoadToolBar() or CExtToolControlBar::SetButtons() methods.
|
|
Timothy Anderson
|
May 7, 2008 - 3:06 PM
|
Thanks for the pointers! I like the "reload the bitmap" approach, it seems a little easier.
|
|
Technical Support
|
May 7, 2008 - 1:15 PM
|
There are several approaches with regard to how to implement the support for icons of different sizes. Creating two toolbars instead one is not effective. You can simply re-load icons into the command manager: UINT nToolBarResourceID = . . . // ID of small or big toolbar resource in your project.
CExtToolControlBar * pToolBar = . . .
ASSERT_VALID( pToolBar );
LPCTSTR strCommandProfileName = g_CmdManager->ProfileNameFromWnd( pToolBar->GetSafeHwnd() );
ASSERT( strCommandProfileName != NULL );
//
// First, we will remove icons for toolbar commands in the command manager
//
CExtCmdIcon iconEmpty;
INT nButtonIndex, nButtonCount = pToolBar->GetButtonsCount();
for( nButtonIndex = 0; nButtonIndex < nButtonCount; nButtonIndex )
{
CExtBarButton * pTBB = pToolBar->GetButton(nButtonIndex );
ASSERT_VALID( pTBB );
if( pTBB->IsSeparator() || pTBB->IsKindOf( RUNTIME_CLASS(CExtBarContentExpandButton) ) )
continue;
UINT nCmdID = pTBB->GetCmdID();
CExtCmdItem * pCmdItem = g_CmdManager->CmdGetPtr( strCommandProfileName, nCmdID );
if( pCmdItem == NULL )
continue;
g_CmdManager->CmdSetIcon( strCommandProfileName, nCmdID, iconEmpty );
}
//
// Second, we will update the command manager from toolbar resource
//
g_CmdManager->UpdateFromToolBar( strCommandProfileName, nToolBarResourceID );
//
// Third, we will recomputed layout of toolbar’s parent frame window
//
pToolBar->GetParentFrame()->RecalcLayout(); The code above (can be a global function or static method) will reload icons for all the toolbar commands from a known toolbar resource. Please note, the newly loaded icons will be used both in toolbars and menus. If you need different size icons in toolbars and menus, then you should use different command identifiers in toolbars and menus. I.e. each command should have two identifiers and you should bind one command handler method for two identifiers. As for the text editor, it is a well-know editor FCKEditor ( http://www.fckeditor.net/).
|
|
Timothy Anderson
|
May 7, 2008 - 4:07 PM
|
Don’t forget the "nButtonIndex++" in the for loop there. Otherwise it works perfectly! Woo Hoo!
|
|
Technical Support
|
May 8, 2008 - 3:01 AM
|
We meant two for loops in the CExtControlBar::InternalFriendlyFrameWnd::SetOuterDockState() method where the i variable is used in all 3 parts of the for statement - not the nButtonIndex variable. Here is the latest code of this method: void CExtControlBar::InternalFriendlyFrameWnd::SetOuterDockState(
const CDockState & state,
const CExtControlBar::OuterPropsArr_t & arrOuterProps,
bool bSerializeFixedBarsState,
bool bSerializeResizableBarsState
)
{
// first pass through barinfo’s sets the m_pBar member correctly
// creating floating frames if necessary
//CMapPtrToWord _mapCFV;
int i = 0;
for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
{
CControlBarInfo * pInfo = (CControlBarInfo *)
state.m_arrBarInfo[i];
ASSERT( pInfo != NULL );
CControlBar * pExistingBar = GetControlBar( pInfo->m_nBarID );
if( pExistingBar != NULL )
{
//
//CControlBar * pOld = pInfo->m_pBar;
//pInfo->m_pBar = pExistingBar;
//__DEBUG_trace_bar_info( _T("-LOAD-"), pInfo, 4 );
//pInfo->m_pBar = pOld;
//
if( (! pExistingBar->IsKindOf(RUNTIME_CLASS(CExtControlBar)) )
|| ( ((CExtControlBar*)pExistingBar)->IsFixedMode() )
|| ( ((CExtControlBar*)pExistingBar)->IsFixedDockStyle() )
)
{
if( ! bSerializeFixedBarsState )
continue;
}
else
{
if( ! bSerializeResizableBarsState )
continue;
}
}
if( pInfo->m_bFloating )
{
// need to create floating frame to match
CMiniDockFrameWnd * pDockFrame =
CreateFloatingFrame(
pInfo->m_bHorz ?
CBRS_ALIGN_TOP : CBRS_ALIGN_LEFT
);
ASSERT( pDockFrame != NULL) ;
CRect rcWnd( pInfo->m_pointPos, CSize(10, 10) );
pDockFrame->CalcWindowRect( &rcWnd );
pDockFrame->SetWindowPos(
NULL,
rcWnd.left, rcWnd.top, 0, 0,
SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE
);
CDockBar * pDockBar = (CDockBar *)
pDockFrame->GetDlgItem( AFX_IDW_DOCKBAR_FLOAT );
ASSERT( pDockBar != NULL );
ASSERT_KINDOF( CDockBar, pDockBar );
pInfo->m_pBar = pDockBar;
// if( pInfo->m_bVisible )
// _mapCFV.SetAt( pDockFrame, 0 );
} // if( pInfo->m_bFloating )
else // regular dock bar or toolbar
{
pInfo->m_pBar =
pExistingBar; // GetControlBar( pInfo->m_nBarID );
if( pInfo->m_pBar == NULL )
continue;
} // else from if( pInfo->m_bFloating )
pInfo->m_pBar->m_nMRUWidth = pInfo->m_nMRUWidth;
} // for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
// update new outer props
for( i = 0; i < arrOuterProps.GetSize(); i++ )
{
OuterItemData_t _oid = arrOuterProps[i];
CControlBar * pBarTmp = GetControlBar( _oid.m_nBarID );
if( pBarTmp == NULL )
continue;
CExtControlBar * pExtBar = DYNAMIC_DOWNCAST( CExtControlBar, pBarTmp );
if( pExtBar == NULL )
continue;
if( ( pExtBar->IsFixedMode() )
|| ( pExtBar->IsFixedDockStyle() )
)
{
if( ! bSerializeFixedBarsState )
continue;
}
else
{
if( ! bSerializeResizableBarsState )
continue;
}
pExtBar->m_ptFloatHelper = _oid.m_ptFloatHelper;
pExtBar->m_sizeDockedH = _oid.m_sizeDockedH;
pExtBar->m_sizeDockedV = _oid.m_sizeDockedV;
pExtBar->m_sizeFloated = _oid.m_sizeFloated;
pExtBar->_AffixmentSetOuter( &_oid.m_AffixmentData );
} // for( i = 0; i < arrOuterProps.GetSize(); i++ )
// the second pass will actually dock all of the control bars and
// set everything correctly
for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
{
CControlBarInfo * pInfo = (CControlBarInfo *)
state.m_arrBarInfo[i];
ASSERT( pInfo != NULL );
if( pInfo->m_pBar == NULL )
continue;
if( (! pInfo->m_pBar->IsKindOf(RUNTIME_CLASS(CExtControlBar)) )
|| ( ((CExtControlBar*)pInfo->m_pBar)->IsFixedMode() )
|| ( ((CExtControlBar*)pInfo->m_pBar)->IsFixedDockStyle() )
)
{
if( ! bSerializeFixedBarsState )
continue;
}
else
{
if( ! bSerializeResizableBarsState )
continue;
}
if( pInfo->m_pBar->m_pDockContext != NULL
&& pInfo->m_pBar->IsKindOf(RUNTIME_CLASS(CExtControlBar))
)
((CExtControlBar*)(pInfo->m_pBar))->m_ptFloatHelper
= pInfo->m_ptMRUFloatPos;
pInfo->m_pBar->SetBarInfo( pInfo, this );
} // for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
// the third pass will move independent floating bars
// into valid positions
for( i = 0; i < arrOuterProps.GetSize(); i++ )
{
OuterItemData_t _oid = arrOuterProps[i];
CControlBar * pBarTmp = GetControlBar( _oid.m_nBarID );
if( pBarTmp == NULL )
continue;
CExtControlBar * pExtBar = DYNAMIC_DOWNCAST( CExtControlBar, pBarTmp );
if( pExtBar == NULL )
continue;
if( ( pExtBar->IsFixedMode() )
|| ( pExtBar->IsFixedDockStyle() )
)
{
if( ! bSerializeFixedBarsState )
continue;
}
else
{
if( ! bSerializeResizableBarsState )
continue;
}
if( ! _oid.m_bFloating )
continue;
CSize _sizeFloating = _oid.m_sizeFloated;
CRect rcFrameInitial( _oid.m_ptFloatHelper, _sizeFloating /*_oid.m_sizeFloated*/ );
CExtMiniDockFrameWnd * pMiniFrame =
DYNAMIC_DOWNCAST(
CExtMiniDockFrameWnd,
pExtBar->GetParentFrame()
);
if( pMiniFrame != NULL )
{
CRect rcClientFrame, rcWndFrame;
pMiniFrame->GetClientRect( &rcClientFrame );
pMiniFrame->GetWindowRect( &rcWndFrame );
_sizeFloating += rcWndFrame.Size() - rcClientFrame.Size();
rcFrameInitial.right += rcWndFrame.Width() - rcClientFrame.Width();
rcFrameInitial.bottom += rcWndFrame.Height() - rcClientFrame.Height();
}
CRect rcFrameNew =
CExtPaintManager::stat_AlignWndRectToMonitor(
rcFrameInitial
);
// CExtMiniDockFrameWnd * pMiniFrame =
// DYNAMIC_DOWNCAST(
// CExtMiniDockFrameWnd,
// pExtBar->GetParentFrame()
// );
if( pMiniFrame != NULL )
{
ASSERT_VALID( pMiniFrame );
CRect rcFrameReal;
pMiniFrame->GetWindowRect( rcFrameReal );
//if( rcFrameReal == rcFrameNew )
if( rcFrameReal.TopLeft() == rcFrameNew.TopLeft() )
continue;
pExtBar->OnNcAreaButtonsReinitialize();
if( ! pExtBar->IsFixedMode() )
pMiniFrame->ModifyStyle( FWS_SNAPTOBARS, 0 );
//((InternalFriendlyFrameWnd *)pMiniFrame)->m_bInRecalcLayout = TRUE;
pMiniFrame->MoveWindow( &rcFrameNew, FALSE );
//((InternalFriendlyFrameWnd *)pMiniFrame)->m_bInRecalcLayout = FALSE;
pMiniFrame->DelayRecalcLayout();
//WORD tmp;
//if( _mapCFV.Lookup( pMiniFrame, tmp )
// && ( pMiniFrame->GetStyle()&WS_VISIBLE ) == 0
// && ( ! pExtBar->IsFixedMode() )
// )
if( _oid.m_bVisible )
{
pExtBar->DelayShow( TRUE );
CSize _size = rcFrameNew.Size();
pExtBar->SetInitDesiredSizeFloating( _size );
pExtBar->m_pDockContext->m_sizeLast = _size;
pMiniFrame->ShowWindow( SW_SHOWNOACTIVATE );
// ((InternalFriendlyFrameWnd *)pMiniFrame)->m_bInRecalcLayout = TRUE;
pMiniFrame->MoveWindow( &rcFrameNew, FALSE );
// ((InternalFriendlyFrameWnd *)pMiniFrame)->m_bInRecalcLayout = FALSE;
pMiniFrame->RecalcLayout();
CRect rcClientFrame, rcWndFrame;
pMiniFrame->GetClientRect( &rcClientFrame );
pMiniFrame->GetWindowRect( &rcWndFrame );
CRect rcClientBar, rcWndBar;
pExtBar->GetClientRect( &rcClientBar );
pExtBar->GetWindowRect( &rcWndBar );
CSize _sizeBar =
_sizeFloating // _oid.m_sizeFloated
- rcClientFrame.Size()
+ rcWndFrame.Size()
- rcClientBar.Size()
+ rcWndBar.Size()
;
pExtBar->OnRepositionSingleChild(
_sizeBar.cx,
_sizeBar.cy,
true
);
}
} // if( pMiniFrame != NULL )
else
pExtBar->FloatControlBar( rcFrameNew.TopLeft() );
} // for( i = 0; i < arrOuterProps.GetSize(); i++ )
// last pass shows all the floating windows that were previously shown
for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
{
CControlBarInfo * pInfo = (CControlBarInfo *)
state.m_arrBarInfo[i];
ASSERT( pInfo != NULL );
if( pInfo->m_pBar == NULL )
continue;
if( (! pInfo->m_pBar->IsKindOf(RUNTIME_CLASS(CExtControlBar)) )
|| ( ((CExtControlBar*)pInfo->m_pBar)->IsFixedMode() )
|| ( ((CExtControlBar*)pInfo->m_pBar)->IsFixedDockStyle() )
)
{
if( ! bSerializeFixedBarsState )
continue;
}
else
{
if( ! bSerializeResizableBarsState )
continue;
}
if( ! pInfo->m_bFloating )
continue;
CFrameWnd * pFrameWnd =
pInfo->m_pBar->GetParentFrame();
CDockBar * pDockBar = (CDockBar *) pInfo->m_pBar;
ASSERT_KINDOF( CDockBar, pDockBar );
if( pDockBar->GetDockedVisibleCount() > 0 )
{
pFrameWnd->RecalcLayout();
pFrameWnd->ShowWindow( SW_SHOWNA );
for( INT nBar = 1; nBar < pDockBar->m_arrBars.GetSize(); nBar ++ )
{
ASSERT( pDockBar->m_arrBars[0] == NULL );
CControlBar * pBar = (CControlBar *)
pDockBar->m_arrBars[nBar];
if( pBar == NULL )
continue;
if( __PLACEHODLER_BAR_PTR(pBar) )
continue;
CExtControlBar * pExtBar =
DYNAMIC_DOWNCAST(
CExtControlBar,
pBar
);
if( pExtBar == NULL
|| pExtBar->IsFixedMode()
)
continue;
pExtBar->_RecalcNcArea();
}
} // if( pDockBar->GetDockedVisibleCount() > 0 )
} // for( i = 0; i < state.m_arrBarInfo.GetSize(); i++ )
}
|
|
Timothy Anderson
|
May 9, 2008 - 1:02 PM
|
...and this has exactly what to do with reloading icons into the command manager? I’m having a problem with serialization using the first method above. After the icons are loaded up correctly, the toolbars seem to be "disabled" when I go to fire the application up again. So it’s updating the icons correctly (the first code chunk) but either the serialization on close is not working correctly with this updated toolbar, or the serialization on startup is not working correctly. If I just leave the toolbars alone everything serializes correctly, but when I change them from one toolbar resource to the next they magically disappear on the next startup of the application.
|
|
Timothy Anderson
|
May 9, 2008 - 2:39 PM
|
Oops! I found it. I had accidently coded in an assumption the toolbar ID changed to the resource ID when switching between the two. So I always use the small toolbar resource ID to identify the toolbar then just slam the larger icons into it as needed. Woo Hoo! Multi-sized toolbars!
|
|
Timothy Anderson
|
May 7, 2008 - 12:59 PM
|
It also wants to use the 32x32 icons in all the menus. I want: always use 16x16 icons everywhere. Optionally display either a 16x16 or a 32x32 sized icon based toolbar. I can’t believe no one does multiple sized toolbars.
|
|
Timothy Anderson
|
May 6, 2008 - 4:17 PM
|
I’ve been adding and removing toolbars from my app and I’m constantly gpf’ing out of the workspace serialization. Is there an official way to trap this? I’m using VS2K5 and profuis 282. Problem is when i’m done adding in a new toolbar the end user is going to experience the same gpf’ing with the final app. Access off of a null pointer at ProfUIS282md.dll!CExtControlBar::InternalFriendlyFrameWnd::SetOuterDockState(const CDockState & state={...}, const CArray<CExtControlBar::OuterItemData_t,CExtControlBar::OuterItemData_t &> & arrOuterProps={...}, bool bSerializeFixedBarsState=true, bool bSerializeResizableBarsState=true) Line 2890 + 0x6 bytes C++ The pExtBar it pulls from CExtControlBar * pExtBar = STATIC_DOWNCAST(CExtControlBar, GetControlBar( _oid.m_nBarID ));
is null.
|
|
Technical Support
|
May 7, 2008 - 1:41 PM
|
We confirm this issue. This line of code should be replaced with (two places): CControlBar * pTmpBar = GetControlBar( _oid.m_nBarID );
if( pTmpBar == NULL )
continue;
CExtControlBar * pExtBar = STATIC_DOWNCAST( CExtControlBar, pTmpBar );
|
|
Timothy Anderson
|
May 7, 2008 - 3:07 PM
|
Thanks again! I wasn’t sure if the fix was that straight forward. Thanks for the confirmation.
|
|
Timothy Anderson
|
May 6, 2008 - 4:25 PM
|
I did tuck this into a try catch with the appropriate value set but I keep getting blown out with this new weird VS2K5 exception handling.
|
|
Sebastian Leopold
|
May 6, 2008 - 3:14 PM
|
Hello, how can I prevent all columns from deletion ? I don’t want that the user can remove a column from the grid.
I mean you can remove a column by dragging it out of ReportgGrid Area. I dont want that.
regards Sebastian Leopold
|
|
Sebastian Leopold
|
May 8, 2008 - 1:38 PM
|
You dont understand me, No column should be removeable !!!
regards Sebastian Leoplld
|
|
Technical Support
|
May 10, 2008 - 12:14 PM
|
Please remove the __EGBS_BSE_EX_DRAG_REMOVE_COLUMNS style from your report grid. You can do this using its BseModifyStyleEx() method.
|
|
Technical Support
|
May 7, 2008 - 2:50 PM
|
Please add the following line to the ../Prof-UIS/Include/ExtReportGridWnd.h: #define __ERGS_ENABLE_DEACTIVATION_OF_LAST_COLUMN 0x00000080 Then update the source code for the following two methods in the ../Prof-UIS/Src/ExtReportGridWnd.cpp: void CExtReportGridWnd::OnGridOuterDragOut(
const CExtGridHitTestInfo & htInfo
)
{
ASSERT_VALID( this );
ASSERT( ! htInfo.IsHoverEmpty() );
ASSERT( htInfo.GetInnerOuterTypeOfColumn() == 0 );
ASSERT( htInfo.GetInnerOuterTypeOfRow() == (-1) );
CExtGridCell * pCellTmp =
GridCellGet( htInfo );
ASSERT_VALID( pCellTmp );
CExtReportGridColumn * pRGC =
STATIC_DOWNCAST( CExtReportGridColumn, pCellTmp );
bool bDeactivate = true;
DWORD dwReportGridStyle = ReportGridGetStyle();
if( ( dwReportGridStyle & __ERGS_ENABLE_DEACTIVATION_OF_LAST_COLUMN ) == 0 )
{
LONG nActiveColCount = ReportColumnGetCount( true, false );
if( nActiveColCount == 1 )
bDeactivate = false;
}
if( bDeactivate )
{
VERIFY( ReportColumnActivate( pRGC, false ) );
}
}
bool CExtReportGridWnd::OnReportGridQueryColumnKeepActiveOnGroupingBehavior(
__EXT_MFC_SAFE_LPCTSTR strColumnName,
__EXT_MFC_SAFE_LPCTSTR strCategoryName
) const
{
ASSERT_VALID( this );
DWORD dwReportGridStyle = ReportGridGetStyle();
if( ( dwReportGridStyle & __ERGS_KEEP_COLUMNS_ACTIVE_ON_GROUPING ) != 0 )
return true;
const CExtReportGridColumn * pRGC =
ReportColumnGet( strColumnName, strCategoryName );
if( pRGC == NULL )
return false;
if( ( pRGC->GetStyleEx() & __EGCS_EX_KEEP_ACTIVE_ON_GROUPING ) != 0 )
return true;
if( ( dwReportGridStyle & __ERGS_ENABLE_DEACTIVATION_OF_LAST_COLUMN ) == 0 )
{
LONG nActiveColCount = ReportColumnGetCount( true, false );
if( nActiveColCount == 1 )
return true;
}
return false;
} The last column in the report grid in v.2.82 can be deactivated and you cannot change this behavior. The update above introduces a new __ERGS_ENABLE_DEACTIVATION_OF_LAST_COLUMN report grid style to use with the CExtReportGridWnd::ReportGridGetStyle() and CExtReportGridWnd::ReportGridModifyStyle() methods. This style turns on the last column behavior in style 2.82. By default it’s absent in 2.83 and you are unable to deactivate the last column.
|
|
Technical Support
|
May 7, 2008 - 2:53 PM
|
Sorry please also update the following method: bool CExtReportGridWnd::stat_cbItemClickForColumnVisibility(
CExtPopupMenuWnd * pPopup,
LPVOID pItemData
)
{
ASSERT_VALID( pPopup );
pPopup;
ASSERT( pItemData != NULL );
CExtPopupMenuWnd::MENUITEMDATA & mi =
*((CExtPopupMenuWnd::MENUITEMDATA *)pItemData);
ASSERT( mi.IsExtraMark() );
bool bActivate = ! mi.IsExtraChecked();
CExtReportGridColumn * pRGC = (CExtReportGridColumn*)mi.LParamGet();
ASSERT_VALID( pRGC );
ASSERT_KINDOF( CExtReportGridColumn, pRGC );
CExtReportGridWnd * pRGW = pRGC->GetReportGrid();
if( ! bActivate )
{
bool bDeactivate = true;
DWORD dwReportGridStyle = pRGW->ReportGridGetStyle();
if( ( dwReportGridStyle & __ERGS_ENABLE_DEACTIVATION_OF_LAST_COLUMN ) == 0 )
{
LONG nActiveColCount = pRGW->ReportColumnGetCount( true, false );
if( nActiveColCount == 1 )
bDeactivate = false;
}
if( ! bDeactivate )
return true; // not important
}
mi.SetExtraChecked( bActivate );
pRGW->ReportColumnActivate( pRGC, bActivate, -1L, false );
pRGW->OnSwUpdateScrollBars();
pRGW->OnSwDoRedraw();
return true; // not important
}
|