BCG disc menu

Source: Internet
Author: User

1. Create a BCG project bcupladialmenusingle Based on the dialog box.

2. Create or find a PNG Image with Several icons on it. Import to project. After the import, the type is PNG resource ID is idr_png1.

3. Use the Class Wizard to override pretranslatemessage.

Bool cbcupladialmenusingledlg: pretranslatemessage (MSG * PMSG)

{

If (PMSG-> message = wm_rbuttondown)

{

Cpoint point = PMSG-> pt;

Cbcupladialmenu * pmenuctrl = new cbcupladialmenu;

Cbcupladialmenuobject * pmenu = pmenuctrl-> getradialmenuobject ();

Assert_valid (pmenu );

Pmenu-> setimagelist (idr_png1 );

Pmenu-> addcommand (id_edit_paste, 2/* image Index */);

Pmenu-> addcommand (id_edit_cut, 3/* image Index */);

Pmenu-> addcommand (id_edit_copy, 4/* image Index */);

Pmenu-> enablecenterbutton ();

Pmenu-> addcommand (id_edit_clear, 7/* image Index */);

Pmenuctrl-> createpopup (point, (byte) (155 ));

}

Return cbcgpdialog: pretranslatemessage (PMSG );

}

4. Run Ctrl + F5, right-click the dialog box, and select effect.

Note:

1. Because the cbcupladialmenu family has a child cstatic, drag a static control directly on the interface and associate it with the variable of the cbcupladialmenu type, so that the disk menu always appears.

Download source code:

BCG disc menu

BCG disc menu

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.