You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
4.2 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-ButtonGroup-method-constructor'><span id='Ext-ButtonGroup'>/**
  19. </span></span> * @class Ext.ButtonGroup
  20. * @extends Ext.Panel
  21. * Container for a group of buttons. Example usage:
  22. * &lt;pre&gt;&lt;code&gt;
  23. var p = new Ext.Panel({
  24. title: 'Panel with Button Group',
  25. width: 300,
  26. height:200,
  27. renderTo: document.body,
  28. html: 'whatever',
  29. tbar: [{
  30. xtype: 'buttongroup',
  31. {@link #columns}: 3,
  32. title: 'Clipboard',
  33. items: [{
  34. text: 'Paste',
  35. scale: 'large',
  36. rowspan: 3, iconCls: 'add',
  37. iconAlign: 'top',
  38. cls: 'x-btn-as-arrow'
  39. },{
  40. xtype:'splitbutton',
  41. text: 'Menu Button',
  42. scale: 'large',
  43. rowspan: 3,
  44. iconCls: 'add',
  45. iconAlign: 'top',
  46. arrowAlign:'bottom',
  47. menu: [{text: 'Menu Item 1'}]
  48. },{
  49. xtype:'splitbutton', text: 'Cut', iconCls: 'add16', menu: [{text: 'Cut Menu Item'}]
  50. },{
  51. text: 'Copy', iconCls: 'add16'
  52. },{
  53. text: 'Format', iconCls: 'add16'
  54. }]
  55. }]
  56. });
  57. * &lt;/code&gt;&lt;/pre&gt;
  58. * @constructor
  59. * Create a new ButtonGroup.
  60. * @param {Object} config The config object
  61. * @xtype buttongroup
  62. */
  63. Ext.ButtonGroup = Ext.extend(Ext.Panel, {
  64. <span id='Ext-ButtonGroup-cfg-columns'> /**
  65. </span> * @cfg {Number} columns The &lt;tt&gt;columns&lt;/tt&gt; configuration property passed to the
  66. * {@link #layout configured layout manager}. See {@link Ext.layout.TableLayout#columns}.
  67. */
  68. <span id='Ext-ButtonGroup-cfg-baseCls'> /**
  69. </span> * @cfg {String} baseCls Defaults to &lt;tt&gt;'x-btn-group'&lt;/tt&gt;. See {@link Ext.Panel#baseCls}.
  70. */
  71. baseCls: 'x-btn-group',
  72. <span id='Ext-ButtonGroup-cfg-layout'> /**
  73. </span> * @cfg {String} layout Defaults to &lt;tt&gt;'table'&lt;/tt&gt;. See {@link Ext.Container#layout}.
  74. */
  75. layout:'table',
  76. <span id='Ext-ButtonGroup-cfg-defaultType'> defaultType: 'button',
  77. </span><span id='Ext-ButtonGroup-cfg-frame'> /**
  78. </span> * @cfg {Boolean} frame Defaults to &lt;tt&gt;true&lt;/tt&gt;. See {@link Ext.Panel#frame}.
  79. */
  80. frame: true,
  81. <span id='Ext-ButtonGroup-property-internalDefaults'> internalDefaults: {removeMode: 'container', hideParent: true},
  82. </span>
  83. <span id='Ext-ButtonGroup-method-initComponent'> initComponent : function(){
  84. </span> this.layoutConfig = this.layoutConfig || {};
  85. Ext.applyIf(this.layoutConfig, {
  86. columns : this.columns
  87. });
  88. if(!this.title){
  89. this.addClass('x-btn-group-notitle');
  90. }
  91. this.on('afterlayout', this.onAfterLayout, this);
  92. Ext.ButtonGroup.superclass.initComponent.call(this);
  93. },
  94. <span id='Ext-ButtonGroup-method-applyDefaults'> applyDefaults : function(c){
  95. </span> c = Ext.ButtonGroup.superclass.applyDefaults.call(this, c);
  96. var d = this.internalDefaults;
  97. if(c.events){
  98. Ext.applyIf(c.initialConfig, d);
  99. Ext.apply(c, d);
  100. }else{
  101. Ext.applyIf(c, d);
  102. }
  103. return c;
  104. },
  105. <span id='Ext-ButtonGroup-method-onAfterLayout'> onAfterLayout : function(){
  106. </span> var bodyWidth = this.body.getFrameWidth('lr') + this.body.dom.firstChild.offsetWidth;
  107. this.body.setWidth(bodyWidth);
  108. this.el.setWidth(bodyWidth + this.getFrameWidth());
  109. }
  110. <span id='Ext-ButtonGroup-cfg-tools'> /**
  111. </span> * @cfg {Array} tools @hide
  112. */
  113. });
  114. Ext.reg('buttongroup', Ext.ButtonGroup);
  115. </pre>
  116. </body>
  117. </html>