Site Tools


This shows you the differences between two versions of the page.

Link to this comparison view

developer:sdksamples:objpropicon [2015/09/14] (current)
Line 1: Line 1:
 +====== Object Properties Page Icons ======
 +> **Developer:​** //​[[developer:​cplusplusplugins|C++]]//​
 +> **Summary:​** //Discusses how to provide an icon for a custom object properties page.//
 +===== Question =====
 +The object properties dialog in Rhino 4.0 had a drop down (combo) box that allows you to select between the available properties pages. In Rhino 5.0, the dialog shows a list of icons, instead of the combo box. How can I add a custom icon to the object properties dialog when I my plug-in adds a custom page?
 +===== Answer =====
 +Instead of deriving your custom object properties page from **CRhinoObjectPropertiesDialogPage**,​ use **CRhinoObjectPropertiesDialogPageEx**,​ which has a virtual **Icon()** member that you must override and implement. You will want to implement this virtual function as follows:
 +==== C++ ====
 +<code c++>
 +HICON CTestObjectPropertiesPageExDlg::​Icon() const
 +  AFX_MANAGE_STATE( AfxGetStaticModuleState() );
 +  return (HICON)::​LoadImage(AfxGetInstanceHandle(),​ MAKEINTRESOURCE(IDI_OBJPROPPAGE_DIALOG),​ IMAGE_ICON, 24, 24, LR_SHARED); ​
 +Note carefully the AFX_MANAGE_STATE macro. See MFC Technical Notes 33 and 58 for additional details.
 +{{tag>​Developer cplusplus}}
developer/sdksamples/objpropicon.txt ยท Last modified: 2015/09/14 (external edit)