File: form.mxml

package info (click to toggle)
wxwidgets3.0 3.0.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 120,464 kB
  • sloc: cpp: 896,633; makefile: 52,303; ansic: 21,971; sh: 5,713; python: 2,940; xml: 1,534; perl: 264; javascript: 33
file content (59 lines) | stat: -rw-r--r-- 1,642 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="utf-8"?> 
<!--
 Name:        form.mxml
 Purpose:     Simple form in Flash
 Author:      Vadim Zeitlin
 Created:     2009-01-13
 Copyright:   (c) 2009 Vadim Zeitlin
 Licence:     wxWindows licence

 This file can be compiled to SWF using the mxmlc free compiler from Flex SDK.

 You then can call SetText() and GetText() functions from the C++ flash sample.
 -->
<mx:Application
   xmlns:mx="http://www.adobe.com/2006/mxml"
   xmlns:adl="*"
   preinitialize="preinit();"
   horizontalAlign="left" verticalAlign="top" 
   layout="absolute"
   backgroundAlpha="1" 
   backgroundColor="0xaaaaaa"
   width="100%">
<mx:Script>
<![CDATA[
import flash.external.ExternalInterface;

private function preinit():void
{
    ExternalInterface.addCallback("SetText", DoSetText);
    ExternalInterface.addCallback("GetText", DoGetText);
}

private function DoSetText(str: String):void {
    txt.text = str;
}

private function DoGetText():String {
    return txt.text;
}

public function onok():void {
    fscommand("call_fscommand_form", "button");
}
]]>
</mx:Script>
<mx:Canvas width="100%">
    <mx:VBox width="100%">
        <mx:Form borderColor="0x0" borderStyle="solid" width="100%">
            <mx:Label text="Simple Flash Form" />
            <mx:FormItem label="Type any text here:">
                <mx:TextInput id="txt" text="Hello wxWidgets!" width="100%"/>
            </mx:FormItem>
            <mx:FormItem label="Click button to generate event">
                <mx:Button id="formbutton" label="OK" click="onok();"/>
            </mx:FormItem>
        </mx:Form>
    </mx:VBox>
</mx:Canvas>
</mx:Application>