Chapter 2 DuiEngine resource file Introduction: duiengine resource file

Source: Internet
Author: User

Chapter 2 DuiEngine resource file Introduction: duiengine resource file
I. I first recognized DuiEngine's Skin Files

The traditional MFC interface is mainly in one. layout the window in the rc file, and then in the resource. h. A control ID is used to access the control through the control ID in the program to perform various operations on the specified control. The DuiEngine is different from the Control ID, but the idea is still similar. In the above chapter, we use the first project generated by DuiEngineWizard as an example:

"XXXX\ Duiengine \ tool \ residbuilder2.exe "-I"XXXX\ Duiengine \ FirsrtDuiEngineDemo \ skin \ index. xml "-y-p

Skin-r. \ duires \ winres. rc2-n. \ duires \ name2id. xml-h. \ duires \ winres. h

Next we will explain in detail the functions of each file using the above command:

First

-I"XXXX\ Duiengine \ FirsrtDuiEngineDemo \ skin \ index. xml"

Command-I indicates reading index. xml, that is, reading the projectResource file name table

<resid type="XML" name="IDR_DUI_INIT"  file="xml\init.xml"  /><resid type="XML" name="IDR_DUI_MSGBOX"   file="xml\dlg_msgbox.xml"  /><resid type="XML" name="IDR_DUI_MAIN_DIALOG"   layer="1" file="xml\dlg_main.xml"/><resid type="IMGX" name="IDP_MAIN_DLG_FRAME"    file="image\dlg_bg_frame.png"  /><resid type="IMGX" name="IDP_BTN_WND_CHECKBOX"     file="image\btn_wnd_checkbox.png"/><resid type="IMGX" name="IDP_BTN_WND_RADIO"  file="image\btn_wnd_radio.png"   /><resid type="IMGX" name="IDP_FOCUS_CHECK"    file="image\focus_checkbox.png"/><resid type="IMGX" name="IDP_FOCUS_RADIO"    file="image\focus_radio.png"   /><resid type="IMGX" name="IDP_BORDER_EDIT"    file="image\img_edit_border.png"   /><resid type="IMGX" name="IDP_BTN_SYS_CLOSE"   file="image\btn_sys_close.png"    /><resid type="IMGX" name="IDP_SCROLL"   file="image\scrollbar.bmp" />

It mainly stores the names of various types of resource files used in the project. DuiEngine supports the following definition of resource file types:

XML: for example, the layout files and style files on our interface are of the XML type.

ICO: icon Resource

BMP: bitmap Resource

IMGX: GDI + image resources, of course, bitmap can also use this type

Careful friends may see that in the XML type, name = IDR_DUI_MAIN_DIALOG is followed by a property of layer = 1. I will explain its role later.

 

Second

-Y-p skin

-Y indicates force rewrite of the logo (to be honest, I didn't understand what it meant)

-P indicates that the current path is set to the skin directory.

 

Three

-R. \ duires \ winres. rc2

Format the content in the index. xml file to the winres. rc2 file of the resource file.

DEFINE_XML(IDR_DUI_INIT,"skin\\xml\\init.xml")DEFINE_XML(IDR_DUI_MSGBOX,"skin\\xml\\dlg_msgbox.xml")DEFINE_XML(IDR_DUI_MAIN_DIALOG,"skin\\xml\\dlg_main.xml")DEFINE_IMGX(IDP_MAIN_DLG_FRAME,"skin\\image\\dlg_bg_frame.png")DEFINE_IMGX(IDP_BTN_WND_CHECKBOX,"skin\\image\\btn_wnd_checkbox.png")DEFINE_IMGX(IDP_BTN_WND_RADIO,"skin\\image\\btn_wnd_radio.png")DEFINE_IMGX(IDP_FOCUS_CHECK,"skin\\image\\focus_checkbox.png")DEFINE_IMGX(IDP_FOCUS_RADIO,"skin\\image\\focus_radio.png")DEFINE_IMGX(IDP_BORDER_EDIT,"skin\\image\\img_edit_border.png")DEFINE_IMGX(IDP_BTN_SYS_CLOSE,"skin\\image\\btn_sys_close.png")DEFINE_IMGX(IDP_SCROLL,"skin\\image\\scrollbar.bmp")

Four

-N. \ duires \ name2id. xml

Indicates to include the xml Resource (layout file XML) in index. XML with the propertyLayer = ''1"The control name in is converted to the corresponding id and stored in the current file. We still remember that layer = "1" is set for IDR_DUI_MAIN_DIALOG in index. xml"

Therefore, the id control is generated based on the name attribute of the control in dlg_main.xml and stored in the name2id. xml file.

<Name2id name = "DUI-DEMO" id = "65536"/> <name2id name = "maindlg" id = "65537"/> <name2id name = "btn_close" id = "1" /> <name2id name = "btn_msgbox" id = "65538"/>

Five

-H. \ duires \ winres. h

This command appears only when "ID system supported" is selected during project generation.

/* <Strong> * // * this file is generated by residbuilder2, please do not manually modify * // * <strong> */# defineDUI-DEMO65536 # definemaindlg65537 # definebtn_close1 # definebtn_msgbox65538
Chapter 1 and Chapter 2 Introduction to English content 100,000

Chapter 1: The Sound of the Shell
Piggy and Ralph meet up with each other after escaping from their shot-down plane. A large scar was made in the untouched jungle, symbolizing the first of man's destruction on the island. A war is going on in the outside world, and now for the rest of the book, everyone will be isolated from it and put into their own "world."
Piggy spots a conch shell, and tells Ralph how to use it to make a noise. ralph does so, and callall of the other boys on the island who crashed down with the plane. jack and his Choir, Simon, Sam and Eric, and have other characters join in an assembly (including the littl's uns, which are the youngest kids at about 6 or 7 years old ). rules are set down, and Ralph is to be chief. there is no one else on the island but the young boys, so Jack decides to take his choir out to hunt for wild pigs, although he is unsuccessful in killing a small pig with his knife.
Significance: While Jack's first attempt to kill the pig failed, his quote "next time..." foreshadowed his future of savage hunting.
Chapter 2: Fire on the Mountain
Ralph callanother assembly, and reminds everyone that they are completely alone on the island, and there are no adults. jack recounts his failure in killing the pig, and reiterates the need for skilled hunters. several rules are made up, such as "whoever holds the conch gets to speak. "Unexpectedly, an unnamed littl 'un with a birthmark on his face tells abo ...... remaining full text>

Not 1 + 2 = 3?

Yes! But what people talk about is Bach's conjecture, not elementary arithmetic.

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.