File: cs_245.html

package info (click to toggle)
crystalspace 0.94-20020412-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 62,276 kB
  • ctags: 52,843
  • sloc: cpp: 274,783; ansic: 6,608; perl: 6,276; objc: 3,952; asm: 2,942; python: 2,354; php: 542; pascal: 530; sh: 430; makefile: 370; awk: 193
file content (192 lines) | stat: -rw-r--r-- 7,491 bytes parent folder | download
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created by texi2html 1.64 -->
<!-- 
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
 
-->
<HTML>
<HEAD>
<TITLE>Crystal Space: AWS QT Designer and AWS</TITLE>

<META NAME="description" CONTENT="Crystal Space: AWS QT Designer and AWS">
<META NAME="keywords" CONTENT="Crystal Space: AWS QT Designer and AWS">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META NAME="Generator" CONTENT="texi2html 1.64">

</HEAD>

<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">

<A NAME="SEC605"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_244.html#SEC603"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_246.html#SEC610"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_226.html#SEC559"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_228.html#SEC561"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_246.html#SEC610"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<HR SIZE=1>
<H3> 7.12.7 Using QT Designer To Create AWS Definition Files </H3>
<!--docid::SEC605::-->
<P>

On many platforms Trolltechs Designer is available, a tool that lets you create graphical user interfaces like
Dialogs, Forms etc. It saves the interface description in an easy to read format (XML -  even though i was not 
able to locate a formal document type description (DTD) for it, it's format is pretty obvious).
</P><P>

You should be aware that not all features the Designer is capable of can be translated into AWS simply because
they are not available in AWS. The same is true for features available in AWS but not in Designer.
</P><P>

<A NAME="SEC606"></A>
<H4> What you need </H4>
<!--docid::SEC606::-->
<P>

Since Designer saves its interface description in XML writing an extensible stylesheet to transform it into AWS format
was an obvious choice. So you will need a XSLT stylesheet processor. You can either choose a commercial product or
the excellent Xalan which is part of the Apache project. You can get it for free here:
<A HREF="http://xml.apache.org">http://xml.apache.org</A>
For development i used the Xalan Java 2 version at: <A HREF="http://xml.apache.org/xalan-j/index.html">http://xml.apache.org/xalan-j/index.html</A>
</P><P>

<A NAME="SEC607"></A>
<H4> How to use it </H4>
<!--docid::SEC607::-->
<P>

Design your dialog or widget in Designer and save it somewhere.
To process the stylesheet with the java version of Xalan you call:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>java org.apache.xalan.xslt.Process \
    -IN path/to/the/saved/designer/file.ui \
    -XSL path/to/CS/scripts/aws/qt2aws.xsl
</pre></td></tr></table></P><P>

Append the output to a file containing skin definitions.
</P><P>

<A NAME="SEC608"></A>
<H4> What controls are converted ? </H4>
<!--docid::SEC608::-->
<P>

<TABLE>
<TR><TD><STRONG>QT Class</STRONG> </TD><TD> </TD><TD> <STRONG>AWS Class</STRONG></TD>
</TR>
<TR><TD>QPushButton </TD><TD> ==&#62; </TD><TD> Command Button</TD>
</TR>
<TR><TD>QRadioButton </TD><TD> ==&#62; </TD><TD> Radio Button</TD>
</TR>
<TR><TD>QSlider </TD><TD> ==&#62; </TD><TD> Scroll Bar</TD>
</TR>
<TR><TD>QButtonGroup </TD><TD> ==&#62; </TD><TD> Group Frame</TD>
</TR>
<TR><TD>QGroupBox </TD><TD> ==&#62; </TD><TD> Group Frame</TD>
</TR>
<TR><TD>QFrame </TD><TD> ==&#62; </TD><TD> Group Frame</TD>
</TR>
<TR><TD>QCheckBox </TD><TD> ==&#62; </TD><TD> Check Box</TD>
</TR>
<TR><TD>QLineEdit </TD><TD> ==&#62; </TD><TD> Text Box</TD>
</TR>
<TR><TD>QLabel </TD><TD> ==&#62; </TD><TD> Label</TD>
</TR>
<TR><TD>QLabel with Pixmap </TD><TD> ==&#62; </TD><TD> Image View</TD>
</TR>
<TR><TD>QListBox </TD><TD> ==&#62; </TD><TD> List Box</TD>
</TR>
<TR><TD>QListView </TD><TD> ==&#62; </TD><TD> List Box</TD>
</TR>
<TR><TD>QDialog </TD><TD> ==&#62; </TD><TD> Window</TD>
</TR>
<TR><TD>QWidget </TD><TD> ==&#62; </TD><TD> Window</TD>
</TR>
<TR><TD>QTabWidget </TD><TD> ==&#62; </TD><TD> Notebook</TD>
</TR></TABLE>
<P>

<A NAME="SEC609"></A>
<H4> Special Notes </H4>
<!--docid::SEC609::-->
<P>

You can place special information in the controls <STRONG>whatsThis</STRONG> property. The content will be broken into tokens
separated by the pipe ("|"). A token consist of a token identifier, the colon : and token text.
The following tokens are recognized:
</P><P>

<UL>
<LI>connect token
<UL>
<LI>token identifier: c
<LI>token text: a list of comma separated items
<LI>example:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>c:signalClicked,mySink::OnClick,signalBreak,mySink::ByeBye
</pre></td></tr></table><P>

This will be translated into
</P><P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>connect 
{
  signalClicked -&#62; mySink::OnClick  
  signalBreak -&#62; mySink::ByeBye
}
</pre></td></tr></table></UL>
<P>

<LI>literal token
<UL>
<LI>token identifier: l
<LI>token text: some text
<LI>example:
<TABLE><tr><td>&nbsp;</td><td class=example><pre>l:LeftEye: "Blue"
</pre></td></tr></table><P>

This will be translated into
</P><P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>LeftEye: "Blue"
</pre></td></tr></table></UL>
</UL>
<P>

Both examples from above would be concatenated and placed in the
<STRONG>whatsThis</STRONG> property and would look like this:
</P><P>

<TABLE><tr><td>&nbsp;</td><td class=example><pre>c:signalClicked,mySink::OnClick,signalBreak,
    mySink::ByeBye|l:LeftEye: "Blue"
</pre></td></tr></table><A NAME="Internals"></A>
<HR SIZE=1>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_244.html#SEC603"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_246.html#SEC610"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_226.html#SEC559"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_228.html#SEC561"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_246.html#SEC610"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="index.html#SEC_Top">Top</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_toc.html#SEC_Contents">Contents</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_285.html#SEC711">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="cs_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<BR>  
<FONT SIZE="-1">
This document was generated

using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>

</BODY>
</HTML>