Subject |
Author |
Date |
|
tera tera
|
Jan 12, 2010 - 6:24 PM
|
Hello. 
|
|
Technical Support
|
May 17, 2010 - 2:46 PM
|
|
|
Ulrich Heinicke
|
May 17, 2010 - 12:18 PM
|
Hi, do you have an example? Ulrich
|
|
Technical Support
|
Jan 13, 2010 - 11:09 AM
|
The grid controls support tooltips and expanding features for grid cells. The tooltip window is displayed near grid cell. The content expanding window is displayed exactly over grid cell and location of cell text inside cell. Both windows are displayed automatically when the grid cell’s text is displayed partially. Unfortunately, the grid controls currently does not support independent cell tooltips with custom text. I.e. there is no tooltip support similar to tooltips of toolbar button. But you can display tooltips manually. You can handle the standard WM_MOUSEMOVE message your grid class, hit test the cells which should display tooltip and display the standard tooltip control for them or the CExtPopupMenuTipWnd control.
|
|
Offer Har
|
Jan 10, 2010 - 10:20 PM
|
Dear Support, I have an application with CExtGridWnd and CExtTreeGridWnd . I need to drag a row from the grid and drop it into the tree’s first level with will add a child node to that node. Can you please explain how this can be done? I could not find an exact sample, and it’s not completly clear why I need to do in OnGbwDataDndDo exactly, and in which of my classes - the tree or the grid. Thanks, Ron.
|
|
Technical Support
|
Jan 11, 2010 - 5:41 AM
|
The CExtGridWnd -based control should initialize drag-n-drop. We recommend you to use the standard OLE drag-n-drop for that. The CExtGridBaseWnd::OnGbwDataDndDo() virtual method is invoked when the grid detects the drag-n-drop starting event for the inner data cells. The CExtTreeGridWnd -based control should implement the OLE drop target. Please note, the OLE drag-n-drop feature is part of OLE - not a part of COM. This means your application should invoke the ::AfxOleInit() or ::OleInitialize() API s at startup – not ::CoInitialize() . Unfortunately we don’t have a ready to use sample similar to what you need. But the FormEditor sample application implements several OLE drag sources and drop targets. You can start dragging the toolbox item implementing control, the drag it over MDI tabs and drop it into some of opened view windows. The MDI tabs become selected when you drag objects over them. The form editor view window understands the drop event. The toolbox control initializes the drag-n-drop. Both MDI tabs and OLE view are implementing the OLE drop target feature. Please take a look at the CFormEditorToolBoxWnd::OnToolBoxWndStartItemDrag() method. This is how to start the standard OLE drag-n-drop. The CFormEditorMdiTabWnd::CMdiTabOleDropTarget::OnDragOver() and CFormEditorView::OnDragOver() methods are invoked when data object is dragged over a window implementing OLE drop target. The CFormEditorView::OnDrop() method is invoked when you dropped some control object into form editor view window. The OLE drag-n-dropping feature is close to the Windows clipboard related APIs. Both drag-n-dropped data and clipboard data are based on the same clipboard format descriptors which define some general type of data. Both clipboard and dragged data are typically based on something serialized into memory file/archive.
|
|
tera tera
|
Jan 8, 2010 - 5:49 PM
|
Hello. I want to draw bitmap in outercell.
Please teach a good function name. 
|
|
Technical Support
|
Jan 11, 2010 - 5:17 AM
|
You can insert a picture grid cell into the corner area:
CExtGridWnd & wndGrid = . . .
CExtGridCellPicture * pPicCell = STATIC_DOWNCAST( CExtGridCellPicture, wndGrid.GridCellGet( 0, 0, -1, -1, RUNTIME_CLASS(CExtGridCellPicture) ) );
pPicCell->ImageModeSet( . . . );
CExtBitmap _bmp;
VERIFY( _bmp.Load . . . ( . . . ) );
pPicCell->BitmapSet( &_bmp );
|
|
Offer Har
|
Jan 8, 2010 - 6:05 AM
|
Dear Support, I am trying to create the following application: 1) A tree and some other controls in a docked control bar on the left side 2) Menu bar and toolbar using Prof-UIS 3) Tab container in the rest of the window. I have created the tree dialog OK, but I have problems filling the rest of the window with the tab container - I have dereived my class from CExtTabPageContainerWnd , and created it as a child of the main frame window: m_pTab->Create(AfxGetMainWnd(), CRect(0,0,0,0), AFX_IDW_PANE_FIRST)
and filled it with tabs. However, it does not look good - sometimes the tab container is not displayed, if I remove the the toolbar I sudenly see the tabs, etc etc. What am I doing wrong...? Is there any sample that shows how to implement this? Thanks, Ron.
|
|
Technical Support
|
Jan 8, 2010 - 10:41 AM
|
The TabbedBars sample application uses the One Note tab page container as main SDI view window. It creates 3 colored dialog tab pages. We don’t see similar problems in this sample application. The tab page container can be used as main view window. Please check whether some of other windows is created with the AFX_IDW_PANE_FIRST dialog control identifier. Only the tab page container should use it.
|
|
Offer Har
|
Jan 10, 2010 - 10:21 PM
|
|
|
Rado Manzela
|
Jan 7, 2010 - 4:37 AM
|
I’m using CExtTreeGridWnd to display tree data with more columns. Is it possible to create some rows in the tree which are just empty lines, or some label text to separate data rows into some groups? There should be no columns lines and sorting of data by columns should sort data in each group separately. Thank you.
|
|
Technical Support
|
Jan 8, 2010 - 11:50 AM
|
You should override the CExtGridBaseWnd::OnGbwAnalyzeCellMouseClickEvent() virtual method in your CExtTreeGridWnd -derived class. This will let you catch the mouse clicks on outer header cells. Your mouse click handler should invoke the CExtTreeGridWnd::ItemSortChildren() or the CExtTreeGridWnd::ItemSortChildrenDeep() method for each tree row whose children tree rows should be sorted.
|
|
Joachim Meißner
|
Jan 6, 2010 - 7:54 AM
|
If in a CExtTreeCtrl a tooltip for an item is shown which ist not selected and one clicks with the mouse on that item, OnTreeMouseClick is not called with nClick==1 (Button released). The next click works.
|
|
Technical Support
|
Jan 11, 2010 - 5:42 AM
|
Thank you for reporting us this issue. To fix it, please update the source code for the following method:
void CExtTreeCtrl::OnTreeMouseMove( UINT nFlags, CPoint point )
{
ASSERT_VALID( this );
nFlags;
bool bTrackSelection =
( ( ( GetStyle() & TVS_TRACKSELECT ) != 0)
|| ( ( TreeGetStyleEx() & (__EXT_TREE_EX_HOVER_TREE_BOXES|__EXT_TREE_EX_HOVER_CHECK_BOXES|__EXT_TREE_EX_HOVER_RADIO_BUTTONS) ) != 0 )
)
? true: false;
if( ! bTrackSelection )
return;
bool bInfoTip = ( ( GetStyle() & TVS_INFOTIP ) != 0 ) ? true: false;
DWORD dwHitTestFlagsNew = 0;
HTREEITEM htiHoverNew = NULL;
CPoint ptScreen = point;
ClientToScreen( &ptScreen );
HWND hWndFromPoint = ::WindowFromPoint( ptScreen );
if( hWndFromPoint != NULL
&& ( hWndFromPoint == m_hWnd
|| hWndFromPoint == m_wndContentExpand.GetSafeHwnd()
)
)
htiHoverNew = TreeItemHitTest( point, dwHitTestFlagsNew );
if( htiHoverNew == m_htiHover
&& dwHitTestFlagsNew == m_dwLastHoverHitTestFlags
)
return;
if( m_htiHover != NULL )
{
CRect rcItemEntire;
TreeItemRectGet( m_htiHover, rcItemEntire, e_tirt_entire );
InvalidateRect( &rcItemEntire );
}
if( htiHoverNew != NULL )
{
if( m_htiHover != htiHoverNew )
{
CRect rcItemEntire;
TreeItemRectGet( htiHoverNew, rcItemEntire, e_tirt_entire );
InvalidateRect( &rcItemEntire );
}
if( GetCapture() != this )
SetCapture();
}
else
{
if( GetCapture() == this )
ReleaseCapture();
}
if ( htiHoverNew != NULL )
CWnd::SetCapture();
else
ReleaseCapture();
OnTreeItemSetCursor(
htiHoverNew,
dwHitTestFlagsNew
);
OnTreeItemHoverChanged(
htiHoverNew,
dwHitTestFlagsNew,
m_htiHover,
m_dwLastHoverHitTestFlags
);
m_htiHover = htiHoverNew;
m_dwLastHoverHitTestFlags = dwHitTestFlagsNew;
if( bInfoTip )
{
bool bDeactivate = true;
if( htiHoverNew != NULL )
{
CRect rcLabel;
TreeItemRectGet( htiHoverNew, rcLabel, e_tirt_label );
if( rcLabel.PtInRect( point ) )
{
CRect rcClient;
GetClientRect( &rcClient );
CWnd::RepositionBars( 0, 0xFFFF, 0, CWnd::reposQuery, &rcClient, &rcClient );
if( rcLabel.left < rcClient.left
|| rcLabel.right > rcClient.right
)
{
bDeactivate = false;
m_wndContentExpand.Activate(
rcLabel,
this,
__ECWAF_DEF_EXPANDED_ITEM_PAINTER|__ECWAF_NO_CAPTURE
|__ECWAF_PASS_WM_LBUTTONUP
|__ECWAF_PASS_WM_RBUTTONUP
|__ECWAF_PASS_WM_MBUTTONUP
);
SetTimer( __EXT_TREE_CONTROL_TIMER_ID_TRACKHOVER, 100, NULL );
}
}
}
if( bDeactivate )
m_wndContentExpand.Deactivate();
} // if( bInfoTip )
}
|
|
Dominik Braendlin
|
Jan 5, 2010 - 11:55 PM
|
Dear Tech Support, I am referring to your “test_splitter_dlg” example from thread “CExtSplitterWnd in a CExtResizableDialog”. I would like to have two splitter windows. A right and a left. The left splitter would be a list ctrl and the right splitter would be a CExtResizableDialog. So far I failed creating the right splitter dialog window. Is it possible to use a dialog in a splitter window at all? Do I need some kind of a container class / window to do so. I have found a way to do it with the CExtTabPageContainerWnd class but I don’t need a tabpage window. I only need one dialog in that right splitter part. If yes could you please give an example. Thanks Adrian
|
|
Technical Support
|
Jan 6, 2010 - 9:22 AM
|
|
|
Neville Franks
|
Jan 5, 2010 - 10:46 PM
|
I have a Toolbar with a CExtBarColorButton and when I select "Bright Green" from the pallete my MDI App changes windows. Selecting "Bright Green" sends a WM_COMMAND wParam = 0xFF00 to the mainframe which is AFX_IDM_FIRST_MDICHILD. I don’t know if this is what is causing the MDI window to change though. The following code prevents the Window change.
CMainFrame::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
{
if ( message == WM_COMMAND )
{
if ( wParam == 0xFF00 )
return 0L;
} Is this a known problem and is their a better solution or a fix in newer version of Prof-UIS. I am using V2.85 Thanks, Neville http://www.surfulater.com
|
|
Technical Support
|
Jan 6, 2010 - 9:22 AM
|
Thank you for reporting this issue. To fix it, please update the source code for the following method:
bool CExtPopupColorMenuWnd::_OnMouseClick(
UINT nFlags,
CPoint point,
bool & bNoEat
)
{
ASSERT_VALID( this );
bNoEat;
if( GetSafeHwnd() == NULL )
return false;
if( GetSite().GetAnimated() != NULL )
return true;
TranslateMouseClickEventData_t _td( this, nFlags, point, bNoEat );
if( _td.Notify() )
{ bNoEat = _td.m_bNoEat; return true; }
bool bLButtonUpCall = ( nFlags==WM_LBUTTONUP || nFlags==WM_NCLBUTTONUP ) ? true : false;
if( m_eCombineAlign != __CMBA_NONE && m_bTopLevel )
{
CRect rcExcludeAreaTest( m_rcExcludeArea );
ScreenToClient( &rcExcludeAreaTest );
if( rcExcludeAreaTest.PtInRect( point ) )
{
if( ! bLButtonUpCall )
{ _OnCancelMode(); return true; }
return false;
}
}
if( _IsTearOff() && CExtPopupMenuWnd::_HitTest(point) == IDX_TEAROFF )
{
if( ! bLButtonUpCall )
_DoTearOff();
return true;
}
if( ! bLButtonUpCall )
return false;
bool bEndSequence = false;
HWND hWndOwn = GetSafeHwnd();
ASSERT( hWndOwn != NULL && ::IsWindow(hWndOwn) );
int m_nColorIdxCurr = _ColorItemHitTest(point);
if( ( m_nColorIdxCurr >= 0 || m_nColorIdxCurr == IDX_DEFAULT_COLOR_BTN || m_nColorIdxCurr == IDX_CUSTOM_COLOR_BTN )
&& ( ! _FindCustomizeMode() )
)
{
bEndSequence = true;
_NotifyColorChanged( true );
g_SoundPlayer->PlaySound( CExtSoundPlayer::__ON_MENU_CMD_CLICKED );
}
if( ! ::IsWindow(hWndOwn) )
return true;
CPoint ptScreenClick( point );
ClientToScreen( &ptScreenClick );
HWND hWndFromPoint = ::WindowFromPoint( ptScreenClick );
if( hWndFromPoint != NULL && hWndFromPoint == m_pWndParentMenu->GetSafeHwnd() )
{
m_pWndParentMenu->ScreenToClient( &ptScreenClick );
return m_pWndParentMenu->_OnMouseClick( nFlags, ptScreenClick, bNoEat );
}
if( bEndSequence || ( ! bLButtonUpCall ) )
{
COLORREF clr = (COLORREF)__ECST_NONE;
switch( m_nColorIdxCurr )
{
case IDX_DEFAULT_COLOR_BTN: clr = (COLORREF)__ECST_BUTTON_DEFAULT; break;
case IDX_CUSTOM_COLOR_BTN: clr = (COLORREF)__ECST_BUTTON_CUSTOM; break;
default: clr = _GetColorValue( m_nColorIdxCurr ); break;
}
_EndSequence( 0 );
}
return true;
}
|
|
Offer Har
|
Dec 30, 2009 - 3:44 PM
|
Dear Support, We have a grid in a resizable dialog. The grid have many lines. There is an Add button, and when pressed, we add a row to the grid, and we want to make sure its visible, so we call EnsureVisibleRow after we add the row. The problem is that if the dialog’s height is not exactly in multiples of grid rows height, the last line , which we should be fully is cut in the middle, so it’s impossible to see it, and edit it. Please fix, or explain how to solve this problem. Thanks, Ron.
|
|
Technical Support
|
Jan 3, 2010 - 9:20 AM
|
If you invoke the OnSwUpdateScrollBars() method after adding a new grid row, then the EnsureVisibleRow() method should make it completely visible.
|
|
tera tera
|
Dec 26, 2009 - 1:10 AM
|
Hello. Cannot you build such PoupMenu? 
|
|
Technical Support
|
Jan 6, 2010 - 9:18 AM
|
Check marks can be set on/off through the CCmdUI::SetCheck() method invoked in the command updating handler method.
|
|
tera tera
|
Jan 8, 2010 - 5:23 PM
|
Because the following menus cannot set ID.
I cannot use CCmdUI-SetCheck. 
|
|
Technical Support
|
Jan 11, 2010 - 5:16 AM
|
|
|
tera tera
|
Jan 13, 2010 - 1:24 AM
|

I click this place and want to judge it.
Is it impossible?
|
|
Technical Support
|
Jan 13, 2010 - 11:09 AM
|
You should catch the CExtPopupBaseWnd::g_nMsgTranslateMouseClickEvent registered message. The WPARAM parameter is pointer to the CExtPopupBaseWnd::TranslateMouseClickEventData_t data structure. You should set its m_bMessageHandled property to true flag value if your handler method processes the mouse click event. The CExtPopupMenuWnd::_HitTest() internal method can be used for hit testing the menu elements. If the returned value is greater or equal to zero, then it specifies the menu item index. If it’s negative, then you should use the following enumeration declared locally in the CExtPopupMenuWnd class:
enum spec_buttons_index_t
{
IDX_NOTHING = -1,
IDX_SCROLL_TOP = -2,
IDX_SCROLL_BOTTOM = -3,
IDX_EXPAND = -4,
IDX_TEAROFF = -5,
IDX_RIBBON_FILE_MENU_OPTIONS_BUTTON = -6,
IDX_RIBBON_FILE_MENU_EXIT_BUTTON = -7,
};
|
|
tera tera
|
Jan 13, 2010 - 6:43 PM
|
Popup is not closed even if I click it.
I want to close Popup.
Please teach a method. LRESULT CSamplePopupDlg::OnTranslateMouseClickEvent(WPARAM wParam, LPARAM lParam)
{
wParam;
CExtPopupBaseWnd::TranslateMouseClickEventData_t * pData =
reinterpret_cast< CExtPopupBaseWnd::TranslateMouseClickEventData_t * >
( wParam ); pData->m_bMessageHandled = true;
CMuPopupMenuWnd * pPopupMenuWnd = (CMuPopupMenuWnd *)pData->m_pEventSourcePopup;
int nIndex = pPopupMenuWnd->_HitTest( pData->m_point ); return false;
}
|
|
Technical Support
|
Jan 15, 2010 - 8:13 AM
|
The CExtPopupMenuWnd::_ItemFocusCancel() method closes the next level popup menu.
|
|
tera tera
|
Jan 15, 2010 - 6:55 PM
|
I programed it as follows
PopupMenu does not close it 
LRESULT CSamplePopupDlg::OnTranslateMouseClickEvent(WPARAM wParam, LPARAM lParam)
{
wParam;
CExtPopupBaseWnd::TranslateMouseClickEventData_t * pData =
reinterpret_cast< CExtPopupBaseWnd::TranslateMouseClickEventData_t * >
( wParam ); pData->m_bMessageHandled = true;
CMuPopupMenuWnd * pPopupMenuWnd = (CMuPopupMenuWnd *)pData->m_pEventSourcePopup;
int nIndex = pPopupMenuWnd->_HitTest( pData->m_point ); pPopupMenuWnd->_ItemFocusCancel( TRUE , TRUE , TRUE ); return false;
}
|
|
Technical Support
|
Jan 17, 2010 - 10:56 AM
|
Here is the fixed source code:
lParam;
CExtPopupBaseWnd::TranslateMouseClickEventData_t * pData =
reinterpret_cast< CExtPopupBaseWnd::TranslateMouseClickEventData_t * >
( wParam );
CExtPopupMenuWnd * pPopupMenuWnd = (CExtPopupMenuWnd*)pData->m_pEventSourcePopup;
// the pData->m_point point depends on WM_*** or WM_NC*** message type
// we will get actual cursor position instead
CPoint ptHitTest;
if( ! ::GetCursorPos( &ptHitTest ) )
return 0L;
pPopupMenuWnd->ScreenToClient( &ptHitTest );
int nIndex = pPopupMenuWnd->_HitTest( ptHitTest );
if( nIndex >= 0 )
{
CExtPopupMenuWnd::MENUITEMDATA & mi = pPopupMenuWnd->ItemGetInfo( nIndex );
if( mi.IsPopup() )
{
// close displayed sub menu, un-focus menu item
pPopupMenuWnd->_ItemFocusCancel( FALSE, TRUE, FALSE );
// restore menu item focus, do not show next level submenu
pPopupMenuWnd->_ItemFocusSet( nIndex, FALSE, TRUE, FALSE, FALSE );
// move captured state into clicked popup menu
pPopupMenuWnd->_SetCapture();
pData->m_bMessageHandled = true; // we handled this message
pData->m_bNoEat = false; // this message should be filtered by thread hook of popup menu
}
}
return 0L;
|
|
tera tera
|
Jan 17, 2010 - 6:07 PM
|
|
|
tera tera
|
Jan 19, 2010 - 5:30 PM
|
I never request this function.
However, is it impossible to realize this function?
|
|
Technical Support
|
Jan 20, 2010 - 1:31 PM
|
We tested the suggested code in the ProfUIS_Controls sample application. We modified the CPagePopupMenus dialog page. Here is the updated code files:
http://www.prof-uis.com/download/forums/tmp/MenuTestForTeraTera.zip
Please extract the PagePopupMenus.h and PagePopupMenus.cpp files from this ZIP file into the folder of the ProfUIS_Controls sample application, then compile and run it. You can right click the Popup Menus dialog page and context menu and context menu will appear. This context menu contains several popup items and they behave like you requested.
|
|
tera tera
|
Jan 14, 2010 - 6:17 PM
|
Is it impossible?
I give it up. ( It does not need to be able to come true forcibly. ) Thanks
|
|
Technical Support
|
Dec 26, 2009 - 12:36 PM
|
We suspect your question is related to popup menus displayed from ribbon buttons because all your last questions were related to ribbon bar. Please let us assume you already initialized some CExtRibbonNode which represents a button in your ribbon bar. This button is displayed and works as an normal push button in your ribbon bar. To make it displaying a popup menu like on your screen shot you should construct the CExtCustomizeCmdTreeNode -based tree representing the popup menu. The menu must contain only the CExtCustomizeCmdTreeNode objects. It must not contain the CExtRibbonNode objects. I.e. if you already initialized the CExtRibbonNode node representing ribbon button, then you should insert the CExtCustomizeCmdTreeNode nodes into button’s ribbon node and these CExtCustomizeCmdTreeNode nodes will represent the first level of popup menu. Some of CExtCustomizeCmdTreeNode objects can contain a set of CExtCustomizeCmdTreeNode nodes representing the second menu level.
|
|
tera tera
|
Jan 4, 2010 - 5:58 PM
|
>We suspect your question is related to popup menus displayed from ribbon buttons because all your last questions were related to ribbon bar
No, the ribbon menu does not matter.
In normal PopupMenu,
I want PopupMenu which can realize the following checkmarks. 
I want a sample.
Is this unrealizable?
|
|
tera tera
|
Dec 24, 2009 - 1:08 AM
|
Hello. I want to always make this button non-display 
|
|
tera tera
|
Dec 24, 2009 - 5:29 PM
|
Hello. Because it is RibbonTypeMenu, this CExtMenuControlBar-_InstallMdiDocButtons is not called.
It is necessary to revise other points?
|
|
Technical Support
|
Dec 25, 2009 - 9:40 AM
|
Just do not insert the CExtRibbonNodeMdiRightButtons node into the right buttons collection.
|
|
Technical Support
|
Dec 24, 2009 - 7:49 AM
|
This button is an CExtBarMdiRightButton object. Please override <code>CExtMenuControlBar::_InstallMdiDocButtons()<code> internal virtual method, copy the source code from the original method and comment the following part of it:
if( pRightTBB == NULL )
{
pRightTBB =
new CExtBarMdiRightButton(
this,
m_nMdiDocButtonCmdID
);
ASSERT_VALID( pRightTBB );
m_buttons.InsertAt( nRightIndex + 1, pRightTBB );
bRetVal = TRUE;
} // if( pRightTBB == NULL )
|
|
tera tera
|
Dec 18, 2009 - 1:29 AM
|
Hello. Where will this line of popup control it?
I want to change a line of popup. I want an answer immediately.
Give my best regards 
|
|
Technical Support
|
Dec 22, 2009 - 5:22 AM
|
|
|
tera tera
|
Dec 20, 2009 - 5:32 PM
|
Please teach a method to change the rank of a displayed title for PopupMenu 
|
|
Technical Support
|
Dec 18, 2009 - 11:11 AM
|
The red arrow on the screen shot in your message points to the resizing separator of the Resizable Bar 3 control bar. This separator is the control bar border implemented as part of bar’s non-client area. This part of bar is absolutely not related to popup menu and does not affect to any popup menus.
Looking from the other side, the red arrow points to the top border of the view area. The main view window always have the AFX_IDW_PANE_FIRST dialog control identifier. This means you can invoke the pMainFrame->GetDlgItem( AFX_IDW_PANE_FIRST ) code to get the main view window. This is some view window in SDI. This is always the MDI client area window in MDI. You can get window/client rectangle of the main view window if you know its CWnd* pointer or HWND handle. If your application uses some specific delayed initialization or re-creates the main view window at run time, then the described method cannot be used for querying location of the main view window and you should use the CWnd::RepositionBars() API with the CWnd::reposQuery parameter to get the view rectangle.
Is that what you want to know? If not, then please provide us with more details.
|
|
Borremans Pierre
|
Dec 16, 2009 - 8:50 AM
|
How to have a button (CExtBtnOnFlat or CExtButton) with an Icon and transparent border ?
|
|
Borremans Pierre
|
Dec 17, 2009 - 4:23 AM
|
I use your CExtIconButton and it works. Thanks for you help
|
|
Technical Support
|
Dec 16, 2009 - 10:37 AM
|
Such button will not be recognizable as a clickable button. But you can create your own CExtButton -derived class and override the CExtButton::_RenderImpl() virtual method in it. Your method should implement the custom painting. It should be similar to the CExtButton::_RenderImpl() method, but it should paint icon and text without paint manager invocation. Also, the CExtHyperLinkButton and CExtIconButton classes can be used as samples of how to do this.
|
|
Dave Calkins
|
Dec 11, 2009 - 8:58 AM
|
We have been using CExtWFF<CTreeCtrl> in our app. We use this with an image list to provide icons for individual items in the tree. We’ve noticed that under Windows 7, the dashed lines drawn to the nodes in the tree do not render correctly. If we comment out the set image list call, removing the images, then the lines draw correctly. Prof-UIS support suggested we use CExtTreeCtrl instead and use the TreeIconInsert method there instead of image lists. Is there a sample anywhere which illustrates this? We’ve tried this but cannot get images to show in the tree using this approach. We’re initializing the tree images with the below code using the same image we used to use with the image list (so we have to manually chop it up into the individual icons). <tt> CImage treeIconSet;
treeIconSet.LoadFromResource(AfxGetInstanceHandle(),IDB_TAB);
const int iconWidth = 16;
const int iconHeight = 16;
CDC screenDC;
screenDC.CreateDC(_T("DISPLAY"),NULL,NULL,NULL);
CDC offscreenDC;
offscreenDC.CreateCompatibleDC(&screenDC);
HDC hOffscreenDC = offscreenDC.GetSafeHdc();
INT iconPos = 0;
for (int xUL = 0; (xUL+iconWidth-1) < treeIconSet.GetWidth(); xUL += iconWidth, iconPos++)
{
CImage iconImg;
if (!iconImg.CreateEx(iconWidth,iconHeight,32,BI_RGB,NULL,CImage::createAlphaChannel))
break;
HBITMAP hBmp = iconImg.Detach();
HGDIOBJ hPrevObj = ::SelectObject(hOffscreenDC,hBmp);
treeIconSet.Draw(hOffscreenDC,0,0,iconWidth,iconHeight,xUL,0,iconWidth,iconHeight);
::SelectObject(hOffscreenDC,hPrevObj);
CExtCmdIcon& cmdIcon = *new CExtCmdIcon;
cmdIcon.AssignFromHBITMAP(hBmp);
TreeIconInsert(cmdIcon,iconPos);
}</tt> We then call CTreeCtrl::SetItemImage on individual items. But no icons show up in the tree. Is there something else we need to do?
|
|
Technical Support
|
Dec 15, 2009 - 1:46 PM
|
Yes. The ProfUIS_Controls sample application contains the CPageTreeCtrl dialog page dedicated to the CExtTreeCtrl extended tree control. The tree control displays images there. Here is the part of the CPageTreeCtrl::OnInitDialog() method initializing a set of tree items displaying icons:
HTREEITEM htiItemsWithIcons = m_wndTree.InsertItem( _T("Items with icons"), htiControls, NULL );
m_wndTree.TreeItemInfoGet( htiItemsWithIcons ).m_nIconIndexCollapsed = 1;
m_wndTree.TreeItemInfoGet( htiItemsWithIcons ).m_nIconIndexExpanded = 0;
hti = m_wndTree.InsertItem( _T("Item 0"), htiItemsWithIcons, NULL );
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexCollapsed = 2;
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexExpanded = 2;
hti = m_wndTree.InsertItem( _T("Item 1"), htiItemsWithIcons, NULL );
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexCollapsed = 3;
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexExpanded = 3;
hti = m_wndTree.InsertItem( _T("Item 2"), htiItemsWithIcons, NULL );
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexCollapsed = 4;
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexExpanded = 4;
hti = m_wndTree.InsertItem( _T("Item 3"), htiItemsWithIcons, NULL );
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexCollapsed = 5;
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexExpanded = 5;
hti = m_wndTree.InsertItem( _T("Item 4"), htiItemsWithIcons, NULL );
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexCollapsed = 6;
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexExpanded = 6;
hti = m_wndTree.InsertItem( _T("Item 5"), htiItemsWithIcons, NULL );
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexCollapsed = 7;
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexExpanded = 7;
hti = m_wndTree.InsertItem( _T("Item 6 (disabled)"), htiItemsWithIcons, NULL );
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexCollapsed = 8;
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexExpanded = 8;
m_wndTree.TreeItemInfoGet( hti ).m_bDisabled = true;
hti = m_wndTree.InsertItem( _T("Item 7"), htiItemsWithIcons, NULL );
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexCollapsed = 8;
m_wndTree.TreeItemInfoGet( hti ).m_nIconIndexExpanded = 8;
|
|
Dave Calkins
|
Dec 17, 2009 - 12:27 PM
|
I noticed that if I set a breakpoint on CExtTreeCtrl::OnPaint that the breakpoint never gets called. If I set a breakpoint on CExtTreeCtrl::TreeIconAdd, it does get called (so the breakpoints are being properly set).
So now I suspect the rendering is just using the base CTreeCtrl which might be why we’re not getting images. We’re creating the tree control dynamically at runtime using the below code (as opposed to a dialog resource like in your example).
Is there something special we need to do to get the CExtTreeControl to take over and do its own rendering?
BOOL COurTree::CreateTreeCtrl(CExtTabPageContainerWnd& tabsContainer) { m_pTabsContainer = &tabsContainer;
if( !this->Create( WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_HSCROLL|WS_TABSTOP |TVS_HASBUTTONS|TVS_HASLINES|TVS_LINESATROOT |TVS_INFOTIP |TVS_SHOWSELALWAYS|TVS_TRACKSELECT, CRect(0,0,0,0), m_pTabsContainer, UINT(IDC_STATIC) ) ) { TRACE0("Failed to create TreeCtrl\n"); return FALSE; // fail to create }
Note that COurTree class is created as follows.
class COurTree : public CExtWFF<CExtTreeCtrl>, public OurTreeBase {}
|
|
Dave Calkins
|
Dec 17, 2009 - 12:32 PM
|
I think I found the problem. If I remove the CExtWFF<> from the class derivation (just derive from CExtTreeCtrl) the images work.
I believe we added the CExtWFF<> in there to have flicker free scrolling through the tree. What alternative should we now use with CExtTreeCtrl?
|
|
Technical Support
|
Dec 18, 2009 - 11:12 AM
|
The CExtWFF template class can remove flicker effects from standard common controls. It just implements double-buffered painting. Most of the Prof-UIS controls does not need assistance of this template class. Most of the Prof-UIS controls have their own flicker free painting code. I.e. you can make the MFC’s tree control non-flickering by using CExtWFF < CTreeCtrl > type. But the CExtTreeCtrl does not require the CExtWFF template class.
|
|
Technical Support
|
Dec 18, 2009 - 11:12 AM
|
The CExtWFF template class can remove flicker effects from standard common controls. It just implements double-buffered painting. Most of the Prof-UIS controls does not need assistance of this template class. Most of the Prof-UIS controls have their own flicker free painting code. I.e. you can make the MFC’s tree control non-flickering by using CExtWFF < CTreeCtrl > type. But the CExtTreeCtrl does not require the CExtWFF template class.
|
|
Dave Calkins
|
Dec 17, 2009 - 9:11 AM
|
Your sample ProfUIS_Controls project does not appear to call TreeIconInsert. I can’t find any sample code which calls TreeIconInsert. I can see in that sample where its setting up the icons for each item, but not where they’re being added to the tree.
|
|
Dave Calkins
|
Dec 17, 2009 - 9:19 AM
|
I see you’re doing TreeIconAdd instead; I switched to that, but still no icons in the tree.
|
|
Dave Calkins
|
Dec 17, 2009 - 7:30 AM
|
I’m adding tree items after the window is initialized. I’m adding an item and then need to set its icon after the fact. I also have cases where I need to change the icon of an existing tree item. Your example code just involves setting a variable in the item info structure. This doesn’t seem sufficient to get the tree control to re-draw that item with the new icon. Is there some other call I need to tell the tree control to update that item and use the modified info structure?
|
|
Dave Calkins
|
Dec 14, 2009 - 3:56 PM
|
I made the change you suggested, but I’m still not seeing any icons in the tree. Is there some style I need to set or flag to enable use of the images? Also, the code you provided just sets a member variable in the TREEITEMINFO structure. Shouldn’t there be another call to cause the tree to take notice of the change and use the new value?
|
|
Technical Support
|
Dec 14, 2009 - 9:28 AM
|
Please remove the CTreeCtrl::SetItemImage() method invocation and use the following code instead:
CExtTreeCtrl & wndTree = . . .
INT nImageIndex = . . .
HTREEITEM hti = . . .
CExtTreeCtrl::TREEITEMINFO_t & _TII = wndTree.TreeItemInfoGet( hti );
_TII.m_nIconIndexCollapsed = _TII.m_nIconIndexExpanded = nImageIndex;
|
|
Dave Calkins
|
Dec 14, 2009 - 8:35 PM
|
There must be some missing information here. Do you have a sample illustrating how to use CExtTreeCtrl with images for the items? I can’t get images in my tree.
|
|
Dave Calkins
|
Dec 14, 2009 - 3:57 PM
|
I made the change you suggested, but I’m still not seeing any icons in the tree. Is there some style I need to set or flag to enable use of the images? Also, the code you provided just sets a member variable in the TREEITEMINFO structure. Shouldn’t there be another call to cause the tree to take notice of the change and use the new value?
|
|
Chun Pong Lau
|
Dec 11, 2009 - 8:55 AM
|
Dear sir/madam, How to add a maximize button in floating control bar, just like the one in a normal window? Regards, Chun Pong
|
|
Chun Pong Lau
|
Dec 11, 2009 - 4:59 PM
|
Thank you for your response.
May I have a concrete example / sample / steps to add the button?
|
|
Technical Support
|
Dec 14, 2009 - 1:22 PM
|
No, unfortunately we don’t have such sample project. But this is simple to do. You should create your own CExtControlBar -derived class and override the CExtControlBar::OnNcAreaButtonsReinitialize() virtual method in it. Your method should look like:
void C_YOUR_ControlBar_CLASS_NAME::OnNcAreaButtonsReinitialize()
{
ASSERT_VALID( this );
INT nCountOfNcButtons = NcButtons_GetCount();
if( nCountOfNcButtons > 0 )
return;
NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
#if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
#endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
// NcButtons_Add( new CExtBarNcAreaButtonExpand(this) );
NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
NcButtons_Add( new CExtBarNcAreaButtonFloatingMaximizeRestore(this) );
}
The method above is very similar to the original CExtControlBar::OnNcAreaButtonsReinitialize() method. The only difference is the last line of code: NcButtons_Add( new CExtBarNcAreaButtonFloatingMaximizeRestore(this) );
Prof-UIS contains the commented source code of the CExtBarNcAreaButtonFloatingMaximizeRestore class in the .../Prof-UIS/Include/ExtControlBar.h and .../Prof-UIS/Src/ExtControlBar.cpp files. You can copy this source code into your project. The CExtBarNcAreaButtonFloatingMaximizeRestore class is the beta implementation of the caption button you need.
|
|
Technical Support
|
Dec 11, 2009 - 3:17 PM
|
The floating bars are really docked inside floating palette windows. These palette windows are the CExtMiniDockFrameWnd windows in Prof-UIS or CMiniDockFrameWnd windows in MFC. These windows are based on the WS_EX_TOOLWINDOW style. I.e. they are tool windows. The tool windows cannot display maximize/restore/minimize caption buttons. But you can inject your own custom buttons into the captions of Prof-UIS control bars, handle the button click and move the floating bar into the position which covers the monitor’s desktop area:
http://www.prof-uis.com/prof-uis/tech-support/faq/control-bars.aspx#how-to-add-a-custom-button-to-the-caption-of-my-control-bar
|
|
Gevork Odabashyan
|
Dec 11, 2009 - 6:30 AM
|
When Main frame switching from MAXIMIZED state to RESTORED and then again to MAXIMIZED state,
the control bars layout not restoring.
To reproduce bug use next steps:
- Start ProfStudio sample and switch Main Frame to MAXIMIZED state.
- Change proportion of the "ClaseView" and "Server Explorer" bars heights to about 1:3 or ~ 25% : 75% of the Main Frame height.
- Switch Main Frame to RESTORED state
- Switch Main Frame to MAXIMIZED state
Proportion of the "ClaseView" and "Server Explorer" heights changed.
Now its about 1:1 or ~ 50% : 50% of the Main Frame height.
This bug appears in 2.87 release.
Attention!
The bug reproduced on ProfStudio sample builded from 2.87 release sample sources.
If download ProfStudio sample from you site the bug not reproduced.
Maybe its help to fix the bug.
We need to get work around for this bug in the short time!
|
|
Technical Support
|
Jan 3, 2010 - 9:48 AM
|
The resizable control bars docked into one column store information about their height in pixels. They do not store any floating point values describing percent of column height occupied by each bar. The same about widths of resizable control bars docked into one row. If the column height is too small for the main frame in restored state, and you have two resizable bars occupying 25 percent and 75 percent of height in maximized state, then restoring main frame and maximizing them again can change 25/75 proportion to something closer to 50/50 proportion. This is design of current control bar positioning algorithm implemented in Prof-UIS. It’s not critical in the most of cases because applications with many bars are usually limiting the minimal size of main frame window via handling the standard WM_GETMINMAXINFO message.
|
|
Gevork Odabashyan
|
Jan 4, 2010 - 3:42 AM
|
We cannot limiting the minimal size of main frame window in our application.
This is the choice of our users.
So, the bug is very critical for us and our users!
We have not this problem with Prof-UIS version 2.84.
Please, fix this critical bug.
|
|
Borremans Pierre
|
Dec 11, 2009 - 3:45 AM
|
How to change the font and color for the selected item in CExtTreeCtrl ?
|
|
Technical Support
|
Dec 11, 2009 - 3:19 PM
|
Please invoke the CExtTreeCtrl::TreeItemInfoGetPtr() method and get pointer to the CExtTreeCtrl::TREEITEMINFO_t data objects describing the properties of the specified HTREEITEM tree item. The CExtTreeCtrl::TREEITEMINFO_t class has the following public properties:
COLORREF
m_clrTextNormal, m_clrBackgroundNormal,
m_clrTextSelected, m_clrBackgroundSelected,
m_clrTextDisabled, m_clrBackgroundDisabled,
m_clrTextHover;
|
|
Borremans Pierre
|
Dec 9, 2009 - 3:32 AM
|
How to add a combobox in the caption of CExtControlBar ?
|
|
Technical Support
|
Dec 9, 2009 - 1:28 PM
|
The caption of the CExtControlBar window is part of its non-client area. It’s not possible to create any window inside non-client area of other window. The classic approach is to create some toolbar near the caption of resizable bar and insert combo box into it. You can find a lot of examples of such design in Visual Studio .NET / 2005 / 2008 / 2010, in the <span class="newgreen">ProfStudio</spa> and <span class="newgreen">GLViews</spa> sample applications provided with Prof-UIS.
|
|
tera tera
|
Dec 8, 2009 - 5:23 PM
|
|
|
Technical Support
|
Dec 11, 2009 - 3:18 PM
|
This is not a problem. This is a feature request and we are working on it.
|
|
Gevork Odabashyan
|
Dec 4, 2009 - 7:51 AM
|
Dear support,
with version 2.8.7 we have new problem with task main frame.
We used ’FormulaGrid’ sample from url: http://www.prof-uis.com/download/samples/win32/FormulaGrid.zip
and Windows XP SP3.
To reproduced problem we used the next steps:
- Expand task main frame on full main monitor.
- When Outlook Express adds icon to system tray to notify about new message, task main frame change it size. It first switch to not maximized state and then again expands to maximized state.
The second method to reproduced bug - block current session (Ctrl+Alt+Del, Enter) and then unblock it.
Also the same problem some times appears with activating ’Quick lunch’ on task bar, but in this case the bug reproducing not stable.
Currently we must release our product, so can you supply us with the work around for this bug?
|
|
Gevork Odabashyan
|
Dec 11, 2009 - 2:18 AM
|
It’s not the multimonitor problem. The problem with the next method of the CExtNcFrameImpl class:
bool CExtNcFrameImpl::NcFrameImpl_PreWindowProc( LRESULT & lResult, UINT message, WPARAM wParam, LPARAM lParam ) { .................... case WM_SETTINGCHANGE:
NcFrameImpl_MapHtRects_Clean();
if( ! NcFrameImpl_IsSupported() )
break;
if( NcFrameImpl_IsDwmBased() )
break;
if( wParam == SPI_SETWORKAREA )
{
WINDOWPLACEMENT _wp;
::memset( &_wp, 0, sizeof(WINDOWPLACEMENT) );
_wp.length = sizeof(WINDOWPLACEMENT);
if( GetWindowPlacement( _wp ) && _wp.showCmd == SW_SHOWMAXIMIZED )
{
CExtPaintManager::monitor_parms_t _mp;
CExtPaintManager::stat_GetMonitorParms( _mp, pWndFrameImpl );
WINDOWPLACEMENT _wpAdjust;
::memcpy( &_wpAdjust, &_wp, sizeof(WINDOWPLACEMENT) );
_wpAdjust.showCmd = SW_SHOWNORMAL; // SW_RESTORE;
// pWndFrameImpl->GetWindowRect( &_wpAdjust.rcNormalPosition );
::CopyRect( &_wpAdjust.rcNormalPosition, &_mp.m_rcWorkArea );
_wpAdjust.ptMaxPosition.x = _wpAdjust.ptMaxPosition.x = _wpAdjust.rcNormalPosition.left;
_wpAdjust.ptMaxPosition.y = _wpAdjust.ptMaxPosition.y = _wpAdjust.rcNormalPosition.top;
SetWindowPlacement( _wpAdjust );
SetWindowPlacement( _wp );
//NcFrameImpl_RecalcNcFrame();
}
} } Currently I override this method in CMainFrame: bool CMainFrame::NcFrameImpl_PreWindowProc( LRESULT & lResult, UINT message, WPARAM wParam, LPARAM lParam )
{
if (message != WM_SETTINGCHANGE)
{
return CExtNCW<CMDIFrameWnd>::NcFrameImpl_PreWindowProc( lResult, message, wParam, lParam );
}
return TRUE;
} This fix bug. Is this correct work around, or you can provide one another?
|
|
Gevork Odabashyan
|
Dec 10, 2009 - 8:34 AM
|
The problem with CExtNCW. See previouse addition for our bug request.
|
|
Gevork Odabashyan
|
Dec 10, 2009 - 8:30 AM
|
The problem with CExtNCW class. See addition for our request.
|
|
Gevork Odabashyan
|
Dec 10, 2009 - 8:27 AM
|
It’s the problem with CExtNCW<> class. If we remove CExtNCW <> from the CMainFrame class definition in ’FormulaGrid’ sample: class CMainFrame : public CExtNCW < CFrameWnd > ----> class CMainFrame : public CFrameWnd the bug will be fixed. In opposit side "ProfStudio" sample work correct.
|
|
Technical Support
|
Dec 8, 2009 - 10:57 AM
|
We confirm this issue. It happens on multi monitor systems only and only if monitors have different screen resolutions. But we reproduced it only with using the Win+L key combinations. We were unable to reproduce it using any other actions you described in your message. We are working on the fix.
|
|
Gevork Odabashyan
|
Dec 11, 2009 - 7:10 AM
|
Attention!
The bug reproduced on ProfStudio sample builded from 2.87 release sample sources.
If download ProfStudio sample from you site the bug not reproduced.
Maybe its help to fix the bug.
We need to get work around for this bug in the short time!
|
|
Gevork Odabashyan
|
Dec 11, 2009 - 6:32 AM
|
It’s not the multimonitor problem. The problem with the next method of the CExtNcFrameImpl class:
bool CExtNcFrameImpl::NcFrameImpl_PreWindowProc( LRESULT & lResult, UINT message, WPARAM wParam, LPARAM lParam ) { .................... case WM_SETTINGCHANGE:
NcFrameImpl_MapHtRects_Clean();
if( ! NcFrameImpl_IsSupported() )
break;
if( NcFrameImpl_IsDwmBased() )
break;
if( wParam == SPI_SETWORKAREA )
{
WINDOWPLACEMENT _wp;
::memset( &_wp, 0, sizeof(WINDOWPLACEMENT) );
_wp.length = sizeof(WINDOWPLACEMENT);
if( GetWindowPlacement( _wp ) && _wp.showCmd == SW_SHOWMAXIMIZED )
{
CExtPaintManager::monitor_parms_t _mp;
CExtPaintManager::stat_GetMonitorParms( _mp, pWndFrameImpl );
WINDOWPLACEMENT _wpAdjust;
::memcpy( &_wpAdjust, &_wp, sizeof(WINDOWPLACEMENT) );
_wpAdjust.showCmd = SW_SHOWNORMAL; // SW_RESTORE;
// pWndFrameImpl->GetWindowRect( &_wpAdjust.rcNormalPosition );
::CopyRect( &_wpAdjust.rcNormalPosition, &_mp.m_rcWorkArea );
_wpAdjust.ptMaxPosition.x = _wpAdjust.ptMaxPosition.x = _wpAdjust.rcNormalPosition.left;
_wpAdjust.ptMaxPosition.y = _wpAdjust.ptMaxPosition.y = _wpAdjust.rcNormalPosition.top;
SetWindowPlacement( _wpAdjust );
SetWindowPlacement( _wp );
//NcFrameImpl_RecalcNcFrame();
}
} } Currently I override this method in CMainFrame: bool CMainFrame::NcFrameImpl_PreWindowProc( LRESULT & lResult, UINT message, WPARAM wParam, LPARAM lParam )
{
if (message != WM_SETTINGCHANGE)
{
return CExtNCW<CMDIFrameWnd>::NcFrameImpl_PreWindowProc( lResult, message, wParam, lParam );
}
return TRUE;
} This fix bug. Is this correct work around, or you can provide one another?
|