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 |
|
tera t
|
Jan 31, 2008 - 11:44 PM
|
|
|
Technical Support
|
Feb 8, 2008 - 12:22 PM
|
This is a local problem in the custom drawn list box in the IconEditor sample application. We would like to ask you to use a CExtGridWnd control instead of list boxes and a list view in thereport mode to avoid any painting problems with custom drawn Win32 common controls.
|
|
tera t
|
Feb 1, 2008 - 1:36 AM
|
The problem was settled.
Thanks,
|
|
tera t
|
Jan 31, 2008 - 10:06 PM
|
|
|
Technical Support
|
Feb 13, 2008 - 3:45 AM
|
Your code looks absolutely correct. You can use the CExtToolControlBar::CommandToIndex() method instead of the for() loop in your ScanCommandItems() method.
|
|
tera t
|
Feb 12, 2008 - 1:16 AM
|
Hello.
I seem not to be able to ask you a question well. Not dynamic, I want to change it into appointed CmdID from the program inside. I seem to be able to do it by the following programs. If there is the method that is better than this, please teach it
CExtBarButton * pExtBarButton; pExtBarButton = ScanCommandItems( nGrpCmdID ); if ( pExtBarButton != NULL ){ CExtRibbonButton * pNodeGrid; pNodeGrid = (CExtRibbonButton *)pExtBarButton; pNodeGrid->SetCmdID ( ID_LINE3 , true , true ); }
----------------------------------------------------------------
CExtBarButton * CMuRibbonBar::ScanCommandItems( UINT nCmdID ) {
if( ! IsVisible() ) return 0;
INT nBtnsCount = GetButtonsCount(); if( nBtnsCount == 0 ) return 0;
INT nUpdateBtnsCount = 0; bool bUpdateBar = false; for( INT nBtnIdx = 0; nBtnIdx < nBtnsCount; nBtnIdx++ ) { CExtBarButton * pTBB = NULL;
pTBB = ( ( CExtRibbonPage * )( this ) ) -> GetButton( nBtnIdx ); ASSERT_VALID( pTBB ); UINT nTbbCmdID = pTBB->GetCmdID( false ); if( nTbbCmdID != nCmdID ) continue; return pTBB; } // for( INT nBtnIdx = 0; nBtnIdx < nBtnsCount; nBtnIdx++ )
return NULL; }
|
|
Technical Support
|
Feb 8, 2008 - 12:21 PM
|
The ribbon bar buttons display exactly the same menus like toolbar buttons. If you need fully dynamic menus, then you can choose one of the following ways:
1) Change command tree nodes describing popup menu structure under ribbon barās button.
2) Make this menu containing only one command item and handle the CExtPopupMenuWnd::g_nMsgPrepareMenu (or CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel ) registered windows message like demonstrated in the ProfUIS_Controls sample application. This will allow you to find a single command item in a popup menu, remove it and insert a set of other menu items instead.
|
|
tera t
|
Feb 4, 2008 - 2:41 AM
|
Hello.
I know how to use __ECTN_TBB_SEPARATED_DROPDOWN| __ECTN_TBB_AUTOCHANGE_ID.
What I want to hear. It was generated in the ribbon bar inside. pTBB = new CExtBarButton
With pTBB, I want to operate a menu from the program side.
|
|
Technical Support
|
Feb 2, 2008 - 11:19 AM
|
Please apply the __ECTN_TBB_SEPARATED_DROPDOWN|__ECTN_TBB_AUTOCHANGE_ID styles to the ribbon command tree node which represents the ribbon button with line widths menu. As a result, this button will automatically change its icon and its effective command part to the last invoked menu item’s icon and command identifier.
|
|
Vlad Kozatchenko
|
Jan 31, 2008 - 5:23 PM
|
hello, Support,
the rendering of the ribbon is OK with Normal Fonts on WindowsXP. however, if to use large fonts setting (DPI properties of the screen in Windows XP) the layout is destroyed - it looks like it tries to show nodes in 4 rows (not in 3 as it was with small font).
how to make it use the same layout for LargeFonts settings as it is used for normal fonts?
thank you!
Vladimir
|
|
Technical Support
|
Feb 2, 2008 - 11:11 AM
|
We have just checked the ribbon on both large font theme settings using 96 DPI screen and on 120 DPI screen and everything is ok with v. 2.82. Please provide the exact steps to reproduce the problem using our RibbonBar sample application.
|
|
Chris Anderson
|
Jan 31, 2008 - 3:27 PM
|
hi,
is it possible to change the way a bitmap is painted on a button ( CExtButton ) when the bitmap of a button ( m_icon ) has a larger size than the button. Currently prof-uis automatically centers the bitmap on the button ( we use prof-uis v282 )
CExtPaintManagerXP::PaintIcon(...) { ....
if( ( _sizeIcon.cy + rcIconMargins.top + rcIconMargins.bottom ) > rcClient.Height() ) { nIconAlignment &= ~__ALIGN_VERT_MASK; nIconAlignment |= __ALIGN_VERT_CENTER; }
...
else if( (nIconAlignment&__ALIGN_VERT_MASK) == __ALIGN_VERT_CENTER ) { rcIconLocation.OffsetRect( 0, ( rcClient.bottom - rcIconLocation.bottom ) / 2 + rcIconMargins.top - rcIconMargins.bottom ); }
Now only the central portion will be painted : i.e. if the m_icon is a bitmap with a height of 100, and the button has a height of 50. Only the 25 - 75 portion of the bitmap will be displayed ( ignore the margin ).
how to disable this feature and make sure the top left corner of the bitmap always show up in the button ?
Thanks
|
|
Technical Support
|
Feb 2, 2008 - 11:18 AM
|
You can find all the alignments and margins supported by button control in the ProfUIS_Controls sample (the Buttons page) . The button control can be painted as a colored rectangle with a single pixel border in one theme and as a bitmap based skin with a wide skinned border in other theme. We assume that button icons should be less than a button at least by two or three pixels. We can change the centering behavior for the button icon but in any case the icon that is larger than a button will have incorrect look under the most of themes. It would be extremely interesting to know more details about the button controls in your real project which need larger icons.
|
|
Chris Anderson
|
Feb 4, 2008 - 10:16 AM
|
thanks for the information. Since our app allows the user to attach a bitmap to a button on the fly, there is a good chance the bitmap may be larger than the button. My solution is crop the bitmap to make sure this won’t happen. Now it works.
|
|
Nicholas Vezirgiannis
|
Jan 30, 2008 - 8:52 AM
|
Hallo, I would like to ask if it is possible to toggle a CExtControlBar just like a Toolbar from the view menu. The Toolbars have a check icon next to them in the View Menu while the control bar does not. Also when I click the view menu entry it only shows the control bar (if I have closed it before) but does not hide it. Any ideas?
|
|
Nicholas Vezirgiannis
|
Feb 5, 2008 - 3:11 AM
|
Thank you for the help. I forgot to change a parameter in these functions. Your examples were most helpful and a solution was found. Thank you for your time.
|
|
Technical Support
|
Feb 4, 2008 - 12:29 PM
|
We can provide you with a relevant solution. For instance, the SDI sample application uses a check-like control bar menu commands for resizable control bars when the ProfStudio sample uses Visual Studio style commands. The difference between these applications are only in the OnBarCheck() and OnUpdateControlBarMenu() methods of the main frame class. If you provide us with a test project, we make any or all resizable control bars use menu commands like you need.
|
|
Nicholas Vezirgiannis
|
Feb 4, 2008 - 3:00 AM
|
I think this answer is a copy of my other thread. This is not what I asked. Could you please provide a relevant answer?
|
|
Technical Support
|
Feb 2, 2008 - 11:23 AM
|
The CExtPropertyGridCtrl class does not support print/preview. The CExtPPVW < CExtPropertyGridCtrl > template based class supports it. You should simply remove CExtPPVW from the declaration of the property grid control in your project.
|
|
Nicholas Vezirgiannis
|
Feb 1, 2008 - 4:47 AM
|
Hallo again, I don’t think you understood my question. I am using these methods as your manual describes. In most of the cases they were automatically created by your wizard. My question is, if I can Show and hide a control bar, by clicking the "view menu" entry that corresponds to that control bar, the same way I show and hide any other toolbar from the equivalent "VIEW menu" entry. Up till now I can only show the control bar but cannot hide it from the View menu. If the control bar is already visible and I select it from the "View menu" it only gives it Focus instead of hiding it.
|
|
Technical Support
|
Jan 31, 2008 - 4:15 AM
|
You can use the following versions of control bar handling/updating methods: void CMainFrame::OnUpdateControlBarMenu(CCmdUI* pCmdUI)
{
CExtControlBar::DoFrameBarCheckUpdate( this, pCmdUI, true );
}
BOOL CMainFrame::OnBarCheck(UINT nID)
{
return CExtControlBar::DoFrameBarCheckCmd( this, nID, true );
} Please note that toolbar style commands can be applied to control bars only if the auto-hide feature is into enabled in the main frame window. This means you should not invoke the CExtControlBar::FrameInjectAutoHideAreas() method in the CMainFrame::OnCreate() .
|
|
Ian McIntosh
|
Jan 30, 2008 - 2:49 AM
|
I have a class derived from CExtPropertyGridWndCategorized as I want to add sub categories only when the user presses expand for the first time. My code seems to work, but I get an assert.
I get an assert in: CExtTreeGridWnd::ItemEnsureVisibleBranch() when it calls EnsureVisibleRow( nRowOffset, bRedraw ); with nRowOffset = -1.
I seem to be able to fix the assert by changing: if( nRowOffset < rcVisibleRange.top ) { EnsureVisibleRow( nRowOffset, bRedraw ); return; }
to: if( nRowOffset < rcVisibleRange.top ) { if (nRowOffset!=(-1)) EnsureVisibleRow( nRowOffset, bRedraw ); return; }
but as I’m not sure what this code is doing I’m not sure if it will have any side effects. I can achieve this by overriding CExtTreeGridWnd::ItemEnsureVisibleBranch(), but is this the right thing to do?
My Grid Wnd is derived from CExtPropertyGridWndCategorized as follows:
class CExtPropertyGridWndCategorizedArc : public CExtPropertyGridWndCategorized { public: CExtPropertyGridWndCategorizedArc(CExtPropertyGridCtrl* pPropertyGridCtrl = NULL) : CExtPropertyGridWndCategorized(pPropertyGridCtrl) {} virtual void ItemExpand(HTREEITEM hTreeItem, INT nActionTVE = TVE_TOGGLE, bool bRedraw = true); std::vector<HTREEITEM> m_vExpandedOnce; };
void CArchivePropertyCtrl::CExtPropertyGridWndCategorizedArc::ItemExpand(HTREEITEM hTreeItem, INT nActionTVE, bool bRedraw) { CWaitCursor wc; CExtPropertyItem* pItem = PropertyItemFromTreeItem(hTreeItem); ASSERT(pItem); bool bUpdated = false; bool bExpanding = !pItem->ExpandedGet(); if ( bExpanding ) { bool bFoundCategory=false; int iCount = pItem->ItemGetCount(); for (int i=0; i<pItem->ItemGetCount(); i++) { CExtPropertyItem* pChild = pItem->ItemGetAt(i); if (pChild->ItemGetCount()>0) { bFoundCategory = true; break; } } if (!bFoundCategory) { bUpdated = dynamic_cast<CArchivePropertyCtrl*>(m_pPropertyGridCtrl)->ExpandSubKey(*pItem, "", 1); } } if ( bUpdated ) dynamic_cast<CArchivePropertyCtrl*>(m_pPropertyGridCtrl)->PropertyStoreSynchronize(); __super::ItemExpand(hTreeItem, nActionTVE, bRedraw); }
this is the assert call stack: > ProfUIS281md.dll!CExtGridBaseWnd::EnsureVisibleRow(long nRowNo=-1, bool bRedraw=true) Line 6017 + 0x17 bytes C++ ProfUIS281md.dll!CExtTreeGridWnd::ItemEnsureVisibleBranch(_TREEITEM * hTreeItem=0x06f890a8, bool bRedraw=true) Line 3649 + 0x1a bytes C++ ProfUIS281md.dll!CExtTreeGridWnd::ItemExpand(_TREEITEM * hTreeItem=0x06f890a8, int nActionTVE=2, bool bRedraw=true) Line 3624 + 0x1a bytes C++ ProfUIS281md.dll!CExtPropertyGridWnd::ItemExpand(_TREEITEM * hTreeItem=0x06f890a8, int nActionTVE=2, bool bRedraw=true) Line 7320 C++ GuiMdi.exe!CArchivePropertyCtrl::CExtPropertyGridWndCategorizedArc::ItemExpand(_TREEITEM * hTreeItem=0x06f890a8, int nActionTVE=2, bool bRedraw=true) Line 750 + 0x17 bytes C++ ProfUIS281md.dll!CExtPropertyItem::OnGridRowInitialized(CExtPropertyGridWnd & wndPG={...}, _TREEITEM * hTreeItem=0x06f890a8, CExtGridCell * pCellCaption=0x06fafea8, CExtGridCell * pCellValue=0x06fafef8) Line 838 + 0x1a bytes C++ ProfUIS281md.dll!CExtPropertyGridWnd::PropertyItemInsert(CExtPropertyItem * pPropertyItem=0x06fa7110, long nIndex=9, _TREEITEM * htiParent=0x06f88c70, bool bRedraw=false) Line 6741 + 0x22 bytes C++ ProfUIS281md.dll!CExtPropertyGridWnd::PropertyItemInsertAlphabetic(CExtPropertyItem * pPropertyItem=0x06fa7110, _TREEITEM * htiParent=0x06f88c70, bool bRedraw=false) Line 6788 + 0x22 bytes C++ ProfUIS281md.dll!CExtPropertyGridWnd::PropertyStoreSynchronizeOneLevel(CExtPropertyItem * pPropertyItem=0x06fa7110, CExtPropertyItem * pParentItem=0x0470c280) Line 6571 + 0x1c bytes C++ ProfUIS281md.dll!CExtPropertyGridWnd::PropertyStoreSynchronizeOneLevel(CExtPropertyItem * pPropertyItem=0x0470c280, CExtPropertyItem * pParentItem=0x0470ccc0) Line 6629 + 0x1a bytes C++ ProfUIS281md.dll!CExtPropertyGridWnd::PropertyStoreSynchronizeOneLevel(CExtPropertyItem * pPropertyItem=0x0470ccc0, CExtPropertyItem * pParentItem=0x045fe758) Line 6629 + 0x1a bytes C++ ProfUIS281md.dll!CExtPropertyGridWnd::PropertyStoreSynchronizeOneLevel(CExtPropertyItem * pPropertyItem=0x045fe758, CExtPropertyItem * pParentItem=0x00000000) Line 6629 + 0x1a bytes C++ ProfUIS281md.dll!CExtPropertyGridWnd::PropertyStoreSynchronizeAll() Line 6501 + 0x18 bytes C++ ProfUIS281md.dll!CExtPropertyGridCtrl::PropertyStoreSynchronize() Line 9417 + 0x12 bytes C++ ProfUIS281md.dll!CExtPropertyGridCtrl::PropertyStoreSet(CExtPropertyStore * pPS=0x045fe758) Line 9444 + 0x12 bytes C++ ProfUIS281md.dll!CExtPropertyGridComboBoxBar::_SynchronizeCurSel() Line 7759 + 0x16 bytes C++ ProfUIS281md.dll!CExtPropertyGridComboBoxBar::PropertyStoreInsert(CExtPropertyStore * pPropertyStore=0x045fe758, int nPos=0) Line 7684 + 0x12 bytes C++ GuiMdi.exe!CArchivePropertyCtrl::ShowArchive(const CArchivePropertyCtrl::PropertiesInfo & pi={...}) Line 230 + 0x18 bytes C++
|
|
Technical Support
|
Feb 9, 2008 - 1:24 AM
|
Yes, and we can provide you with the latest stable version 2.83. You can download it from our ftp server. Send us a request for details by email.
|
|
Ian McIntosh
|
Feb 7, 2008 - 5:05 AM
|
Will this change be incorporated in future versions of prof-uis?
|
|
Technical Support
|
Jan 31, 2008 - 4:20 AM
|
The following version is more correct because nRowOffset is a zero based row index in the grid: if( nRowOffset < rcVisibleRange.top )
{
if( nRowOffset >= 0 )
EnsureVisibleRow( nRowOffset, bRedraw );
return;
}
|
|
Nicholas Vezirgiannis
|
Jan 30, 2008 - 2:02 AM
|
Hallo, I Have a class derived from CExtPropertyGridCtrl as follows: class DataEntryGrid : public CExtPPVW < CExtPropertyGridCtrl > I also have derived classes for the cells of the property grid.
I dynamically attach property stores on it with properties I create on runtime depending on the type of data I have. Basically I would like to enable or disable properties during runtime depending on the values of other properties the user changes.
I would like to know if there is a way to disable a property so that it appears grayed and the user cannot enter any data. Thanks in advance.
|
|
Nicholas Vezirgiannis
|
Feb 4, 2008 - 3:49 AM
|
Thank you very much. All this was most helpful.
|
|
Technical Support
|
Feb 2, 2008 - 11:21 AM
|
The CExtPropertyGridCtrl class does not support print/preview. The CExtPPVW < CExtPropertyGridCtrl > template based class does. You should simply remove the CExtPPVW template from declaration of the property grid control in your project.
|
|
Nicholas Vezirgiannis
|
Feb 1, 2008 - 4:27 AM
|
Thank you for your quick responce. I have one more question. The CExtPropertyGridCtrl also has the print and print preview buttons on it. Because it seems rather confusing for the user, is there a way to hide them or disable them?
|
|
Technical Support
|
Jan 31, 2008 - 4:25 AM
|
The disabled state is not supported in the grid cells, but the read-only state is supported. You can apply it to a cell by using CExtGridCell::ModifyStyle() in which __EGCS_READ_ONLY is passed in the first parameter. You can use CExtPropertyGridCtrl::PropertyStoreSynchronize() to reload a property grid control. Please note a CExtPropertyGridCtrl control contains one or more tree grid windows inside. By default, it contains two tree grids: CExtPropertyGridWndCategorized and CExtPropertyGridWndSorted . Each of tree grids contains copies of active grid cells of each property value in the property store. Itās possible to access tree grids and change appropriate grid cells in them but this is not reasonable if you are using combined property stores.
|
|
Phillip Bernard
|
Jan 30, 2008 - 1:47 AM
|
1. Create CExtGridWnd with default styles. Modify styles SiwModifyStyle(__EGBS_GRIDLINES | __EGBS_SFM_FULL_ROWS | __EGBS_MULTI_AREA_SELECTION); Try select some rows with SHIFT key - row selected but not redraw. If I add SiwModifyStyle(__ESIS_STH_PIXEL|__ESIS_STV_PIXEL) the selection redraw successfully. Why ?
2. Create CExtGridWnd with styles: SiwModifyStyleEx(__EGBS_EX_HVI_HIGHLIGHT_ROWS|__EGBS_EX_HVI_EVENT_CELLS|__EGBS_EX_HVI_HIGHLIGHT_CELL); There are all ok - hovered row highlights successfully. Set to all cells BackColorSet(CExtGridCell::__ECS_NORMAL, SomeColorRef); Highlights only one hovered cell. Why ?
|
|
Technical Support
|
Feb 2, 2008 - 1:07 PM
|
We analyzed your request in more details and found that both ways are enough close to each other. A new version of CExtGridCell::e_cell_state_t specifies a greater number of supported color types: enum e_cell_state_t
{
__ECS_ALL = 0, // color in any state
__ECS_NORMAL = 1, // normal, not hovered, not selected, not highlighted
__ECS_SELECTED = 2, // selected
__ECS_HOVERED = 3, // hovered
// next added in 2.83
__ECS_HIGHLIGHT_PRESSING = 4, // pressed
__ECS_HIGHLIGHT_BY_FOCUS = 5, // in the same row or column with focused
__ECS_HIGHLIGHT_BY_SELECTION = 6, // in the same row or column with selected
__ECS_HIGHLIGHT_BY_HOVER = 7, // in the same row or column with hovered
}; All these constants can be used in invocations of the CExtGridCell::TextColorGet() , CExtGridCell::TextColorSet() , CExtGridCell::BackColorGet() and CExtGridCell::BackColorSet() methods. You should simply set only the __ECS_NORMAL color instead of the __ECS_ALL color and highlighting will work like you requested. Please send us an e-mail to the support mail box at this web site so we will provide you with the source code update.
|
|
Phillip Bernard
|
Feb 1, 2008 - 5:53 AM
|
I’d prefer second way. I think what changing cell’s background color in __ECS_NORMAL state must not influence to full row highlighting.
|
|
Technical Support
|
Jan 31, 2008 - 4:26 AM
|
The scrolling strategy style should be applied to the grid window at least in one of directions: horizontal or vertical. This is really required by the current implementation of the grid windows.
If the background color is specified to some grid cell, then it really ignores highlighting. There are two improvements can be done in the grid window:
1) We can add support for additional cell colors that can be used during highlighting. Currently only normal, hover, selected and single persistent colors are supported.
2) We can make highlighted cells ignore their preferred colors.
We think first case is better, but which of them would you prefer?
|
|
Phillip Bernard
|
Jan 30, 2008 - 1:52 AM
|
Prof-UIS v2.82 VS2008 Windows XP sp2
|
|
David Skok
|
Jan 29, 2008 - 6:12 PM
|
How can I get the rects of a cell in a ExtReportGridWnd given the CExtReportGridColumn and CExtReportGridItem of the cell?
Thanks, Dave
|
|
Technical Support
|
Jan 31, 2008 - 4:29 AM
|
You can do this using the following code CExtReportGridWnd & wndRG = . . .
CExtReportGridColumn * pRGC = . . .
CExtReportGridItem & pRGI = . . .
if( pRGC == NULL || pRGC == NULL )
return ... // incorrect parameters
ASSERT_VALID( pRGC );
ASSERT_VALID( pRGI );
if( ! pRGC->ColumnIsActive() )
return . . . // itās not possible to get cell rectangles if itās inside inactive column
LONG nRowNo = wndRG.ItemGetVisibleIndexOf( (HTREEITEM)pRGI );
if( nRowNo < 0L )
return . . . // report row is collapsed and locations of its cells are unavailable
LONG nColNo = 0L, nTmp = wndRG.ColumnCountGet();
for( ; nColNo < nTmp; nColNo++ )
{
CExtGridCell * pHdrCell = wndRG.GridCellGetOuterAtTop( nColNo, 0L );
ASSERT_VALID( pHdrCell );
if( LPVOID(pHdrCell) == LPVOID(pRGC) )
break;
}
ASSERT( nColNo < nTmp );
CRect rcCell, rcCellExtra;
if( ! wndRG.GridCellRectsGet(
nColNo,
nRowNo,
0,
0,
&rcCell,
&rcCellExtra
)
)
return . . . // cell is outside visible range and its location is unavailable As you can see, itās not possible to get cell location if itās inside an inactive column under a collapsed group row or not at least partially visible in the displayed cell range (you need to scroll to it). The computed nColNo and nRowNo indices can be used in invocations of the CExtGridWnd::EnsureVisibleColumn() and CExtGridWnd::EnsureVisibleRow() methods if you want to scroll the report grid to a particular cell. The CExtGridWnd::GridCellRectsGet() method can compute rectangles of all cell parts. In the code above we computed the rcCell rectangle of exact cell location. The rcCellExtra rectangle is exactly the same if auto-preview mode is off. If itās on, then rcCellExtra rectangle contains a larger bottom side which is used by the in-row preview area.
|
|
Pierre MEDART
|
Jan 28, 2008 - 11:29 AM
|
Hi,
our application has a docked view containing a tree control that host various objects and view to reports, a bit like in Visual Studio.
The issue we face is:
On the toolbar (a CExtToolControlBar), click on pixel left or right of a separator -> the toolbar is inactive.
The issue I clearly face here is that my view looses the focus -> the update mechanism is broken.
I try to restore it by setting the active view. The issue I now is that my toolbar is partially activated either the buttons linked to the tree or the ones linked to the view.
Any idea or suggestion ?
I’m using the 2.7.0 version of the toolkit.
|
|
Technical Support
|
Jan 29, 2008 - 10:27 AM
|
We set a breakpoint to case WM_SETFOCUS in CExtControlBar::WindowProc() . So, we can catch the focus setting event on the toolbar. We run the SDI sample and set focus on the editor inside the Resizable Bar 0 bar. If the main frame window is active, then dragging start event of the toolbar will never make the toolbar focused. If the frame window is inactive and you are starting to drag-n-drop the toolbar window through its gripper or any separator, then the toolbar may become focused but this is not exactly related to the problem described in your message. Fortunately, the MthOutput sample application allowed us to reproduce this issue successfully. We found a situation when the code of the CExtControlBar class can really set focus to itself without analyzing whether the bar is a resizable panel bar or a toolbar. The problem can be solved in two steps:
1) Update the source code of the following overloaded version of the CExtControlBar::stat_QueryFocusChangingEnabled method: bool CExtControlBar::stat_QueryFocusChangingEnabled(
HWND hWndNotifyTarget,
CWnd * pWndQueryOwner,
HWND hWndNewFocusOwner
)
{
ASSERT( hWndNotifyTarget != NULL && ::IsWindow( hWndNotifyTarget ) );
ASSERT_VALID( pWndQueryOwner );
ASSERT( pWndQueryOwner->GetSafeHwnd() != NULL );
ASSERT( hWndNewFocusOwner != NULL && ::IsWindow( hWndNewFocusOwner ) );
CExtControlBar * pBar = DYNAMIC_DOWNCAST( CExtControlBar, pWndQueryOwner );
if( pBar != NULL
&& pBar->IsFixedMode()
)
return false;
QueryFocusChangingEnabled_t _QFCE( pWndQueryOwner, hWndNewFocusOwner );
::SendMessage( hWndNotifyTarget, g_nMsgQueryFocusChangingEnabled, _QFCE, 0 );
return _QFCE.m_bFocusChangingEnabled;
} 2) Modify the following part of the CExtControlBar::_DraggingStart() method: . . .
} // if( ! bEnableStartDragging )
} // if( sizeWaitMouseMove.cx > 0 && sizeWaitMouseMove.cy > 0 )
//ASSERT( CExtMouseCaptureSink::GetCapture() == hWndOwn );
CExtMouseCaptureSink::SetCapture( hWndOwn );
_SetCursor( point );
m_bDragDetecting = false;
ASSERT( g_DragStateOld.IsEmpty() );
ASSERT( g_DragStateNew.IsEmpty() );
g_DragStateOld.ExtBarSrcSet( this );
. . .
|
|
Pierre MEDART
|
Jan 29, 2008 - 9:42 AM
|
the call stack is
> FiREGrids.dll!FReportView::OnKillFocus(CWnd * pWnd=0x04b8ea68) Line 2400 C++ mfc80d.dll!CWnd::OnWndMsg(unsigned int message=8, unsigned int wParam=1183186, long lParam=0, long * pResult=0x0012e230) Line 2079 C++ mfc80d.dll!CWnd::WindowProc(unsigned int message=8, unsigned int wParam=1183186, long lParam=0) Line 1741 + 0x20 bytes C++ og801asd.dll!CGXGridView::WindowProc(unsigned int message=8, unsigned int wParam=1183186, long lParam=0) Line 333 C++ FiREGrids.dll!GTBContentBasedView::WindowProc(unsigned int message=8, unsigned int wParam=1183186, long lParam=0) Line 347 + 0x14 bytes C++ mfc80d.dll!AfxCallWndProc(CWnd * pWnd=0x085f1818, HWND__ * hWnd=0x00401008, unsigned int nMsg=8, unsigned int wParam=1183186, long lParam=0) Line 240 + 0x1c bytes C++ mfc80d.dll!AfxWndProc(HWND__ * hWnd=0x00401008, unsigned int nMsg=8, unsigned int wParam=1183186, long lParam=0) Line 389 C++ mfc80d.dll!AfxWndProcBase(HWND__ * hWnd=0x00401008, unsigned int nMsg=8, unsigned int wParam=1183186, long lParam=0) Line 411 + 0x15 bytes C++ user32.dll!GetDC() + 0x6d bytes [Frames below may be incorrect and/or missing, no symbols loaded for user32.dll] user32.dll!GetDC() + 0x14f bytes user32.dll!DefWindowProcW() + 0x184 bytes user32.dll!DefWindowProcW() + 0x1d0 bytes ntdll.dll!_KiUserCallbackDispatcher@12() + 0x13 bytes user32.dll!SetFocus() + 0xc bytes ProfUIS270nd.dll!CExtControlBar::_DraggingStart(const CPoint & point={...}, const CPoint & pointOffset={...}, CSize sizeWaitMouseMove={...}) Line 12176 C++ ProfUIS270nd.dll!CExtControlBar::OnLButtonDown(unsigned int nFlags=1, CPoint point={...}) Line 9960 + 0x2d bytes C++ ProfUIS270nd.dll!CExtToolControlBar::OnLButtonDown(unsigned int nFlags=1, CPoint point={...}) Line 10789 C++ mfc80d.dll!CWnd::OnWndMsg(unsigned int message=513, unsigned int wParam=1, long lParam=655768, long * pResult=0x0012e8e8) Line 2169 C++ mfc80d.dll!CWnd::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=655768) Line 1741 + 0x20 bytes C++ mfc80d.dll!CControlBar::WindowProc(unsigned int nMsg=513, unsigned int wParam=1, long lParam=655768) Line 504 + 0x14 bytes C++ ProfUIS270nd.dll!CExtControlBar::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=655768) Line 8536 C++ ProfUIS270nd.dll!CExtToolControlBar::WindowProc(unsigned int message=513, unsigned int wParam=1, long lParam=655768) Line 12839 C++ mfc80d.dll!AfxCallWndProc(CWnd * pWnd=0x04b8ea68, HWND__ * hWnd=0x00120dd2, unsigned int nMsg=513, unsigned int wParam=1, long lParam=655768) Line 240 + 0x1c bytes C++ mfc80d.dll!AfxWndProc(HWND__ * hWnd=0x00120dd2, unsigned int nMsg=513, unsigned int wParam=1, long lParam=655768) Line 389 C++ mfc80d.dll!AfxWndProcBase(HWND__ * hWnd=0x00120dd2, unsigned int nMsg=513, unsigned int wParam=1, long lParam=655768) Line 411 + 0x15 bytes C++ user32.dll!GetDC() + 0x6d bytes user32.dll!GetDC() + 0x14f bytes user32.dll!GetWindowLongW() + 0x127 bytes user32.dll!DispatchMessageA() + 0xf bytes mfc80d.dll!AfxInternalPumpMessage() Line 183 C++ mfc80d.dll!CWinThread::PumpMessage() Line 896 C++ [Managed to Native Transition] FRC.exe!FFiREApp::PumpMessage() Line 748 + 0xb bytes C++ [Native to Managed Transition] mfc80d.dll!CWinThread::Run() Line 625 + 0xd bytes C++ mfc80d.dll!CWinApp::Run() Line 894 C++ mfc80d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f10, int nCmdShow=5) Line 47 + 0xd bytes C++ FRC.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f10, int nCmdShow=5) Line 33 C++ FRC.exe!__tmainCRTStartup() Line 589 + 0x35 bytes C FRC.exe!WinMainCRTStartup() Line 414 C mfc80d.dll!CWinThread::Run() Line 625 + 0xd bytes C++ mfc80d.dll!CWinApp::Run() Line 894 C++ mfc80d.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f10, int nCmdShow=5) Line 47 + 0xd bytes C++ FRC.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f10, int nCmdShow=5) Line 33 C++ FRC.exe!__tmainCRTStartup() Line 589 + 0x35 bytes C FRC.exe!WinMainCRTStartup() Line 414 C ntdll.dll!_RtlFreeHeapSlowly@12() + 0x207 bytes ntdll.dll!_RtlFreeHeapSlowly@12() + 0x207 bytes ntdll.dll!_LdrpGetProcedureAddress@20() + 0x136 bytes ntdll.dll!_RtlAllocateHeap@12() + 0x117 bytes
as you can read the Toolbar enters in a ::_DraggingStart(...) function -> it seems that we don’t exit properly
The window that kills the focus is
+ pWnd 0x04b8ea68 {CExtToolControlBar hWnd=0x00120dd2} CWnd *
What can I do ?
|
|
Technical Support
|
Jan 29, 2008 - 8:22 AM
|
A toolbar window never sets focus to itself. If this issue exists, then you can handle the WM_KILLFOCUS in your view window and set a breakpoint in the handler method. The call stack will allow you to see what happens and the handler method has a pointer to the window which requested focus.
|
|
Wilhelm Falkner
|
Jan 28, 2008 - 8:57 AM
|
Hello,
I want to insert a toplevel popup menu into any existing menu. Using a MFC-Application without Prof-UIS the code: CMenu* pMenu = AfxGetMainWnd()->GetMenu(); if (pMenu != NULL) { CMenu cmInsert; if (cmInsert.LoadMenu(IDR_INSERT_4_DB)) { /* CMenu* pSubMenu = cmInsert.GetSubMenu(0); UINT nFlags = MF_BYPOSITION | MF_POPUP; nFlags = MF_BYPOSITION; nFlags = MF_POPUP; nFlags = MF_BYPOSITION | MF_POPUP; pMenu->InsertMenu(1, nFlags, (UINT_PTR)pSubMenu->m_hMenu); */ CMenu* pPopupMenu = cmInsert.GetSubMenu(0); // get its string - *ˆ&) Windows can’t figure it out for itself CString strMenuItem; cmInsert.GetMenuString(0, strMenuItem, MF_BYPOSITION);
// Add it VERIFY(pMenu->InsertMenu(1, MF_BYPOSITION | MF_POPUP, (UINT)pPopupMenu->GetSafeHmenu(), strMenuItem)); // remove from the other menu! cmInsert.RemoveMenu(0, MF_BYPOSITION);
DrawMenuBar(); // pMenu->InsertMenu(1, MF_BYPOSITION | MF_POPUP, (UINT_PTR)cmInsert.m_hMenu); } } }
|
|
Technical Support
|
Jan 29, 2008 - 3:01 AM
|
The CExtMenuControlBar class kills main frameās menus and completely monitors menu changing in MDI main frames. It keeps current the main frameās menu handle internally and uses it for building its toolbar buttons. So the top menu level is ab array of toolbar buttons in the menu bar. You can override the CExtMenuControlBar::_UpdateMenuBar() internal virtual method which builds toolbar buttons. Your method should be similar to the original one except it should insert the additional top level buttons like you need. You should invoke the following code from outside the menu bar to make it rebuild and update its content: CExtMenuControlBar * pBar = . . .
pBar->UpdateMenuBar();
pBar->GetParentFrame()->RecalcLayout();
|
|
Wilhelm Falkner
|
Jan 28, 2008 - 9:03 AM
|
Contine:
But working with PROF-UIS and CExtMenuControlBar, I’m without success. In your article "Constructing Menus Dynamically at Run Time" you work with items to replace. This works fine (I use it at other locations), but in this case, I can not replace any Item, I have to insert a new popup menu. How can I do this?
TIA Willi
|
|
Monte Variakojis
|
Jan 27, 2008 - 9:46 PM
|
Hello Group and Support,
I’ve installed version Prof-UIS 1.82 on to my Vista machine with Visual Studio 2008 installed. The installation seemed to go well. However the Integration Wizard fails. I select "Add Prof-UIS paths to Visual environment variables for Win32 platform", Add wizard to Visual studio and the integration wizard fails on the environment variables and shows a strange error, "-Remove Prof-UIS paths from Visual Studio environment variables for Win32 platform". However I selected _ADD_ variables. The second failure is the VS "New Project". I select a new project using Prof-UI and state the path and project name click OK and nothing happens.
What have I not done to cause these failures?
The report:
/*******************************************************************/ REPORT FILE [1-27-2008, 20:28] /*******************************************************************/
Remove Prof-UIS paths from Visual Studio environment variables for Win32 platform - Failed.
Install Prof-UIS Application Wizard to Visual Studio - Succeeded.
TIA
|
|
Monte Variakojis
|
Jan 30, 2008 - 8:13 PM
|
Thanks for the reply. Here are some more details:
OS: Windows Vista Ultimate 32 bit
VS 2008 Pro: * Installed using all of its default parameters and in its default directory (c:\Program Files\Microsoft Visual Studio 8). * The VS 2008 Pro is taken from the MSDN library.
Integration Wizard: * Vista Ultimate 32 bit. * Trying to add support to WS 2008 for 32 bit build. * Fails on creating environment variables. The check box is there and selected. The error message is as if I was trying to REMOVE the environment variables. * 32 Bit build fails
Creating a new Prof-UI project from VS 2008 * The project option exists on the new project for VC++ * When OK is selected, the wizard never appears so I cannot step through any of the pages.
Other notes: I tried to uninstall 1.82 and clean the directory and reinstall it.
Please let me know if there are any other parameters you would like to see.
Monte--
|
|
Technical Support
|
Jan 29, 2008 - 2:54 AM
|
Please provide some more details about the problem. Which version of Windows Vista, Win32 or x64? Which language? If Visual Studio 2008 is installed into the default location and if its installation path contains some no-English characters? Does the Application Wizard work correctly in any other cases? Will it work if you go through its pages?
|
|
Monte Variakojis
|
Jan 27, 2008 - 9:51 PM
|
Sorry about the mess! <cut and paste>, try again:
Hello Group and Support,
I’ve installed version Prof-UIS 1.82 on to my Vista machine with Visual Studio 2008 installed. The installation seemed to go well. However the Integration Wizard fails. I select "Add Prof-UIS paths to Visual environment variables for Win32 platform", Add wizard to Visual studio and the integration wizard fails on the environment variables and shows a strange error, "-Remove Prof-UIS paths from Visual Studio environment variables for Win32 platform". However I selected _ADD_ variables. The second failure is the VS "New Project". I select a new project using Prof-UI and state the path and project name click OK and nothing happens.
What have I not done to cause these failures? The report: /*******************************************************************/ REPORT FILE [1-27-2008, 20:28] /*******************************************************************/
Remove Prof-UIS paths from Visual Studio environment variables for Win32 platform - Failed.
Install Prof-UIS Application Wizard to Visual Studio - Succeeded.
TIA
|
|
Offer Har
|
Jan 26, 2008 - 6:23 AM
|
Hi,
I need to implement a tree grid with 100,000 rows - is it possible?
Thanks, Ron.
|
|
Technical Support
|
Jan 26, 2008 - 12:09 PM
|
100,000 rows is quite a lot If you insert these rows at once during initialization of the tree grid window, this will take quite a time. So you should initialize the tree grid window on the fly. First, insert top level items which are children of the root item. Each of this item should be collapsed and has one child item with text Expanding.... You can override CExtTreeGridWnd::ItemExpand() which should remove the single item of the currently expanding item and insert new required items. If you have 100,000 rows then you should carefully analyze your task and implement some filtered data displaying. For instance, some combo box and/or set of other controls should allow you to choose which data to see in the tree grid window. As a result, the number of rows in tree grid should be several times less and even in this case you may still need to use dynamic data displaying in the tree grid.
|
|
Darius Mikalauskas
|
Jan 25, 2008 - 7:09 AM
|
Hello,
I have CExtGridWnd object with two columns. I would like to set second column width to occupy all free space available in CExtGridWnd window.
Thank you.
|
|
Technical Support
|
Jan 26, 2008 - 3:03 PM
|
The feature you need is called proportional column resizing. First of all, you should make your grid not using any scrolling strategy at all in horizontal direction. You should use the __ESIS_STH_NONE style instead of __ESIS_STH_PIXEL or __ESIS_STH_ITEM or __ESIS_STH_VIRTUAL styles in invocation of the SiwModifyStyle() method of your grid window. The __ESIS_STH_NONE style means not to use horizontal scrolling at all. You can also invoke the wndGrid.SiwScrollTypeHSet( __ESIW_ST_NONE ); code to disable horizontal scrolling. Next, you should allow proportional column resizing for your grid window by applying the __EGBS_BSE_EX_PROPORTIONAL_COLUMN_WIDTHS style using the CExtGridWnd::BseModifyStyleEx() method. Then, we assume you have initialized outer header row at the top side of your grid window with the CExtGridCellHeader grid cell objects. The header cells are supporting both minimal/current/maximal widths in pixels (pHeaderCell->ExtentSet() ) and proportional sizes (pHeaderCell->ExtentPercentSet() ). It all three cell widths in pixels are equal, then user will not be able to resize it and it will not be resized proportionally by the grid control when it will attempt to make all the columns occupying entire available widths. The proportional widths (pHeaderCell->ExtentPercentSet() ) are floating point values. The summary floating point value of all the header cells will assumed as 100%. During horizontal resizing of the grid window its columns will be resized proportionally according their proportional width values. So, you can specify proportional widths of first column as pHeaderCell0->ExtentPercentSet(0.0) and proportional widths of second column as pHeaderCell1->ExtentPercentSet(1.0) . This means only the second column will be resized automatically when the grid window will become resized horizontally.
|
|
tera t
|
Jan 25, 2008 - 1:46 AM
|
|
|
tera t
|
Feb 25, 2008 - 5:39 PM
|
Hello.
I do not have any problem. I was not able to understand English answers well. I decide to use the thing of new Version. Thank you.
|
|
Technical Support
|
Feb 25, 2008 - 4:38 AM
|
We do not support old versions. Do you have any strong reason not to switch to to a newer version ?
|
|
tera t
|
Feb 22, 2008 - 4:39 AM
|
I use Prof-UIS2.70. However, the application does not work well ????
|
|
Technical Support
|
Feb 21, 2008 - 6:51 AM
|
We already fixed this issue. You should use a newer version than 2.70.
|
|
tera t
|
Feb 21, 2008 - 2:04 AM
|
|
|
tera t
|
Feb 19, 2008 - 1:11 AM
|
Hello.
>Could you put the source code which produces this screen shot into our sample application and send it to us? In the source which I sent last time, will "Debug" be impossible?
http://www.yukai.jp/~ifreeta/20080219/RibbonBarTestA.lzh I incorporated it in RibbonSample. (--; Please answer me.
|
|
Technical Support
|
Feb 18, 2008 - 4:21 AM
|
Could you put the source code which produces this screen shot into our sample application and send it to us?
|
|
Technical Support
|
Feb 18, 2008 - 4:20 AM
|
We cannot reproduce similar painting effects. Could you ensure both the main frame window and un-painted container window are created with the WS_CLIPSIBLINGS|WS_CLIPCHILDREN standard window styles?
|
|
tera t
|
Feb 15, 2008 - 5:35 PM
|
|
|
tera t
|
Feb 15, 2008 - 5:29 PM
|
|
|
Technical Support
|
Feb 15, 2008 - 10:50 AM
|
If this issue is in Prof-UIS, then itās in any tab page container and not only in the flat tab page container. How to reproduce this incorrect painting effect with our sample applications?
|
|
tera t
|
Feb 14, 2008 - 6:34 PM
|
|
|
Technical Support
|
Feb 14, 2008 - 6:25 AM
|
Could you please reproduce this problem with our RibbonBar sample and send it to us?
|
|
tera t
|
Feb 14, 2008 - 1:05 AM
|
|
|
Technical Support
|
Feb 9, 2008 - 1:04 AM
|
You should add the following two files to your project: // in .H file
class CYourTextFieldButton : public CExtBarTextFieldButton
{
public:
DECLARE_DYNCREATE( CYourTextFieldButton );
CYourTextFieldButton(
bool bComboField = false,
INT nTextFieldWidth = __EXT_MENU_DEF_INPLACE_EDIT_WIDTH,
CExtToolControlBar * pBar = NULL,
UINT nCmdID = ID_SEPARATOR,
UINT nStyle = 0
)
: CExtBarTextFieldButton(
bComboField,
nTextFieldWidth,
pBar,
nCmdID,
nStyle
)
{
}
virtual CSize CalculateLayout(
CDC & dc,
CSize sizePreCalc,
BOOL bHorz
)
{
ASSERT_VALID( this );
CSize _size = CExtBarTextFieldButton::CalculateLayout( dc, sizePreCalc, bHorz );
_size.cy += 10; // make it 10 pixels larger in height
}
};
class CYourTextFieldNode : public CExtRibbonNode
{
public:
DECLARE_SERIAL( CYourTextFieldNode );
CYourTextFieldNode(
UINT nCmdIdBasic = 0L,
UINT nCmdIdEffective = 0L,
CExtRibbonNode * pParentNode = NULL,
DWORD dwFlags = 0L,
__EXT_MFC_SAFE_LPCTSTR strTextInToolbar = NULL,
__EXT_MFC_SAFE_LPCTSTR strTextInMenu = NULL,
__EXT_MFC_SAFE_LPCTSTR strTextUser = NULL,
LPARAM lParam = 0L,
CExtCmdIcon * pIconCustomized = NULL,
INT nTextFieldWidth = 100,
INT nDropDownWidth = -2, // (-1) - auto calc, (-2) - same as button area
INT nDropDownHeightMax = 250
);
CExtRibbonNode(
UINT nCmdIdBasic = 0L,
UINT nCmdIdEffective = 0L,
CExtRibbonNode * pParentNode = NULL,
DWORD dwFlags = 0L,
__EXT_MFC_SAFE_LPCTSTR strTextInToolbar = NULL,
__EXT_MFC_SAFE_LPCTSTR strTextInMenu = NULL,
__EXT_MFC_SAFE_LPCTSTR strTextUser = NULL,
LPARAM lParam = 0L,
CExtCmdIcon * pIconCustomized = NULL,
INT nTextFieldWidth = 100,
INT nDropDownWidth = -2, // (-1) - auto calc, (-2) - same as button area
INT nDropDownHeightMax = 250
);
virtual CRuntimeClass * _OnRibbonGetButtonRTC()
{
ASSERT_VALID( this );
return ( RUNTIME_CLASS( CYourTextFieldButton ) );
}
virtual CExtBarButton * OnRibbonCreateBarButton(
CExtRibbonPage * pBar,
CExtBarButton * pParentTBB = NULL
)
{
CYourTextFieldButton * pTextFieldTBB =
STATIC_DOWNCAST(
CYourTextFieldButton,
CExtRibbonNode::OnRibbonCreateBarButton( pBar, pParentTBB )
);
pTextFieldTBB->m_nDropDownWidth = DropDownWidthGet();
pTextFieldTBB->m_nDropDownHeightMax = DropDownHeightMaxGet();
pTextFieldTBB->m_bTextFieldIsNotEditable = ( GetFlags() & __ECTN_TBB_TF_NE ) ? true : false;
return pTextFieldTBB;
}
};
// in .CPP file
IMPLEMENT_DYNCREATE( CYourTextFieldButton, CExtBarTextFieldButton );
IMPLEMENT _SERIAL( CYourTextFieldNode, CExtRibbonNode ); The CYourTextFieldButton class implements a custom measured text/combo field toolbar button and CYourTextFieldNode is a ribbon node that creates an instance of the CYourTextFieldButton class instead of CExtBarTextFieldButton implemented in Prof-UIS.
|
|
tera t
|
Feb 4, 2008 - 5:00 PM
|
|
|
tera t
|
Jan 31, 2008 - 8:00 PM
|
Hello.
I do not understand ways of the descriptions well. I ask for your sample code.
Thanks
|
|
Technical Support
|
Jan 26, 2008 - 3:00 PM
|
Itās possible to specify the width of text or combo field. The height is measured automatically. If you need some custom height, you should implement a text field button class like we advised on our previous answer and implement the CExtBarButton::CalculateLayout() virtual method in it. Your method should invoke parent class method and then increase the CSize::cy height value before returning the CSize object.
|
|
tera t
|
Jan 25, 2008 - 1:50 AM
|
By a theme, height does a variable stripe. If it is difficult, this matter is good
Thanks,
|
|
Debabrata Mukherjee
|
Jan 24, 2008 - 11:40 PM
|
Can the PageRemove() method be used without selecting the previous page in a tab strip in the class CExtTabPageContainerWnd . Because the PageRemoveAll() method does not work. Please treat it as urgent!
|
|
Technical Support
|
Jan 26, 2008 - 12:21 PM
|
If you open the CExtTabPageContainerWnd::PageRemove() method you can find the following code: // select previous page
if( nCount > 0L )
{
if( nIndex > 0L )
nIndex--;
PageSelectionSet( nIndex );
} This code selects the previous page. So you can use a modified version of this method where this fragment is removed. As for the CExtTabPageContainerWnd::PageRemoveAll() , what do you mean by "method does not work"?
|
|
tera t
|
Jan 24, 2008 - 11:11 PM
|
|
|
Technical Support
|
Jan 26, 2008 - 3:00 PM
|
First of all, you need your own CExtBarTextFieldButton -derived class which implements the CExtBarTextFieldButton::PaintCompound() virtual method. This method should invoke the parent class method for painting a default combo box like appearance of the toolbar button and then draws a black line of required width over the combo box. Second, you should override the CExtCustomizeSite::OnCreateToolbarButton() virtual method in your CExtRibbonBar -derived class. This method is needed for instantiating your text field button class instead the standard one. Third, you need to implement the CExtCustomizeSite::OnPopupListBoxItemDraw() and CExtCustomizeSite::OnPopupListBoxItemMeasure() virtual methods in the same CExtRibbonBar -derived class for painting combo box items as lines of different width. We think the combo box with lines is some kind of old UI item. We would prefer a drop-down button with a menu instead like implemented in the DRAWCLI sample application.
|
|
tera t
|
Jan 24, 2008 - 11:08 PM
|
|
|
Technical Support
|
Jan 26, 2008 - 2:56 PM
|
Please try to assign some icons wider than 16 pixels with icon images shifted to the right side.
|
|
Suhai Gyorgy
|
Jan 24, 2008 - 2:06 AM
|
Dear Support,
I found some problems in our multiline grid cell. It can be reproduced in your ProfUIS_Controls sample. Go to Grid page and then to Text column. Go into edit mode in one of the multiline cells and place the cursor to the very end of the first line. If you press Delete key here, you can see a square kind of character appearing between the texts "Cellx Line1" and "Cellx Line2". I think it is connected to how VK_DELETE is handled in the in-place editor’s message loop in CExtGridWnd::OnGbwBeginEdit.
Could you please check this issue? Thank you!
|
|
Technical Support
|
Jan 24, 2008 - 11:12 AM
|
Thank you for reporting this issue. Please update the source code for this method: bool CExtGridWnd::OnGbwBeginEdit(
LONG nVisibleColNo,
LONG nVisibleRowNo,
LONG nColNo,
LONG nRowNo,
INT nColType,
INT nRowType,
const RECT & rcCellExtra,
const RECT & rcCell,
const RECT & rcInplaceControl,
bool bContinueMsgLoop,
__EXT_MFC_SAFE_LPCTSTR strStartEditText
)
{
ASSERT_VALID( this );
if( CExtGridBaseWnd::OnGbwBeginEdit(
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtra,
rcCell,
rcInplaceControl,
bContinueMsgLoop,
strStartEditText
)
)
return true;
if( CExtPopupMenuWnd::IsMenuTracking() )
CExtPopupMenuWnd::CancelMenuTracking();
CWnd::CancelToolTips();
DWORD dwBseStyle = BseGetStyle();
if( nColType < 0
&& (dwBseStyle&__EGWS_BSE_EDIT_CELLS_OUTER_L) == 0L
)
return false;
else if( nColType > 0
&& (dwBseStyle&__EGWS_BSE_EDIT_CELLS_OUTER_R) == 0L
)
return false;
else if( nRowType < 0
&& (dwBseStyle&__EGWS_BSE_EDIT_CELLS_OUTER_T) == 0L
)
return false;
else if( nRowType > 0
&& (dwBseStyle&__EGWS_BSE_EDIT_CELLS_OUTER_B) == 0L
)
return false;
else if( nColType == 0
&& nRowType == 0
&& (dwBseStyle&__EGWS_BSE_EDIT_CELLS_INNER) == 0L
)
return false;
static CExtGridCell * g_pEditCell = NULL;
bool bDoMsgLoop = true;
if( m_hWndInplaceControl != NULL )
{
if( ! bContinueMsgLoop )
return false;
HWND hWndInplaceControl = m_hWndInplaceControl;
m_hWndInplaceControl = NULL;
if( hWndInplaceControl != NULL )
{
bDoMsgLoop = false;
if( ::IsWindow(hWndInplaceControl) )
::DestroyWindow( hWndInplaceControl );
}
}
CRect rcActivate( rcInplaceControl );
if( rcActivate.left >= rcActivate.right
|| rcActivate.top >= rcActivate.bottom
)
{
if( ! GridCellRectsGet(
nColNo,
nRowNo,
nColType,
nRowType,
NULL,
NULL,
NULL,
&rcActivate
)
)
{
g_pEditCell = NULL;
return false;
}
if( rcActivate.IsRectEmpty() )
{
g_pEditCell = NULL;
return false;
}
}
CExtGridCell * pCellToEdit =
GridCellGet(
nColNo,
nRowNo,
nColType,
nRowType
);
if( pCellToEdit == NULL )
return false;
ASSERT_VALID( pCellToEdit );
ASSERT( pCellToEdit->IsKindOf(RUNTIME_CLASS(CExtGridCell)) );
ASSERT_VALID( pCellToEdit->DataProviderGet() );
g_pEditCell = pCellToEdit;
m_hWndInplaceControl =
g_pEditCell->OnInplaceControlCreate(
*this,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtra,
rcCell,
rcActivate,
m_nHelperLastEditedColNo,
m_nHelperLastEditedRowNo
);
if( m_hWndInplaceControl == NULL
|| ( ! ::IsWindow( m_hWndInplaceControl ) )
)
{
m_hWndInplaceControl = NULL;
g_pEditCell = NULL;
DWORD dwCellStyle = pCellToEdit->GetStyle();
if( (dwCellStyle&__EGCS_CHK_MASK) == 0 )
{
if( (dwCellStyle&__EGCS_BUTTON_DROPDOWN) != 0 )
{
bool bEnabled = false;
if( pCellToEdit->OnQueryButtonInfo(
INT(CExtGridCell::__EBTT_DROPDOWN),
&bEnabled
)
)
{
if( bEnabled )
{
pCellToEdit->OnButtonPressed(
*this,
INT(CExtGridCell::__EBTT_DROPDOWN),
rcCellExtra,
rcCell,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType
);
return true;
}
}
}
}
return false;
}
m_nHelperLastEditedColNo = nColNo;
m_nHelperLastEditedRowNo = nRowNo;
if( ! bDoMsgLoop )
return true;
CWinThread * pThread = ::AfxGetThread();
ASSERT_VALID( pThread );
if( strStartEditText != NULL )
{
bool bSetText = true;
TCHAR strClassName[512];
::GetClassName( m_hWndInplaceControl, strClassName, 512 );
if( _tcslen( strClassName ) > 0 )
{
__EXT_MFC_STRLWR( strClassName, 512 );
if( _tcsstr( strClassName, _T("edit") ) != NULL
|| _tcsstr( strClassName, _T("riched") ) != NULL
|| _tcsstr( strClassName, _T("sysipaddress32") ) != NULL
)
{
bSetText = false;
HWND hWndInplaceControl = m_hWndInplaceControl;
if( _tcsstr( strClassName, _T("sysipaddress32") ) != NULL )
{
for( HWND hWnd = ::GetWindow( m_hWndInplaceControl, GW_CHILD );
hWnd != NULL;
hWnd = ::GetWindow( hWnd, GW_HWNDNEXT )
)
{
ASSERT( hWnd != NULL );
ASSERT( ::IsWindow(hWnd) );
if( ::GetFocus() == hWnd )
{
hWndInplaceControl = hWnd;
break;
}
}
}
::SendMessage(
hWndInplaceControl,
EM_SETSEL,
WPARAM(0),
LPARAM(-1)
);
::SendMessage(
hWndInplaceControl,
EM_REPLACESEL,
WPARAM(TRUE),
LPARAM(strStartEditText)
);
}
}
if( bSetText )
::SetWindowText( m_hWndInplaceControl, strStartEditText );
}
HWND hWndGrid = m_hWnd;
bool bStopFlag = false;
for( MSG msg;
m_hWndInplaceControl != NULL
&& ::IsWindow( m_hWndInplaceControl )
&& ::IsWindowVisible( m_hWndInplaceControl )
&& ::IsWindow( hWndGrid )
&& (!bStopFlag)
&& (g_pEditCell != NULL)
;
)
{
if( ! ::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) )
{
if( m_hWndInplaceControl == NULL
|| ( ! ::IsWindow( m_hWndInplaceControl ) )
|| ( ! ::IsWindow( hWndGrid ) )
|| bStopFlag
|| g_pEditCell == NULL
)
break;
LONG nIdleCounter = 0L;
for( nIdleCounter = 0L;
g_pEditCell->OnInplaceControlIdle(
m_hWndInplaceControl,
*this,
nIdleCounter
);
nIdleCounter ++
)
{
ASSERT_VALID( g_pEditCell );
}
if( CExtGridWnd::g_bEnableOnIdleCalls )
{
for( nIdleCounter = 0L;
pThread->OnIdle(nIdleCounter);
nIdleCounter ++
);
}
::WaitMessage();
continue;
}
switch( msg.message )
{
case WM_KILLFOCUS:
if( msg.hwnd == m_hWndInplaceControl )
bStopFlag = true;
break;
case WM_CANCELMODE:
case WM_ACTIVATEAPP:
case WM_SYSCOMMAND:
case WM_SETTINGCHANGE:
case WM_SYSCOLORCHANGE:
bStopFlag = true;
break;
case WM_COMMAND:
if( (HIWORD(msg.wParam)) == 0
|| (HIWORD(msg.wParam)) == 1
)
bStopFlag = true;
break;
case WM_CAPTURECHANGED:
if( (HWND)msg.wParam != m_hWndInplaceControl )
bStopFlag = true;
break;
case WM_LBUTTONUP:
case WM_LBUTTONDOWN:
case WM_LBUTTONDBLCLK:
case WM_RBUTTONUP:
case WM_RBUTTONDOWN:
case WM_RBUTTONDBLCLK:
case WM_MBUTTONUP:
case WM_MBUTTONDOWN:
case WM_MBUTTONDBLCLK:
case WM_NCLBUTTONUP:
case WM_NCLBUTTONDOWN:
case WM_NCLBUTTONDBLCLK:
case WM_NCRBUTTONUP:
case WM_NCRBUTTONDOWN:
case WM_NCRBUTTONDBLCLK:
case WM_NCMBUTTONUP:
case WM_NCMBUTTONDOWN:
case WM_NCMBUTTONDBLCLK:
case WM_CONTEXTMENU:
if( msg.hwnd != m_hWndInplaceControl
&& (!::IsChild( m_hWndInplaceControl, msg.hwnd ))
)
bStopFlag = true;
break;
default:
if( ( ! bStopFlag )
&& WM_KEYFIRST <= msg.message
&& msg.message <= WM_KEYLAST
&& ( msg.hwnd != m_hWndInplaceControl
|| (!::IsChild( m_hWndInplaceControl, msg.hwnd ))
)
)
{
bool bAlt =
( (::GetAsyncKeyState(VK_MENU)&0x8000) != 0 )
? true : false;
bool bCtrl =
( (::GetAsyncKeyState(VK_CONTROL)&0x8000) != 0 )
? true : false;
bool bShift =
( (::GetAsyncKeyState(VK_SHIFT)&0x8000) != 0 )
? true : false;
if( ! bAlt )
{
if( bCtrl
&& (!bShift)
&& ( int(msg.wParam) == VK_INSERT
|| int(msg.wParam) == int( _T(’C’) )
)
)
{
LRESULT lResult = 0L;
g_pEditCell->OnInplaceControlWindowProc(
lResult,
msg.message,
msg.wParam,
msg.lParam,
msg.hwnd,
*this,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtra,
rcCell,
rcInplaceControl
);
::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
if( msg.message == WM_KEYDOWN )
::SendMessage( msg.hwnd, WM_COPY, 0, 0 );
continue;
}
if( ( bCtrl && (!bShift) && int(msg.wParam) == int( _T(’V’) ) )
|| ( (!bCtrl) && bShift && int(msg.wParam) == VK_INSERT )
)
{
LRESULT lResult = 0L;
g_pEditCell->OnInplaceControlWindowProc(
lResult,
msg.message,
msg.wParam,
msg.lParam,
msg.hwnd,
*this,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtra,
rcCell,
rcInplaceControl
);
::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
if( msg.message == WM_KEYDOWN )
::SendMessage( msg.hwnd, WM_PASTE, 0, 0 );
continue;
}
if( ( bCtrl && (!bShift) && int(msg.wParam) == int( _T(’X’) ) )
|| ( (!bCtrl) && bShift && int(msg.wParam) == VK_DELETE )
)
{
LRESULT lResult = 0L;
g_pEditCell->OnInplaceControlWindowProc(
lResult,
msg.message,
msg.wParam,
msg.lParam,
msg.hwnd,
*this,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtra,
rcCell,
rcInplaceControl
);
::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
if( msg.message == WM_KEYDOWN )
{
if( ( g_pEditCell->GetStyle() & __EGCS_READ_ONLY ) == 0 )
::SendMessage( msg.hwnd, WM_CUT, 0, 0 );
else
::SendMessage( msg.hwnd, WM_COPY, 0, 0 );
}
continue;
}
if( bCtrl && (!bShift) && int(msg.wParam) == int( _T(’A’) ) )
{
LRESULT lResult = 0L;
g_pEditCell->OnInplaceControlWindowProc(
lResult,
msg.message,
msg.wParam,
msg.lParam,
msg.hwnd,
*this,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtra,
rcCell,
rcInplaceControl
);
::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
if( msg.message == WM_KEYDOWN )
::SendMessage( msg.hwnd, EM_SETSEL, 0, -1 );
continue;
}
if( (!bCtrl) && (!bShift) && int(msg.wParam) == VK_DELETE )
{
if( msg.message != WM_CHAR )
{
LRESULT lResult = 0L;
g_pEditCell->OnInplaceControlWindowProc(
lResult,
msg.message,
msg.wParam,
msg.lParam,
msg.hwnd,
*this,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtra,
rcCell,
rcInplaceControl
);
::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
if( msg.message == WM_KEYDOWN )
{
LPTSTR strEmpty = _T("");
INT nSelStart = 0, nSelEnd = 0;
::SendMessage(
msg.hwnd,
EM_GETSEL,
reinterpret_cast < WPARAM > ( &nSelStart ),
reinterpret_cast < LPARAM > ( &nSelEnd )
);
if( nSelStart == nSelEnd )
{
INT nReplaceEnd = nSelStart + 1;
CString s;
CWnd::FromHandle( msg.hwnd )->GetWindowText( s );
TCHAR chr = s.GetAt( nSelStart );
if( chr == _T(’\r’) || chr == _T(’\n’) )
nReplaceEnd ++;
::SendMessage(
msg.hwnd,
EM_SETSEL,
WPARAM( nSelStart ),
LPARAM( nReplaceEnd )
);
}
if( ( g_pEditCell->GetStyle() & __EGCS_READ_ONLY ) == 0 )
::SendMessage(
msg.hwnd,
EM_REPLACESEL,
1,
reinterpret_cast < LPARAM > ( strEmpty )
);
}
continue;
}
}
}
if( ( (!bAlt) && bCtrl && (!bShift) && int(msg.wParam) == int( _T(’Z’) ) )
|| ( bAlt && (!bCtrl) && (!bShift) && int(msg.wParam) == VK_BACK )
)
{
LRESULT lResult = 0L;
g_pEditCell->OnInplaceControlWindowProc(
lResult,
msg.message,
msg.wParam,
msg.lParam,
msg.hwnd,
*this,
nVisibleColNo,
nVisibleRowNo,
nColNo,
nRowNo,
nColType,
nRowType,
rcCellExtra,
rcCell,
rcInplaceControl
);
::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
if( msg.message == WM_KEYDOWN )
::SendMessage( msg.hwnd, WM_UNDO, 0, 0 );
continue;
}
}
break;
}
if( bStopFlag )
break;
if( ! pThread->PumpMessage() )
break;
}
g_pEditCell = NULL;
if( ! ::IsWindow( hWndGrid ) )
return true;
ASSERT( CWnd::FromHandlePermanent(hWndGrid) == this );
ASSERT_VALID( this );
m_nHelperLastEditedColNo = -1L;
m_nHelperLastEditedRowNo = -1L;
if( m_hWndInplaceControl != NULL )
{
if( ::IsWindow(m_hWndInplaceControl) )
{
if( ::GetCapture() == m_hWndInplaceControl )
::ReleaseCapture();
::ShowWindow( m_hWndInplaceControl, SW_HIDE );
::SetFocus( m_hWnd );
}
m_hWndInplaceControl = NULL;
}
return true;
}
|
|
Offer Har
|
Jan 23, 2008 - 8:17 AM
|
Dear Support,
We get repeat complains from our customers that when a cell is read-only it is impossible to read it - the color scheme is too light. The theme we use is CExtPaintManagerOffice2007_Blue and the problem is when we set the attribute __EGCS_READ_ONLY
1. I think that this is a problem in the skin that should be modified. 2. If not, can you please explain us how to change this specific color so that it will be readable.
Thanks, Ron.
|
|
Technical Support
|
Feb 8, 2008 - 3:16 AM
|
You can download the latest source code from our ftp server. Please contact us for details via email.
|
|
Offer Har
|
Feb 7, 2008 - 8:50 AM
|
Yes - this how it should look... Can you please send me the updated version? I need to release a version ASAP.
Thanks, Ron.
|
|
Technical Support
|
Feb 7, 2008 - 8:28 AM
|
Here is what we have now:
Please let us know if it is what you mean?
|
|
Offer Har
|
Feb 5, 2008 - 12:06 PM
|
My problem is that they are not even gray... when I add pCellString->ModifyStyle(__EGCS_READ_ONLY); The cell looks exactly the same as a editable cell, only it is not editable. In version 2.72 the gray was too light, and in 2.82 there gray is black.
Again, I am in CExtPaintManagerOffice2007_Blue - please check it with it, not apple not Obsidian.
|
|
Technical Support
|
Feb 5, 2008 - 11:56 AM
|
We followed your advice and here is the result:
But read-only cells look like disabled dialog items rather than grid cells. What do you think? We would prefer to leave them white with gray text.
|
|
Offer Har
|
Feb 4, 2008 - 1:03 PM
|
Dear Support,
The problem is with grid cells - not with normal controls - grit controls with the read-only (__EGCS_READ_ONLY) looks the same as cells that are not read-only, and they should have a gray background like the controls.
Thanks, Ron.
|
|
Technical Support
|
Feb 4, 2008 - 12:32 PM
|
Here is the screen shot demonstrating the current versions of the read only combo box and edit controls in Office 2007 Obsidian theme:
Please let us know what should we change.
|
|
Ian McIntosh
|
Feb 1, 2008 - 10:29 AM
|
I’m using v2.81. I have just had another issue reported, read only combo box using CExtPaintManagerOffice2007_Black is unreadable. not sure if that’s changed in 2.82.
|
|
Offer Har
|
Jan 30, 2008 - 3:00 AM
|
Hi,
I upgraded to 2.82, now, in CExtPaintManagerOffice2007_Blue read-only cells’ text is black like editable cells. It is not as bad as before, because you can read them - but there is no indication that they are read-only... Support - is this the way it should be? Ian - what version are you using?
Regards, Ron.
|
|
Ian McIntosh
|
Jan 30, 2008 - 2:19 AM
|
I also have had similar comments from my users (although I didn’t seem to get the same problem on my pc).
I added the following code:
#define RGB_CELL_TEXT RGB(0,0,75)
pCellString->ModifyStyle(__EGCS_READ_ONLY); pCellString->TextColorSet(CExtGridCell::__ECS_NORMAL, RGB_CELL_TEXT);
but it would obviously be preferable if I didn’t have to.
If this has been sorted, please could you post the solution. Thanks.
|
|
Offer Har
|
Jan 24, 2008 - 12:59 PM
|
I am sending it again... let me know if you haven’t received it - I am sending it to support@prof-uis.com
|
|
Technical Support
|
Jan 24, 2008 - 12:06 PM
|
We are sorry but have not yet received the screen shot.
|
|
Offer Har
|
Jan 24, 2008 - 4:44 AM
|
Dear Support,
The Read-Only color color is not black, it’s very light blue.
I am sending you as screen-shot.
Regards, Ron.
|
|
Technical Support
|
Jan 24, 2008 - 12:49 AM
|
Actually the text color of a read-only cell is the same as that of a normal cell. You just cannot edit the cell but the text color is black as usual. Would you send us some screenshots so we can see this ourselves?
As for cell colors, each cell has the following methods for managing colors: virtual COLORREF TextColorSet(
e_cell_state_t eCellState,
COLORREF clr = COLORREF( -1L )
);
virtual COLORREF TextColorGet(
e_cell_state_t eCellState
) const;
virtual COLORREF BackColorSet(
e_cell_state_t eCellState,
COLORREF clr = COLORREF( -1L )
);
virtual COLORREF BackColorGet(
e_cell_state_t eCellState
) const; The e_cell_state_t enumeration is defined in scope of the CExtGridCell class as follows: enum e_cell_state_t
{
__ECS_ALL = 0,
__ECS_NORMAL = 1,
__ECS_SELECTED = 2,
__ECS_HOVERED = 3,
}; That means you can set text/background colors of each grid cell for its normal, selected and hovered states independently of each other.
|
|