Duilib (2)--Introduction to the general properties of several controls

Source: Internet
Author: User

Properties common to many controls

Name= "Thebtn" (useful: represents the current control.) )

text= "Text" (useful: The text displayed on the control. TextColor can set its color. Disabledtextcolor the color when disabled. textpadding text margins. )

tooltip= "hint text" (useful: the mouse to put on the hint of text. )

Bgcolor= "#FF00FF00" (use: Background color. The background of Bkcolor2 and bkcolor3= is gradually discolored. )

Pos= "10,10,100,30" (Usefulness: Positioning. When float is true, it is absolutely positioned. Left,top,right,bottom, respectively)

Width= "+" + height= "30" (Use: Dimensions. In conflict with Pos, who is after, whichever. )

Minwidth= "x" + minheight= "20" (Usefulness: Min. width height. )

Maxwidth= "+" + maxheight= "50" (use: Maximum width and height. )

Align= "Left" (use: Alignment.) )

Padding= "4,0,4,0" (use: Margin. )

Inset= "4,0,4,0" (use: padding. )

Bordersize= "1" (use: Set border.) )

Bordercolor= "#FF00FF00" (useful: normal border color.) )

Focusbordercolor= "#FF00FF00" (useful: the border color when you get focus.) )

borderround= "bis" (use: The radian of the four corners of the border. )

Shortcut= "P" (useful: Set shortcut key alt+p. )

Font= "1" (Useful: header-defined font, sorted by ordinal, here Select the font with the ordinal 1.) )

Showhtml= "true" (useful: You can use HTML in text to describe a control.) )

Endellipsis= "true" (useful: if the length of the font exceeds the width of the control to ... Omit the tail. )

Visible= "false" (useful: hides the control.) )

Enabled= "false" (use: Block control response message.) )

Mouse= "false" (useful: prevents a control from responding to a mouse message.) )

Mousechild= "false" (useful: Blocks the control's subspace response message.) )

Vscrollbar= "false" (use: Disables the vertical scroll bar.) )

Hscrollbar= "false" (useful: disables the horizontal scroll bar.) )

Bkimage= "Img.png" (useful: setting a background picture.) File= "" Gets the picture from the path. Res= "", restype= "" Gets the picture from the resource. Dest sets the control display area. Source sets the picture display area. Corner sets the extrusion area. Mask sets the alpha value to make it transparent. Fade set the transparency. Xtiled,ytiled sets the picture to be tiled on the x, Y axis. )

Sepwidth= "" (Useful: Sets the delimiter to show around.) )

Sepheight= "" (Use: Sets the delimiter to display up and down.) )

Sepimm= "true" (use: Drag the delimiter to change the size immediately.) )


One, button

Usage examples:

<button name= "BTNSDF" tooltip= "This is the button" 
	float= "true" 
	pos= "120,10,0,0" width= "" "height=" 
	30 " 
	bkcolor= "#FF00FF00" 
	text= "Hello World" 
	shortcut= "P" 
	normalimage= "file= ' sysbtn\xp_normal.png ' Source= ' 1,1,59,24 ' " 
	hotimage=" file= ' sysbtn\xp_hot.png ' source= ' 1,1,59,24 ' " 
	pushedimage=" file= ' SYSBTN\XP _pushed.png ' source= ' 1,1,59,24 ' " 
	borderround="/>

Second, progress bar

Usage examples:

			<progress name= "ProgressDemo1" text= "Progress" 
				float= "true" pos= "80,80,0,0" 
				width= "139" height= "30" Bkcolor= "#FFFF0000" 
				foreimage= "sysbtn\xp_normal.png" 
				min= "0" max= "All" value= "" 
				hor= "true" align = "Center"/>

Min Min, max max, current value, progress bar direction hor,foreimage to foreground picture, bkcolor as background color, background picture bkimage,isstretchfore Specifies whether the foreground color is scaled.

Three, slider control

Usage examples:

<slider name= "SliderDemo1" float= "true" 
	pos= "30,77,0,0" width= "139" 
	height= " 
	" thumbsize= "12,20" Bkimage= "file= ' sysbtn/adjustcolorsliderh_foreground.bmp ' mask= ' 0xffff00ff '" 
	thumbimage= "file= ' SysBtn/ Selectcolor_sliderbar_thumb.png ' mask= ' 0xFFFFFFFF ' "/>

Iv. combo Box control combobox

Usage examples:

<combo name= "ComboDemo1" float= "true" pos= "30,264,0,0" width= "139" height= "" "Normalimage=" file= "Sysbtn/combobox /combo_nor.bmp ' "hotimage=" file= ' sysbtn/combobox/combo_over.bmp ' "pushedimage=" file= ' SysBtn/ComboBox/Combo_ Over.bmp ' ">
    <listlabelelement text=" Zhang San "selected=" true "/>
    <listlabelelement text=" John Doe "/>
