1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation (qt-info@nokia.com)
|
---|
6 | **
|
---|
7 | ** This file is part of the documentation of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:FDL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in a
|
---|
14 | ** written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Free Documentation License
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Free
|
---|
18 | ** Documentation License version 1.3 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file included in the packaging of this
|
---|
20 | ** file.
|
---|
21 | **
|
---|
22 | ** If you have questions regarding the use of this file, please contact
|
---|
23 | ** Nokia at qt-info@nokia.com.
|
---|
24 | ** $QT_END_LICENSE$
|
---|
25 | **
|
---|
26 | ****************************************************************************/
|
---|
27 |
|
---|
28 | /*!
|
---|
29 | \page qaxserver-demo-simple.html
|
---|
30 |
|
---|
31 | \title A standard ActiveX and the "simple" ActiveQt widget
|
---|
32 |
|
---|
33 | \raw HTML
|
---|
34 | <object ID="QSimpleAX" CLASSID="CLSID:DF16845C-92CD-4AAB-A982-EB9840E74669"
|
---|
35 | CODEBASE="http://qt.nokia.com/demos/simpleax.cab">
|
---|
36 | <PARAM NAME="text" VALUE="A simple control" />
|
---|
37 | <PARAM NAME="value" VALUE="1" />
|
---|
38 | [Object not available! Did you forget to build and register the server?]
|
---|
39 | </object>
|
---|
40 |
|
---|
41 | <FORM>
|
---|
42 | <INPUT TYPE="BUTTON" VALUE="About..." onClick="QSimpleAX.about()" />
|
---|
43 | </FORM>
|
---|
44 |
|
---|
45 | <object ID="Calendar" CLASSID="CLSID:8E27C92B-1264-101C-8A2F-040224009C02">
|
---|
46 | [Standard Calendar control not available!]
|
---|
47 | <PARAM NAME="day" VALUE="1" />
|
---|
48 | </object>
|
---|
49 |
|
---|
50 | <FORM>
|
---|
51 | <INPUT TYPE="BUTTON" VALUE="Today" onClick="Calendar.Today()" />
|
---|
52 | </FORM>
|
---|
53 |
|
---|
54 | <SCRIPT LANGUAGE="VBScript">
|
---|
55 | Sub Calendar_Click()
|
---|
56 | MsgBox( "Calendar Clicked!" )
|
---|
57 | End Sub
|
---|
58 |
|
---|
59 | Sub QSimpleAX_TextChanged( str )
|
---|
60 | document.title = str
|
---|
61 | End Sub
|
---|
62 | </SCRIPT>
|
---|
63 |
|
---|
64 | <SCRIPT LANGUAGE="JavaScript">
|
---|
65 | function QSimpleAX::ValueChanged( Newvalue )
|
---|
66 | {
|
---|
67 | Calendar.Day = Newvalue;
|
---|
68 | }
|
---|
69 | </SCRIPT>
|
---|
70 | \endraw
|
---|
71 | */
|
---|
72 |
|
---|
73 | /*!
|
---|
74 | \example activeqt/simple
|
---|
75 | \title Simple Example (ActiveQt)
|
---|
76 |
|
---|
77 | The Simple example demonstrates the use of
|
---|
78 | QAxBindable::requestPropertyChange() and
|
---|
79 | QAxBindable::propertyChanged(), and the use of the default
|
---|
80 | QAxFactory through the \c QAXFACTORY_DEFAULT() macro.
|
---|
81 |
|
---|
82 | The ActiveX control in this example is a laid out QWidget with a
|
---|
83 | QSlider, a QLCDNumber and a QLineEdit. It provides a
|
---|
84 | signal/slot/property interface to change the values of the slider
|
---|
85 | and the line edit, and to get notified of any property changes.
|
---|
86 |
|
---|
87 |
|
---|
88 | The Qt implementation of the ActiveX for this example is
|
---|
89 | \snippet examples/activeqt/simple/main.cpp 0
|
---|
90 |
|
---|
91 | The control is exported using the default QAxFactory
|
---|
92 | \snippet examples/activeqt/simple/main.cpp 1
|
---|
93 |
|
---|
94 | To build the example you must first build the QAxServer library.
|
---|
95 | Then run qmake and your make tool in \c examples/activeqt/simple.
|
---|
96 |
|
---|
97 | The \l{qaxserver-demo-simple.html}{demonstration} requires your
|
---|
98 | WebBrowser to support ActiveX controls, and scripting to be enabled.
|
---|
99 |
|
---|
100 | The simple ActiveX control is embedded using the \c <object> tag.
|
---|
101 |
|
---|
102 | \snippet doc/src/examples/activeqt/simple-demo.qdocinc 0
|
---|
103 |
|
---|
104 | A simple HTML button is connected to the ActiveQt's about() slot.
|
---|
105 |
|
---|
106 | \snippet doc/src/examples/activeqt/simple-demo.qdocinc 1
|
---|
107 |
|
---|
108 | A second ActiveX control - the standard Calendar Control - is instantiated
|
---|
109 |
|
---|
110 | \snippet doc/src/examples/activeqt/simple-demo.qdocinc 2
|
---|
111 |
|
---|
112 | Events from the ActiveX controls are handled using both Visual Basic Script
|
---|
113 | and JavaScript.
|
---|
114 |
|
---|
115 | \snippet doc/src/examples/activeqt/simple-demo.qdocinc 3
|
---|
116 | */
|
---|