Transferred from: http://www.jizhuomi.com/software/251.html
The previous section on the GDI object painting brush CBrush, so that the knowledge of the beginning of the graphic image is finished. Starting from this section will bring you the content of Ribbon interface development. This article first describes how to create a ribbon-style application framework.
Ribbon interface is the introduction of Microsoft from the Office2007 to make the application's functionality easier to find and use, reduce the number of mouse clicks of the new interface, from the actual effect, not only beautiful appearance, and intuitive function, user operation is simple and convenient.
The process of creating a ribbon-style, single-document application framework using the MFC Wizard is illustrated in a graphic and graphical manner, but the Ribbon application framework is created in many places similar to a regular single document application, so if the options for some of the steps are not quite clear, see vs2010/ Introduction to MFC Programming II (using the MFC wizard to generate a single document application framework).
Here are the specific steps:
1. Open VS2010, select File->new->project in the menu and pop up the dialog titled "New Project". Select Installed Templates->visual c++->mfc in the left panel of the dialog box and select MFC application in the middle area.
After you have selected the project type, you can see that there are three settings under the dialog box, namely the name--project name, the location--solution path, and the solution name--solution name. Here the name is set to "Example52", location is set to "desktop" path, solution name is the same as name, we do not make changes here. Such as:
Click the "OK" button.
2, this will pop up the "MFC Application Wizard" dialog box, the upper part of the "Welcome to the MFC Application Wizard", the following shows the current project default settings. The first "tabbed Multiple Document Interface (MDI)" means that this project is a multi-document application. If you just click the "Finish" button below, you can generate a multi-document program with the settings listed above. But our example is to create a ribbon-style single-document application, so click the "Next" button to continue setting it.
3, the next pop-up dialog box is written "Application Type", of course, let's choose the application type, we select "Single document", that is to create an application framework. Also, under Project Type, select Officeto indicate that the application is Office style. Such as:
Click the "Next" button.
4. Pop up a dialog box with "Compound Document support", which can be used to add OLE support to the application, using the default value "None". Click the "Next" button.
5. A new dialog box appears with "Document Template Properties" in the upper part. Use the default settings here, click the "Next" button.
6. The theme of the dialog box that pops up is "Database support". Used to set database options. Still use the default value, click "Next".
7. The dialog box that pops up is about "user Interface Features", which is the UI feature. Because we want to use the Ribbon interface, make sure that the radio button "Use a Ribbon" is selected under "Command Bars (Menu/toolbar/ribbon)". The other settings use the default values. Such as:
Click the "Next" button.
8. The Advanced Features dialog box is displayed. Advanced features that you can set include print and print preview, and so on. Leave the default value unchanged, point to "Next".
9. Pop up the Last "Generated Classes" (Generate Class) wizard dialog box, listing the four classes to be generated. Do not make changes here, click "Finish".
This completes all the settings for creating the Ribbon-style application framework. Compile the Run program and get the Ribbon interface as follows (Office (Blue Style)):
There is a "style" drop-down menu in the upper-right corner of the Ribbon interface where we can choose a different style, in office (Blue style), office (Black style), office Style), switch between styles in Office (Aqua style), Windows 7, and 5.
The creation of the Ribbon-style application framework is here, and with the previous foundation, these operations can be said to be a piece of cake.
VS2010-MFC (Ribbon interface Development: Creating a ribbon-style application framework)