{"id":95,"date":"2011-08-15T23:46:52","date_gmt":"2011-08-15T14:46:52","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=95"},"modified":"2011-08-16T00:00:21","modified_gmt":"2011-08-15T15:00:21","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-2","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=95","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(2)"},"content":{"rendered":"<p>\u300c<a title=\"\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\" href=\"\/\/www.ka-net.org\/blog\/?p=80\" target=\"_blank\">\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<\/a>\u300d\u306e\u95a2\u9023\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n<p>\u524d\u56de\u306f<span style=\"color: #ff0000;\">toggleButton\u8981\u7d20<\/span>\u306e<span style=\"color: #ff0000;\">getPressed\u5c5e\u6027<\/span>\u3092\u4f7f\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306f<span style=\"color: #ff0000;\">getEnabled\u5c5e\u6027<\/span>\u3092\u4f7f\u3063\u3066\u6709\u52b9\u30fb\u7121\u52b9\u3092\u5207\u308a\u66ff\u3048\u3066\u307f\u307e\u3059\u3002<br \/>\n<!--more--><br \/>\n<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; getEnabled=&quot;tglSample_getEnabled&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n          &lt;toggleButton id=&quot;tglSample2&quot; label=&quot;tgl2&quot; size=&quot;normal&quot; getEnabled=&quot;tglSample_getEnabled&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n          &lt;toggleButton id=&quot;tglSample3&quot; label=&quot;tgl3&quot; size=&quot;normal&quot; getEnabled=&quot;tglSample_getEnabled&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n          &lt;toggleButton id=&quot;tglSample4&quot; label=&quot;tgl4&quot; size=&quot;normal&quot; getEnabled=&quot;tglSample_getEnabled&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n          &lt;toggleButton id=&quot;tglSample5&quot; label=&quot;tgl5&quot; size=&quot;normal&quot; getEnabled=&quot;tglSample_getEnabled&quot; onAction=&quot;tglSample_onAction&quot; \/&gt;\r\n          &lt;toggleButton id=&quot;tglSample6&quot; label=&quot;tgl6&quot; size=&quot;normal&quot; getEnabled=&quot;tglSample_getEnabled&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_getEnabled(control As IRibbonControl, ByRef returnedVal)\r\n  Select Case flgTgl\r\n    Case 0\r\n      returnedVal = True\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  Else\r\n    flgTgl = 0\r\n  End If\r\n  myRibbon.Invalidate\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\u201d<strong>Sample Tab<\/strong>\u201c\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_toggleButton2_01.jpg\" alt=\"\" title=\"Sample_toggleButton2_01\" width=\"300\" height=\"145\" class=\"alignnone size-full wp-image-97\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton2_01.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton2_01-290x140.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton2_01-150x72.jpg 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u300c<span style=\"color: #ff0000;\">tgl5<\/span>\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton2_02.jpg\" alt=\"\" title=\"Sample_toggleButton2_02\" width=\"300\" height=\"145\" class=\"alignnone size-full wp-image-98\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton2_02.jpg 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton2_02-290x140.jpg 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/Sample_toggleButton2_02-150x72.jpg 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u300c<span style=\"color: #ff0000;\">tgl5<\/span>\u300d\u4ee5\u5916\u306etoggleButton\u8981\u7d20\u304c\u7121\u52b9\u306b\u306a\u308a\u3001\u3082\u3046\u4e00\u5ea6tgl5\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u30aa\u30d5\u306b\u3059\u308b\u3068\u3001\u3059\u3079\u3066\u306etoggleButton\u8981\u7d20\u304c\u6709\u52b9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u300c\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\u300d\u306e\u95a2\u9023\u8a18\u4e8b\u3067\u3059\u3002 \u524d\u56de\u306ftoggleButton\u8981\u7d20\u306egetPressed\u5c5e\u6027\u3092\u4f7f\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306fgetEnabled\u5c5e\u6027\u3092\u4f7f\u3063\u3066\u6709\u52b9\u30fb [&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":[11,12,7],"class_list":["post-95","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ribbon","tag-office-2","tag-12","tag-ribbon-2"],"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-1x","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/95","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=95"}],"version-history":[{"count":8,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/95\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/95\/revisions\/105"}],"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=95"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=95"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=95"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}