Example 1: An “About” Dialog Box
The first sample XML resource file creates an “About MyApp” dialog:
<?xml version="1.0" ?>
<Dialog name="aboutDialog" title="About MyApp"
height="150" width="400" layout="vertical">
<ComponentContainer layout="vertical" alignment="center">
<Static name="credit"
title="Brought to you by the Information Technology group"
themeClass="csLblFnt csThmClr csAbtTxt" />
<!-- Add a 10px space in between two Static components -->
<Spacer />
<Static name="company"
title="Copyright 2003 Your company name here."
themeClass="clsIbar" />
<Spacer />
</ComponentContainer>
<!-- Add another ComponentContainer to have the button aligned in
the center -->
<ComponentContainer layout="horizontal" alignment="center">
<!--If button text is less than 7-8 characters, add width="70" -->
<Button name="ok" title="OK" />
</ComponentContainer>
<!-- Add 10px margin from bottom -->
<Spacer />
</Dialog>
Example 2: A Confirmation Dialog Box
The second sample XML resource file creates a confirmation dialog:
The XML code that produces the above dialog is as follows
<?xml version="1.0" ?>
<Dialog name="myDialog" title="Confirmation" modal="true"
height="140" width="400" layout="vertical">
<!-- Add 10px margin from top -->
<Spacer />
<!-- Need a horizontal layout in the main area in order to add 20px
margin on each side -->
<ComponentContainer layout="horizontal">
<!-- Add 20px margin on left side -->
<Spacer width="20" />
<!-- CONTENT AREA-->
<StaticImage ImageURL="/SalesApp/Images/logo.gif" />
<Spacer width="10" />
<Static name="credit"
title="Do you want to apply the change?"
themeClass="csLblFnt csThmClr csAbtTxt" />
<!-- Add 20px margin on right side -->
<Spacer width="20" />
</ComponentContainer>
<!-- Add 10px margin between content area and buttons -->
<Spacer />
<ComponentContainer name="buttonContainer" layout="horizontal"
alignment="right">
<!--If button text is less than 7-8 characters, add width="70" -->
<Button name="ok" title="Yes" width="70" />
<!-- Add 5px margin between buttons -->
<Spacer width="5" />
<Button name="cancel" title="Cancel" width="70" />
<!-- Add 20px margin on right side, matching main content area -->
<!-- Only put this in if there is equivalent or greater margin on the
left already -->
<Spacer width="20" />
</ComponentContainer>
<!-- Add 10px margin from bottom -->
<Spacer />
</Dialog>