Chapter 1 DuiEngine introduction and Configuration

Source: Internet
Author: User
Tags xml attribute

I. Preface

Alterto is a cainiao who has graduated from a three-stream undergraduate college in less than two years and loves programming. Among the many languages, c/c ++ has a special liking. The first thing I came into contact with was the windows program design. I had been aiming to make a very dazzling interface, and then I learned the MFC and used windows standard controls for the interface, at this time, I found that the standard controls provided by Windows could not make the interface I wanted at all, so I began to learn the self-painting of windows standard controls. After a period of effort, I followedGoldfishThe instructor learns to customize, customize button, TAB, combo box and other windows standard controls can basically implement the interface I want. However, in the process of learning self-painting, we also found many shortcomings in the Standard Control Self-Painting:

 

 

First, the self-drawing of common controls is still carried out in a new window. That is to say, there are multiple sub-windows in the drawn interface. In this way, if improper processing is performed, the interface will easily flash, the solution is to use double buffering, WS_CLIPCHILDREN, and NULL background painter ).

Second, it is difficult to implement some cool effects on the traditional interface. For example, if you need an interface with a translucent background effect similar to QQ (my understanding: Use a translucent PNG image as the background of the window) you need to set a hierarchical form, but the child controls on the window cannot be implemented at this time, because the normal window is drawn in the OnPaint function. Once the hierarchical form is set, the interface painting will be moved to the UpdateLayeredWindow function.

Later, I contacted Dui and began to try to use the interface library written by the online experts to find a suitable interface library. However, this is not easy because most of the excellent dui interface libraries on the network are not open-source and expensive. Many open-source interface libraries are incomplete. However, there are still many excellent products in the open-source interface library, which is not easy under the tianchao system.

Duilib and DuiEngine, but I personally think DuiEngine is better. (In Windows 7, the interface that duilib writes keeps scaling, and there will still be a black image, furthermore, the duilib author has basically not updated it.

System injury, helpless ]).

Why did Alterto write tutorials for DuiEngine?

First of all, inspired by Albert L, I believe many people have read the tutorial written by Albert for Duilib. I personally felt that it was too good. At that time, even cainiao like me understood it. (I also lamented it, people who have graduated for more than a year, how can the gap be as big as 0.0,

Cough! There is still a long way to go .). Furthermore, DuiEngine does not have a decent tutorial at present, and the author is usually busy and has no time to do these things, it is a pity that such an excellent interface library does not have a decent tutorial, so

I had the idea of organizing the tutorials for them, and I also hope that I can better master DuiEngine while writing the tutorials.

Again, because I am still in the cainiao stage, it is inevitable that there will be errors. Please tell me after seeing it, and I hope you will not spray me, in this way, I have the motivation to keep writing this tutorial. Okay. I don't want to talk about the transfer.

 

 

Ii. DuiEngine Introduction

 

An emerging open-source interface based on Kingsoft's bkwin code. After nearly two years of improvement, the core framework has undergone many major reconstruction. At present, more than 90% of genes are new.

Main features (compared with bkwin ):

1. The framework is more complete. Generally, interfaces do not need to depend on real sub-Windows (originally realwnd). Of course, realwnd is also supported.

2. It does not depend on WTL and can be used in win32 and MFC.

3. More complex control implementations, such as treectrl.

4. UpdateLayeredWindow can be used to implement a special window. You only need to modify one XML Attribute.

5. Higher efficiency: All plotting operations are performed on a memory bitmap, avoiding a large number of Bitmap copy operations.

6. The structure is clearer.

To put it bluntly, see the Demo below for how DuiEngine works.

 

Beyond all doubt, the effect is amazing !! Are you stunned. And there is no page flashing.

 

 

Iii. DuiEngine Configuration:

1. To do a good job, you must first sharpen the tool. We recommend that you use vs2008 as the IDE.

2. Download DuiEngine, DuiEngine SVN: http://code.taobao.org/svn/duiengine/trunk, you can install a free open source clientTortoiseSVN,

The installation method is not described too much here. After the download, find a directory where you want to store the DuiEngine project and right-click and select SVN Checkout,

Enter the information and click OK.

The download is as follows:

3. Configure DuiEngine. The author of duiengine is alive Lei Feng. I have already compiled a development environment Configuration tool for me to run the DuiEngine \ wizard directory.

The configuration of wizard.setup.exe. It is best to restart the computer once after the configuration. You can open the VS2008 command prompt and enter SET to check whether the environment variable has been SET.

4. Compile DuiEngine kernel and enable DUIEngine Solution

 

Select "generate"> "batch generate" from the menu, because we usually compile win32 applications, so here we remove all X64 platforms, because Alterto only learns MFC, WTL has never been used,

So here I will remove Debug_ATL (unless you have installed WTL, you will be prompted not to open the include file: "atlapp. h ": No such file or directory"), because we only need to use,

Release and Debug are two versions of the dynamic link library, so only the following two items can be generated.

It may take several minutes to compile. After compilation, the dynamic library and static Link Library of debug and release versions are generated in the following directory.

 

4. Create the first program that relies on the DuiEngine Library

If you are not familiar with the duiengine, we recommend that you put the project in the directory at the same level as duiengine. If the previous configuration is correct, a DuiEngineWizard template is available under the template.

 

Then copy the DUIEngine_d.dll and DUIEngine. dll files generated to the project directory file, Ctrl + F5. Haha! It's time to witness the miracle

Without adding any code, we generate a Dialog with skin.

Okay! The DUIEngine configuration is here, and Alterto is about to take a break.

Related Article

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.