3 This file is part of Ext JS 4
5 Copyright (c) 2011 Sencha Inc
7 Contact: http://www.sencha.com/contact
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
15 Ext.require('Ext.button.*');
16 Ext.onReady(function() {
17 var genericConfig = [{
27 _name : 'Icon and Text (left)',
31 _name : 'Icon and Text (top)',
35 _name : 'Icon and Text (right)',
39 _name : 'Icon and Text (bottom)',
53 function renderButtons(title, configs, defaultConfig) {
54 Ext.getBody().createChild({
59 Ext.each(configs, function(config) {
60 var generateButtons = function(config) {
61 //Ext.each(['gray', 'darkgray', 'blue', 'darkblue', 'red', 'green'], function(color) {
62 Ext.each(['default'], function(color) {
63 Ext.createWidget(defaultConfig.defaultType || 'button', Ext.apply({
67 }, config, defaultConfig));
69 Ext.createWidget(defaultConfig.defaultType || 'button', Ext.apply({
73 }, config, defaultConfig));
75 Ext.createWidget(defaultConfig.defaultType || 'button', Ext.apply({
79 }, config, defaultConfig));
83 Ext.getBody().createChild({
88 var el = Ext.getBody().createChild({});
90 if (config.children) {
91 Ext.each(config.children, function(child) {
102 generateButtons(Ext.apply(config, {
109 renderButtons('Normal Buttons', genericConfig, {
113 renderButtons('Toggle Buttons', genericConfig, {
118 renderButtons('Menu Buttons', genericConfig, {
123 renderButtons('Split Buttons', genericConfig, {
125 defaultType: 'splitbutton',
129 renderButtons('Menu Buttons (Arrow on bottom)', genericConfig, {
135 renderButtons('Split Buttons (Arrow on bottom)', genericConfig, {
137 defaultType: 'splitbutton',