Using the Default Look and Feel
By default, only one style is used in a given Rogue Wave® Views program, which is the standard style of the computer system:
ViewsX style on UNIX®
Microsoft® Windows 3®.11 style on Windows 3.x and Microsoft Windows NT 3.x
Microsoft Windows 95 style on Windows 95 Windows NT 4, and Windows 2000
Microsoft Windows XP style on Windows XP and later versions
Note: You can override this default setting by using the ILVLOOK environment variable, or the LOOK resource. In this case, be sure to provide access to the specified look to your application, or it will not be used. See the section Using Several Look and Feel and Dynamic Loading of Look and Feel. |
Note: The Microsoft Windows XP style is only available on computers running Microsoft Windows XP and later versions. A Rogue Wave Views application built on a Microsoft Windows XP (or later) platform may not run on a previous version of Microsoft Windows (Windows 2000, NT, and so on). For more details, see the section Using the Windows XP Look and Feel. |
Depending on the platform on which you are building your application, it must be linked with the corresponding look-and-feel libraries. The following tables sum up the different libraries available:
Look Libraries for Windows Platforms
Look | Standard Gadgets Library | Advanced Gadgets Library |
Motif | ilvmlook.lib | ilvamlook.lib |
Windows 3.11 | ilvwlook.lib | ilvawlook.lib |
Windows 95 | ilvw95look.lib, ilvwlook.lib | ilvaw95look.lib, ilvawlook.lib |
Windows XP | ilvwxplook.lib, ilvw95look.lib, ilvwlook.lib, uxtheme.lib | ilvawxplook.lib, ilvaw95look.lib, ilvawlook.lib |
ViewsX | ilvvxlook.lib, ilvwlook.lib | ilvavxlook.lib,ilvawlook.lib |
Note that the
uxtheme.lib is a Microsoft library. If this library is not present on your computer, it is available in the Microsoft Platform SDK. To get the SDK, go to
http://www.microsoft.com/downloads/details.aspx?FamilyId=A55B6B43-E24F-4EA3-A93E-40C0EC4F68E5&displaylang=en.
Look Libraries for UNIX Platforms
Look | Standard Gadgets Library | Advanced Gadgets Library |
Motif | libilvmlook | libilvamlook |
Windows 3.11 | libilvwlook | libilvawlook |
Windows 95 | libilvw95look, libilvwlook | libilvaw95look, libilvawlook |
ViewsX | libilvvxlook, libilvwlook | libilvavxlook,libilvawlook |
Note: Windows XP look is not mentioned in the above table, because this look is only available for platforms running the Microsoft Windows XP (or later) operating system. For more details, see the section Using the Windows XP Look and Feel. |
For example, if you are building a program using the Rogue Wave Views standard gadget library (See the section
Gadgets Libraries for details) on Microsoft Windows 95, you will need to link with
ilvw95look.lib, ilvwlook.lib.Similarly, if you are building a program using the Rogue Wave Views advanced gadget library on UNIX, you will need to link with libilvmlook and libilvamlook.
However, if you are using shared libraries, you can avoid linking with look-and-feel libraries. See the section
Dynamic Loading of Look and Feel.
Note: On Windows platforms, linking with the look-and-feel libraries is not required, even when using static libraries. The libraries needed by the application will be automatically linked with it thanks to specific directives put in header files. |
Using Several Look and Feel
If you want to use several styles in your program, you must add a compiler option or an include file to indicate which of the additional styles you want to use:
In the compiler flags, define the symbol names for the styles you want to use:
ILVMOTIFLOOK for the Motif® look in Windows® applications.
ILVWINDOWSLOOK for the Microsoft® Windows® 3.11 look in X Window applications.
ILVWINDOWS95LOOK for the Microsoft Windows 95 look in X Window applications.
ILVWINDOWSXPLOOK for the Microsoft Windows XP look in Windows applications.
ILVVXLOOK for the ViewsX look in Windows applications.
In your implementation file, and before any other
#include directive, include the style header file. Note that if a header file declaring a gadget class precedes one of these header files, the corresponding virtual styles will not be loaded in your program. This may result in a crash when you change the style of your application.
Here are the files to include:
<ilviews/motif.h> to add an access to the Motif look for Microsoft Windows applications.
<ilviews/windows.h> to add an access to the Microsoft Windows 3.11 look for X Window applications.
<ilviews/win95.h> to add an access to the Microsoft Windows 95 look for X Window applications.
<ilviews/winxp.h> to add an access to the Microsoft Windows XP look. This look is only available for Windows XP (or later) platforms.
<ilviews/vx.h> to add an access to the ViewsX look for Microsoft Windows application.
You must also link your application with the look-and-feel gadget libraries corresponding to the looks used by your application. See
Look Libraries for Windows Platforms and
Look Libraries for UNIX Platforms.
However, if you are using shared libraries, you can avoid linking with look-and-feel libraries. See the section
Dynamic Loading of Look and Feel.
Note: If you do not want the default look and feel to be used, you must compile with the ILVNODEFAULTLOOK flag. Compiling with this flag will prevent you from linking with the default look-and-feel libraries. |
Dynamic Loading of Look and Feel
When using the dynamic loading of look and feel, you do not have to care about which look and feel your application will use. Depending on what is needed by the application, the looks will be loaded at runtime. This means that you do not have to link your application with any look-and-feel specific library.
How does it work?
You must use shared libraries (or DLL for Microsoft® Windows®). This is the sine qua none condition without which dynamic loading of modules is not possible.
You must not include look specific header files, or you will have to link with the corresponding libraries.
You must compile with the ILVNODEFAULTLOOK symbol defined, or you will have to link with the default look libraries.
Note: Using the dynamic loading of look and feel is strongly encouraged, as it allows the application to be completely independent of the style used at runtime. |
Changing the Look and Feel Dynamically
The appearance of a graphic object is managed at different levels:
Object level
The method
IlvGraphic::getLookFeelHandler() is used to query an object about its look-and-feel handler. The default implementation is to use the look-and-feel handler defined by the object holder.
Holder level
The method
IlvGraphicHolder::getLookFeelHandler() is used to query a holder about its look-and-feel handler. The default implementation is to use the look-and-feel handler defined by the holder display instance.
Display level
It is possible to change the look of a single gadget, of a whole container, or of the whole application by using respectively the methods
IlvGadget::setLookFeelHandler,
IlvGadgetContainer::setLookFeelHandler, and
IlvDisplay::setLookFeelHandler.
A look-and-feel handler is a subclass of the
IlvLookFeelHandler class. Each handler has a unique name that identifies it. Here are the names for the five predefined look-and-feel styles:
Motif | motif |
Windows 3.11 | windows |
Windows 95 | win95 |
Windows XP | winxp |
ViewsX | vx |
A look-and-feel handler is associated to a display instance. To obtain an instance of a look-and-feel handler, use the method
getLookFeelHandler that takes a name as parameter:
IlvLookFeelHandler* lfh = display->getLookFeelHandler(IlGetSymbol(“motif”));
If the required look and feel has already been created for this display, it is returned, otherwise a new one is created. If the look and feel cannot be created, the method returns 0.
Changing the Look and Feel of the Whole Display
As seen above, the method
setLookFeelHandler should be used to change the look and feel of the whole display. However, the Rogue Wave Views 4.0 API used to define an
enum (
IlvLookStyle) to describe predefined looks. This
enum can still be used as follow:
#include <ilviews/ilv.h>
typedef enum IlvLookStyle {
IlvOtherLook,
IlvMotifLook,
IlvWindowsLook,
IlvWindows95Look,
IlvWindowsXPLook
IlvVXLook
};
The following member functions of the
IlvDisplay class let you manipulate the setting of the
look display resource using this
enum:
getCurrentLook returns the current style identifier used by this display instance. If the current look and feel of the display is not one of the predefined look-and-feel styles,
IlvOtherLook is returned.
setCurrentLook sets the style identifier used by this display instance to
style.
You can be informed of a change in the look and feel of the display by using the following methods:
addChangeLookCallback and lets you add user-defined functions that are called when the style is dynamically changed.
Using the Windows XP Look and Feel
Although the Microsoft® Windows® 3.11, Microsoft Windows 95, ViewsX and Motif styles are independent of the platform, the Microsoft Windows XP style uses the Microsoft Windows operating system to draw the components. This means that you can only use this style on a platform running Microsoft Windows XP or later versions. This also means that if a new theme is available in later versions of Microsoft Windows, it will also be available to Rogue Wave Views applications.
Using Rogue Wave Views Dynamic Link Libraries
When using the Rogue Wave Views DLLs (
dll_md, or
dll_mda), the Microsoft Windows XP style can be dynamically loaded when needed. This means that you can build a Rogue Wave Views application that can be run on any Microsoft Windows platform. The application will load the Microsoft Windows XP style if it is needed. See
Dynamic Loading of Look and Feel for more details.
Using Rogue Wave Views Static Libraries
When using the Rogue Wave Views static libraries, you must be aware of the following issues:
When building a Rogue Wave Views application using the default style on a Microsoft Windows XP (or later) platform, the flag
WINVER must be set to
0x501 when compiling your application, otherwise only the Microsoft Windows 95 style will be registered. See
Using the Default Look and Feel.
A Rogue Wave Views application using the Microsoft Windows XP style and the Rogue Wave Views static libraries can only be run on platforms running Microsoft Windows XP or later versions. If you want to compile a Rogue Wave Views application on a Microsoft Windows XP (or later) platform and you want this application to run on any Windows platform, you can either not define the
WINVER flag, or define the
ILVNODEFAULTLOOK flag. In this last case, you will need to link your application with look-and-feel libraries other than XP libraries. See
Using Several Look and Feel for more details.
Version 6.2.1
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.