{"id":363,"date":"2010-10-11T00:43:36","date_gmt":"2010-10-10T16:43:36","guid":{"rendered":"http:\/\/www.hawkwithwind.net\/blog\/?p=363"},"modified":"2010-10-11T00:45:52","modified_gmt":"2010-10-10T16:45:52","slug":"%e4%bb%a3%e7%a0%81%e4%ba%a4%e5%8f%89%e6%8b%b7%e8%b4%9d%e6%82%96%e8%ae%ba","status":"publish","type":"post","link":"https:\/\/www.hawkwithwind.net\/blog\/2010\/10\/11\/%e4%bb%a3%e7%a0%81%e4%ba%a4%e5%8f%89%e6%8b%b7%e8%b4%9d%e6%82%96%e8%ae%ba\/","title":{"rendered":"\u4ee3\u7801\u4ea4\u53c9\u62f7\u8d1d\u6096\u8bba"},"content":{"rendered":"<p>\u4e00\u76f4\u4ee5\u6765\u5199\u4ee3\u7801\u4f1a\u628a\u81ea\u5df1\u903c\u5230\u67d0\u79cd\u975e\u5e38\u96be\u53d7\u7684\u6b7b\u89d2\uff0c\u660e\u660e\u662f\u975e\u5e38\u7c7b\u4f3c\u7684\u4ee3\u7801\uff0c\u5374\u4e0d\u80fd\u65b9\u4fbf\u7684\u526a\u5207\u7c98\u8d34\uff0c\u4e5f\u65e0\u6cd5\u7528\u91cd\u6784\u4ee3\u7801\u7684\u65b9\u5f0f\u5408\u7406\u7684\u89e3\u51b3\u95ee\u9898\u3002\u5c31\u662f\u4ed6\u6070\u597d\u7c7b\u4f3c\u4e8e\u6570\u636e\u5e93\u4ea4\u53c9\u8868\u90a3\u79cd\u60c5\u51b5\uff0c\u597d\u50cf\u51a5\u51a5\u4e2d\u6307\u5b9a\u4e86\u4ed6\u7684\u590d\u6742\u5ea6\u5c31\u662fn\u5e73\u65b9\u3002\u3002\u3002<\/p>\n<p>\u4ece\u81ea\u5df1\u5199\u7684\u4e00\u4e2ascroll bar\u7684\u7c7b\u91cc\u9762\u627e\u4e86\u4e00\u6bb5\u4ee3\u7801\u51fa\u6765\u3002<br \/>\n<code><br \/>\n\t\tm_thumbCap->SetVOffset(m_Height);<br \/>\n\t\tm_thumb->SetVOffset(m_Height);<br \/>\n\t\tm_thumbBottom->SetVOffset(m_Height);<\/p>\n<p>\t\tm_thumbCap->SetRotation(270);<br \/>\n\t\tm_thumb->SetRotation(270);<br \/>\n\t\tm_thumbBottom->SetRotation(270);<br \/>\n<\/code><br \/>\n\u6eda\u52a8\u6761\u7684thumb\u7531\u4e09\u5757Image\u7ec4\u4ef6\u6784\u6210\uff0ccap,body\u548cbottom\u3002\u6eda\u52a8\u6761\u7684\u56fe\u7247\u9ed8\u8ba4\u662f\u7eb5\u5411\u7684\uff0c\u6a2a\u5411\u6eda\u52a8\u6761\u662f\u5c06\u56fe\u7247\u6a2a\u8fc7\u6765\u7528\u7684\u3002\u8fd9\u4e00\u6bb5\u662f\u5c06\u6eda\u52a8\u6761\u8bbe\u7f6e\u4e3a\u6a2a\u5411\u7684\u65f6\u5019\uff0c\u5206\u522b\u5c06\u4e09\u5757\u56fe\u7247\u7684\u5782\u76f4\u4f4d\u7f6e\u8bbe\u7f6e\u4e3a<html>\u5c5e\u6027\u91cc\u8bbe\u7f6e\u7684\u9ad8\u5ea6\uff0c\u5e76\u5c06\u4ed6\u4eec\u7684\u56fe\u7247\u65cb\u8f6c270\u5ea6\u6765\u6a2a\u5411\u4f7f\u7528\u3002<\/p>\n<p>\u6211\u60f3\u8bf4\u7684\u662f\uff0c\u8fd9\u5757\u4ee3\u7801\u7684\u4e24\u7ec4\u8bed\u53e5\u4e4b\u95f4\u6709\u7740\u9ad8\u5ea6\u5bf9\u79f0\u6027\uff0c\u5374\u96be\u4ee5\u5229\u7528\u8fd9\u4e2a\u5bf9\u79f0\u6027\u9ad8\u6548\u7684\u5f00\u53d1\u51fa\u6765\uff0c\u53cd\u800c\u8d39\u65f6\u8d39\u529b\u3002\u3002\u5f88\u7ea0\u7ed3\u3002\u4e0d\u77e5\u5927\u5bb6\u9047\u5230\u8fd9\u79cd\u60c5\u51b5\u6ca1\u6709\u3002<br \/>\n<code><br \/>\n\t\tm_thumbCap->SetVOffset(m_Height);<br \/>\n\t\tm_thumbCap->SetRotation(270);<br \/>\n\t\tm_thumb->SetVOffset(m_Height);<br \/>\n\t\tm_thumb->SetRotation(270);<br \/>\n\t\tm_thumbBottom->SetVOffset(m_Height);<br \/>\n\t\tm_thumbBottom->SetRotation(270);<br \/>\n<\/code><br \/>\n\u8fd9\u4e2a\u4f8b\u5b50\u6bd4\u8f83\u5e78\u8fd0\uff0c\u6070\u597d\u4fee\u6539\u4e00\u4e0b\u5206\u7ec4\u65b9\u5f0f\u4fee\u6539\u8d77\u6765\u4f1a\u6bd4\u8f83\u65b9\u4fbf\u3002\u751a\u81f3\u53ef\u4ee5\u5199\u4e2a\u51fd\u6570\u5c06\u8fd9\u4e24\u53e5\u8bdd\u5305\u88c5\u8d77\u6765\u3002\u4f46\u6709\u65f6\u9047\u5230\u7684\u60c5\u51b5\u5c31\u6ca1\u8fd9\u4e48\u65b9\u4fbf\u4e86\u3002<\/p>\n<p><code><br \/>\n\tint coordinaryValue;<br \/>\n\tif(m_Orientation == ScrollBar::vertical){<br \/>\n\t\tcoordinaryValue = value \/ (double)(m_Max-m_Min+m_PageSize) * m_Height;<br \/>\n\t\tm_thumbCap->SetVOffset(coordinaryValue);<br \/>\n\t}else if(m_Orientation == ScrollBar::horizontal){<br \/>\n\t\tcoordinaryValue = value \/ (double)(m_Max-m_Min+m_PageSize) * m_Width;<br \/>\n\t\tm_thumbCap->SetHOffset(coordinaryValue);<br \/>\n\t}<br \/>\n\tsetImagePos();<br \/>\n<\/code><br \/>\n\u8fd9\u6bb5\u4ee3\u7801\u6839\u636e\u6eda\u52a8\u6761\u662f\u7eb5\u5411\u7684\u8fd8\u662f\u6a2a\u5411\u7684\u91cd\u65b0\u8ba1\u7b97thumb\u5757\u7684\u4f4d\u7f6e\u5e76\u66f4\u65b0\u56fe\u5f62\u663e\u793a\u3002\u6a2a\u5411\u548c\u7eb5\u5411\u7684\u8ba1\u7b97\u65b9\u5f0f\u96f7\u540c\u5374\u4e0d\u76f8\u540c\uff0c\u590d\u5236\u4e4b\u540e\u4ecd\u9700\u4fee\u6539\u51e0\u4e2a\u5730\u65b9\uff0c\u5047\u5982\u66f4\u590d\u6742\u4e9b\u7684\u8bdd\u5c31\u4f1a\u66f4\u9ebb\u70e6\u3002\u5e76\u4e14\u8fd9\u91cc\u751a\u81f3\u627e\u4e0d\u5230\u5f88\u597d\u7684\u5305\u88c5\u51fd\u6570\u7684\u65b9\u5f0f\u3002\u4e14\u4e0d\u8bf4\u7531\u4e8e\u6574\u4e2a\u9879\u76ee\u53ea\u6709\u8fd9\u91cc\u7528\u5230\u4e86\u8fd9\u4e00\u5c0f\u5757\u4ee3\u7801\uff0c\u5c01\u88c5\u51fd\u6570\u53ef\u80fd\u5bf9\u4e8e\u5f00\u53d1\u6548\u7387\u4e5f\u6ca1\u5565\u63d0\u9ad8\u3002<\/p>\n<p>\u554a\u554a\u8c8c\u4f3c\u4e3e\u4e86\u4e24\u4e2a\u4f8b\u5b50\u90fd\u4e0d\u662f\u5f88\u8981\u547d\u7684\u90a3\u79cd\uff0c\u4e00\u65f6\u627e\u4e0d\u5230\u975e\u5e38\u5178\u578b\u7684\u4f8b\u5b50\u4e86\u3002\u4e0d\u8fc7\u5047\u5982\u4ee5\u524d\u9047\u5230\u540c\u7c7b\u95ee\u9898\u7684\u8bdd\uff0c\u5e94\u8be5\u4f1a\u6709\u5370\u8c61\u5427\u3002\u4e5f\u6709\u53ef\u80fd\u6240\u6709\u7c7b\u4f3c\u95ee\u9898\u90fd\u6709\u89e3\u51b3\u529e\u6cd5\u7684\u53ea\u662f\u6211\u6709\u65f6\u56f0\u897f\u897f\u7684\u7f16\u7a0b\u6ca1\u6709\u4ed4\u7ec6\u60f3\u5427\u3002\u6b22\u8fce\u7838\u6211\uff5e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u76f4\u4ee5\u6765\u5199\u4ee3\u7801\u4f1a\u628a\u81ea\u5df1\u903c\u5230\u67d0\u79cd\u975e\u5e38\u96be\u53d7\u7684\u6b7b\u89d2\uff0c\u660e\u660e\u662f\u975e\u5e38\u7c7b\u4f3c\u7684\u4ee3\u7801\uff0c\u5374\u4e0d\u80fd\u65b9\u4fbf\u7684\u526a\u5207\u7c98\u8d34\uff0c\u4e5f\u65e0\u6cd5\u7528\u91cd\u6784\u4ee3\u7801\u7684\u65b9\u5f0f\u5408\u7406\u7684\u89e3\u51b3\u95ee\u9898\u3002\u5c31\u662f\u4ed6\u6070\u597d\u7c7b\u4f3c\u4e8e\u6570\u636e\u5e93\u4ea4\u53c9\u8868\u90a3\u79cd\u60c5\u51b5\uff0c\u597d\u50cf\u51a5\u51a5\u4e2d\u6307\u5b9a\u4e86\u4ed6\u7684\u590d\u6742\u5ea6\u5c31\u662fn\u5e73\u65b9\u3002\u3002\u3002 \u4ece\u81ea\u5df1\u5199\u7684\u4e00\u4e2ascroll bar\u7684\u7c7b\u91cc\u9762\u627e\u4e86\u4e00\u6bb5\u4ee3\u7801\u51fa\u6765\u3002 m_thumbCap->SetVOffset(m_Height); m_thumb->SetVOffset(m_Height); m_thumbBottom->SetVOffset(m_Height); m_thumbCap->SetRotation(270); m_thumb->SetRotation(270); m_thumbBottom->SetRotation(270); \u6eda\u52a8\u6761\u7684thumb\u7531\u4e09\u5757Image\u7ec4\u4ef6\u6784\u6210\uff0ccap,body\u548cbottom\u3002\u6eda\u52a8\u6761\u7684\u56fe\u7247\u9ed8\u8ba4\u662f\u7eb5\u5411\u7684\uff0c\u6a2a\u5411\u6eda\u52a8\u6761\u662f\u5c06\u56fe\u7247\u6a2a\u8fc7\u6765\u7528\u7684\u3002\u8fd9\u4e00\u6bb5\u662f\u5c06\u6eda\u52a8\u6761\u8bbe\u7f6e\u4e3a\u6a2a\u5411\u7684\u65f6\u5019\uff0c\u5206\u522b\u5c06\u4e09\u5757\u56fe\u7247\u7684\u5782\u76f4\u4f4d\u7f6e\u8bbe\u7f6e\u4e3a\u5c5e\u6027\u91cc\u8bbe\u7f6e\u7684\u9ad8\u5ea6\uff0c\u5e76\u5c06\u4ed6\u4eec\u7684\u56fe\u7247\u65cb\u8f6c270\u5ea6\u6765\u6a2a\u5411\u4f7f\u7528\u3002 \u6211\u60f3\u8bf4\u7684\u662f\uff0c\u8fd9\u5757\u4ee3\u7801\u7684\u4e24\u7ec4\u8bed\u53e5\u4e4b\u95f4\u6709\u7740\u9ad8\u5ea6\u5bf9\u79f0\u6027\uff0c\u5374\u96be\u4ee5\u5229\u7528\u8fd9\u4e2a\u5bf9\u79f0\u6027\u9ad8\u6548\u7684\u5f00\u53d1\u51fa\u6765\uff0c\u53cd\u800c\u8d39\u65f6\u8d39\u529b\u3002\u3002\u5f88\u7ea0\u7ed3\u3002\u4e0d\u77e5\u5927\u5bb6\u9047\u5230\u8fd9\u79cd\u60c5\u51b5\u6ca1\u6709\u3002 m_thumbCap->SetVOffset(m_Height); m_thumbCap->SetRotation(270); m_thumb->SetVOffset(m_Height); m_thumb->SetRotation(270); m_thumbBottom->SetVOffset(m_Height); m_thumbBottom->SetRotation(270); \u8fd9\u4e2a\u4f8b\u5b50\u6bd4\u8f83\u5e78\u8fd0\uff0c\u6070\u597d\u4fee\u6539\u4e00\u4e0b\u5206\u7ec4\u65b9\u5f0f\u4fee\u6539\u8d77\u6765\u4f1a\u6bd4\u8f83\u65b9\u4fbf\u3002\u751a\u81f3\u53ef\u4ee5\u5199\u4e2a\u51fd\u6570\u5c06\u8fd9\u4e24\u53e5\u8bdd\u5305\u88c5\u8d77\u6765\u3002\u4f46\u6709\u65f6\u9047\u5230\u7684\u60c5\u51b5\u5c31\u6ca1\u8fd9\u4e48\u65b9\u4fbf\u4e86\u3002 int coordinaryValue; if(m_Orientation == ScrollBar::vertical){ coordinaryValue = value \/ (double)(m_Max-m_Min+m_PageSize) * m_Height; m_thumbCap->SetVOffset(coordinaryValue); }else if(m_Orientation == ScrollBar::horizontal){ coordinaryValue = value \/ (double)(m_Max-m_Min+m_PageSize) * m_Width; m_thumbCap->SetHOffset(coordinaryValue); } setImagePos(); \u8fd9\u6bb5\u4ee3\u7801\u6839\u636e\u6eda\u52a8\u6761\u662f\u7eb5\u5411\u7684\u8fd8\u662f\u6a2a\u5411\u7684\u91cd\u65b0\u8ba1\u7b97thumb\u5757\u7684\u4f4d\u7f6e\u5e76\u66f4\u65b0\u56fe\u5f62\u663e\u793a\u3002\u6a2a\u5411\u548c\u7eb5\u5411\u7684\u8ba1\u7b97\u65b9\u5f0f\u96f7\u540c\u5374\u4e0d\u76f8\u540c\uff0c\u590d\u5236\u4e4b\u540e\u4ecd\u9700\u4fee\u6539\u51e0\u4e2a\u5730\u65b9\uff0c\u5047\u5982\u66f4\u590d\u6742\u4e9b\u7684\u8bdd\u5c31\u4f1a\u66f4\u9ebb\u70e6\u3002\u5e76\u4e14\u8fd9\u91cc\u751a\u81f3\u627e\u4e0d\u5230\u5f88\u597d\u7684\u5305\u88c5\u51fd\u6570\u7684\u65b9\u5f0f\u3002\u4e14\u4e0d\u8bf4\u7531\u4e8e\u6574\u4e2a\u9879\u76ee\u53ea\u6709\u8fd9\u91cc\u7528\u5230\u4e86\u8fd9\u4e00\u5c0f\u5757\u4ee3\u7801\uff0c\u5c01\u88c5\u51fd\u6570\u53ef\u80fd\u5bf9\u4e8e\u5f00\u53d1\u6548\u7387\u4e5f\u6ca1\u5565\u63d0\u9ad8\u3002 \u554a\u554a\u8c8c\u4f3c\u4e3e\u4e86\u4e24\u4e2a\u4f8b\u5b50\u90fd\u4e0d\u662f\u5f88\u8981\u547d\u7684\u90a3\u79cd\uff0c\u4e00\u65f6\u627e\u4e0d\u5230\u975e\u5e38\u5178\u578b\u7684\u4f8b\u5b50\u4e86\u3002\u4e0d\u8fc7\u5047\u5982\u4ee5\u524d\u9047\u5230\u540c\u7c7b\u95ee\u9898\u7684\u8bdd\uff0c\u5e94\u8be5\u4f1a\u6709\u5370\u8c61\u5427\u3002\u4e5f\u6709\u53ef\u80fd\u6240\u6709\u7c7b\u4f3c\u95ee\u9898\u90fd\u6709\u89e3\u51b3\u529e\u6cd5\u7684\u53ea\u662f\u6211\u6709\u65f6\u56f0\u897f\u897f\u7684\u7f16\u7a0b\u6ca1\u6709\u4ed4\u7ec6\u60f3\u5427\u3002\u6b22\u8fce\u7838\u6211\uff5e<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[16,45],"class_list":["post-363","post","type-post","status-publish","format-standard","hentry","category-post","tag-16","tag-45"],"_links":{"self":[{"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts\/363","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=363"}],"version-history":[{"count":3,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts\/363\/revisions"}],"predecessor-version":[{"id":367,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/posts\/363\/revisions\/367"}],"wp:attachment":[{"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/media?parent=363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/categories?post=363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hawkwithwind.net\/blog\/wp-json\/wp\/v2\/tags?post=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}