Tuesday, September 13, 2011

A Trip to the .NET Forms Library with uniPaaS 2.0

With the release of uniPaaS 2.0, the Magic Application Platform now supports the use of the Windows .NET forms library. These capabilities are delivered by .NET within “classes” that are a part of what is known as the System.Windows.Forms namespace.

Beginning with uniPaaS 2.0, the use of the .NET Forms library within a uniPaaS application is supported in both uniPaaS online (client server) and rich client tasks. After you begin a new task, you must define your .NET object in a new variable by creating a virtual variable in the Dataview Tab of the uniPaaS task. You select the .NET object type either by typing the name or using the uniPaaS selection lists to find the .NET object you want to use.

Developing with the Windows .NET forms library is much easier on the uniPaaS .NET application platform than it is in simple 3GL .NET coding languages such as C#, C++, JScript or VB.NET. uniPaaS 2.0 provides a metadata driven paradigm for application development that allows you to easily incorporate managed code from the .NET forms library along with so-called “unmanaged functionality.” This is true because the uniPaaS 2.x runtime engine is an extension of the uniPaaS 1.x runtime engine. A new .NET front-end wraps the existing C++ engine, thus enabling both .NET and unmanaged functionality in a single runtime engine. The ease-of-use comes into play in several ways:
  1. When you want to use .NET forms capabilities, you can. It is not mandatory.  Very rich applications can be designed using the core GUI capabilities within uniPaaS.
  2.      Adding .NET managed code is simplified because your overall application leverages the benefits of the uniPaaS metadata-driven platform. Low-level programming is never required.     
  3. uniPaaS’ tab and table driven interface allows you to avoid complex line-by-line scripting and coding. uniPaaS takes care of the typical programmer “housekeeping chores” so that there is less effort than normally expected to create a program.

Let’s review the seven main class categories in the Windows .NET form library:


Control, User Control and Form classes.  The Control class constitutes the majority of classes available in the System.Windows.Forms namespace. Controls are key to visibility. In other words, a control class is sued to provide the base functionality for all program controls that are displayed on a form in your application. You can think of a form as a window within your application such as a dialog box, modeless windows, Multiple Document Interface (MDI) client and parent windows.


Menu and Toolbar classes. The library also includes a category of classes for building custom toolbars and menus with your desired look and feel. ToolStrip is used for creating toolbars.  MenuStrip is used for creating menu bars.  ContextMenuStrip is used to create context menus. And StatusStrip can be used to create status bars.


Standard GUI Control classes. The Windows forms library included a number of mainstream controls for input (such as TextBox and ComboBox) display of data (such as Label and ListView) and firing of commands (such as Button).


Layout classes. The layout classes in Windows Forms help control the layout of controls on a display surface, such as a form or control. For example, the FlowLayoutPanel lays out all the controls it contains in a series, and the TableLayoutPanel provides a control for laying out data in a fixed grid. More sophisticated layouts can be managed through the SplitContainer class which is a control that divides your display area into adjustable parts.


Data and Data Binding classes.  You can also use Windows Forms to create the interfaces for binding to data sources such as databases, XML and flat files. The DataGridView is a sophisticated data control that allows for custom tables displaying information with specific  cell, row, column, and border properties. Also, the BindingNavigator and BindingSource controls allow you to develop interfaces  that navigate and work with data on a form in a standard way.


Helpful classes. It is possible to use a number of other helpful classes within the Windows Forms namespace that aid in the display of application related information in your application. Certain classes, provide Windows standard ways of displaying a ToolTip or an error (ErrorProvider).  And the Help and HelpProvider classes are useful for displaying relevant Help information to a user of your applications.


Traditional Dialog Boxes. The final category of Windows Forms classes that we’d like to discuss are common dialog boxes. Dialog boxes give your application a consistent look and feel for common and repetitive functionality such as opening or saving a file, manipulating text properties such as font, size or color, printing or any of a number of other common processes within your application. For example, the OpenFileDialog and SaveFileDialog classes display dialog boxes for opening and saving files by users. The FontDialog class provides a user dialog box set Font properties used in a particular aspect of your application. The PageSetupDialogPrintPreviewDialog, and PrintDialog classes display well-known and easily understood functionality in a standardized way as well. In addition to the common dialog boxes, a MessageBox class is also available to create a simple box to display and retrieve data from the user.


Conclusion. In addition to all the standard classes within the System.Windows.Formsnamespace, there are of course a number of very interesting third party controls libraries that are worth exploring when you’re looking for that “something extra” or special pizzazz in your user interface. The trick is finding the right balance between uniPaaS, standard .NET and third-party controls within your application. That’s all for this trip to the library.  




1 comment: