ShowAnnotationToolPalette Example VC++

This example shows how to invoke the annotation tool palette with user-defined tool tips.  If tool tips are not specified, defaults are used.

void CImgEdit1Dlg::OnToolPalette() 
{
    // An example of showing the annotation tool palette with user
    // defined tooltips.  If Tool tips are not specified default values
    // are provided
    // True parameter allows user to right click on a tool on the
    // palette to set attributes (color, size, etc) for that tool
    // If location is not specified, palette is positioned relative to ImgEdit control
    CString szToolTips;
    szToolTips = "Tool Tip #1|Tool Tip #2|Tool Tip #3|Tool Tip #4|
     Tool Tip #5|Tool Tip #6|Tool Tip #7|Tool Tip #8|
     Tool Tip #9|Tool Tip #10|Tool Tip #11";
    // Tool palette will appear in its default location since it is
    // not specified
    VARIANT vToolTips;
    V_VT(&vToolTips) = VT_BSTR;
    V_BSTR(&vToolTips) = szToolTips.AllocSysString();
    VARIANT evt; V_VT(&evt) = VT_ERROR; // set to default
    VARIANT vShowAttrDlg; V_VT(&vShowAttrDlg) = VT_BOOL;   
    V_BOOL(&vShowAttrDlg) = TRUE;

    ImgEdit1.ShowAnnotationToolPalette(vShowAttrDlg, evt, evt, vToolTips);
}