</Combo>

V. List control ListBox

Usage examples:

<list name= "ListDemo1" float= "true" pos= "30,150,0,0" width= "139" height= "" bkcolor= "#FFFFFFFF" header= "hidden" 
	itemtextcolor= "#FF000000" 
	itembkcolor= "#FFE2DDDF" 
	itemselectedtextcolor= "#FF000000" 
	Itemselectedbkcolor= "#FFC1E3FF" 
	itemhottextcolor= "#FF000000" 
	itemhotbkcolor= "#FFE9F5FF" 
	Itemdisabledtextcolor= "#FFCCCCCC" 
	itemdisabledbkcolor= "#FFFFFFFF" >
    <listlabelelement text= "Zhang San" Selected= "true"/>
    <listlabelelement text= "John Doe"/>
</List>

Vi. Table Control Listctrl, also called Table control, similar to table in HTML

Usage examples:

<list name= "ListDemo1" float= "true" pos= "30,150,0,0" width= "139" height= "" bkcolor= "#FFFFFFFF" itemtextcolor= "# FF000000 "itembkcolor=" #FFE2DDDF "itemselectedtextcolor=" #FF000000 "itemselectedbkcolor=" #FFC1E3FF "Itemhottextcol Or= "#FF000000" itemhotbkcolor= "#FFE9F5FF" itemdisabledtextcolor= "#FFCCCCCC" itemdisabledbkcolor= "#FFFFFFFF" Vscrol
        Lbar= "true" hscrollbar= "true" > <listheader name= "domain" bkimage= "sysbtn\list/list_header_bg.png" > <listheaderitem text= "serial number" width= "All" height= "minwidth=" "sepwidth=" 1 "align=" center "hotimage=" sysbtn\list/ List_header_hot.png "pushedimage=" Sysbtn\list/list_header_pushed.png "sepimage=" Sysbtn\list/list_header_sep.png " /> <listheaderitem text= "file name" width= "$" height= "all" minwidth= "sepwidth=" 1 "align=" center "hotimage=" S Ysbtn\list/list_header_hot.png "pushedimage=" Sysbtn\list/list_header_pushed.png "sepimage=" SysBtn\List/list_ Header_sep.png "/> </ListHeader> </list&Gt 

Adding data when initializing the UI

	virtual void Initwindow () {
		cduistring str;
		clistui* pList = static_cast<clistui*> (M_paintmanager.findcontrol (_t ("ListDemo1"));

		Add list contents, must first Add (plistelement), then settext for
		(int i = 0; i <; i++)
		{
			clisttextelementui* Plistelement = new Clisttextelementui;
			Plistelement->settag (i);
			Plist->add (plistelement);

			Str. Format (_t ("%d"), I);
			Plistelement->settext (0, str);
			Plistelement->settext (1, _t ("haha"));
		}
	}

Seven, drawer Control, tab control

Usage examples

<option name= "OptionDemo1" text= "Option1" float= "true" pos= "207,28,0,0" width= "" height= "" bkcolor= "#FFC5D4F2" Selectedtextcolor= "#FF0000FF" selectedbkcolor= "#FFC5D4F2" group= "TabDemo" selected= "true"/>
<option Name = "OptionDemo2" text= "Option2" float= "true" pos= "284,28,0,0" width= "" height= "" bkcolor= "#FFFFDC78" group= "TabDemo "/>
<option name=" OptionDemo3 "text=" Option3 "float=" true "pos=" 361,28,0,0 "width=", height= "bkcolor=" "#FFBECEA1" group= "TabDemo"/>


<tablayout name= "Tabtest" float= "true" pos= "202,75,0,0" width= "255" height= " 169 "bkcolor=" #FF757676 ">
	<verticallayout pos=" 0,0,200,150 "bkcolor=" #FF00FFFF "></verticallayout >
	<verticallayout pos= "0,0,200,150" bkcolor= "#FF00FF00" ></VerticalLayout>
	< Verticallayout pos= "0,0,200,150" bkcolor= "#FFFF00FF" ></VerticalLayout>
</TabLayout>

Code section

		else if (Msg.stype = = _t ("selectchanged"))
		{
			cduistring    strName = Msg.psender->getname ();
			ctablayoutui* Pcontrol = static_cast<ctablayoutui*> (M_paintmanager.findcontrol (_T ("tabTest"));

			if (StrName = = _t ("OptionDemo1"))
				Pcontrol->selectitem (0);
			else if (StrName = = _t ("OptionDemo2"))
				Pcontrol->selectitem (1);
			else if (StrName = = _t ("OptionDemo3"))
				Pcontrol->selectitem (2);
		}



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.