{"id":80,"date":"2011-08-15T00:20:17","date_gmt":"2011-08-14T15:20:17","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=80"},"modified":"2011-08-15T15:15:50","modified_gmt":"2011-08-15T06:15:50","slug":"%e8%a4%87%e6%95%b0%e3%81%aetogglebutton%e8%a6%81%e7%b4%a0%e3%81%ae%e4%b8%ad%e3%81%8b%e3%82%891%e3%81%a4%e3%81%a0%e3%81%91%e3%81%97%e3%81%8b%e3%82%aa%e3%83%b3%e3%81%ab%e3%81%a7%e3%81%8d%e3%81%aa","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=80","title":{"rendered":"\u8907\u6570\u306etoggleButton\u8981\u7d20\u306e\u4e2d\u304b\u30891\u3064\u3060\u3051\u3057\u304b\u30aa\u30f3\u306b\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u3059\u308b"},"content":{"rendered":"<p>\u300c<a title=\"\u30ea\u30dc\u30f3\u306e\u30c8\u30b0\u30eb\u30dc\u30bf\u30f3\" href=\"http:\/\/www.moug.net\/faq\/viewtopic.php?t=59709\" target=\"_blank\">\u30ea\u30dc\u30f3\u306e\u30c8\u30b0\u30eb\u30dc\u30bf\u30f3<\/a>\u300d\u3067\u56de\u7b54\u3057\u305f\u30b3\u30fc\u30c9\u3067\u3059(\u4e0b\u306b\u8a18\u8f09\u3057\u3066\u3044\u308b\u30b3\u30fc\u30c9\u306f\u4e00\u90e8\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002)\u3002<\/p>\n<p>\u30ea\u30dc\u30f3\u4e0a\u306b\u8907\u6570\u306etoggleButton\u8981\u7d20\u3092\u8a2d\u5b9a\u3057\u305f\u3068\u304d\u3001\u3044\u305a\u308c\u304b\u306etoggleButton\u8981\u7d20\u3092\u9078\u629e\u3057\u305f\u3044 \u2192 1\u3064\u306etoggleButton\u8981\u7d20\u3057\u304b\u30aa\u30f3\u306b\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u3044\u3001\u3068\u3044\u3046\u5185\u5bb9\u306e\u8cea\u554f\u3067\u3057\u305f\u3002<\/p>\n<p><!--more--><br \/>\n\u3053\u306e\u51e6\u7406\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306b\u306f<span style=\"color: #ff0000;\">toggleButton\u8981\u7d20<\/span>\u306e<span style=\"color: #ff0000;\">getPressed\u5c5e\u6027<\/span>\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3068<span style=\"color: #ff0000;\">onAction\u5c5e\u6027<\/span>\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p><strong>[\u30ea\u30dc\u30f3XML]<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;customUI onLoad=&quot;tglSample_onLoad&quot; xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/2006\/01\/customui&quot;&gt;\r\n  &lt;ribbon&gt;\r\n    &lt;tabs&gt;\r\n      &lt;tab id=&quot;tabSample&quot; label=&quot;Sample Tab&quot;&gt;\r\n        &lt;group id=&quot;grpSample&quot; label=&quot;Sample Group&quot;&gt;\r\n          &lt;toggleButton id=&quot;tglSample1&quot; label=&quot;tgl1&quot; size=&quot;normal&quot; getPressed=&quot;tglSample_getPressed&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n          &lt;toggleButton id=&quot;tglSample2&quot; label=&quot;tgl2&quot; size=&quot;normal&quot; getPressed=&quot;tglSample_getPressed&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n          &lt;toggleButton id=&quot;tglSample3&quot; label=&quot;tgl3&quot; size=&quot;normal&quot; getPressed=&quot;tglSample_getPressed&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n          &lt;toggleButton id=&quot;tglSample4&quot; label=&quot;tgl4&quot; size=&quot;normal&quot; getPressed=&quot;tglSample_getPressed&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n          &lt;toggleButton id=&quot;tglSample5&quot; label=&quot;tgl5&quot; size=&quot;normal&quot; getPressed=&quot;tglSample_getPressed&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n          &lt;toggleButton id=&quot;tglSample6&quot; label=&quot;tgl6&quot; size=&quot;normal&quot; getPressed=&quot;tglSample_getPressed&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n        &lt;\/group&gt;\r\n      &lt;\/tab&gt;\r\n    &lt;\/tabs&gt;\r\n  &lt;\/ribbon&gt;\r\n&lt;\/customUI&gt;<\/pre>\n<p><strong>[\u6a19\u6e96\u30e2\u30b8\u30e5\u30fc\u30eb]<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPrivate myRibbon As IRibbonUI\r\nPrivate flgTgl As Long\r\n\r\nPrivate Sub tglSample_onLoad(ribbon As IRibbonUI)\r\n  Set myRibbon = ribbon\r\n  flgTgl = 0 '\u521d\u671f\u5316\r\nEnd Sub\r\n\r\nPrivate Sub tglSample_getPressed(control As IRibbonControl, ByRef returnedVal)\r\n  Select Case flgTgl\r\n    Case 0\r\n      returnedVal = False\r\n    Case Else\r\n      If Right$(control.ID, 1&amp;) = CStr(flgTgl) Then\r\n        returnedVal = True\r\n      Else\r\n        returnedVal = False\r\n      End If\r\n  End Select\r\nEnd Sub\r\n\r\nPrivate Sub tglSample_onAction(control As IRibbonControl, pressed As Boolean)\r\n  If pressed Then\r\n    flgTgl = CLng(Right$(control.ID, 1&amp;))\r\n    myRibbon.Invalidate\r\n  End If\r\nEnd Sub<\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u8a2d\u5b9a\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f\u3068\u3001&#8221;<strong>Sample Tab<\/strong>&#8220;\u30bf\u30d6\u3068\u305d\u306e\u4e2d\u306b6\u500b\u306etoggleButton\u8981\u7d20\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton01.jpg\" alt=\"\" title=\"Sample_toggleButton01\" width=\"392\" height=\"146\" class=\"alignnone size-full wp-image-84\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton01.jpg 392w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton01-300x111.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton01-290x108.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton01-150x55.jpg 150w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><\/p>\n<p>\u300c<span style=\"color: #ff0000;\">tgl1<\/span>\u300d\u304c\u30aa\u30f3\u306b\u306a\u3063\u3066\u3044\u308b\u72b6\u614b\u3067\u300c<span style=\"color: #ff0000;\">tgl2<\/span>\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u30aa\u30f3\u306b\u3059\u308b\u3068\u3001<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton02.jpg\" alt=\"\" title=\"Sample_toggleButton02\" width=\"392\" height=\"146\" class=\"alignnone size-full wp-image-85\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton02.jpg 392w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton02-300x111.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton02-290x108.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton02-150x55.jpg 150w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><\/p>\n<p>\u300c<span style=\"color: #ff0000;\">tgl1<\/span>\u300d\u304c\u30aa\u30d5\u300c<span style=\"color: #ff0000;\">tgl2<\/span>\u300d\u304c\u30aa\u30f3\u306b\u306a\u308a\u30011\u3064\u306etoggleButton\u8981\u7d20\u3057\u304b\u30aa\u30f3\u306b\u3067\u304d\u306a\u3044\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u300c\u30ea\u30dc\u30f3\u306e\u30c8\u30b0\u30eb\u30dc\u30bf\u30f3\u300d\u3067\u56de\u7b54\u3057\u305f\u30b3\u30fc\u30c9\u3067\u3059(\u4e0b\u306b\u8a18\u8f09\u3057\u3066\u3044\u308b\u30b3\u30fc\u30c9\u306f\u4e00\u90e8\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002)\u3002 \u30ea\u30dc\u30f3\u4e0a\u306b\u8907\u6570\u306etoggleButton\u8981\u7d20\u3092\u8a2d\u5b9a\u3057\u305f\u3068\u304d\u3001\u3044\u305a\u308c\u304b\u306etoggleButton\u8981\u7d20\u3092\u9078\u629e\u3057\u305f\u3044 \u2192 1\u3064\u306et [&hellip;]","protected":false},"author":1,"featured_media":7130,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[7,11,12],"class_list":["post-80","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ribbon","tag-ribbon-2","tag-office-2","tag-12"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Ribbon.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-1i","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/80","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=80"}],"version-history":[{"count":12,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions"}],"predecessor-version":[{"id":94,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/80\/revisions\/94"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7130"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}