自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

C++界面庫截圖說明

開發(fā) 后端
下面詳細(xì)介紹C++界面庫,使用Graphic Element Template制作按鈕模板,首先說一下什么是C++界面庫,及其C++界面庫的相關(guān)知識。

對于C++界面庫:使用Graphic Element Template制作按鈕模板的說明進(jìn)行詳細(xì)介紹,模板的屬性一共有6個(gè):x、y、w、h、state、content,其中state有normal、hot和press三個(gè)取值。XML、代碼和截圖如下:

下面的模板文件有兩個(gè)模板,分別是background和button。background制作玻璃效果,button給background加上一個(gè)邊框,展示了property evaluation和template reference的功能:

  1.  1 <?xml version="1.0" encoding="utf-8" ?> 
  2.  2 <irconfig xmlns="http://tempuri.org/irconfig.xsd"> 
  3.  3   <resources> 
  4.  4     <brush name="outer_border_brush" kind="solid"> 
  5.  5       <main_color r="96" g="128" b="255" a="255"/> 
  6.  6     </brush> 
  7.  7       
  8.  8     <brush name="up_content_brush_normal" kind="linear_gradient" gradient_angle="0"> 
  9.  9       <main_color r="224" g="224" b="224" a="255"/> 
  10. 10       <gradient_color r="192" g="192" b="192" a="255"/> 
  11. 11     </brush> 
  12. 12     <brush name="down_content_brush_normal" kind="linear_gradient" gradient_angle="0"> 
  13. 13       <main_color r="128" g="128" b="128" a="255"/> 
  14. 14       <gradient_color r="160" g="160" b="160" a="255"/> 
  15. 15     </brush> 
  16. 16       
  17. 17     <brush name="up_content_brush_hot" kind="linear_gradient" gradient_angle="0"> 
  18. 18       <main_color r="224" g="224" b="255" a="255"/> 
  19. 19       <gradient_color r="192" g="192" b="255" a="255"/> 
  20. 20     </brush> 
  21. 21     <brush name="down_content_brush_hot" kind="linear_gradient" gradient_angle="0"> 
  22. 22       <main_color r="128" g="128" b="255" a="255"/> 
  23. 23       <gradient_color r="160" g="160" b="255" a="255"/> 
  24. 24     </brush> 
  25. 25       
  26. 26     <brush name="up_content_brush_press" kind="linear_gradient" gradient_angle="0"> 
  27. 27       <main_color r="224" g="224" b="255" a="255"/> 
  28. 28       <gradient_color r="160" g="160" b="255" a="255"/> 
  29. 29     </brush> 
  30. 30     <brush name="down_content_brush_press" kind="linear_gradient" gradient_angle="0"> 
  31. 31       <main_color r="32" g="32" b="255" a="255"/> 
  32. 32       <gradient_color r="96" g="96" b="255" a="255"/> 
  33. 33     </brush> 
  34. 34       
  35. 35     <brush name="background_brush" kind="solid"> 
  36. 36       <main_color r="255" g="255" b="255" a="255"/> 
  37. 37     </brush> 
  38. 38     <brush name="text_brush" kind="solid"> 
  39. 39       <main_color r="0" g="0" b="0" a="255"/> 
  40. 40     </brush> 
  41. 41     <pen name="outer_border_pen" brush="outer_border_brush" endcap="round" join="round" weight="1"/> 
  42. 42     <font name="text_font" face="微軟雅黑" size="18"/> 
  43. 43   </resources> 
  44. 44   <templates> 
  45. 45     <template name="background"> 
  46. 46       <properties> 
  47. 47         <property name="x" type="int" default="0"/> 
  48. 48         <property name="y" type="int" default="0"/> 
  49. 49         <property name="w" type="int" default="100"/> 
  50. 50         <property name="h" type="int" default="100"/> 
  51. 51         <property name="state" type="str" default="normal"/> 
  52. 52         <property name="content" type="str" default=""/> 
  53. 53       </properties> 
  54. 54       <content> 
  55. 55         <rectangle name="client" x="$x" y="$y" width="$w" height="$h"> 
  56. 56           <text brush="text_brush" font="text_font" text="$content" x="(client.width-this.width)/2" y="(client.height-this.height)/2"/> 
  57. 57   
  58. 58           <rectangle brush="up_content_brush_normal" visible="$state=='normal'" 
  59. 59                      x="0" y="0" width="client.width" height="client.height/2" /> 
  60. 60           <rectangle brush="down_content_brush_normal" visible="$state=='normal'" 
  61. 61                      x="0" y="client.height/2" width="client.width" height="client.height/2+1" /> 
  62. 62   
  63. 63           <rectangle brush="up_content_brush_hot" visible="$state=='hot'" 
  64. 64                      x="0" y="0" width="client.width" height="client.height*4/9" /> 
  65. 65           <rectangle brush="down_content_brush_hot" visible="$state=='hot'" 
  66. 66                      x="0" y="client.height*4/9" width="client.width" height="client.height*5/9+1" /> 
  67. 67   
  68. 68           <rectangle brush="up_content_brush_press" visible="$state=='press'" 
  69. 69                      x="0" y="0" width="client.width" height="client.height*5/9" /> 
  70. 70           <rectangle brush="down_content_brush_press" visible="$state=='press'" 
  71. 71                      x="0" y="client.height*5/9" width="client.width" height="client.height*4/9+1" /> 
  72. 72         </rectangle> 
  73. 73       </content> 
  74. 74     </template> 
  75. 75     <template name="button"> 
  76. 76       <properties> 
  77. 77         <property name="x" type="int" default="0"/> 
  78. 78         <property name="y" type="int" default="0"/> 
  79. 79         <property name="w" type="int" default="100"/> 

程序由4個(gè)按鈕組成,4個(gè)按鈕都是button的實(shí)例化,但是只處理了最后一個(gè)按鈕的消息。因?yàn)楝F(xiàn)在只有畫圖,所以消息處理部分是手動的。下面是截圖:

截圖

【編輯推薦】

  1. 如何正確編寫C++項(xiàng)目開發(fā)編寫項(xiàng)目計(jì)劃書
  2. 對C++庫函數(shù)進(jìn)行學(xué)習(xí)探索總結(jié)筆記
  3. 深度演示C++語言的種種高安全性
  4. 詳細(xì)介紹如何準(zhǔn)確無誤的編寫C++語言
  5. 深度演示C++語言的種種高安全性
責(zé)任編輯:chenqingxiang 來源: 計(jì)世網(wǎng)
相關(guān)推薦

2011-07-13 18:18:49

C++

2010-01-18 15:30:01

Visual C++

2010-01-14 17:42:47

CC++

2010-01-13 10:09:24

C++標(biāo)準(zhǔn)庫

2010-01-26 13:42:28

C++指針

2010-01-25 10:54:18

C++設(shè)計(jì)

2010-01-26 10:42:26

C++函數(shù)

2010-01-26 13:36:27

C++設(shè)計(jì)

2010-01-19 13:43:59

C++函數(shù)

2010-01-28 11:08:09

C++變量

2010-01-28 13:27:12

C++類定義

2010-01-25 18:19:17

C++特性

2010-01-27 10:22:53

C++基類

2010-01-21 15:07:31

C++開發(fā)

2010-01-12 10:40:22

C++程序員

2010-01-19 17:54:47

C++程序

2010-01-25 18:19:17

C++特性

2010-01-25 18:19:17

C++特性

2010-11-03 16:16:09

DB2目錄視圖

2009-11-12 11:00:56

Visual C++
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號