]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * This example shows how to draw doodles of different sizes and colors.\r | |
3 | */\r | |
4 | Ext.define('KitchenSink.view.draw.FreeDraw', {\r | |
5 | extend: 'Ext.panel.Panel',\r | |
6 | xtype: 'free-paint',\r | |
7 | \r | |
8 | requires: [\r | |
9 | 'Ext.draw.Component',\r | |
10 | 'KitchenSink.view.FreeDrawComponent'\r | |
11 | ],\r | |
12 | \r | |
13 | layout: 'anchor',\r | |
14 | width: 650,\r | |
15 | \r | |
16 | // <example>\r | |
17 | // Content between example tags is omitted from code preview.\r | |
18 | otherContent: [{\r | |
19 | type: 'Component',\r | |
20 | path: 'classic/samples/view/draw/FreeDrawComponent.js'\r | |
21 | }],\r | |
22 | // </example>\r | |
23 | \r | |
24 | lastEvent: 0,\r | |
25 | \r | |
26 | tbar: ['->', {\r | |
27 | text: 'Clear',\r | |
28 | handler: function(event, toolEl, panelHeader) {\r | |
29 | // Remove all the sprites and redraw\r | |
30 | var draw = Ext.getCmp('free-paint');\r | |
31 | draw.getSurface().removeAll(true);\r | |
32 | draw.renderFrame();\r | |
33 | }\r | |
34 | }],\r | |
35 | \r | |
36 | items: [{\r | |
37 | xtype: 'free-paint-component',\r | |
38 | id: 'free-paint',\r | |
39 | anchor: '100%',\r | |
40 | height: 500\r | |
41 | }],\r | |
42 | \r | |
43 | onAdded: function(container, pos, instanced) { \r | |
44 | this.callParent([container, pos, instanced]); \r | |
45 | container.setScrollable(false);\r | |
46 | },\r | |
47 | \r | |
48 | onRemoved: function(destroying) {\r | |
49 | this.ownerCt.setScrollable(true);\r | |
50 | this.callParent([destroying]);\r | |
51 | }\r | |
52 | \r | |
53 | });\r |