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