]> git.proxmox.com Git - extjs.git/blame - extjs/build/examples/kitchensink/classic/samples/view/draw/Composite.js
import ExtJS 7.0.0 GPL
[extjs.git] / extjs / build / examples / kitchensink / classic / samples / view / draw / Composite.js
CommitLineData
947f0963
TL
1/**
2 * This example shows how to create and use composite sprites.
3 * Please see the 'Sprite' tab for details.
4 */
5Ext.define('KitchenSink.view.draw.Composite', {
6 extend: 'Ext.panel.Panel',
7 xtype: 'draw-composite',
8 controller: 'draw-composite',
9 //<example>
10 otherContent: [{
11 type: 'Controller',
12 path: 'classic/samples/view/draw/CompositeController.js'
13 }, {
14 type: 'Sprite',
15 path: 'classic/samples/view/draw/Protractor.js'
16 }],
17 //</example>
18
19 requires: [
20 'Ext.draw.Component',
21 'KitchenSink.view.draw.Protractor'
22 ],
23
24 layout: 'fit',
25 width: 650,
26 cls: 'composite-panel',
27
28 profiles: {
29 classic: {
30 buttonWidth: 200
31 },
32 neptune: {
33 buttonWidth: 200
34 },
35 graphite: {
36 buttonWidth: 300
37 },
38 'classic-material': {
39 buttonWidth: 300
40 }
41 },
42
43 tbar: ['->', {
44 xtype: 'segmentedbutton',
45 width: '${buttonWidth}',
46 items: [{
47 text: 'Interaction',
48 pressed: true
49 }, {
50 text: 'Animation'
51 }],
52 listeners: {
53 toggle: 'onToggle'
54 }
55 }],
56
57 items: {
58 xtype: 'draw',
59 reference: 'draw',
60 width: '100%',
61 height: 500,
62 sprites: [{
63 type: 'protractor',
64 id: 'protractor',
65 fromX: 325,
66 fromY: 250,
67 toX: 400,
68 toY: 150,
69 strokeStyle: 'red'
70 }],
71 listeners: {
72 element: 'el',
73 mousedown: 'onMouseDown',
74 mousemove: 'onMouseMove'
75 }
76 }
77
78});