Visual C + + 2005 Image Programming toolbar

Source: Internet
Author: User
In this image processing tool software, there are more toolbars to implement. I want each toolbar to be floating without a close button, and you can also set the number of columns that the toolbar displays in the Toolbox toolbar. Based on the principles of class abstraction, we create a base class Cbasetoolbar for all toolbars, derived from CToolBar. The main features that Cbasetoolbar need to implement are: remove the close button when floating and set the number of columns in the toolbar.

Starting with Visual Studio.NET, including Visual C + + 2005, the Class Wizard features in Visual C + + 6.0 are removed. Some conceptual changes have taken place. Workspace that can contain multiple projects are replaced by solution, called a solution.

To add a new class to Visual C + + 2005, simply select the project in Solution Explorer, select the Add Class from the pop-up menu that you clicked on, and the wizard dialog box for the Add Class pops up. The following figure:


In the Class wizard dialog box that appears, select Add MFC Class, then click Add button, finally select CToolBar as base class, and derive class name to enter Cbasetoolbar. The wizard features in Visual C + + 2005 are more complete than Visual C + + 6.0 and have a richer selection of features. If you want to add CToolBar to the 6.0 version of the derived class can not directly select the CToolBar class, the general approach is to select the CToolBarCtrl, add the completed after the manual modification of the method to CToolBar, and now can directly choose CToolBar, save a lot of trouble.

To build a CToolBar derived class, let's look at how to implement the set of toolbar columns and remove the Close button. When setting the number of columns we add a function to the class: void setcolumns (int ncolumn); Adding a function to a particular class requires switching from Solution Explorer to Class View, where all classes are displayed. Select Add function or variable in the right key pop-up menu on the corresponding class name:


The Add Function dialog box is followed by a very rich feature, with direct mouse clicks can add virtual, static, inline, and other keywords to the function.

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.