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 General Discussion » How to disable the item of the shortcutlist Collapse All
Subject Author Date
Zhang KaiFeng Dec 2, 2005 - 1:35 AM

1、Is there anyway to disable the item of the CExtShortCutListWnd?


2、Is there anyway to disable the item of the CListBox?

Zhang KaiFeng Dec 2, 2005 - 9:02 PM

Thank you for your help! I tried to do it with the way that you have told me , howerver I can’t invisible shortcut items .the code as following:


int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{


........


........


CExtShortcutListWnd::SHORTCUT_ITEM_INFO * pItem = m_wndSLH0.ItemGetInfo(1);
 pItem->m_bPressed =false;
 m_wndSLH0.UpdateShortcutListWnd(TRUE);


}


Could you please give me a simple which support invisible shortcut items ,thak you !


My e-mail :grace_wang1011@126.com

Technical Support Dec 3, 2005 - 7:40 AM

Here is the line of code from your message:

pItem->m_bPressed =false;
It seems you should replace it with the following line to make shortcut item invisible:
pItem->m_bVisible = false;


Technical Support Dec 2, 2005 - 6:34 AM

The CExtShortcutListWnd class does not support disabled shortcut items explicitly. But you can override the following virtual method and return false if the appropriate shortcut list item is disabled for clicking:

bool CExtShortcutListWnd::OnShortcutListItemPressedStart(
    LONG nIndex,
    bool bPrePressedTest
    )
Alternatively, you can use invisible shortcut items if you want to make them unavailable for users. You should invoke the CExtShortcutListWnd::ItemGetInfo() method to get a pointer to the CExtShortcutListWnd::SHORTCUT_ITEM_INFO data structure. Set the m_bVisible member to false in the latter. Finally, please invoke the CExtShortcutListWnd::UpdateShortcutListWnd() method to update the shortcut list layout.

The list box common control does not support disabled items either.