Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
Look & feel base class. More...
#include <ilviews/base/look.h>
Public Member Functions | |
void | addObjectLFHandler (IlvObjectLFHandler *olfh) |
Adds the specified object look and feel handler to this look and feel handler. More... | |
virtual IlvObjectLFHandler * | createObjectLFHandler (const IlvClassInfo *ci) const |
Creates and returns the object look & feel handler for specified class information. More... | |
IlvDisplay * | getDisplay () const |
Retrieves the IlvDisplay instance associated with this handler. More... | |
virtual const char * | getLookName () const =0 |
Returns the name of the look & feel handler. More... | |
IlvObjectLFHandler * | getObjectLFHandler (const IlvClassInfo *ci) const |
Returns the object look & feel handler for the specified class information. More... | |
void | removeObjectLFHandler (const IlvClassInfo *classinfo) |
Removes the object look and feel handler linked with the specified class information from this look and feel handler. More... | |
Static Public Member Functions | |
static IlvLookFeelHandler * | Create (IlSymbol *lookname, IlvDisplay *display) |
Creates and returns a look & feel handler that matches the specified name. More... | |
static const IlSymbol *const * | GetAvailableLooks (IlUInt &count, IlBoolean sort=IlTrue) |
Returns an array containing the available look & feel handlers. More... | |
static IlvLookFeelHandler * | GetDefaultLookFeelHandler (IlvDisplay *display, IlBoolean warn=IlTrue) |
Returns the default look & feel handler for the running platform. More... | |
static const IlSymbol *const * | GetDynamicLooks (IlUInt &count, IlBoolean sort=IlTrue) |
Returns an array containing the look & feel handlers that can be dynamically loaded. More... | |
static const IlSymbol *const * | GetRegisteredLooks (IlUInt &count, IlBoolean sort=IlTrue) |
Returns an array containing the registered look & feel handlers. More... | |
Friends | |
class | IlvDisplay |
Look & feel base class.
Library: xviews or winviews or mviews (mutually exclusive)IlvLookFeelHandler
is the base class for look & feel handlers. A look & feel handler is responsible for supplying gadgets with specific object look & feel handlers of the class IlvObjectLFHandler
. An object look & feel handler handles the way a specific gadget behaves and looks. For example, when drawing itself, a button asks the look & feel handler for the object look & feel handler linked with the IlvButton
class. This object describes the interface through which the button will be drawn and controlled. Four predefined look & feel handlers are provided:
IlvMotifLFHandler
IlvWindowsLFHandler
IlvWindows95LFHandler
IlvWindowsXPLFHandler
IlvVXLFHandler
Each of these classes is able to return a valid object look & feel handler for all Rogue Wave Views predefined gadgets. If you plan to create your own look & feel handler, you must provide an object look & feel handler for each gadget. However, it is possible to create a subclass of a predefined handler; by doing so, you inherit from it and only have to define what you want to change or add.
An instance of the IlvLookFeelHandler
class is always available through the display connection. See IlvDisplay::getLookFeelHandler()
for details. The default behavior for a gadget is to use this look & feel handler to obtain its object look & feel handler. However, each gadget can have its own look & feel handler. See the member function IlvGadget::setLookFeelHandler()
for details.
You cannot create a look & feel handler by calling its constructor. Instead, use the IlvLookFeelHandler::Create()
member function. Similarly, you cannot delete a look & feel handler. The display connection is responsible for deleting look & feel handlers. To set a new look & feel handler to a display connection, use the member function IlvDisplay::setLookFeelHandler()
.
It is possible to create a subclass.
void IlvLookFeelHandler::addObjectLFHandler | ( | IlvObjectLFHandler * | olfh | ) |
Adds the specified object look and feel handler to this look and feel handler.
The previous object look and feel handler, if any, is deleted.
olfh | The new object look and feel handler. |
removeObjectLFHandler()
.
|
static |
Creates and returns a look & feel handler that matches the specified name.
Each look & feel handler has a specific name (see the member function IlvLookFeelHandler::getLookName()
). This name can be used to create an instance of the corresponding look & feel handler. If no look & feel handler that matches the specified name can be found, the method returns 0
.
lookname | The name of the look & feel handler to create. |
display | The display connection. |
|
virtual |
Creates and returns the object look & feel handler for specified class information.
The method looks first into the object look & feel handlers defined in this look & feel handler. If such an object cannot be found, the superclass is asked to provide one, and so on.
ci | The class information. |
|
static |
Returns an array containing the available look & feel handlers.
The available look & feel handlers is the union of the registered and dynamic look & feel handlers.
count | The size of the returned array. |
sort | Indicates whether the returned array should be sorted. |
GetDynamicLooks()
, GetRegisteredLooks()
.
|
static |
Returns the default look & feel handler for the running platform.
If such a look & feel handler has already been created for the specified display, it is returned. Otherwise, a new instance is created and returned. This method uses the environment variable "ILVLOOK", or the resource "look" to create the default look & feel handler. If such resources are not set, the default behavior is to create a Motif look & feel for Unix platforms, and a Windows
look & feel on Windows platforms.
display | The display connection. |
warn | Indicates whether the method should warn the user if a default look cannot be found. |
IlvDisplay* IlvLookFeelHandler::getDisplay | ( | ) | const |
Retrieves the IlvDisplay
instance associated with this handler.
|
static |
Returns an array containing the look & feel handlers that can be dynamically loaded.
The dynamic look & feel handlers are read from Rogue Wave Views Module Description (.imd
) files. They are not necessarily registered yet. To register or load a look & feel handler returned by this method, use the static method IlvLookFeelHandler::Create()
. Note that this method can be used only when dynamic loading of modules is enabled, that is, when using shared libraries. See the section IlvModule: The Dynamic Module Class of the User Manual for details.
count | The size of the returned array. |
sort | Indicates whether the returned array should be sorted. |
|
pure virtual |
Returns the name of the look & feel handler.
Usually you do not have to declare this method by hand, since the DeclareLookFeelTypeInfo()
does it.
Implemented in IlvBasicLFHandler.
IlvObjectLFHandler* IlvLookFeelHandler::getObjectLFHandler | ( | const IlvClassInfo * | ci | ) | const |
Returns the object look & feel handler for the specified class information.
This method is called each time a gadget needs to get its object look & feel handler. The class information specified by ci indicates which object look & feel handler to return.
ci | The class information object. |
0
is returned.
|
static |
Returns an array containing the registered look & feel handlers.
count | The size of the returned array. |
sort | Indicates whether the returned array should be sorted. |
void IlvLookFeelHandler::removeObjectLFHandler | ( | const IlvClassInfo * | classinfo | ) |
Removes the object look and feel handler linked with the specified class information from this look and feel handler.
classinfo | The class information of the object look and feel handler to remove. |
addObjectLFHandler()
. © Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.