Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Show property pages for inner items of a namespace extension.

 
Subscribe to the RSS feed for this forum  Forum Index -> EZNamespaceExtensionsMFC
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Tue Jun 23, 2009 10:16 am    Post subject: HOWTO: Show property pages for inner items of a namespace extension.

Just like you can use EZShellExtensionsMFC to develop a property sheet extension for the root node of your namespace extension, you can use EZShellExtensionsMFC to show property sheet for inner items. To do so, create a property sheet extension derived from the CPropertySheetExtension class from EZShellExtensionsMFC. Add this class to the same project as your namespace extension.

1. In the GetMenuItems method override of your CNSEFolder derived class, include the 'properties' verb as follows :

Code:
e.menu->AddItem(_T("Properties"), StandardVerb_Properties, _T("Displays the properties of the selected items"));


2. In the GetAttributes method override of your CNSEFolder derived class, include 'NSEIA_HasPropSheet' in the list of attributes.

3. Override the OnProperties virtual method of your CNSEFolder derived class and use the following code:

Code:
BOOL CKeyItem::OnProperties(CExecuteMenuitemsEventArgs& e)
{
CNSEPropertySheet propSheet;
propSheet.caption = _T("Properties"); // caption
propSheet.hWndParent=e.hWnd; // parent window

CMyPropertySheetExtension* ext = new CMyPropertySheetExtension();

// The e.children contains the namespace items for which the properties are being shown -
// We will pass it on to the property sheet extension
// 'items' is a member we have defined of type 'CPtrList*'
ext->items = e.children;

// Add the extension to the list of pages
propSheet.pages.Add(ext);

// Show
propSheet.Show();

return TRUE;
}


Notes

Since you will also be using EZShellExtensionsMFC in the project, add the path to EZShellExtensionsMFC as follows :
'Additional Include Directories' project setting : Add "C:\Program Files\LogicNP Software\EZShellExtensionsMFC 2009\Include"
'Additional Library Directories' project setting : Add "C:\Program Files\LogicNP Software\EZShellExtensionsMFC 2009\Lib"

Since you will be using both EZNamespaceExtensionsMFC and EZShellExtensionsMFC in the same project, there will be some ambiguities on certain classes such as CGetMenuItemEventArgs, CShellMenu, etc which you can resolved by prefixing the proper namespace (eg "EZNamespaceExtensionsMFC::CGetMenuItemEventArgs").
Back to top
Display posts from previous:   
Forum Index -> EZNamespaceExtensionsMFC All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group