AnnNameOptions example for C++ 5 and later
//'This sample enumerates all objects in a container,
//'changing the object name and making it display.
//'If the object is a button, the name is restricted to appear within the bitmap bounds.
//'If the object is not a button, the name is not restricted.
void CTutorDlg::ExampleAnnSetNameOptions(long hObject)
{
m_pRasterAnn->AnnEnumerate(hObject, ANN_FLAG_RECURSE | ANN_FLAG_NOTCONTAINER, "");
}
void CRasterAnnSink::OnAnnEnumerate(long hObject)
{
AnnObjectType ObjectType;
m_pRasterAnn->AnnNameOptions->Flags = ANN_NAME_ALL;
m_pRasterAnn->AnnGetNameOptions (hObject);
m_pRasterAnn->AnnGetType (hObject);
ObjectType = m_pRasterAnn->GetAnnType();
if (ObjectType == ANN_OBJECT_BUTTON)
{
m_pRasterAnn->AnnNameOptions->EnableShowName = FALSE;
m_pRasterAnn->AnnNameOptions->AnnotationName = " Name Restricted";
m_pRasterAnn->AnnNameOptions->EnableNameRestrict = FALSE;
m_pRasterAnn->AnnNameOptions->EnableFontBold = FALSE;
m_pRasterAnn->AnnNameOptions->EnableFontItalic = FALSE;
m_pRasterAnn->AnnNameOptions->EnableFontStrikeOut = FALSE;
m_pRasterAnn->AnnNameOptions->EnableFontUnderline = FALSE;
m_pRasterAnn->AnnNameOptions->EnableNameBackTransparent = FALSE;
}
else
{
m_pRasterAnn->AnnNameOptions->EnableShowName = TRUE;
m_pRasterAnn->AnnNameOptions->AnnotationName = " Name UnRestricted";
m_pRasterAnn->AnnNameOptions->EnableNameRestrict = TRUE;
m_pRasterAnn->AnnNameOptions->EnableFontBold = TRUE;
m_pRasterAnn->AnnNameOptions->EnableFontItalic = TRUE;
m_pRasterAnn->AnnNameOptions->EnableFontStrikeOut = TRUE;
m_pRasterAnn->AnnNameOptions->EnableFontUnderline = TRUE;
m_pRasterAnn->AnnNameOptions->EnableNameBackTransparent = TRUE;
}
m_pRasterAnn->AnnNameOptions->X = 10;
m_pRasterAnn->AnnNameOptions->Y = 10 ;
m_pRasterAnn->AnnNameOptions->FaceNameColor = RGB(0, 0, 0);
m_pRasterAnn->AnnNameOptions->BackNameColor = RGB(255, 255, 255);
m_pRasterAnn->AnnNameOptions->FontName = "Arial";
m_pRasterAnn->AnnNameOptions->FontSize = 12;
m_pRasterAnn->AnnNameOptions->Flags = ANN_NAME_ALL;
m_pRasterAnn->AnnSetNameOptions(hObject);
}