Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
Team Developer 6
New Controls Demonstration
Unify Corporation
Table of Contents
Introduction .................................................................................................... 3
Requirements .................................................................................................. 3
Creating a Microsoft Outlook Look and Feel Application .............................. 4
Team Developer 6 NEW Controls .................................................................... 4
Tree ...................................................................................................................................................... 4 Navigation Bar ..................................................................................................................................... 5 Tab Control .......................................................................................................................................... 6 SalMail Class ....................................................................................................................................... 6 WPF Custom Control .......................................................................................................................... 6
Application Demonstration ............................................................................. 7
Creating a Split Window ..................................................................................................................... 8 Implementing a Tree Control............................................................................................................... 9 Implementing a Navigation Bar......................................................................................................... 10 Implementing a Tab Control .............................................................................................................. 11 Implementing the SalMail Class ........................................................................................................ 13
Receiving emails using POP3 protocol ........................................................................................ 13 Sending emails using SMTP protocol ........................................................................................... 14
Implementing WPF Custom Control ................................................................................................. 15
About Unify ................................................................................................... 17
Introduction
This document illustrates the implementation of the new controls introduced
in Team Developer 6 to create an application that looks and feels like
Microsoft Outlook.
Note: You will find the demonstration application used in this document
under the following directory:
C:\...\Unify\Team Developer 6.0\Samples\60Demos\Demo1\
Requirements
The application used in this document requires that you have:
…installed Team Developer 6 samples;
…access to the SQLBase ISLAND database.
Creating a Microsoft Outlook Look and Feel Application
Creating an application that looks and feels like Microsoft Outlook has never
been as easy as it is with Team Developer 6.
In Team Developer 6 you will find all the pieces you will need to build sleek
looking interfaces.
Team Developer 6 NEW Controls
Team Developer 6 introduces the following new controls:
Tree
A Tree control is a rich and compact way of
representing hierarchical data. It allows end-users
to navigate and interact with data.
Each element in a Tree is called a Tree Item. De-
pending on the nature of the data that you might
want to represent, tree items can be static or dy-
namically created –the application used in this
document builds a Tree control based on the result
set of two SQL SELECT statements.
To implement this control, create a top level win-
dow and look for the “Tree Control” icon ( ) in
your Controls screen; click on this icon and draw it
on the window of your selection.
Team Developer 6 provides a new set of
SalTree* functions that have been properly docu-
mented to ensure that you gain the flexibility and
control that you will need to manipulate this object
in any way –for details about Tree Control new
API please refer to Team Developer 6 Help and
type the keyword: SalTree…
5
Navigation Bar
The Navigation Bar is a container
used primarily to control the
navigation within your programs.
To understand how a Navigation Bar
behaves it is important for you to be
aware that within a Navigation Bar
you might find one or more
Navigation Panes and Groups .
Each of these Navigation Panes and
Groups will help you get the screen
layout you look for.
To implement this control create a
top level window and look for the
“Navigation Bar” icon ( ) in your
Controls screen; click on this icon
and draw it on the window of your
selection.
Team Developer 6 offers a vast num-
ber of SalNav* functions that you are
able to use to manipulate this control
–for details on Navigation Bar new
API please refer to Team Developer
6 Help and type the keyword: Sal-
Nav…
6
Tab Control
The Tab Control in Team De-
veloper 6 is a brand new object
that behaves pretty much like
what you are accustomed to
with QuickTabs in previous ver-
sions of Team Developer.
If you have QuickTabs applica-
tion and you want to convert
them to use Team Developer 6
new Tab Control, you can use
the “Quick Tab Migration Wi-
zard” that comes with Team
Developer 6.
With this Tab Control you are
able to associate child object by
simply selecting a Tab Page and
then dropping any object in it.
To implement this control create a top level window and look for the “Tab
Bar” icon ( ) in your Controls screen; click on this icon and draw it on
the window of your selection. If you want to add a new Tab Page to this
control, please look for the “Tab Page” icon ( ) in you Controls screen;
click on this icon and then drop the Tab Page on the Tab Control.
Team Developer 6 offers a new set of SalTab* functions that you are able
to use to manipulate this control –for details on Tab Control API please
refer to Team Developer 6 Help and type the keyword: SalTab…
SalMail Class
Team Developer 6 introduces a new class to its repertory of classes called
SalMail. This class solves the need for an application to both: send and re-
ceive emails.
The application used in this document illustrates a SalMail example using a
Gmail mailbox: [email protected].
WPF Custom Control
With Team Developer 6 you are able to incorporate attractive WPF Controls
into your .NET applications. WPF Controls offer high visual attractiveness
and unmatched usability.
7
The application used for the purpose of this document illustrates the imple-
mentation of a WPF Control: Microsoft .NET WebBrowser.
You will find a more advanced WPF Control example in:
C:\...\Unify\Team Developer 6.0\Samples\60Demos\Demo2.
Application Demonstration
Once you have installed Team Developer 6 Samples look for the following folder location:
C:\...\Unify\Team Developer 6.0\Samples\60Demos\Demo1
Inside this folder you will find two *.APP files:
a. Win32DemoApp.app In this file you will find an implementation of the Navigation Bar, Tree Control and
SalMail Class for a Win32 application.
8
b. WPFDemoApp.app In this file you will find an implementation of the Navigation Bar, Tree Control,
SalMail Class and the WPF Control.
Creating a Split Window
To create a Split Window you will need: an MDI Window, a Form Window
one (or two) Modeless Dialogs and the use of a combination of SalCreate-
Window( ) and SalDlgSetDockStatus( ) calls.
The application used in this document illustrates a simple method to create a
Split Window –the following screenshot illustrates the method used for this
demonstration:
9
Implementing a Tree Control
Creating a Tree Control is an easy
task in Team Developer 6. It is a
matter of simply selecting the
“Tree Control” icon ( ) from the
Controls window and then drop-
ping the object into a top-level
window of your selection.
Filling the content of a Tree Con-
trols can be achieved manually or
dynamically –the application used
in this document illustrates the
dynamic method.
As we mention earlier in this doc-
ument each element of a Tree
Control is called a Tree Item. All
Tree Items depend from a main
element called Root. To obtain
the Root handle of a Tree Element
use the following call:
Set hRoot = SalTreeGetFirstItem( treeDemo, 0 )
…the returned value for hRoot will be the one that belongs to the Root ele-
ment.
You can show or hide the Root element from a Tree Control by changing the
“Show Root” attribute from the Attribute Inspector window to “Yer” or
“No”.
The following code illustrates how the Tree Control implemented in dlgLeft
was populated based on the SQL Result Set of two SQL SELECT statements.
10
Implementing a Navigation Bar
Navigation Bar controls can be dropped on form windows and dialogs only.
Across the application used in this document you will find multiple imple-
mentations of this control. The Navigation Bar is, if not the most, one of the
most representative controls to achieve the look and feel of a Microsoft Out-
look application.
Creating a Navigation Bar is just a matter of selecting this object from the
Team Developer 6 Controls window and then dropping it into a form window
or dialog of your selection.
The following screenshots illustrates how a Navigation Bar is implemented
and how its child objects get associated to each Navigation Pane –for details
about these screenshots please refer to the dlgLeft dialog.
11
Implementing a Tab Control
If you are familiar with cQuickTabs you will have no trouble to get use to
Team Developer 6 new Tab Control. Existing applications that currently use
cQuickTabs can be converted to Tab Controls by using Team Developer 6
Quick Tabs Migration Wizard.
Creating a Tab Control is as easy as creating any other Team Developer con-
trol. Just click on the “Tab Bar” icon ( ) in the Controls window and drop
the object on a top-level window.
Tab Page controls can be added to an existing Tab Control by clicking on the
“Tab Page” icon ( ) and then dropping them in it. Adding child objects to a
Tab Page can also be achieved by directly dropping these objects on them or
by editing the outline.
Tab Page controls can be dynamically created by using the
SalTabAddPage( ) function –If you like to see an example of this procedure
please look at the code below the frmContacts.PAM_SetLayout:
12
13
Implementing the SalMail Class
In order to properly implement the SalMail Class you will have to create two
instances of it: one to send emails using SMTP protocol and another to re-
ceive email using POP3 protocol –If you look at the Variable Declaration for
gridEmail you will find oSMTP and oPOP3, each of them represent an in-
stance of the new SalMail Class.
Receiving emails using POP3 protocol
1. Define User and Mail Server settings as follows:
Call oPOP3.SetUser( sUserName, sPassword )
Call oPOP3.SetMailServer( sServerName, nPort, bSSL1, bSend
2)
2. Connect to your Mail Server. To connect to your Mail Server use the fol-lowing call:
Set nPOP3Connect = oPOP3.Connect( )
If the function succeeds nPOP3Connect will always be zero (0) –for a list
of the different return values for SalMail.Connect( ) function please look
at Team Developer 6 Help and type the keyword: “Connect - SalMail Me-
thod”.
1 bSSL will be TRUE if the Mail Server requires an SSL connection, otherwise se it to FALSE.
2 bSend will always be FALSE when using SalMail Class instance to receive emails.
14
3. Retrieve envelope(s) information as follows:
Set nPOP3ReturnGetEnvelopes = oPOP3.GetEnvelopes( bPOP3First,
nPOP3Count, a_nPOP3MessageIDs, a_sPOP3DatesReceived,
a_sPOP3Subjects, a_sPOP3Originators )
If SalMail.GetEnvelopes( ) succeeds (this will happen when it’s return is
zero) run through the following arrays: a_nPOP3MessageIDs,
a_sPOP3DatesReceived, a_sPOP3Subjects and a_sPOP3Originators.
If you want to retrieve email body use: SalMail.GetMail( ) or Sal-
Mail.GetNextEmail( ) respectively.
4. Once you finish downloading all your emails proceed to disconnect from the Mail Server as follows:
Set nPOP3ReturnDisconnect = oPOP3.Disconnect( )
If SalMail.Disconnect( ) function succeeds the function will return zero
(0).
The code under gridEmail.PAM_Get illustrates how to receive emails and
then store then inside a database table.
Sending emails using SMTP protocol
1. Define User and Mail Server settings as follows:
Call oSMTP.SetUser( sUserName, sPassword )
Call oSMTP.SetMailServer(sServerName, nPort, bSSL3, bSend
4)
2. Connect to your Mail Server. To connect to your Mail Server use the fol-lowing call:
Set nreturnConnect = oSMTP.Connect( )
If the function succeeds nreturnConnect will always be zero (0) –for a list
of the different return values for SalMail.Connect( ) function please look
at Team Developer 6 Help and type the keyword: “Connect - SalMail
Method”.
3 bSSL will be TRUE if the Mail Server requires an SSL connection, otherwise se it to FALSE.
4 bSend will always be TRUE when using SalMail Class instance to send emails.
15
3. Invoke SalMail.SendMail( ) function to deliver a email:
Set nreturnSendMail = oSMTP.SendMail( nMailFormat, dfSubject,
dfFrom, dfTo, dfCc, mlEmailContent, sAttachments, bDeliveryRecipient,
nMailPriority )
sAttachments. This is a list of fully qualified file. If you want to attach
more than one file use a semicolon to separate each file.
For a full description of the SalMail.SendMail( ) function please use
Team Developer 6 Help and type the keyword “SendMail - SalMail Me-
thod”.
4. Once you have finished sending an email proceed to disconnect from the Mail Server as follows:
Call oSMTP.Disconnect( )
In case you want to get a better sense of how to implement Team Devel-
oper 6 SalMail Class to send emails please refer to the application used in
this document and look the code under dlgEmailSend.pbSend.SAM_Click
you will find everything you will need to implement this functionality
yourself.
Implementing WPF Custom Control
WPF Custom Controls are used in Team Developer 6 WPF Applications to
incorporate today’s most modern graphical controls into your applications.
The following WPF Controls are examples of the types of controls that you
will be able to use in your Team Developer 6 WPF Applications:
16
The application used in this document illustrates how to implement Microsoft
.NET WebBrowser Control. You will find this control implementation in
WPFDemoApp.app under dlgEmail.SAM_CreateComplete.
For a complete description of Microsoft .NET WebBrowser Control please re-
fer to the following link:
http://msdn.microsoft.com/en-us/library/cc491147.aspx
Note: For more information about the use of WPF Controls in Team De-
veloper 6 please refer to the white paper titled: “WPF Container and con-
trol in TD 6.0”
http://msdn.microsoft.com/en-us/library/cc491147.aspx
About Unify
Unify is an information management and eDiscovery solutions company. Unify
delivers solutions for developing, managing, modernizing, and archiving applications
and business data. Over 10,000 of the world’s most demanding companies trust
Unify to help them preserve the information necessary to run their business.
Comprehensive eDiscovery solutions are delivered by Daegis, a Unify company.
Unify is headquartered in Roseville, Calif., with offices in San Francisco, Chicago,
Rutherford NJ, London, Munich, Calgary, Paris, Sao Paulo and Sydney.
Visit www.unify.com or email [email protected].
Follow Unify on Twitter at www.twitter.com/GoUnify.
Unify Corporation
1420 Rocky Ridge Drive, Suite 380 Roseville, CA 95661
USA Phone: 1.916.218.4700
Toll Free: 1.800.468.6439 Fax: 1.916.218.4378
United Kingdom: +44 (0)1753 245 510 France: +33 (0)1 34 58 28 30
COPYRIGHT © 2010. UNIFY CORPORATION. All rights reserved.
Unify, the Unify logo and Unify NXJ are
registered trademarks of Unify Corporation. Unify Composer is a trademark of Unify Corporation. Java and J2EE are the trademarks or registered trademarks of
Sun Microsystems, Inc. in the United States and other countries. All other company or product names are trademarks of their respective owners.
mailto:[email protected]