{"id":296,"date":"2012-10-08T21:21:40","date_gmt":"2012-10-08T12:21:40","guid":{"rendered":"http:\/\/bellsprite.com\/?p=296"},"modified":"2012-10-15T15:37:59","modified_gmt":"2012-10-15T06:37:59","slug":"%e3%80%90%e7%bf%bb%e8%af%91%e3%80%91%e3%80%90cegui%e3%80%91%e5%88%9b%e5%bb%ba%e4%b8%80%e4%b8%aachecklistboxitem%e3%80%90%e5%88%9b%e5%bb%ba%e5%a4%8d%e5%90%88widget%e7%9a%84%e6%95%99%e7%a8%8b%e3%80%91","status":"publish","type":"post","link":"https:\/\/bellsprite.com\/?p=296","title":{"rendered":"\u3010\u7ffb\u8bd1\u3011\u3010CEGUI\u3011\u521b\u5efa\u4e00\u4e2acheckListboxItem\u3010\u521b\u5efa\u590d\u5408widget\u7684\u6559\u7a0b\u3011"},"content":{"rendered":"<p>\u539f\u6587\uff1a<a href=\"http:\/\/www.cegui.org.uk\/wiki\/index.php\/Create_a_CheckListboxItem\" target=\"_self\">CEGUI\u5b98\u65b9wiki<\/a><\/p>\n<p>\u7ffb\u8bd1\uff1a<a href=\"http:\/\/bellsprite.com\/?p=296\" target=\"_self\">\u57fa\u62c9\u94c3\u5996<\/a><\/p>\n<p><\/p>\n<p>===================================================================<\/p>\n<p style=\"text-align: left; \"><strong><span style=\"color: rgb(0, 0, 0); \">2012.10.15\u65e5\u66f4\u65b0<\/span><\/strong><\/p>\n<p><strong><span style=\"color: rgb(255, 0, 0); \">\u88ab\u8fd9\u6559\u7a0b\u5751\u5566!!!<img decoding=\"async\" src=\"http:\/\/img.baidu.com\/hi\/jx2\/j_0012.gif\" style=\"\" \/><\/span><\/strong><\/p>\n<p><strong><span style=\"color: rgb(255, 0, 0); \">\u540e\u6765\u4eba\u6ce8\u610f\uff1a\u5728\u201c<span style=\"white-space: normal; \">\u5728CEGUI\u4e2d\u6b63\u786e\u5730\u6ce8\u518c\u8fd9\u4e2a\u7a97\u53e3<\/span>\u201d\u90a3\u6bb5\u4ee3\u7801\u91cc\uff0c<span style=\"white-space: normal; \">addFalagardWindowMappings\u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\u5e94\u8be5\u586b\u4f60\u5728CheckListboxItem.cpp\u91cc\u521d\u59cb\u5316\u7684WidgetTypeName\u7684\u503c\uff0c\u5728\u8fd9\u4e2a\u4f8b\u5b50\u91cc\u5c31\u662f\u201cCEGUI\/CheckListboxItem\u201d\uff0c\u800c\u4e0d\u662f\u5b83\u7684\u57fa\u7c7b\u201cCEGUI\/ItemEntry\u201d\uff01\uff01<\/span><\/span><\/strong><strong><span style=\"color: rgb(255, 0, 0); \">\u586bItemEntry\u867d\u7136\u4e5f\u80fd\u8fd0\u8f6c\uff0c\u4f46\u4f60\u5728CheckListboxItem\u91cc\u91cd\u5199\u7684\u57fa\u7c7b\u51fd\u6570\u90fd\u4e0d\u4f1a\u751f\u6548.<\/span><\/strong><\/p>\n<p><strong><span style=\"color: rgb(255, 0, 0); \">\u6211\u6628\u5929\u5c31\u662f\u6b7b\u6d3b\u8986\u76d6\u4e0d\u4e86\u57fa\u7c7b\u51fd\u6570\uff0c\u540e\u6765\u4e0b\u65ad\u70b9\u53d1\u73b0\u5b83\u8fde\u6211\u91cd\u5199\u7684\u6784\u9020\u51fd\u6570\u90fd\u6ca1\u6709\u8fdb\u5165\uff0c\u5f53\u65f6\u5c31\u5bd2\u5fc3\u4e86\u554a\u6211\u53bb\uff01\uff01\uff01<img decoding=\"async\" src=\"http:\/\/img.baidu.com\/hi\/jx2\/j_0012.gif\" style=\"\" \/><\/span><\/strong><\/p>\n<p><strong><span style=\"color: rgb(255, 0, 0); \">\u8fd8\u6211\u65f6\u95f4\uff01\u8fd8\u6211\u88ab\u6d88\u8017\u7684\u5bf9CEGUI\u7684\u70ed\u60c5\uff01\uff01<\/span><\/strong><\/p>\n<p><strong><span style=\"color: rgb(255, 0, 0); \"><br \/><\/span><\/strong><\/p>\n<p><strong><span style=\"color: rgb(255, 0, 0); \">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/span><\/strong><\/p>\n<p><strong><span style=\"color: rgb(255, 0, 0); \">\u4e0d\u8fc7\u591a\u4e8f\u8fd9\u4e2a\u6559\u7a0b\u6211\u624d\u77e5\u9053\u600e\u4e48\u81ea\u5b9a\u4e49\u63a7\u4ef6\uff0c\u800c\u4e14\u5b83\u5168\u6587\u4e5f\u5c31\u8fd9\u4e00\u5904\u9519\u8bef\uff0c\u603b\u7684\u6765\u8bf4\u8fd8\u662f\u6536\u76ca\u8fdc\u5927\u4e8e\u5371\u5bb3\u7684\u3002<\/span><\/strong><\/p>\n<p><strong><span style=\"color: rgb(255, 0, 0); \">\u2026\u2026\u5509\u3002\u60f3\u4e0d\u8fdd\u80cc\u516c\u5141\u5c31\u5f97\u597d\u574f\u90fd\u770b\uff0c\u8fd9\u6837\u4e00\u6765\u8fde\u53d1\u6cc4\u4e00\u4e0b\u7684\u673a\u4f1a\u90fd\u6ca1\u6709\u4e86\u2026\u2026<\/span><\/strong><\/p>\n<p><\/p>\n<p><\/p>\n<p>===================================================================<\/p>\n<p><\/p>\n<p>\u6709\u65f6\u5019\u4f60\u9700\u8981\u4e00\u4e2a\u5217\u8868\u6765\u5305\u542b\u4e00\u4e9b\u53ef\u9009\u4e2d\u7684item\u3002CEGUI&nbsp;0.5\u5f15\u5165\u7684ItemListbox\u53ef\u4ee5\u63a5\u53d7\u6240\u6709\u7ee7\u627f\u81eaItemEntry\u7684item\u3002\u6211\u5c06\u5411\u4f60\u4ecb\u7ecd\u5982\u4f55\u521b\u5efa\u4e00\u4e2aCheckListboxItem\u6765\u653e\u5165\u4f60\u7684list\u4e2d\u3002<\/p>\n<p><\/p>\n<h2>\u5f00\u59cb\uff01<\/h2>\n<p>\u6211\u5047\u8bbe\u4f60\u4f7f\u7528\u7684\u662f\u6807\u51c6imageset\uff0c\u4ee5\u53ca\u6807\u51c6scheme\uff08\u73b0\u5728\u652f\u6301TaharezLook\u548cWindowsLook\uff09\u3002<\/p>\n<p>\u6211\u4eec\u9996\u5148\u6765\u5199\u4e00\u4e2alooknfeel&nbsp;entry\u3002\u8fd9\u662f\u672c\u6559\u7a0b\u4e2d\u6700\u91cd\u8981\u7684\u5185\u5bb9\uff0c\u5b83\u5c06\u5360\u6574\u4e2a\u6559\u7a0b70%\u5de6\u53f3\u7684\u6bd4\u91cd\u3002\u9996\u5148\uff0c\u8fd9\u4e2aentry\u6709\u51e0\u4e2a\u58f0\u660e\uff08states\uff09\uff1a<\/p>\n<p>1.Enabled\uff1a\u5f53item\u662fenabled\u65f6\uff0c\u5b83\u662f\u4ec0\u4e48\u6837\u5b50\u3002<\/p>\n<p>2.Disabled\uff1a\u5f53item\u662fdisabled\u65f6\uff0c\u5b83\u662f\u4ec0\u4e48\u6837\u5b50\u3002<\/p>\n<p>3.SelectedEnabled\uff1a\u5f53item\u88ab\u9009\u4e2d\u4e14\u662fenabled\u65f6\uff0c\u5b83\u662f\u4ec0\u4e48\u6837\u5b50\u3002<\/p>\n<p>4.SelectedDisabled\uff1a\u5f53item\u88ab\u9009\u4e2d\u4e14\u662fdisabled\u65f6\uff0c\u5b83\u662f\u4ec0\u4e48\u6837\u5b50\u3002<\/p>\n<p><\/p>\n<h2>\u5199\u4e0b\u6240\u9700\u6587\u4ef6<\/h2>\n<p>\u6253\u5f00\u4e00\u4e2a\u5408\u9002\u7684looknfeel\u6587\u4ef6\uff08WindowsLook.looknfeel\u6216\u8005TaharezLook.looknfeel\uff09\uff0c\u7136\u540e\u5728\u6587\u4ef6\u5e95\u90e8\u586b\u4e0a\u4ee5\u4e0b\u5185\u5bb9\uff08\u8bf4\u662f\u5728\u6700\u4e0b\u9762\u4f46\u662f\u4e5f\u8981\u5728Falagard&nbsp;tag\u5185\uff01\uff09<\/p>\n<p><\/p>\n<p><strong>\u6211\u4eec\u7684\u5f00\u59cb<\/strong><\/p>\n<p><widgetlook name=\"WindowsLook\/CheckListboxItem\"><\/widgetlook><\/p>\n<p><widgetlook><\/widgetlook><\/p>\n<p style=\"text-align: left; \"><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_01.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_01.png\" width=\"339\" height=\"64\" style=\"float:none;\" \/><\/a><\/p>\n<p>\u6211\u4eec\u9996\u5148\u9700\u8981\u5b9a\u4e49\u4e00\u4e2aWidgetLook\uff0c\u8fd9\u4e2a\u6587\u4ef6\u91cc\u5305\u542b\u6240\u6709\u7684\u52a8\u4f5c\uff08action\uff09\u3002\u5b83\u6709\u4e00\u4e2a\u5c5e\u6027\uff0cname\u3002\u5b83\u4ee3\u8868\u62df\u5b9a\u4e00\u4e2a\u8fd9\u4e2awidget\u7684\u540d\u5b57\u3002\u73b0\u5728\u6211\u4eec\u6765\u6dfb\u52a0\u58f0\u660e\uff08states\uff09\u3002\u8fd9\u4e9b\u58f0\u660e\uff08states\uff09\u4f7fitem\u53ef\u4ee5\u54cd\u5e94\u6307\u5b9a\u7684\u4e8b\u4ef6\uff08Events\uff09\u3002\u6bd4\u5982\uff0c\u5f53item\u88ab\u8bbe\u4e3adisabled\uff0c\u5219\u58f0\u660e\uff08state\uff09Disabled\u5c06\u88ab\u4f7f\u7528\u3002<\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_02.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_02.png\" width=\"339\" height=\"220\" style=\"float:none;\" \/><\/a><\/p>\n<p>\u6211\u4eec\u901a\u8fc7StateImagery\u5b9a\u4e49\u4e00\u4e2a\u58f0\u660e\uff08state\uff09\u3002\u5b83\u9700\u8981\u5c5e\u6027name\u6765\u6307\u5b9a\u5b83\u5728\u54ea\u4e2a\u72b6\u6001\uff08state\uff09\u5185\u3002\u5148\u4e0d\u7528\u7ba1Layer\u3002Section\u603b\u4f1a\u88ab\u7528\u5230\u3002\u8fd9\u4e00\u90e8\u5206\u8d1f\u8d23\u5e02\u7ea7\u6539\u53d8\u5916\u89c2\u3002\u5b83\u9700\u8981\u4e00\u4e2a\u5c5e\u6027section\uff0c\u8fd9\u662f\u8981\u6539\u53d8&nbsp;\u4ec0\u4e48&nbsp;\uff0c\u5728\u8fd9\u91cc\u6307label\u3002TextColour\u5c31\u662f\u989c\u8272\uff08\u9ed1\u8272\uff09\uff0c\u6211\u4eec\u4f1a\u5728\u4e0b\u9762\u5b9a\u4e49\u5b83\u3002\u73b0\u5728\uff0c\u5982\u4f60\u6240\u89c1\uff0cEnabled\u72b6\u6001\uff08state\uff09\u53ea\u662f\u628a\u6587\u672c\u989c\u8272\u8bbe\u4e3a\u9ed1\u8272\uff0c\u4ec5\u6b64\u800c\u5df2\u3002Disabled\u4e5f\u7c7b\u4f3c\uff08\u8bb0\u4f4f\u8fd9\u662f\u4e00\u4e2aitem\uff0citems\u901a\u5e38\u4e0d\u4f1a\u662fdisabled\u72b6\u6001\u7684\uff09\u3002<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u6765\u770b\u770b\u53e6\u5916\u4e24\u4e2a\u72b6\u6001\u3002<\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_03.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_03.png\" width=\"378\" height=\"415\" style=\"float:none;\" \/><\/a><\/p>\n<p>\u8fd9\u4e9b\u72b6\u6001\u5f88\u597d\u5730\u89e3\u91ca\u4e86\u5b83\u4eec\u81ea\u5df1\uff0c\u867d\u7136\u91cc\u9762\u53c8\u591a\u4e86\u51e0\u4e2asection\u3002Section\u4e0d\u4ec5\u5b9a\u4e49\u8981\u6539\u53d8\u4ec0\u4e48\uff0c\u5b83\u8fd8\u5b9a\u4e49\u4ec0\u4e48\u5e94\u8be5\u88ab\u663e\u793a\u3002\u5728Enabled\u72b6\u6001\u4e2d\u6211\u4eec\u4e0d\u60f3\u8ba9\u4ed6\u770b\u8d77\u6765\u662f\u88ab\u9009\u4e2d\u7684\uff0c\u6240\u4ee5\u6ca1\u6709selection&nbsp;section\u3002\u6ce8\u610f\uff0c\u4f60\u4e66\u5199Section\u7684\u987a\u5e8f\u540c\u65f6\u4e5f\u662fZ\u8f74\u7684\u987a\u5e8f\u3002\u5728\u672c\u4f8b\u4e2d\u6211\u4eec\u628aselection\u56fe\u653e\u5728\u524d\u9762\uff0c\u7136\u540e\u662f\u6587\u5b57\u3002\u5982\u679c\u6211\u4eec\u628a\u987a\u5e8f\u53cd\u8fc7\u6765\uff0c\u5c31\u770b\u4e0d\u5230\u5b57\u4e86\u3002\uff08\u88abselection\u56fe\u6321\u4f4f\u4e86\uff09<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u6765\u6dfb\u52a0\u989c\u8272\u548c\u5c5e\u6027\u7684\u5b9a\u4e49\u3002<\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_04.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_04.png\" width=\"743\" height=\"517\" style=\"float:none;\" \/><\/a><\/p>\n<p>\u6211\u4eec\u7684\u7b2c\u4e00\u4e2aPropetryDefinition\u53ea\u662f\u5b9a\u4e49\u4e86\u4e00\u4e2a\u7528\u5728StateImagery&nbsp;sections\u4e2d\u7684\u6587\u672c\u989c\u8272\u3002\u5176\u4ed6PropertyDefinitions\u4e5f\u4e00\u6837\uff0c\u9664\u4e86SelectionBrush\u3002\u5b83\u4e0d\u662f\u5b9a\u4e49\u989c\u8272\uff0c\u800c\u662f\u5b9a\u4e49\u4e86\u4e00\u4e2a\u56fe\u50cf\u3002\u5728\u8fd9\u4e2a\u4f8b\u5b50\u91cc\uff0c\u5b83\u4f7f\u7528\u5b9a\u4e49\u5728imageset\u91cc\u7684WindowsLook\u7684\u80cc\u666f\u56fe\u3002\u7136\u540e\uff0c\u6211\u4eec\u6709\u4e86\u4e00\u4e2a\u53ef\u4ee5\u5f71\u54cd\u67d0\u4e9b\u8bbe\u7f6e\u7684Property\uff08\u5c5e\u6027\uff09\u3002\u5728\u8fd9\u4e2a\u4f8b\u5b50\u91cc\uff0c\u6211\u4eec\u901a\u8fc7\u6dfb\u52a0Selectable\u5c5e\u6027\u5e76\u8bbe\u4e3atrue\u6765\u521b\u5efa\u4e00\u4e2aitem\u3002<\/p>\n<p><\/p>\n<h2>\u5199\u529f\u80fd\u90e8\u5206<\/h2>\n<p>\u6211\u4eec\u73b0\u5728\u9700\u8981\u589e\u52a0\u589e\u52a0\u7ed8\u5236\u80cc\u666f\u3001\u6587\u5b57\u548c\u9009\u53d6\u7684\u90e8\u5206\u3002\u8fd9\u770b\u8d77\u6765\u6709\u70b9\u96be\uff0c\u4e0d\u8fc7\u5176\u5b9e\u4e0d\u662f\u3002\u6211\u4eec\u4ece\u4e00\u4e2aNamedArea\u5f00\u59cb\u5427\u3002\u5b83\u662flistbox&nbsp;item\u6240\u5fc5\u9700\u7684\uff0c\u56e0\u4e3alistbox\u9700\u8981\u77e5\u9053\u8fd9\u4e2aitem\u6709\u591a\u5927\u6765\u786e\u4fdd\u628a\u5b83\u5f88\u597d\u5730\u653e\u8fdblist\u3002<\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_05.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_05.png\" width=\"733\" height=\"727\" style=\"float:none;\" \/><\/a><\/p>\n<p>\u6211\u5047\u8bbe\u4f60\u77e5\u9053Area\u3001Dim\u4e4b\u7c7b\u7684\u57fa\u672c\u6982\u5ff5\u3002FontDim\u662f\u7528\u6765\u6839\u636elabel\u6539\u53d8item\u7684\u5c3a\u5bf8\u7684\u3002\u6211\u4eec\u521a\u521a\u52a0\u8fdb\u53bb\u7684\u90e8\u5206\u5b9a\u4e49\u4e86item\u7684\u5c3a\u5bf8\u3002\u8fd9\u6b21\u6211\u4e0d\u518d\u8d34\u51fa\u5168\u90e8\u4ee3\u7801\uff0c\u800c\u53ea\u5c55\u793a\u65b0\u589e\u7684\u90e8\u5206\u3002<\/p>\n<p>OK!\u73b0\u5728\u6211\u4eec\u6765\u6dfb\u52a0\u4e00\u4e2a\u4e16\u7eaa\u7684Checkbox\u5427\u3002\u8fd9\u5bf9\u6211\u4eec\u7684\u76ee\u6807\u6765\u8bf4\u5f88\u91cd\u8981\uff0c\u56e0\u4e3a\u5b83\u662f\u6211\u4eec\u7684item\u53ef\u4ee5\u88ab\u70b9\u51fb\u9009\u4e2d\u3002\u6211\u4eec\u4e0d\u7528\u4e3aCheckbox\u5199\u5168\u90e8\u7684\u72b6\u6001\u548c\u5176\u4ed6\u4e1c\u897f\uff0c\u6211\u4eec\u76f4\u63a5\u7528Child\uff01\u53ea\u8981\u628a\u4e0b\u9762\u8fd9\u6bb5\u5185\u5bb9\u653e\u5728\u6211\u4eec\u7684NamedArea\u4e0b\u9762\u3001\u7b2c\u4e00\u4e2aStateImagery\u7684\u4e0a\u9762\u5373\u53ef\u3002\uff08\u5b83\u4fe9\u4e2d\u95f4\uff09<\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_06.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_06.png\" width=\"444\" height=\"258\" style=\"float:none;\" \/><\/a><\/p>\n<p>\u8fd9\u91cc\u6dfb\u52a0\u4e86\u4e00\u4e2aWindowsLook\/Checkbox\u5230\u6211\u4eec\u7684item\u91cc\u9762\u53bb\u4e86\u3002\u5176\u4e2d\u7684suffix\u662f\u5fc5\u9700\u7684\uff0c\u52a0\u5b83\u662f\u4e3a\u4e86\u4f7fname\u4e0d\u91cd\u590d\u3002\u5269\u4e0b\u7684\u5185\u5bb9\u5c31\u975e\u5e38\u76f4\u767d\u4e86\u2014\u2014\u628acheckbox\u52a0\u5230item\u7684\u5de6\u8fb9\uff0c\u548c\u5de6\u8fb9\u754c\u7559\u51fa3\u4e2a\u50cf\u7d20\u7684\u8ddd\u79bb\uff0c\u8ba9\u5b83\u770b\u8d77\u6765\u66f4\u5e73\u6574\u4e00\u4e9b\u3002<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u9700\u8981\u4e00\u4e2alabel\uff0c\u8fd9\u90e8\u5206\u5f88\u7b80\u5355\u6240\u4ee5\u6211\u4e0d\u4f1a\u82b1\u5f88\u591a\u65f6\u95f4\u53bb\u89e3\u91ca\uff0c\u57fa\u672c\u4e0a\u770b\u4e86\u5c31\u660e\u767d\u4e86\u3002<\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_07.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_07.png\" width=\"465\" height=\"270\" style=\"float:none;\" \/><\/a><\/p>\n<p>TextComponent\u662f\u4e00\u4e2a\u6587\u672c\u5bb9\u5668\u3002Dim\u662f\u5b9a\u4f4d\u3002\u6ce8\u610fLeftEdge\uff0clabel\u79bb\u5f00\u5de6\u8fb9\u754c18\u4e2a\u50cf\u7d20\u3002\u8fd9\u662f\u56e0\u4e3acheckbox\u5360\u4e86\u524d\u976215\u50cf\u7d20\u7684\u7a7a\u95f4\u3002<\/p>\n<p>\u73b0\u5728\u91cd\u8981\u7684\u6765\u4e86\uff01selection&nbsp;image\u3002<\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_08.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_08.png\" width=\"388\" height=\"321\" style=\"float:none;\" \/><\/a><\/p>\n<p>\u6ce8\u610f\u6211\u4eec\u7ed9\u5c5e\u6027\u201cname\u201d\u590d\u5236\u4e3a\u201cselection\u201d\uff0cas&nbsp;used&nbsp;in&nbsp;the&nbsp;StateImagery.Area\u90e8\u5206\u8fd8\u662f\u5b9a\u4f4d\u548c\u81ea\u9002\u5e94\u3002Dim\u7528\u6765\u786e\u4fdd\u6574\u4e2aitem\u90fd\u88ab\u586b\u6ee1\u4e86\u3002<\/p>\n<p>ImageProperty\u5b9a\u4e49\u4e86\u8981\u4f7f\u7528\u7684\u56fe\u50cf\u7231\u4f60\u4e2a\u3002\u6211\u4eec\u5df2\u7ecf\u5728WidgetLook\u7684\u524d\u9762\u67d0\u5904\u5b9a\u4e49\u4e86SelectionBrush\u3002\u5b83\u73b0\u5728\u53ea\u662f\u7528\u56fe\u586b\u5145\u90a3\u4e2a\u533a\u57df\uff08Area\uff09\u3002ColourProperty\u7ed9image\u4e0a\u8272\uff0c\u6211\u4eec\u4e5f\u5df2\u7ecf\u5728WidgetLook\u7684\u524d\u9762\u67d0\u5904\u5b9a\u4e49\u8fc7SelectionColour\u4e86\u3002VertFormat\u548cHorzFormat\u662f\u62c9\u4f38\u7684\uff08stretched\uff09\uff0c\u5982\u679c\u4ed6\u6ca1\u6709\u88ab\u62c9\u4f38\uff0c\u5b83\u5c06\u53ea\u4f1a\u753bimage\u7684\u4e00\u4e2a\u50cf\u7d20\u70b9\uff0c\u90a3\u5c31\u51e0\u4e4e\u4e0d\u53ef\u89c1\u4e86\u3002\u62c9\u4f38\u5b83\u662f\u4e3a\u4e86\u786e\u4fdd\u6574\u4e2a\u533a\u57df\u90fd\u88ab\u8986\u76d6\u4e86\u3002<\/p>\n<p>\u5b8c\u6210\uff01\u6211\u4eec\u5df2\u7ecf\u5199\u597d\u4e86\u6211\u4eec\u7684looknfeel&nbsp;entry\uff01\uff01<\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_09.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_09.png\" width=\"721\" height=\"1466\" style=\"float:none;\" \/><\/a><\/p>\n<p>Pfew&nbsp;am&nbsp;I&nbsp;glad&nbsp;thats&nbsp;done.(\u57fa\u62c9\uff1a\u6211\u6000\u7591\u8fd9\u662f\u4e2a\u62fc\u5199\u9519\u8bef\u3002\u4f5c\u8005\u6587\u4e2d\u591a\u51fa\u62fc\u5199\u9519\u8bef\uff0c\u6709\u7684\u6211\u8bc6\u522b\u51fa\u6765\u4e86\uff0c\u6709\u7684\u6211\u771f\u662f\u641e\u4e0d\u5b9a\uff0c\u6bd4\u5982\u8fd9\u53e5=&nbsp;=b)<\/p>\n<p><\/p>\n<h2>\u7ed9item\u5199\u4ee3\u7801<\/h2>\n<p>\u5230\u4e86\u5b9e\u9645\u8003\u9a8c\u6211\u4eec\u7684\u65b0item\u7684\u65f6\u5019\u4e86\u3002\u6211\u4eec\u9700\u8981\u518d\u505a\u4e00\u70b9\u5de5\u4f5c\u6765\u589e\u52a0\u8fd9\u4e2a\u6559\u7a0b\u7684\u5b8c\u6210\u5ea6\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efaCheckListboxItem\u7c7b\u3002\u7136\u540e\uff0c\u6211\u4eec\u8981\u6dfb\u52a0window\u5de5\u5382\uff08factory\uff09\u5230\u7cfb\u7edf\u4e2d\u3002\u6700\u540e\uff0c\u6211\u4eec\u8981\u505a\u4e00\u4e2aFalagard\u6620\u5c04\uff08mapping\uff09\u3002\u6211\u4eec\u5148\u4eceCheckListboxItem\u7c7b\u5f00\u59cb\u5427\u3002<\/p>\n<p><\/p>\n<p><strong>CheckListItem.h<\/strong><\/p>\n<p><a href=\"http:\/\/http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_10.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_10.png\" width=\"446\" height=\"294\" style=\"float:none;\" \/><\/a><\/p>\n<p>\u5982\u4f60\u6240\u89c1\uff0c\u8fd9\u4e2a\u7c7b\u7ee7\u627f\u81eaItemEntry\u3002\u8fd9\u662f\u5fc5\u9700\u7684\uff0c\u56e0\u4e3a\u8fd9\u6837\u624d\u80fd\u8ba9\u6211\u4eec\u7684\u65b0item\u50cf\u4e2a\u6b63\u5e38\u7684item\u4e00\u6837\u8fd0\u4f5c\u3002\u9700\u8981\u7279\u522b\u6ce8\u610f\u7684\u662f\u8fd9\u4e2a<strong>CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)<\/strong>.&nbsp;\u5b83\u544a\u8bc9CEGUI\u6211\u4eec\u6b63\u5728\u58f0\u660e\u8fd9\u4e2a\u7a97\u53e3\u3002<\/p>\n<p><\/p>\n<p><strong>CheckListItem.cpp<\/strong><\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_11.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_11.png\" width=\"549\" height=\"229\" style=\"float:none;\" \/><\/a><\/p>\n<p>\u8fd9\u91cc\u7684<strong>CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)<\/strong>&nbsp;\u975e\u5e38\u91cd\u8981\u3002\u5b83\u544a\u8bc9CEGUI\u6211\u4eec\u5728\u54ea\u91cc\u653e\u7f6e\u548c\u8fd9\u4e2a\u7a97\u53e3\u76f8\u5173\u7684\u4ee3\u7801\u3002\u5982\u4f60\u6240\u89c1\uff0c\u8fd9\u4e2a\u7c7b\u975e\u5e38\u7a7a\uff0c\u4f60\uff0c\u5f53\u7136\uff0c\u53ef\u4ee5\u52a0\u4efb\u4f55\u4f60\u559c\u6b22\u7684\u4e1c\u897f\u5230\u8fd9\u4e2a\u7c7b\u91cc\u9762\u6765\u2014\u2014\u8fd9\u91cc\u5199\u7684\u53ea\u662f\u7c7b\u7684\u57fa\u7840\u6846\u67b6\u3002<\/p>\n<p>\u73b0\u5728\uff0c\u8fd8\u6709\u4e00\u4ef6\u91cd\u8981\u7684\u4e8b\u8981\u505a\u3002\u5728CEGUI\u4e2d\u6b63\u786e\u5730\u6ce8\u518c\u8fd9\u4e2a\u7a97\u53e3\u3002<\/p>\n<p>(<strong><span style=\"color: rgb(255, 0, 0); \">\u8bd1\u6ce8\uff1a\u5b9e\u8df5\u8bc1\u660e\uff0c<\/span><\/strong><strong style=\"white-space: normal; \"><span style=\"color: rgb(255, 0, 0)\">addFalagardWindowMappings\u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\u5e94\u8be5\u586b\u4f60\u5728CheckListboxItem.cpp\u91cc\u521d\u59cb\u5316\u7684WidgetTypeName\u7684\u503c\uff0c\u5728\u8fd9\u4e2a\u4f8b\u5b50\u91cc\u5c31\u662f\u201cCEGUI\/CheckListboxItem\u201d\uff0c\u800c\u4e0d\u662f\u5b83\u7684\u57fa\u7c7b\u201cCEGUI\/ItemEntry\u201d\u3002\u5177\u4f53\u533a\u522b\u89c1\u672c\u6587\u9876\u90e82012.10.15\u65e5\u66f4\u65b0<\/span><\/strong>)<\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_12.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_12.png\" width=\"867\" height=\"149\" style=\"float:none;\" \/><\/a><\/p>\n<p>addFalagardWindowMappings\u7684\u53c2\u6570\u5206\u522b\u662f\uff1a\u540d\u79f0\uff08Name\uff09\uff0c\u7c7b\u578b\uff08Type\uff09\uff0cLooknFeel\uff0c\u7a97\u53e3\u6e32\u67d3\u5668\uff08WindowRenderer\uff09\u3002\u53ea\u8981\u628a\u8fd9\u6bb5\u4ee3\u7801\u653e\u5728\u4f60\u7684main\u6587\u4ef6\u7684\u67d0\u5904\uff0c\u6216\u8005\u653e\u5728\u5176\u4ed6\u4f60\u786e\u5b9a\u53ef\u4ee5\u5728\u4f7f\u7528\u6211\u4eec\u7684\u65b0item\u4e4b\u524d\u4f1a\u88ab\u6267\u884c\u5230\u7684\u5730\u65b9\u3002\u8fd8\u8981\u6ce8\u610f\uff0c\u4e3a\u4e86\u4f7f\u7528CEGUI_WINDOW_FACTORY()\uff0c\u4f60\u9700\u8981\u5728CEGUI\u547d\u540d\u7a7a\u95f4\u5185\u90e8\u3002<\/p>\n<p><\/p>\n<p><strong>\u5b9e\u4f8b<\/strong><\/p>\n<p><strong>main.cpp<\/strong><\/p>\n<p><a href=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_13.png\" target=\"_self\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bellsprite.com\/img\/2012\/10\/cegui_tutorial_13.png\" width=\"893\" height=\"620\" style=\"float:none;\" \/><\/a><\/p>\n<p>\u5982\u4f60\u6240\u89c1\uff0c\u5728\u8fd9\u4e2amain\u51fd\u6570\u91cc\uff0c\u6ce8\u518c\u7a97\u53e3\u7684\u51fd\u6570\u5728\u5b9e\u9645\u521b\u5efa\u7a97\u53e3\u4e4b\u524d\u88ab\u8c03\u7528\u4e86\u3002\u4e0d\u8981\u5728\u610fSDL\u521d\u59cb\u5316\u7684\u90e8\u5206\u2014\u2014\u90a3\u53ea\u662f\u6211\u7684\u4e2a\u4eba\u6d4b\u8bd5\u73af\u5883\u800c\u5df2\u3002<\/p>\n<p>\u606d\u559c\uff01\u4f60\u5df2\u7ecf\u521b\u5efa\u4e86\u4e00\u4e2aCheckListboxItem\u4e86\u3002\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u597d\u7684\u7ec3\u4e60\uff0c\u56e0\u4e3a\u4f60\u4e5f\u5b66\u4f1a\u4e86\u5982\u4f55\u5199\u4e00\u4e2a\u590d\u5408Widget\u3002<\/p>\n<p>\u5982\u679c\u4f60\u6709\u4efb\u4f55\u7591\u95ee\u3001\u8bc4\u8bba\u3001\u53cd\u9988\u2026\u2026\u4efb\u4f55\u4e8b\u7684\u8bdd\uff0c\u6b22\u8fce\u53d1\u90ae\u4ef6\u544a\u8bc9\u6211\u3002\u6211\u7684\u90ae\u4ef6\u5730\u5740\u662f<span style=\"font-family: sans-serif;font-size: 13px;background-color: rgb(255, 255, 255)\">&nbsp;<\/span><a href=\"mailto:levia@openfrag.org\" class=\"external text\" rel=\"nofollow\" style=\"text-decoration: none; color: rgb(51, 102, 187); background-image: url(http:\/\/www.cegui.org.uk\/wiki\/skins\/vector\/images\/mail-icon.png); background-color: rgb(255, 255, 255); padding: 0px 18px 0px 0px; font-family: sans-serif; font-size: 13px; line-height: 19.200000762939453px; white-space: normal; background-position: 100% 50%; background-repeat: no-repeat no-repeat; \">levia&nbsp;at&nbsp;openfrag&nbsp;dot&nbsp;com<\/a><span style=\"font-family: sans-serif;font-size: 13px;background-color: rgb(255, 255, 255)\">.<\/span><\/p>\n<p><span style=\"font-family: sans-serif;font-size: 13px;background-color: rgb(255, 255, 255)\"><br \/><\/span><\/p>\n<p><span style=\"font-family: sans-serif;font-size: 13px;background-color: rgb(255, 255, 255)\">&#8212;<\/span><a href=\"http:\/\/www.cegui.org.uk\/wiki\/index.php?title=User:Levia&amp;action=edit&amp;redlink=1\" class=\"new\" title=\"User:Levia (page does not exist)\" style=\"text-decoration: none; color: rgb(165, 88, 88); background-image: none; background-color: rgb(255, 255, 255); font-family: sans-serif; font-size: 13px; line-height: 19.200000762939453px; white-space: normal; \">User:Levia<\/a><span style=\"font-family: sans-serif;font-size: 13px;background-color: rgb(255, 255, 255)\">&nbsp;21:10,&nbsp;5&nbsp;April&nbsp;2007&nbsp;(GMT+1)<\/span><\/p>\n<p><\/p>\n<p>======&nbsp;\u8bd1\u8005\u540e\u8bb0&nbsp;=======<\/p>\n<p>@DHorse&nbsp;WordPress\u592a\u51f6\u6b8b\u4e86\uff0c\u6211\u5728\u4f60\u90a3\u4e2a\u7f51\u7ad9\u4e0a\u4e0a\u597d\u8272\u7684XML\u4ee3\u7801\u5b83\u90fd\u541e\uff0c\u597d\u8c61\u662f\u89c1\u4e86\u5c16\u62ec\u53f7\u5c31\u7ba1\u4e0d\u4f4f\u5634\u4f3c\u7684\u3002\u6211\u7b97\u6015\u4e86\u5b83\u4e86\uff0c\u5168\u90e8\u8d34\u56fe\u641e\u5b9a\uff01\u54c7\u54c8\u54c8\u54c8\u54c8\uff01\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\uff1aCEGUI\u5b98\u65b9wiki \u7ffb\u8bd1\uff1a\u57fa\u62c9\u94c3\u5996 ================================ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-296","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"views":8768,"_links":{"self":[{"href":"https:\/\/bellsprite.com\/index.php?rest_route=\/wp\/v2\/posts\/296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bellsprite.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bellsprite.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bellsprite.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bellsprite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=296"}],"version-history":[{"count":28,"href":"https:\/\/bellsprite.com\/index.php?rest_route=\/wp\/v2\/posts\/296\/revisions"}],"predecessor-version":[{"id":325,"href":"https:\/\/bellsprite.com\/index.php?rest_route=\/wp\/v2\/posts\/296\/revisions\/325"}],"wp:attachment":[{"href":"https:\/\/bellsprite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bellsprite.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bellsprite.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}