Professional UI Solutions
Site Map   /  Register
 
 

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.

Forums » Prof-UIS Tech Support » CExtTreeCtrl - FocusItem question Collapse All
Subject Author Date
tera tera Jan 7, 2009 - 6:26 PM

Hello.


With the following commands, a selection does not move either.

I am troubled. 


if ( sItemText == "top level item 1" ){

    m_wndTree.FocusItem( hti , true, true , true );

    m_wndTree.Invalidate();

}



Thanks,


 

Technical Support Jan 9, 2009 - 8:36 AM

Could you modify our test project and make it reproducing this problem and send it to us?

tera tera Jan 13, 2009 - 2:03 AM

Hello.


I described a focus in the following points.


        Walk( hti, s, nIndent + 1 );


        if( sItemText == _T("top level item 1") )

        {

            m_wndTree.SetFocus();

            m_wndTree.FocusItem( hti, true, true, true );

            m_wndTree.Invalidate();

        }

    }


When a focus moves to other control, a focus of tree disappears.


I want you to teach the method how a focus does not disappear.


 

tera tera Jan 15, 2009 - 5:11 PM

Hello.


I want to always display focuses.

Please answer it.


Thanks,


 

tera tera Jan 16, 2009 - 5:05 PM

I decide to display an icon in substitution for focus drawing.


Technical Support Jan 8, 2009 - 10:11 AM

We have tested this issue in the same sample application:
<pre>void CTreeTextDlg::Walk( HTREEITEM htiParent, CString & s, int nIndent /* = 0*/ )
{
HTREEITEM hti = m_wndTree.GetNextItem( htiParent, ( htiParent == NULL ) ? TVGN_ROOT : TVGN_CHILD );
for( ; hti != NULL; hti = m_wndTree.GetNextItem( hti, TVGN_NEXT ) )
{
CString sItem, sItemIdent, sItemText = m_wndTree.GetItemText( hti );
for( int i = 0; i < nIndent; i ++ )
sItemIdent += _T(" --> ");
sItem.Format( _T("%s%s\r\n"), LPCTSTR(sItemIdent), LPCTSTR(sItemText) );
s += sItem;
Walk( hti, s, nIndent + 1 );

if( sItemText == _T("top level item 1") )
{
m_wndTree.FocusItem( hti, true, true, true );
m_wndTree.Invalidate();
}
}
}
<pre>The item focus feature is working ok.

tera tera Jan 8, 2009 - 5:50 PM

Hello.


It was displayed when I set it as follows.


m_wndTree.SetFocus();

m_wndTree.FocusItem( hti , true, true , true );


Even if a focus moves to other Window, I want to always display tree selections.