### Using Native Window Controls and 3D-Borders

The Open Class Library provides features to take advantage of the native look and feel of each operating system.

#### Native Windows Controls

The following controls support both the native Windows (Win32) control and the CUA '91 (OS/2 PM-look) control:

- Container
- Notebook
- Progress Indicator
- Slider
- Spin button (both numeric and text)

To use the CUA control,specify the pmCompatible style for each control. For example, to use the CUA notebook instead of the Windows tab control, specify INotebook::pmCompatible when you construct your INotebook object. You need to specify this style because the native Windows control is the default in the Windows verison of this product.

#### 3-D Borders

The following controls have the border3D extended style as the default to add an etched three-dimensional border to the control:

- Combination box
- Entry field
- Information area (cannot be turned off)
- List box
- Multiline edit field
- Outline box
- Progress indicator
- Slider
- Spin button (ignored if you specify the noBorder or pmCompatible style)
- Static text (not the default)

The Windows Native Controls and 3-D borders styles are ignored, and not supported on OS/2 and AIX. Only the pmCompatible style can be used.

### Creating Cross-Platform Applications

There are many things to consider when you create applications that are portable across OS/2, Windows, and AIX. This section discusses how the Open Class Library differs between platforms and how you can include nonportable functions in a portable application. For information on converting resource and bitmap files between OS/2, Windows, and AIX, see the Resource Conversion Utility (OS/2, Windows) reference topic.

#### Open Class Library Differences between Platforms

The Open Class Library for AIX does not support the following items which are supported in the Open Class Library for OS/2 and Windows:

- Dialog template (DLGTEMPLATE) resources and the ability to construct an IFrameWindow from a dialog template resource. (If you port OS/2 PM programs that use dialog templates, you must convert them to use the canvas classes.)
- All Dynamic Data Exchange (IDDE*) classes. There is no support for Dynamic Data Exchange under Motif.
- ISystemPointerHandle, IBitmapControl and IIconControl constructors that use ISystemBitmapHandle::Identifier and ISystemPointerHandle::Identifier as parameters. (Use IBitmapHandle, which is a user-provided bitmap.)
- IGroupBox. IGroupBox creates a dummy widget which does not appear on the screen. If you make it the parent of any other control, the other control might not appear on the screen either. For portable applications, use ISetCanvas, which has methods that let you draw a box around the canvas and label your canvas. Or, you can use a combination of a canvas and an IOutlineBox control to simulate the IGroupBox behavior.
- IWindow::setParent.
- IContainerControl is limited.

Some classes and member functions from the Open Class Library for OS/2 and Windows are not present in the Open Class Library for AIX, meaning that there is no equivalent function in Motif or AIX. An example is ISystemBitmapHandle. These classes and member functions are not declared in the Open Class Library for AIX library header files, so attempts to use them will be detected at compile time.

Also, there are some classes and member functions that are ignored in the Open Class Library for AIX. This means that you will get valid compile results because the class or member function is ignored. Examples are enableAutoSelect, disableAutoSelect, and isAutoSelect in the IRadioButton class. The autoselect style is always in effect for Motif, therefore, the compiler returns true for isAutoSelect and ignores disableAutoSelect. Many of these ignored classes and member functions result from "look and feel" differences between OS/2 Presentation Manager, Windows, and Motif.

There are flags in the Open Class Library for AIX release .hpp files noting which classes and member functions are ignored. To see if your application contains any of these classes and member functions, include the option define(IC_MOTIF_FLAGNOP) directive in your application's configuration file.

This causes all of the ignored classes and member functions to not be declared, so any occurrence of an ignored class or member function in your application produces a compiler error.

There are also some "look and feel" differences which come from differences between the Object-Oriented Interface Design: IBM Common User Access Guidelines and the OSF/Motif Style Guide. For example, push button mnemonics are not enabled in the Motif classes. Other differences exist, but most are not reflected in the Open Class Library interface.

#### Including Nonportable Functions in Portable Applications

While the Open Class Library provides portable user-classes, there might be cases when you want to take advantage of system-specific features. For example, in Create Your Own Handler Sample, the X-Windows timer function gets the system time. However,these calls prevent the application from running on OS/2 or Windows. To overcome this, the application also provides the corresponding OS2 and Windows function calls. The conditional use of these calls is accomplished by using the compiler preprocessor directives, #ifdef and #endif. In this case, you need the following symbols in the ifdef statement: IC_MOTIF, IC_WIN, and IC_PM.

The Open Class header files environment symbols are defined in ibase.hpp. To get these symbols, include the ibase.hpp file.The symbols are:

- IC-PM
  This is valid for PM only.
- IC-WIN
  This is valid for Windows only.
- IC-MOTIF
  This is valid for Motif only.
- IC-PMWIN
  This is valid for PM and Windows.
- IC-PMMOTIF
  This is valid for PM and Motif.
- IC-MOTIFWIN
  This is valid for Motif and Windows.