[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
On many platforms TrollTech's 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).
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.
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:
For development, I used the Xalan Java 2 version at:
http://xml.apache.org/xalan-j/index.html
Design your dialog or widget in Designer and save it somewhere. To process the stylesheet with the Java version of Xalan you invoke:
java org.apache.xalan.xslt.Process \ -IN path/to/the/saved/designer/file.ui \ -XSL path/to/CS/scripts/aws/qt2aws.xsl |
If you use Designer 1.1 (that comes with QT2), use the style sheet `qt2aws.xsl'. The new Designer version 2.0 (which comes with QT3) changed its `.ui' DTD slightly. In case you use Designer2.0 specify `qt3aws.xsl'.
Append the output to a file containing skin definitions.
QT Class | AWS Class | |
QPushButton | => | Command Button |
QRadioButton | => | Radio Button |
QSlider | => | Scroll Bar |
QButtonGroup | => | Group Frame |
QGroupBox | => | Group Frame |
QFrame | => | Group Frame |
QCheckBox | => | Check Box |
QLineEdit | => | Text Box |
QTextView | => | Multiline Edit |
QLabel | => | Label |
QLabel with Pixmap | => | Image View |
QListBox | => | List Box |
QListView | => | List Box |
QDialog | => | Window |
QWidget | => | Window |
QTabWidget | => | Notebook |
You can place special information in the control's `whatsThis' property. The content will be broken into tokens separated by the pipe (`|') character or vertical bar. A token consist of a token identifier, a colon `:' and token text. The following tokens are recognized:
c:signalClicked,mySink::OnClick,signalBreak,mySink::ByeBye |
This will be translated into
connect { signalClicked -> mySink::OnClick signalBreak -> mySink::ByeBye } |
l:LeftEye: "Blue" |
This will be translated into
LeftEye: "Blue" |
Both examples from above would be concatenated and placed in the `whatsThis' property, and would look like this:
c:signalClicked,mySink::OnClick,signalBreak, mySink::ByeBye|l:LeftEye: "Blue" |
If you coded your own AWS control you can still use QT to layout the control (at least the common parameters like size and position). For this to work simply choose one of the supported controls and use it as a placeholder. Additionally you use the token identifier `t' in the `whatsThis' property of that control to name your control class.
As an example, I have created my own push button control. The name of the control class is `awsMyFancyPushButtonControl'. Since it uses all the properties of the standard AWS command button, I cleverly use `QPushButton' as my placeholder and set all the properties I need and which `QPushButton' already offers, such size, position, button text and others. Additionally I set the `t' token identifier in property `whatsThis' to `awsMyFancyPushButtonControl'.
t:awsMyFancyPushButtonControl |
This will be translated into
component "hitmehard" is "awsMyFancyPushButtonControl" { Frame: (10,330) - (121,350) Caption: "update" } |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated using texi2html 1.76.