Team Developer 6 New Controls Demonstration Gupta Technologies
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 Gupta... 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:\...\Gupta\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. Depending on the nature of the data that you might want to represent, tree items can be static or dynamically 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 window 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 documented 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
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 number 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 5
Tab Control The Tab Control in Team Developer 6 is a brand new object that behaves pretty much like what you are accustomed to with QuickTabs in previous versions of Team Developer. If you have QuickTabs application and you want to convert them to use Team Developer 6 new Tab Control, you can use the Quick Tab Migration Wizard 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 receive emails. The application used in this document illustrates a SalMail example using a Gmail mailbox: island.company.app@gmail.com. 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. 6
The application used for the purpose of this document illustrates the implementation of a WPF Control: Microsoft.NET WebBrowser. You will find a more advanced WPF Control example in: C:\...\Gupta\Team Developer 6.0\Samples\60Demos\Demo2. Application Demonstration Once you have installed Team Developer 6 Samples look for the following folder location: C:\...\Gupta\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. 7
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 SalCreateWindow( ) 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: 8
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 dropping the object into a top-level window of your selection. Filling the content of a Tree Controls can be achieved manually or dynamically the application used in this document illustrates the dynamic method. As we mention earlier in this document 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 element. 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. 9
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 implementations 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 Outlook 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. 10
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 control. 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: 11
12
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 receive email using POP3 protocol If you look at the Variable Declaration for gridemail you will find osmtp and opop3, each of them represent an instance 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, bssl 1, bsend 2 ) 2. Connect to your Mail Server. To connect to your Mail Server use the following 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 Method. 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. 13
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 SalMail.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, bssl 3, bsend 4 ) 2. Connect to your Mail Server. To connect to your Mail Server use the following 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. 14
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 Method. 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 Developer 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: 15
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 refer 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 Developer 6 please refer to the white paper titled: WPF Container and control in TD 6.0 16
About Gupta Gupta is an information management and ediscovery solutions company. Gupta delivers solutions for developing, managing, modernizing, and archiving applications and business data. Over 10,000 of the world s most demanding companies trust Gupta to help them preserve the information necessary to run their business. Comprehensive ediscovery solutions are delivered by Daegis, a Gupta company. Gupta is headquartered in Roseville, Calif., with offices in San Francisco, Chicago, Rutherford NJ, London, Munich, Calgary, Paris, Sao Paulo and Sydney. Visit www.guptatechnologies.com or email info@guptatechnologies.com. Follow Gupta on Twitter at www.twitter.com/gogupta. Gupta Technologies 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 Germany: +49 89 208039 158 United Kingdom: +44 (0)1753 245 510 France: +33 (0)1 34 58 28 30 COPYRIGHT 2012. GUPTA TECHNOLOGIES. All rights reserved. Gupta, the Gupta logo and Gupta NXJ are registered trademarks of Gupta Technologies. Gupta Composer is a trademark of Gupta Technologies. 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.