{"id":592,"date":"2011-08-12T14:41:59","date_gmt":"2011-08-12T06:41:59","guid":{"rendered":"http:\/\/www.hawkwithwind.net\/blog\/?p=592"},"modified":"2011-08-12T15:58:09","modified_gmt":"2011-08-12T07:58:09","slug":"symbian-%e6%b5%8b%e8%af%95%e6%a1%86%e6%9e%b6%e8%b0%83%e7%a0%94%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/www.hawkwithwind.net\/blog\/2011\/08\/12\/symbian-%e6%b5%8b%e8%af%95%e6%a1%86%e6%9e%b6%e8%b0%83%e7%a0%94%e7%ac%94%e8%ae%b0\/","title":{"rendered":"Symbian \u6d4b\u8bd5\u6846\u67b6\u8c03\u7814\u7b14\u8bb0"},"content":{"rendered":"<p style=\"text-align: left;\">symbian\u6ca1\u6709\u5408\u9002\u7684\u81ea\u52a8\u6d4b\u8bd5\u6846\u67b6\u3002\u4e0d\u662fjava\u7684\u4e1c\u897f\u5c31\u662f\u9ebb\u70e6\u3002<\/p>\n<blockquote>\n<p style=\"text-align: left;\">\u6458\u81eaNokia wiki, RWindow::Construct<\/p>\n<\/blockquote>\n<h3 style=\"text-align: left;\">Construct ( const RWindowTreeNode &amp;, TUint32 )<\/h3>\n<div style=\"text-align: left;\">\n<div>\n<table style=\"width: auto; margin-left: 1em;border-collapse:collapse;\">\n<tbody style=\"border: solid 1px silver;\">\n<tr>\n<td>IMPORT_C\u00a0<a href=\"http:\/\/library.developer.nokia.com\/topic\/GUID-E35887BB-7E58-438C-AA27-97B2CDE7E069\/GUID-251A35C1-CC66-4DE4-9EBE-964026E89E7F\/GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html\" shape=\"rect\">TInt<\/a><\/td>\n<td>Construct<\/td>\n<td>(<\/td>\n<td>const\u00a0<a href=\"http:\/\/library.developer.nokia.com\/topic\/GUID-E35887BB-7E58-438C-AA27-97B2CDE7E069\/GUID-251A35C1-CC66-4DE4-9EBE-964026E89E7F\/GUID-9FFD28C7-8747-3438-84BF-44AF26ACEC7D.html\" shape=\"rect\">RWindowTreeNode<\/a>\u00a0&amp;<\/td>\n<td>parent,<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\"><\/td>\n<td><a href=\"http:\/\/library.developer.nokia.com\/topic\/GUID-E35887BB-7E58-438C-AA27-97B2CDE7E069\/GUID-251A35C1-CC66-4DE4-9EBE-964026E89E7F\/GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html\" shape=\"rect\">TUint32<\/a><\/td>\n<td>aHandle<\/td>\n<\/tr>\n<tr>\n<td colspan=\"2\"><\/td>\n<td>)<\/td>\n<td colspan=\"2\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<p>Completes the construction of the window handle.<\/p>\n<p>This method should be called after the\u00a0<a href=\"http:\/\/library.developer.nokia.com\/topic\/GUID-E35887BB-7E58-438C-AA27-97B2CDE7E069\/GUID-251A35C1-CC66-4DE4-9EBE-964026E89E7F\/GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.html#GUID-64B0330C-C339-3220-A510-B2F3EE38A428\" shape=\"rect\">RWindow()<\/a>\u00a0constructor, before any other functions are performed on the window. It creates a window in the window server corresponding to the\u00a0<a href=\"http:\/\/library.developer.nokia.com\/topic\/GUID-E35887BB-7E58-438C-AA27-97B2CDE7E069\/GUID-251A35C1-CC66-4DE4-9EBE-964026E89E7F\/GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.html#GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79\" shape=\"rect\">RWindow<\/a>\u00a0object. The window is initialised to inherit the size and extent of its parent window, given by the first parameter. If its parent is a group window then it will be full screen.<\/p>\n<p>This function always causes a flush of the window server buffer.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<div>\n<table style=\"width: auto;border-collapse:collapse;\">\n<thead>\n<tr style=\"border: solid 1px silver;\">\n<th rowspan=\"1\" colspan=\"1\">Parameter<\/th>\n<th rowspan=\"1\" colspan=\"1\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"border: solid 1px silver;\">\n<td style=\"vertical-align: top; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">parent<\/td>\n<td style=\"vertical-align: top; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">The window&#8217;s parent.<\/td>\n<\/tr>\n<tr style=\"border: solid 1px silver;\">\n<td style=\"vertical-align: top; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">aHandle<\/td>\n<td style=\"vertical-align: top; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">Client handle for the window. This is an integer value chosen by the client that must be unique within the current server session. The usual way of doing this is to cast the address of the object that owns the window to a TUint32; this allows event handlers which are given a window handle to obtain a reference to the window an event is intended for. For example, CCoeControl uses this technique when it constructs a window. Note that in GUI applications, every window is created and owned by a control. Therefore it is rare for 3rd party code to ever need to call a window&#8217;s Construct() function directly.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<p>Returns:\u00a0KErrNone if successful, otherwise one of the system-wide error codes.<\/p>\n<\/div>\n<\/div>\n<p style=\"text-align: left;\">\u8fd9\u91cc\u7684\u89e3\u91ca\u5f88\u91cd\u8981\uff0cThe usual way of doing this is to cast the address of the object that owns the window to a TUint32; this allows event handlers which are given a window handle to obtain a reference to the window an event is intended for. For example, CCoeControl uses this technique when it constructs a window. Note that in GUI applications, every window is created and owned by a control. \u4e5f\u5c31\u662f\u8bf4\uff0cRWindow\u7684handle\u53ef\u4ee5\u7acb\u5373\u5f3a\u8f6c\u4e3a\u4e00\u4e2aCCoeControl*\uff0c\u5e76\u4e14\u5c31\u662f\u6784\u9020\u4ed6\u7684\u63a7\u4ef6\u5bf9\u8c61\u3002<\/p>\n<blockquote>\n<p style=\"text-align: left;\">\u6458\u81eaNokia wiki, RWindowTreeNode::ClientHandle()<\/p>\n<\/blockquote>\n<h3 style=\"text-align: left;\">ClientHandle ( )<\/h3>\n<div style=\"text-align: left;\">\n<div>\n<table style=\"width: auto; margin-left: 1em;border-collapse:collapse;\">\n<tbody>\n<tr style=\"border: solid 1px silver;\">\n<td rowspan=\"1\" colspan=\"1\">IMPORT_C\u00a0<a href=\"http:\/\/library.developer.nokia.com\/topic\/GUID-E35887BB-7E58-438C-AA27-97B2CDE7E069\/GUID-251A35C1-CC66-4DE4-9EBE-964026E89E7F\/GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html\" shape=\"rect\">TUint32<\/a><\/td>\n<td style=\"vertical-align: top; padding-left: 1em; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">ClientHandle<\/td>\n<td style=\"vertical-align: top; padding-left: 1em; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">(<\/td>\n<td style=\"vertical-align: top; padding-left: 1em; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">)<\/td>\n<td style=\"vertical-align: top; padding-left: 1em; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">const<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<p>Gets the window&#8217;s client handle<\/p>\n<p>The return value is the client&#8217;s integer handle that was passed as an argument to the window&#8217;s Construct() function: see\u00a0<a href=\"http:\/\/library.developer.nokia.com\/topic\/GUID-E35887BB-7E58-438C-AA27-97B2CDE7E069\/GUID-251A35C1-CC66-4DE4-9EBE-964026E89E7F\/GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.html#GUID-73BDCAA6-2590-3652-9366-E4C48ED303C0\" shape=\"rect\">RWindow::Construct()<\/a>\u00a0for a description of the client handle.<\/p>\n<p>This function always causes a flush of the window server buffer.<\/p>\n<p>&nbsp;<\/p>\n<p>See also:\u00a0<a href=\"http:\/\/library.developer.nokia.com\/topic\/GUID-E35887BB-7E58-438C-AA27-97B2CDE7E069\/GUID-251A35C1-CC66-4DE4-9EBE-964026E89E7F\/GUID-683603DD-F3D3-3193-BEB3-8236C7DE7F79.html#GUID-73BDCAA6-2590-3652-9366-E4C48ED303C0\" shape=\"rect\">RWindow::Construct()<\/a><\/p>\n<\/div>\n<div>\n<p>Returns:\u00a0Handle ID for the window.<\/p>\n<\/div>\n<\/div>\n<p style=\"text-align: left;\">\u4e5f\u5c31\u662f\u8bf4\uff0c\u901a\u8fc7\u8fd9\u4e2a\u51fd\u6570\u53ef\u4ee5\u83b7\u53d6\u5230\u5bf9\u5e94\u7684\u63a7\u4ef6\u6307\u9488\u3002<\/p>\n<blockquote>\n<p style=\"text-align: left;\">\u6458\u81eaNokia wiki, RWindowTreeNode::Child()<\/p>\n<\/blockquote>\n<h3 style=\"text-align: left;\">Child ( )<\/h3>\n<div style=\"text-align: left;\">\n<div>\n<table style=\"width: auto; margin-left: 1em;border-collapse:collapse;\">\n<tbody>\n<tr style=\"border: solid 1px silver;\">\n<td style=\"vertical-align: top; padding-left: 1em; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">IMPORT_C\u00a0<a href=\"http:\/\/library.developer.nokia.com\/topic\/GUID-E35887BB-7E58-438C-AA27-97B2CDE7E069\/GUID-251A35C1-CC66-4DE4-9EBE-964026E89E7F\/GUID-FC2F2B93-3D18-3BCC-9FD6-6BC6B240B667.html\" shape=\"rect\">TUint32<\/a><\/td>\n<td style=\"vertical-align: top; padding-left: 1em; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">Child<\/td>\n<td style=\"vertical-align: top; padding-left: 1em; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">(<\/td>\n<td style=\"vertical-align: top; padding-left: 1em; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">)<\/td>\n<td style=\"vertical-align: top; padding-left: 1em; font-family: Consolas, Monaco, 'Courier New', monospace !important;\" rowspan=\"1\" colspan=\"1\">const<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div>\n<p>Gets the first child of the node.<\/p>\n<p>This function always causes a flush of the window server buffer.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<div>\n<p>Returns:\u00a0The client handle of the child node that currently has ordinal position 0. This is 0 if there isn&#8217;t a child.<\/p>\n<\/div>\n<\/div>\n<p style=\"text-align: left;\">\u83b7\u53d6TreeNode\u7684\u5b69\u5b50\u8282\u70b9\u3002\u4f7f\u7528NextSibling\u7ee7\u7eed\u5411\u4e0b\u904d\u5386\u3002<\/p>\n<p style=\"text-align: left;\">\u6ce8\u610f\u5230RWindowGroup\u4e5f\u662f\u7ee7\u627f\u81eaRWindowTreeNode\u7684\u3002\u4e00\u4e2a\u6d4b\u8bd5\u601d\u8def\u5c31\u662f\uff0c\u83b7\u53d6\u5230\u5f53\u524dWindowGroup\uff0c\u7136\u540e\u904d\u5386\u6574\u68f5\u6811\uff0c\u83b7\u53d6\u6bcf\u4e2a\u8282\u70b9\u5bf9\u5e94\u7684CCoeControl\u3002\u6682\u65f6\u4e0d\u77e5\u9053Symbian\u7cfb\u7edf\u4e0a\u80fd\u4e0d\u80fd\u505aDynamic Cast\u3002\u7406\u8bba\u4e0a\u6765\u8bf4\u914d\u5408RTTI\u53ef\u4ee5\u4e86\u89e3\u5230\u6bcf\u4e2a\u8282\u70b9\u7684\u7c7b\u578b\uff0c\u5e76\u5bf9\u7279\u5b9a\u7684\u7c7b\u578b\u8c03\u7528\u7279\u5b9a\u7684\u65b9\u6cd5\u8fdb\u4e00\u6b65\u5904\u7406\u3002\u4e0d\u8fc7\u8de8\u8fdb\u7a0b\u505a\u8fd9\u79cd\u4e8b\u60c5\u6050\u6015\u8fd8\u662f\u6709\u95ee\u9898\u3002\u4e0d\u77e5\u80fd\u4e0d\u80fd\u628a\u6d4b\u8bd5\u7a0b\u5e8f\u4f5c\u4e3a\u4e00\u4e2adll\u690d\u5165\u88ab\u6d4b\u7a0b\u5e8f\u53bb\u8fd0\u884c\u3002\u8fd9\u5c31\u53ef\u4ee5\u5b9e\u73b0Android\u4e0aHierarchy Viewer\u7684\u529f\u80fd\u4e86\u3002<\/p>\n<p style=\"text-align: left;\">\u7b80\u5355\u8bb0\u5f55\u4ee5\u4f5c\u5907\u5fd8\u3002\u54ea\u4f4d\u5144\u5f1f\u77e5\u9053\u6210\u719f\u7684symbian\u6d4b\u8bd5\u6846\u67b6\u4e5f\u8bf7\u4e0d\u541d\u8d50\u6559\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>symbian\u6ca1\u6709\u5408\u9002\u7684\u81ea\u52a8\u6d4b\u8bd5\u6846\u67b6\u3002\u4e0d\u662fjava\u7684\u4e1c\u897f\u5c31\u662f\u9ebb\u70e6\u3002 \u6458\u81eaNokia wiki, RWindow::Construct Construct ( const RWindowTreeNode &amp;, TUint32 ) IMPORT_C\u00a0TInt Construct ( const\u00a0RWindowTreeNode\u00a0&amp; parent, TUint32 aHandle ) Completes the construction of the window handle. This method should be called after the\u00a0RWindow()\u00a0constructor, before any other functions are performed on the window. It creates a window in the window server corresponding to the\u00a0RWindow\u00a0object. The window &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[13,55],"class_list":["post-592","post","type-post","status-publish","format-standard","hentry","category-note","tag-mobile","tag-symbian"],"_links":{"self":[{"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts\/592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/comments?post=592"}],"version-history":[{"count":41,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts\/592\/revisions"}],"predecessor-version":[{"id":634,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts\/592\/revisions\/634"}],"wp:attachment":[{"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/media?parent=592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/categories?post=592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/tags?post=592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}